[NTOS:PNP] Assert the presence of a device extension when handling PnP root power IRPs

Handling PnP root driver power IRPs requires that a device object must come up
with a device extension to determine whether it is a function driver and if so,
handle the IRP accordingly.

CORE-18989
This commit is contained in:
George Bișoc 2023-06-16 00:13:30 +02:00
parent 89ecf32e0b
commit 0972f71d9a
No known key found for this signature in database
GPG key ID: 688C4FBE25D7DEF6

View file

@ -1473,6 +1473,12 @@ PnpRootPowerControl(
Status = Irp->IoStatus.Status;
IrpSp = IoGetCurrentIrpStackLocation(Irp);
/*
* We must handle power IRPs based on whether it is a function driver
* or not from the device extension, so it cannot be NULL.
*/
ASSERT(DeviceExtension);
if (DeviceExtension->Common.IsFDO)
{
ASSERT(!DeviceExtension->Common.IsFDO);