[NTOSKRNL]

Move the PDO check in IoOpenDeviceRegistryKey() to the function begin.
Requested by sir_richard.

svn path=/trunk/; revision=47829
This commit is contained in:
Pierre Schweitzer 2010-06-22 18:51:22 +00:00
parent 0ad7647067
commit bbb19308ea

View file

@ -3507,6 +3507,10 @@ IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
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 @@ IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
}
else
{
if (!IopIsValidPhysicalDeviceObject(DeviceObject))
return STATUS_INVALID_DEVICE_REQUEST;
DeviceNode = IopGetDeviceNode(DeviceObject);
KeyNameLength += sizeof(EnumKeyName) - sizeof(UNICODE_NULL) +
DeviceNode->InstancePath.Length;
}