dlls/kernel32/system.c: use FIELD_OFFSET

Gerald Pfeifer gerald at pfeifer.com
Sun Oct 14 06:18:29 CDT 2007


On Wed, 3 Oct 2007, Gerald Pfeifer wrote:
> ChangeLog:
> CONTEXT86.Ebp is DWORD, not WORD.  Fix cast.

This seems to be the official way now, so updated my patch accordingly.

Gerald

ChangeLog:
Use FIELD_OFFSET instead of pointer cast.

Index: system.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel32/system.c,v
retrieving revision 1.2
diff -u -3 -p -r1.2 system.c
--- system.c	7 May 2007 20:28:01 -0000	1.2
+++ system.c	14 Oct 2007 11:17:26 -0000
@@ -174,7 +174,8 @@ static void call_timer_proc16( WORD time
     context.SegGs = wine_get_gs();
     context.SegCs = SELECTOROF( proc );
     context.Eip   = OFFSETOF( proc );
-    context.Ebp   = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + (WORD)&((STACK16FRAME*)0)->bp;
+    context.Ebp   = OFFSETOF(NtCurrentTeb()->WOW32Reserved)
+                    + FIELD_OFFSET(STACK16FRAME,bp);
     context.Eax   = timer;
 
     WOWCallback16Ex( 0, WCB16_REGS, 0, NULL, (DWORD *)&context );



More information about the wine-patches mailing list