update for HEAD-2003091401
[reactos.git] / ntoskrnl / ke / kthread.c
index 41dd61e..4180be9 100644 (file)
@@ -76,7 +76,7 @@ KeReleaseThread(PETHREAD Thread)
   return(STATUS_SUCCESS);
 }
 
-VOID 
+VOID
 KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First)
 /*
  * FUNCTION: Initialize the microkernel state of the thread
@@ -106,13 +106,14 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First)
                                  MM_STACK_SIZE,
                                  0,
                                  &StackArea,
+                                 FALSE,
                                  FALSE);
       MmUnlockAddressSpace(MmGetKernelAddressSpace());
       
       if (!NT_SUCCESS(Status))
        {
          DPRINT1("Failed to create thread stack\n");
-         KeBugCheck(0);
+         KEBUGCHECK(0);
        }
       for (i = 0; i < (MM_STACK_SIZE / PAGE_SIZE); i++)
        {
@@ -120,7 +121,7 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First)
          Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &Page);
          if (!NT_SUCCESS(Status))
            {
-             KeBugCheck(0);
+             KEBUGCHECK(0);
            }
          Status = MmCreateVirtualMapping(NULL,
                                          KernelStack + (i * PAGE_SIZE),
@@ -185,6 +186,9 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First)
   Thread->KernelApcDisable = 1;
   Thread->UserAffinity = Process->Affinity;
   Thread->SystemAffinityActive = 0;
+  Thread->PowerState = 0;
+  Thread->NpxIrql = 0;
+  Thread->ServiceTable = KeServiceDescriptorTable;
   Thread->Queue = NULL;
   KeInitializeSpinLock(&Thread->ApcQueueLock);
   memset(&Thread->Timer, 0, sizeof(KTIMER));
@@ -213,7 +217,7 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First)
   Thread->AutoAlignment = 0;
   KeInitializeApc(&Thread->SuspendApc,
                  Thread,
-                 0,
+                 OriginalApcEnvironment,
                  PiSuspendThreadKernelRoutine,
                  PiSuspendThreadRundownRoutine,
                  PiSuspendThreadNormalRoutine,