[NTOSKRNL]
[reactos.git] / reactos / ntoskrnl / io / pnpmgr / pnpmgr.c
index 9d130ec..06f1405 100644 (file)
@@ -3528,6 +3528,8 @@ IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
    else
    {
       DeviceNode = IopGetDeviceNode(DeviceObject);
+      if (!DeviceNode)
+          return STATUS_INVALID_DEVICE_REQUEST;
       KeyNameLength += sizeof(EnumKeyName) - sizeof(UNICODE_NULL) +
                        DeviceNode->InstancePath.Length;
    }