ipccdeclconv.asm

ipc convention to cdecl convention wrapper

Author

Marcel Sondaar

License

Public Domain

Summary
ipccdeclconv.asmipc convention to cdecl convention wrapper
Functions
ipccdeclconvstub to retrieve the ipc parameters for a cdecl function

Functions

ipccdeclconv

stub to retrieve the ipc parameters for a cdecl function

in

stack(1)pointer to a function that contains the actual handler

out

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

Example ©

void stub(void) { ipccdeclconv(actualhandler); }

Example (Basic)

Sub stub() Call ipccdeclconv(@actualhandler) End Sub