Merge 25584, 25588.
[reactos.git] / reactos / ntoskrnl / ex / init.c
index 1feb2e8..6673931 100644 (file)
@@ -1,11 +1,11 @@
 /*
-* PROJECT:         ReactOS Kernel
-* LICENSE:         GPL - See COPYING in the top level directory
-* FILE:            ntoskrnl/ex/init.c
-* PURPOSE:         Executive Initialization Code
-* PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
-*                  Eric Kohl (ekohl@rz-online.de)
-*/
+ * PROJECT:         ReactOS Kernel
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            ntoskrnl/ex/init.c
+ * PURPOSE:         Executive Initialization Code
+ * PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
+ *                  Eric Kohl (ekohl@rz-online.de)
+ */
 
 /* INCLUDES ******************************************************************/
 
@@ -206,7 +206,7 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
         if (!ExpNlsTableBase) KeBugCheck(PHASE0_INITIALIZATION_FAILED);
 
         /* Copy the codepage data in its new location. */
-        RtlMoveMemory(ExpNlsTableBase,
+        RtlCopyMemory(ExpNlsTableBase,
                       LoaderBlock->NlsData->AnsiCodePageData,
                       ExpNlsTableSize);
 
@@ -264,7 +264,7 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
     }
 
     /* Copy the codepage data in its new location. */
-    RtlMoveMemory(SectionBase, ExpNlsTableBase, ExpNlsTableSize);
+    RtlCopyMemory(SectionBase, ExpNlsTableBase, ExpNlsTableSize);
 
     /* Free the previously allocated buffer and set the new location */
     ExFreePool(ExpNlsTableBase);
@@ -301,7 +301,7 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
     }
 
     /* Copy the table into the system process and set this as the base */
-    RtlMoveMemory(SectionBase, ExpNlsTableBase, ExpNlsTableSize);
+    RtlCopyMemory(SectionBase, ExpNlsTableBase, ExpNlsTableSize);
     ExpNlsTableBase = SectionBase;
 }
 
@@ -425,7 +425,7 @@ ExpLoadInitialProcess(IN PHANDLE ProcessHandle,
     /* Create the environment string */
     RtlInitEmptyUnicodeString(&Environment,
                               ProcessParameters->Environment,
-                              Size);
+                              (USHORT)Size);
 
     /* Append the DLL path to it */
     RtlAppendUnicodeToString(&Environment, L"Path=" );
@@ -792,6 +792,9 @@ ExpInitializeExecutive(IN ULONG Cpu,
     /* Initialize the Process Manager */
     if (!PsInitSystem()) KEBUGCHECK(PROCESS_INITIALIZATION_FAILED);
 
+    /* Initialize the User-Mode Debugging Subsystem */
+    DbgkInitialize();
+
     /* Calculate the tick count multiplier */
     ExpTickCountMultiplier = ExComputeTickCountMultiplier(KeMaximumIncrement);
     SharedUserData->TickCountMultiplier = ExpTickCountMultiplier;
@@ -840,7 +843,6 @@ ExPhase2Init(PVOID Context)
     if (!NoGuiBoot) InbvDisplayBootLogo();
 
     /* Clear the screen to blue and display the boot notice and debug status */
-    HalInitSystem(2, KeLoaderBlock);
     if (NoGuiBoot) ExpDisplayNotice();
     KdInitSystem(2, KeLoaderBlock);
 
@@ -932,6 +934,10 @@ ExPhase2Init(PVOID Context)
 
     /* Unmap Low memory, and initialize the MPW and Balancer Thread */
     MmInit3();
+#if DBG
+    extern ULONG Guard;
+#endif
+    ASSERT(Guard == 0xCACA1234);
 
     /* Initialize VDM support */
     KeI386VdmInitialize();
@@ -948,6 +954,7 @@ ExPhase2Init(PVOID Context)
     /* Wait 5 seconds for it to initialize */
     Timeout.QuadPart = Int32x32To64(5, -10000000);
     Status = ZwWaitForSingleObject(ProcessHandle, FALSE, &Timeout);
+    if (!NoGuiBoot) InbvFinalizeBootLogo();
     if (Status == STATUS_SUCCESS)
     {
         /* Bugcheck the system if SMSS couldn't initialize */