This isn't terribly portable FWIW. Not all calling conventions massage data into either a 32-bit or 64-bit argument. In particular, passing structs by value has some interesting rules even in the common calling conventions.
It will certainly work for 90% of the common function types out there and is a pretty common trick.
Comments
This isn't terribly portable FWIW. Not all calling conventions massage data into either a 32-bit or 64-bit argument. In particular, passing structs by value has some interesting rules even in the common calling conventions.
It will certainly work for 90% of the common function types out there and is a pretty common trick.