[NTOS]: My SVN is haunted. Commit missing changes?
[reactos.git] / reactos / ntoskrnl / ex / init.c
index 9c36488..175fedf 100644 (file)
@@ -4,7 +4,7 @@
  * FILE:            ntoskrnl/ex/init.c
  * PURPOSE:         Executive Initialization Code
  * PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
- *                  Eric Kohl (ekohl@rz-online.de)
+ *                  Eric Kohl
  */
 
 /* INCLUDES ******************************************************************/
@@ -303,7 +303,7 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
                                        KernelMode,
                                        &ExpNlsSectionPointer,
                                        NULL);
-    ZwClose(NlsSection);
+    ObCloseHandle(NlsSection, KernelMode);
     if (!NT_SUCCESS(Status))
     {
         /* Failed */
@@ -827,7 +827,7 @@ ExpInitializeExecutive(IN ULONG Cpu,
     PCHAR CommandLine, PerfMem;
     ULONG PerfMemUsed;
     PLDR_DATA_TABLE_ENTRY NtosEntry;
-    PRTL_MESSAGE_RESOURCE_ENTRY MsgEntry;
+    PMESSAGE_RESOURCE_ENTRY MsgEntry;
     ANSI_STRING CsdString;
     SIZE_T Remaining = 0;
     PCHAR RcEnd = NULL;
@@ -956,8 +956,7 @@ ExpInitializeExecutive(IN ULONG Cpu,
     }
 
     /* Make sure interrupts are active now */
-// FIXME HAX!!!
-    //_enable();
+    _enable();
 
     /* Clear the crypto exponent */
     SharedUserData->CryptoExponent = 0;
@@ -1241,13 +1240,13 @@ Phase1InitializationDiscard(IN PVOID Context)
     LARGE_INTEGER SystemBootTime, UniversalBootTime, OldTime, Timeout;
     BOOLEAN SosEnabled, NoGuiBoot, ResetBias = FALSE, AlternateShell = FALSE;
     PLDR_DATA_TABLE_ENTRY NtosEntry;
-    PRTL_MESSAGE_RESOURCE_ENTRY MsgEntry;
+    PMESSAGE_RESOURCE_ENTRY MsgEntry;
     PCHAR CommandLine, Y2KHackRequired, SafeBoot, Environment;
     PCHAR StringBuffer, EndBuffer, BeginBuffer, MpString = "";
     PINIT_BUFFER InitBuffer;
     ANSI_STRING TempString;
-    ULONG LastTzBias, Size, YearHack = 0, Disposition, MessageCode = 0;
-    SIZE_T Length;
+    ULONG LastTzBias, Length, YearHack = 0, Disposition, MessageCode = 0;
+    SIZE_T Size;
     PRTL_USER_PROCESS_INFORMATION ProcessInfo;
     KEY_VALUE_PARTIAL_INFORMATION KeyPartialInfo;
     UNICODE_STRING KeyName, DebugString;
@@ -1327,14 +1326,14 @@ Phase1InitializationDiscard(IN PVOID Context)
     StringBuffer = InitBuffer->VersionBuffer;
     BeginBuffer = StringBuffer;
     EndBuffer = StringBuffer;
-    Length = 256;
+    Size = 256;
     if (CmCSDVersionString.Length)
     {
         /* Print the version string */
         Status = RtlStringCbPrintfExA(StringBuffer,
                                       255,
                                       &EndBuffer,
-                                      &Length,
+                                      &Size,
                                       0,
                                       ": %wZ",
                                       &CmCSDVersionString);
@@ -1347,7 +1346,7 @@ Phase1InitializationDiscard(IN PVOID Context)
     else
     {
         /* No version */
-        Length = 255;
+        Size = 255;
     }
 
     /* Null-terminate the string */
@@ -1371,7 +1370,7 @@ Phase1InitializationDiscard(IN PVOID Context)
     {
         /* Create the banner message */
         Status = RtlStringCbPrintfA(EndBuffer,
-                                    Length,
+                                    Size,
                                     MsgEntry->Text,
                                     StringBuffer,
                                     NtBuildNumber & 0xFFFF,
@@ -1385,7 +1384,7 @@ Phase1InitializationDiscard(IN PVOID Context)
     else
     {
         /* Use hard-coded banner message */
-        Status = RtlStringCbCopyA(EndBuffer, Length, "REACTOS (R)\n");
+        Status = RtlStringCbCopyA(EndBuffer, Size, "REACTOS (R)\n");
         if (!NT_SUCCESS(Status))
         {
             /* Bugcheck */
@@ -1613,7 +1612,7 @@ Phase1InitializationDiscard(IN PVOID Context)
             else if (!strncmp(SafeBoot, "NETWORK", 7))
             {
                 /* With Networking */
-                InitSafeBootMode = 1;
+                InitSafeBootMode = 2;
                 SafeBoot += 7;
                 MessageCode = BOOTING_IN_SAFEMODE_NETWORK;
             }
@@ -1727,7 +1726,7 @@ Phase1InitializationDiscard(IN PVOID Context)
                                          KeyValuePartialInformation,
                                          &KeyPartialInfo,
                                          sizeof(KeyPartialInfo),
-                                         &Size);
+                                         &Length);
                 if (!NT_SUCCESS(Status)) AlternateShell = FALSE;
             }
 
@@ -1879,17 +1878,17 @@ Phase1InitializationDiscard(IN PVOID Context)
     ZwClose(ProcessInfo->ProcessHandle);
 
     /* Free the initial process environment */
-    Length = 0;
+    Size = 0;
     ZwFreeVirtualMemory(NtCurrentProcess(),
                         (PVOID*)&Environment,
-                        &Length,
+                        &Size,
                         MEM_RELEASE);
 
     /* Free the initial process parameters */
-    Length = 0;
+    Size = 0;
     ZwFreeVirtualMemory(NtCurrentProcess(),
                         (PVOID*)&ProcessParameters,
-                        &Length,
+                        &Size,
                         MEM_RELEASE);
 
     /* Increase init phase */