From 98a8e8f862251844fa39faa57822485feaf9d937 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 2 Jun 2019 09:45:45 +0200 Subject: [PATCH] [NTOS:IO] In IopSynchronousCall first check IrpStack->MajorFunction before checking minor Minor function indices are not unique, they are subfunctions, so without first checking the major function, they are ambiguous. --- ntoskrnl/io/pnpmgr/pnpmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index e5530c61714..f2048782af0 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -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 = -- 2.17.1