ntdll/thread.c: Get rid of CPU id when copying context

Vitaliy Margolen wine-patch at kievinfo.com
Wed Nov 2 22:16:37 CST 2005


Now with this patch I'm back to working source tree with sd1 support ;-)
Thanks Alexandre for fixing [Get|Set]ThreadContext.

Vitaliy Margolen

changelog:
  ntdll/thread.c
  - Get rid of CPU id when copying context
-------------- next part --------------
Index: dlls/ntdll/thread.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/thread.c,v
retrieving revision 1.43
diff -u -p -r1.43 thread.c
--- dlls/ntdll/thread.c	2 Nov 2005 20:54:12 -0000	1.43
+++ dlls/ntdll/thread.c	3 Nov 2005 04:10:07 -0000
@@ -528,6 +528,7 @@ NTSTATUS WINAPI NtSetContextThread( HAND
 static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags )
 {
 #ifdef __i386__
+    flags &= ~CONTEXT_i386;  /* get rid of CPU id */
     if (flags & CONTEXT_INTEGER)
     {
         to->Eax = from->Eax;
@@ -567,6 +568,7 @@ static inline void copy_context( CONTEXT
         to->FloatSave = from->FloatSave;
     }
 #elif defined(__x86_64__)
+    flags &= ~CONTEXT_AMD64;  /* get rid of CPU id */
     if (flags & CONTEXT_CONTROL)
     {
         to->Rbp    = from->Rbp;
@@ -615,6 +617,7 @@ static inline void copy_context( CONTEXT
         to->Dr7 = from->Dr7;
     }
 #elif defined(__sparc__)
+    flags &= ~CONTEXT_SPARC;  /* get rid of CPU id */
     if (flags & CONTEXT_CONTROL)
     {
         to->psr = from->psr;
@@ -664,6 +667,7 @@ static inline void copy_context( CONTEXT
         /* FIXME */
     }
 #elif defined(__powerpc__)
+    /* Has no CPU id */
     if (flags & CONTEXT_CONTROL)
     {
         to->Msr = from->Msr;


More information about the wine-patches mailing list