_stdcall changes in XP SP2

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Anthony Wieser (wieser_at_clara.not)
Date: 08/13/04


Date: Fri, 13 Aug 2004 11:35:31 +0100

On all os's prior to XP SP2, the entry point for _stdcall/WINAPI functions
used to look like:

push ebp
mov ebp,esp
sub esp,0xNNNN // reserve stack

An example of this would be a function like wsprintf

Now with XP SP2, (msvcrt 7.0.260.2180) it looks like this:

mov edi,edi // ?*!*##
push ebp
mov ebp,esp
sub esp,0xNNNN // reserve stack

Can anybody fill us in on what the new code: mov edi, edi is for?

Also, is it the new version of the compiler that generates functions with
this signature, and if so, is there a way to turn it off?

Anthony Wieser
Wieser Software Ltd



Relevant Pages