Author: tfaber
Date: Thu Mar 26 17:02:31 2015
New Revision: 66905

URL: http://svn.reactos.org/svn/reactos?rev=66905&view=rev
Log:
[NTOS:CM]
- Do not allow the creation of keys in the master hive. Fixes boot with the 
VMware sound driver from rapps installed (and it works, too).
CORE-5381 #resolve

Modified:
    trunk/reactos/ntoskrnl/config/cmparse.c
    trunk/reactos/ntoskrnl/config/cmsysini.c
    trunk/reactos/ntoskrnl/include/internal/cm.h

Modified: trunk/reactos/ntoskrnl/config/cmparse.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmparse.c?rev=66905&r1=66904&r2=66905&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmparse.c     [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmparse.c     [iso-8859-1] Thu Mar 26 
17:02:31 2015
@@ -1266,6 +1266,11 @@
                                                        ParentKcb,
                                                        Object);
                         }
+                        else if (Hive == &CmiVolatileHive->Hive && 
CmpNoVolatileCreates)
+                        {
+                            /* Creating keys in the master hive is not allowed 
*/
+                            Status = STATUS_INVALID_PARAMETER;
+                        }
                         else
                         {
                             /* Do the create */

Modified: trunk/reactos/ntoskrnl/config/cmsysini.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmsysini.c?rev=66905&r1=66904&r2=66905&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmsysini.c    [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmsysini.c    [iso-8859-1] Thu Mar 26 
17:02:31 2015
@@ -29,6 +29,7 @@
 BOOLEAN CmpNoWrite;
 BOOLEAN CmpWasSetupBoot;
 BOOLEAN CmpProfileLoaded;
+BOOLEAN CmpNoVolatileCreates;
 ULONG CmpTraceLevel = 0;
 
 extern LONG CmpFlushStarveWriters;
@@ -1470,8 +1471,10 @@
                      L"\\Registry\\Machine\\SAM\\SAM");
 
     /* Link S-1-5-18 to .Default */
+    CmpNoVolatileCreates = FALSE;
     CmpLinkKeyToHive(L"\\Registry\\User\\S-1-5-18",
                      L"\\Registry\\User\\.Default");
+    CmpNoVolatileCreates = TRUE;
 }
 
 BOOLEAN
@@ -1530,7 +1533,7 @@
     }
 
     /* Build the master hive */
-    Status = CmpInitializeHive((PCMHIVE*)&CmiVolatileHive,
+    Status = CmpInitializeHive(&CmiVolatileHive,
                                HINIT_CREATE,
                                HIVE_VOLATILE,
                                HFILE_TYPE_PRIMARY,
@@ -1601,6 +1604,9 @@
 
     /* Close the handle */
     NtClose(KeyHandle);
+
+    /* After this point, do not allow creating keys in the master hive */
+    CmpNoVolatileCreates = TRUE;
 
     /* Initialize the system hive */
     if (!CmpInitializeSystemHive(KeLoaderBlock))

Modified: trunk/reactos/ntoskrnl/include/internal/cm.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/cm.h?rev=66905&r1=66904&r2=66905&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cm.h        [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cm.h        [iso-8859-1] Thu Mar 26 
17:02:31 2015
@@ -1659,6 +1659,7 @@
 extern BOOLEAN CmpFlushOnLockRelease;
 extern BOOLEAN CmpShareSystemHives;
 extern BOOLEAN CmpMiniNTBoot;
+extern BOOLEAN CmpNoVolatileCreates;
 extern EX_PUSH_LOCK CmpHiveListHeadLock, CmpLoadHiveLock;
 extern LIST_ENTRY CmpHiveListHead;
 extern POBJECT_TYPE CmpKeyObjectType;


Reply via email to