Author: cgutman
Date: Sun Apr 11 18:21:29 2010
New Revision: 46842

URL: http://svn.reactos.org/svn/reactos?rev=46842&view=rev
Log:
[NTOSKRNL]
- Store the allocated resources for reported devices

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

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c?rev=46842&r1=46841&r2=46842&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:21:29 2010
@@ -266,9 +266,6 @@
     /* Write the resource information to the registry */
     IopSetDeviceInstanceData(InstanceKey, DeviceNode);
 
-    /* Close the instance key handle */
-    ZwClose(InstanceKey);
-
     /* If the caller didn't get the resources assigned for us, do it now */
     if (!ResourceAssigned)
     {
@@ -278,7 +275,19 @@
        {
           Status = IopTranslateDeviceResources(DeviceNode, RequiredLength);
           if (NT_SUCCESS(Status))
+          {
               Status = IopUpdateResourceMapForPnPDevice(DeviceNode);
+              if (NT_SUCCESS(Status) && DeviceNode->ResourceList)
+              {
+                 RtlInitUnicodeString(&ValueName, L"AllocConfig");
+                 Status = ZwSetValueKey(InstanceKey,
+                                        &ValueName,
+                                        0,
+                                        REG_RESOURCE_LIST,
+                                        DeviceNode->ResourceList,
+                                        
CM_RESOURCE_LIST_SIZE(DeviceNode->ResourceList));
+              }
+          }
        }
        IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES);
 
@@ -286,9 +295,13 @@
        if (!NT_SUCCESS(Status))
        {
            DPRINT("Assigning resources failed: 0x%x\n", Status);
+           ZwClose(InstanceKey);
            return Status;
        }
     }
+
+    /* Close the instance key handle */
+    ZwClose(InstanceKey);
 
     /* Report the device's enumeration to umpnpmgr */
     IopQueueTargetDeviceEvent(&GUID_DEVICE_ENUMERATED,


Reply via email to