update for HEAD-2003091401
[reactos.git] / ntoskrnl / ke / i386 / usercall.c
index 64e1472..9223e14 100644 (file)
@@ -11,7 +11,8 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
+#define NTOS_MODE_KERNEL
+#include <ntos.h>
 #include <internal/ntoskrnl.h>
 #include <internal/ke.h>
 #include <internal/ps.h>
@@ -20,9 +21,7 @@
 
 #define NDEBUG
 #include <internal/debug.h>
-#include <ddk/service.h>
 
-#include <ddk/defines.h>
 #include <internal/ps.h>
 
 /* FUNCTIONS *****************************************************************/
@@ -60,9 +59,36 @@ ULONG KiAfterSystemCallHook(ULONG NtStatus, PKTRAP_FRAME TrapFrame)
   return(NtStatus);
 }
 
+
+VOID KiServiceCheck (ULONG Nr)
+{
+  PETHREAD Thread;
+
+  Thread = PsGetCurrentThread();
+
+#if 0
+  DbgPrint ("KiServiceCheck(%p) called\n", Thread);
+  DbgPrint ("Service %d (%p)\n", Nr, KeServiceDescriptorTableShadow[1].SSDT[Nr].SysCallPtr);
+#endif
+
+  if (Thread->Tcb.ServiceTable != KeServiceDescriptorTableShadow)
+    {
+#if 0
+      DbgPrint ("Initialize Win32 thread\n");
+#endif
+
+      PsInitWin32Thread (Thread);
+
+      Thread->Tcb.ServiceTable = KeServiceDescriptorTableShadow;
+    }
+}
+
 // This function should be used by win32k.sys to add its own user32/gdi32 services
 // TableIndex is 0 based
 // ServiceCountTable its not used at the moment
+/*
+ * @implemented
+ */
 BOOLEAN STDCALL
 KeAddSystemServiceTable (
        PSSDT   SSDT,