https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3d046e0ed2a8aa0a380fe…
commit 3d046e0ed2a8aa0a380fe6c008c6bc207d53ec9e
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Sat Nov 16 23:52:03 2019 +0300
Commit: Victor Perevertkin <victor(a)perevertkin.ru>
CommitDate: Sun Nov 17 18:36:28 2019 +0300
[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
---
ntoskrnl/io/pnpmgr/pnpmgr.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c
index 56b3561fefe..b08f63eb289 100644
--- a/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -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: