"Robert Shearman" rob@codeweavers.com wrote:
- if (!(context.Eax = GetWindowWord( HWND_32(hwnd), GWL_HINSTANCE ))) context.Eax = context.SegDs;
- if (!(context.Eax = GetWindowWord( HWND_32(hwnd), GWLP_HINSTANCE ))) context.Eax = context.SegDs;
GetWindowWord above probably should be replaced by GetWindowLongPtrW. And all appropriate ANSI variants of the GetWindowLongPtr call should have been replaced by a unicode one while you were at it.
Of course that's not critical at all, just a nit pick.
Dmitry Timoshkov wrote:
"Robert Shearman" rob@codeweavers.com wrote:
- if (!(context.Eax = GetWindowWord( HWND_32(hwnd), GWL_HINSTANCE ))) context.Eax = context.SegDs;
- if (!(context.Eax = GetWindowWord( HWND_32(hwnd), GWLP_HINSTANCE ))) context.Eax = context.SegDs;
GetWindowWord above probably should be replaced by GetWindowLongPtrW. And all appropriate ANSI variants of the GetWindowLongPtr call should have been replaced by a unicode one while you were at it.
Of course that's not critical at all, just a nit pick.
Yes, but at least GetWindowWord warns when discarding high bytes of the instance handle. Besides, this code probably won't compile on a 64-bit build anyway. I did replace some GetWindowLongA calls with GetWindowLongPtrW, but there is really no difference between the two A and W versions in terms of performance anyway.
Rob
On Thu, Sep 23, 2004 at 01:37:32PM +0100, Robert Shearman wrote:
I did replace some GetWindowLongA calls with GetWindowLongPtrW, but there is really no difference between the two A and W versions in terms of performance anyway.
Yes, but we should use the W version in preference to the A one as a matter of principle. This way, a simple syntactic check can tell us that we don't have W->A transitions. Otherwise, we have to do semantic checks all the time, and that's just not fun :)