Showing results for January 2004 - Page 5 of 5 - The Old New Thing

Jan 2, 2004
0
2

The history of calling conventions, part 1

Raymond Chen
Raymond Chen

The great thing about calling conventions on the x86 platform is that there are so many to choose from! In the 16-bit world, part of the calling convention was fixed by the instruction set: The BP register defaults to the SS selector, whereas the other registers default to the DS selector. So the BP register was necessarily the register used for a...

History
Jan 1, 2004
0
0

Don't trust the return address

Raymond Chen
Raymond Chen

Sometimes people ask, "So I know how to get my return address [use the _ReturnAddress() intrinsic]; how do I figure out what DLL that return address belongs to?" Beware. Even if you figure out which DLL the return address belongs to [use Get­Module­Handle­Ex(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS)], that doesn't mean that that is a...

Code