A89: Re: Event Handlers......


[Prev][Next][Index][Thread]

A89: Re: Event Handlers......




To find the address of the kernel's event handler (if there's one installed)
simply find the value of EV_hook before you change it, as it points to the
installed event handler.  Then you can easily call the previous handler
after yours.  I don't know about finding the size of a function, though, and
I don't think you can move functions around in memory at will.  Your
function would need to be relocated first (and I don't know anything about
that).

    James Darpinian

----- Original Message -----
From: <JHill8075@aol.com>
To: <assembly-89@lists.ticalc.org>
Sent: Tuesday, August 15, 2000 10:01 PM
Subject: A89: Event Handlers......


>
> I want to install a new event handler (using EV_hook like Doors), but
there
> is a problem. If doors or any compatable kernel that uses SHIFT+ON to
launch
> the program called doors (and what kernel doesn't?) is installed, then my
> handler will overwrite the pointer to the kernel's and SHIFT+ON will no
> longer work! I need a way to find the address/pointer of the allocated
memory
> the kernel stores this handler code in so I can call it at the end of my
> handler (does that make sense?). Also, as I am doing this in C, is there a
> way I can determine the size of the compiled function so I can copy it to
a
> block of memory (need to copy the handler function to a block of memory
and
> lock it so the function can be called). I need to do something like
> memcpy(*my_hook_function, pointer_to_allocated_memory, num_of_bytes), but
I
> need num_of_bytes. Hope this makes sense, and thanks for any help anyone
can
> give me.
>
>       - Josh
>




References: