https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0972f71d9abb1a7e88660cbfbe8e2d564bb1e102

commit 0972f71d9abb1a7e88660cbfbe8e2d564bb1e102
Author:     George Bișoc <[email protected]>
AuthorDate: Fri Jun 16 00:13:30 2023 +0200
Commit:     George Bișoc <[email protected]>
CommitDate: Sun Jun 18 20:44:13 2023 +0200

    [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
---
 ntoskrnl/io/pnpmgr/pnproot.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ntoskrnl/io/pnpmgr/pnproot.c b/ntoskrnl/io/pnpmgr/pnproot.c
index c41844b64d3..58d740b7d3b 100644
--- a/ntoskrnl/io/pnpmgr/pnproot.c
+++ b/ntoskrnl/io/pnpmgr/pnproot.c
@@ -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);

Reply via email to