[NTOS:IO] Fix result length for DevicePropertyRemovalPolicy request

in IoGetDeviceProperty.
Classpnp expects it to be sizeof(DEVICE_REMOVAL_POLICY)
see ClasspInitializeHotplugInfo in classpnp.sys

CORE-6264
This commit is contained in:
Victor Perevertkin 2019-11-16 23:52:03 +03:00 committed by Victor Perevertkin
parent 50605143f6
commit 3d046e0ed2

View file

@ -4240,6 +4240,7 @@ IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject,
GUID BusTypeGuid;
POBJECT_NAME_INFORMATION ObjectNameInfo = NULL;
BOOLEAN NullTerminate = FALSE;
DEVICE_REMOVAL_POLICY Policy;
DPRINT("IoGetDeviceProperty(0x%p %d)\n", DeviceObject, DeviceProperty);
@ -4357,7 +4358,9 @@ IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject,
break;
case DevicePropertyRemovalPolicy:
PIP_RETURN_DATA(sizeof(UCHAR), &DeviceNode->RemovalPolicy);
Policy = DeviceNode->RemovalPolicy;
PIP_RETURN_DATA(sizeof(Policy), &Policy);
/* Handle the registry-based properties */
case DevicePropertyUINumber: