ipc convention to cdecl convention wrapper
Marcel Sondaar
Public Domain
ipccdeclconv.asm | ipc convention to cdecl convention wrapper |
Functions | |
ipccdeclconv | stub to retrieve the ipc parameters for a cdecl function |
stub to retrieve the ipc parameters for a cdecl function
stack(1) | pointer to a function that contains the actual handler |
nothing
This stub assumes that the compiler hasn’t changed the registers used for the call. Normally, manually writing out an appropriate asm stub is more efficient and secure, as it avoids a function pointer indirection, as well as some possible code optimisation that might break this code.
to make sure the compiler doesnt destroy the registers, put one and only one call to this function as the only thing in the registered handler function
void stub(void) { ipccdeclconv(actualhandler); }
Sub stub() Call ipccdeclconv(@actualhandler) End Sub