Author: pschweitzer
Date: Tue Jun 22 18:51:22 2010
New Revision: 47829
URL: http://svn.reactos.org/svn/reactos?rev=47829&view=rev
Log:
[NTOSKRNL]
Move the PDO check in IoOpenDeviceRegistryKey() to the function begin.
Requested by sir_richard.
Modified:
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Tue Jun 22 18:51:22 2010
@@ -3507,6 +3507,10 @@
return STATUS_INVALID_PARAMETER;
}
+ if (!IopIsValidPhysicalDeviceObject(DeviceObject))
+ return STATUS_INVALID_DEVICE_REQUEST;
+ DeviceNode = IopGetDeviceNode(DeviceObject);
+
/*
* Calculate the length of the base key name. This is the full
* name for driver key or the name excluding "Device Parameters"
@@ -3527,9 +3531,6 @@
}
else
{
- if (!IopIsValidPhysicalDeviceObject(DeviceObject))
- return STATUS_INVALID_DEVICE_REQUEST;
- DeviceNode = IopGetDeviceNode(DeviceObject);
KeyNameLength += sizeof(EnumKeyName) - sizeof(UNICODE_NULL) +
DeviceNode->InstancePath.Length;
}