[NTOS:IO] In IopSynchronousCall first check IrpStack->MajorFunction before checking...
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 2 Jun 2019 07:45:45 +0000 (09:45 +0200)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 15 Aug 2019 16:04:57 +0000 (18:04 +0200)
Minor function indices are not unique, they are subfunctions, so without first checking the major function, they are ambiguous.

ntoskrnl/io/pnpmgr/pnpmgr.c

index e5530c6..f204878 100644 (file)
@@ -1441,7 +1441,8 @@ IopSynchronousCall(IN PDEVICE_OBJECT DeviceObject,
     Irp->IoStatus.Information = IoStatusBlock.Information = 0;
 
     /* Special case for IRP_MN_FILTER_RESOURCE_REQUIREMENTS */
-    if (IoStackLocation->MinorFunction == IRP_MN_FILTER_RESOURCE_REQUIREMENTS)
+    if ((IoStackLocation->MajorFunction == IRP_MJ_PNP) &&
+        (IoStackLocation->MinorFunction == IRP_MN_FILTER_RESOURCE_REQUIREMENTS))
     {
         /* Copy the resource requirements list into the IOSB */
         Irp->IoStatus.Information =