[ros-diffs] [cgutman] 46840: [NTOSKRNL] - Make legacy device keys volatile

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sun Apr 11 18:08:26 CEST 2010


Author: cgutman
Date: Sun Apr 11 18:08:20 2010
New Revision: 46840

URL: http://svn.reactos.org/svn/reactos?rev=46840&view=rev
Log:
[NTOSKRNL]
- Make legacy device keys volatile

Modified:
    trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
    trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
    trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c?rev=46840&r1=46839&r2=46840&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sun Apr 11 18:08:20 2010
@@ -63,6 +63,7 @@
 NTSTATUS
 NTAPI
 IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
+                       IN ULONG CreateOptions,
                        OUT PHANDLE Handle);
 
 PDEVICE_NODE
@@ -226,7 +227,7 @@
       }
    }
 
-   Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, &InstanceHandle);
+   Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0, &InstanceHandle);
    if (!NT_SUCCESS(Status))
        return Status;
 
@@ -458,7 +459,7 @@
       }
 
       /* Create the device key for legacy drivers */
-      Status = IopCreateDeviceKeyPath(&Node->InstancePath, &InstanceHandle);
+      Status = IopCreateDeviceKeyPath(&Node->InstancePath, REG_OPTION_VOLATILE, &InstanceHandle);
       if (!NT_SUCCESS(Status))
       {
           ZwClose(InstanceHandle);
@@ -761,6 +762,7 @@
 NTSTATUS
 NTAPI
 IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
+                       IN ULONG CreateOptions,
                        OUT PHANDLE Handle)
 {
     UNICODE_STRING EnumU = RTL_CONSTANT_STRING(ENUM_ROOT);
@@ -811,7 +813,7 @@
                              &ObjectAttributes,
                              0,
                              NULL,
-                             0,
+                             CreateOptions,
                              NULL);
 
         /* Close parent key handle, we don't need it anymore */
@@ -2244,7 +2246,7 @@
    /*
     * Create registry key for the instance id, if it doesn't exist yet
     */
-   Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, &InstanceKey);
+   Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0, &InstanceKey);
    if (!NT_SUCCESS(Status))
    {
       DPRINT1("Failed to create the instance key! (Status %lx)\n", Status);

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c?rev=46840&r1=46839&r2=46840&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c [iso-8859-1] Sun Apr 11 18:08:20 2010
@@ -15,6 +15,7 @@
 NTSTATUS
 NTAPI
 IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
+                       IN ULONG CreateOptions,
                        OUT PHANDLE Handle);
 
 NTSTATUS
@@ -196,7 +197,7 @@
     IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
 
     /* Open a handle to the instance path key */
-    Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, &InstanceKey);
+    Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0, &InstanceKey);
     if (!NT_SUCCESS(Status))
         return Status;
 

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c?rev=46840&r1=46839&r2=46840&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] Sun Apr 11 18:08:20 2010
@@ -172,7 +172,7 @@
     if (NT_SUCCESS(Status))
     {
         InitializeObjectAttributes(&ObjectAttributes, &Device->DeviceID, OBJ_CASE_INSENSITIVE, EnumHandle, NULL);
-        Status = ZwCreateKey(&DeviceKeyHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, 0, NULL);
+        Status = ZwCreateKey(&DeviceKeyHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
         ZwClose(EnumHandle);
     }
 




More information about the Ros-diffs mailing list