[ros-diffs] [ion] 24388: - Fix boot crash due to last patch, forgot that SharedUserDAta wasn't available yet.

ion at svn.reactos.org ion at svn.reactos.org
Wed Oct 4 07:59:56 CEST 2006


Author: ion
Date: Wed Oct  4 09:59:56 2006
New Revision: 24388

URL: http://svn.reactos.org/svn/reactos?rev=24388&view=rev
Log:
- Fix boot crash due to last patch, forgot that SharedUserDAta wasn't available yet.

Modified:
    trunk/reactos/ntoskrnl/ke/i386/kiinit.c

Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?rev=24388&r1=24387&r2=24388&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Wed Oct  4 09:59:56 2006
@@ -297,6 +297,7 @@
     ULONG FeatureBits;
     LARGE_INTEGER PageDirectory;
     PVOID DpcStack;
+    ULONG NXSupportPolicy;
 
     /* Detect and set the CPU Type */
     KiSetProcessorType();
@@ -316,38 +317,38 @@
     /* Get the processor features for the CPU */
     FeatureBits = KiGetFeatureBits();
 
+    /* Set the default NX policy (opt-in) */
+    NXSupportPolicy = 2;
+
+    /* Check if NPX is always on */
+    if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSON"))
+    {
+        /* Set it always on */
+        NXSupportPolicy = 1;
+        FeatureBits |= KF_NX_ENABLED;
+    }
+    else if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTOUT"))
+    {
+        /* Set it in opt-out mode */
+        NXSupportPolicy = 3;
+        FeatureBits |= KF_NX_ENABLED;
+    }
+    else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTIN")) ||
+             (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE")))
+    {
+        /* Set the feature bits */
+        FeatureBits |= KF_NX_ENABLED;
+    }
+    else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSOFF")) ||
+             (strstr(KeLoaderBlock->LoadOptions, "EXECUTE")))
+    {
+        /* Set disabled mode */
+        NXSupportPolicy = 0;
+        FeatureBits |= KF_NX_DISABLED;
+    }
+
     /* Save feature bits */
     Prcb->FeatureBits = FeatureBits;
-
-    /* Set the default NX policy (opt-in) */
-    SharedUserData->NXSupportPolicy = 2;
-
-    /* Check if NPX is always on */
-    if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSON"))
-    {
-        /* Set it always on */
-        SharedUserData->NXSupportPolicy = 1;
-        KeFeatureBits |= KF_NX_ENABLED;
-    }
-    else if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTOUT"))
-    {
-        /* Set it in opt-out mode */
-        SharedUserData->NXSupportPolicy = 3;
-        KeFeatureBits |= KF_NX_ENABLED;
-    }
-    else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTIN")) ||
-             (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE")))
-    {
-        /* Set the feature bits */
-        KeFeatureBits |= KF_NX_ENABLED;
-    }
-    else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSOFF")) ||
-             (strstr(KeLoaderBlock->LoadOptions, "EXECUTE")))
-    {
-        /* Set disabled mode */
-        SharedUserData->NXSupportPolicy = 0;
-        KeFeatureBits |= KF_NX_DISABLED;
-    }
 
     /* Save CPU state */
     KiSaveProcessorControlState(&Prcb->ProcessorState);
@@ -416,6 +417,9 @@
 
     /* Sets up the Text Sections of the Kernel and HAL for debugging */
     LdrInit1();
+
+    /* Set the NX Support policy */
+    SharedUserData->NXSupportPolicy = NXSupportPolicy;
 
     /* Setup the Idle Thread */
     KeInitializeThread(InitProcess,




More information about the Ros-diffs mailing list