[ros-diffs] [hbirr] 16087: Initialized the system call entry independent of the real type of SystemCall.

hbirr at svn.reactos.com hbirr at svn.reactos.com
Sun Jun 19 11:48:20 CEST 2005


Initialized the system call entry independent of the real type of
SystemCall.
Modified: trunk/reactos/ntoskrnl/ke/i386/kernel.c
  _____  

Modified: trunk/reactos/ntoskrnl/ke/i386/kernel.c
--- trunk/reactos/ntoskrnl/ke/i386/kernel.c	2005-06-19 09:07:44 UTC
(rev 16086)
+++ trunk/reactos/ntoskrnl/ke/i386/kernel.c	2005-06-19 09:48:14 UTC
(rev 16087)
@@ -521,25 +521,17 @@

     }
 
     if (FastSystemCallDisable) {
-
         /* Use INT2E */
-        SharedUserData->SystemCall[0] = 0x8D;
-        SharedUserData->SystemCall[1] = 0x54;
-        SharedUserData->SystemCall[2] = 0x24;
-        SharedUserData->SystemCall[3] = 0x08;
-        SharedUserData->SystemCall[4] = 0xCD;
-        SharedUserData->SystemCall[5] = 0x2E;
-        SharedUserData->SystemCall[6] = 0xC3;
-
+        const unsigned char Entry[7] = {0x8D, 0x54, 0x24, 0x08,     /*
lea    0x8(%esp),%edx    */
+                                        0xCD, 0x2E,                 /*
int    0x2e              */
+                                        0xC3};                      /*
ret                      */
+        memcpy(&SharedUserData->SystemCall, Entry, sizeof(Entry));
     } else {
-
         /* Use SYSENTER */
-        SharedUserData->SystemCall[0] = 0x8B;
-        SharedUserData->SystemCall[1] = 0xD4;
-        SharedUserData->SystemCall[2] = 0x0F;
-        SharedUserData->SystemCall[3] = 0x34;
-        SharedUserData->SystemCall[4] = 0xC3;
-
+        const unsigned char Entry[5] = {0x8B, 0xD4,                 /*
movl    %esp,%edx        */ 
+                                        0x0F, 0x34,                 /*
sysenter                 */
+                                        0xC3};                      /*
ret                      */    
+        memcpy(&SharedUserData->SystemCall, Entry, sizeof(Entry));
         /* Enable SYSENTER/SYSEXIT */
         KiFastSystemCallDisable = 0;
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050619/13029a93/attachment.html


More information about the Ros-diffs mailing list