[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.
This commit is contained in:
Timo Kreuzer 2019-06-02 09:45:45 +02:00
parent 05b37f63ea
commit 98a8e8f862

View 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 =