Driver Verifier and bus enumeration

With Driver Verifier set to “verify everything”, I’m hitting this error:

***********************************************************************
* THIS VALIDATION BUG IS FATAL AND WILL CAUSE THE VERIFIER TO HALT *
* WINDOWS (BUGCHECK) WHEN THE MACHINE IS NOT UNDER A KERNEL DEBUGGER! *
***********************************************************************

WDM DRIVER ERROR: [SS1HWADV.sys @ 0xEFD460B2] An IRP dispatch handler for a
PDO has deleted it’s device object, but the hardware has
not been reported as missing in a bus relations query.
DeviceObject = 81EE0400 - Dispatch = EFD460B2 - Irp =
82E88F48
IRP_MJ_PNP.IRP_MN_REMOVE_DEVICE -
[ DevObj=821D8428, FileObject=00000000, Parameters=00000000 00000000
00000000 00000000 ]
http://www.microsoft.com/hwdq/bc/default.asp?os=5.1.2600&major=0xc9&minor=0x
221&lang=0x9
Break, Ignore, Zap, Remove, Disable all (bizrd)?

The situation is this: My bus enumerator exposes a child PDO, PNP loads the
driver for it, binds that driver to my child PDO. That driver fails during
IRP_MN_START_DEVICE, and so PNP tears down the device stack. So my child
PDO receives IRP_MN_REMOVE_DEVICE, and I process it. I remove the device
from the device list of the parent bus enumerator device, I tear down all
child device state, then I call IoDeleteDevice on the child PDO, then I
return. Immediately after returning, Driver Verifier reports the above
error.

I’ve tried to find more information on this error, and how to fix the
problem, but have found nothing useful. I have tried removing my device
from the bus device’s list, then calling IoInvalidateDeviceRelations on the
bus device, but this has had no effect.

Any clues would be appreciated.

– arlie

You need to look at the busenum sample in the ddk (it is the toaster
enumerator). You are only allowed to delete a PDO under the following
circumstances

  1. you invalidated your device relations (BusRelations). On the
    subsequent IRP_MN_REMOVE_DEVICE after you have responded to the QDR with
    the PDO missing, you can delete the PDO. Note that a PDO can get
    multiple IRP_MN_REMOVE_DEVICE irps sent in a row, you can only delete
    the PDO once it has been reported missing.

  2. the parent device object is being deleted. For instance, the FDO is
    surprise removed. In this case, you would delete the PDOs when
    processing the FDOs remove device.

  3. you never reported the PDO via QDR. In which case you won’t get a
    IRP_MN_REMOVE_DEVICE to delete the PDO.

KMDF makes this much easier to support. You just create the PDO and let
KMDF handle the rest.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arlie Davis
Sent: Monday, October 31, 2005 11:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Driver Verifier and bus enumeration

With Driver Verifier set to “verify everything”, I’m hitting this error:

***********************************************************************
* THIS VALIDATION BUG IS FATAL AND WILL CAUSE THE VERIFIER TO HALT *
* WINDOWS (BUGCHECK) WHEN THE MACHINE IS NOT UNDER A KERNEL DEBUGGER! *
***********************************************************************

WDM DRIVER ERROR: [SS1HWADV.sys @ 0xEFD460B2] An IRP dispatch handler
for a
PDO has deleted it’s device object, but the hardware
has
not been reported as missing in a bus relations query.
DeviceObject = 81EE0400 - Dispatch = EFD460B2 - Irp =
82E88F48
IRP_MJ_PNP.IRP_MN_REMOVE_DEVICE -
[ DevObj=821D8428, FileObject=00000000, Parameters=00000000 00000000
00000000 00000000 ]
http://www.microsoft.com/hwdq/bc/default.asp?os=5.1.2600&major=0xc9&mino
r=0x
221&lang=0x9
Break, Ignore, Zap, Remove, Disable all (bizrd)?

The situation is this: My bus enumerator exposes a child PDO, PNP loads
the
driver for it, binds that driver to my child PDO. That driver fails
during
IRP_MN_START_DEVICE, and so PNP tears down the device stack. So my
child
PDO receives IRP_MN_REMOVE_DEVICE, and I process it. I remove the
device
from the device list of the parent bus enumerator device, I tear down
all
child device state, then I call IoDeleteDevice on the child PDO, then I
return. Immediately after returning, Driver Verifier reports the above
error.

I’ve tried to find more information on this error, and how to fix the
problem, but have found nothing useful. I have tried removing my device
from the bus device’s list, then calling IoInvalidateDeviceRelations on
the
bus device, but this has had no effect.

Any clues would be appreciated.

– arlie


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

You need to hold off the delete until after you have reported the PDO
missing in QueryDevice. I think toaster may handle this correctly. Bus
drivers need a ‘delete reported’ flag for the PDO device extension. You
should get a second remove, if I remember correctly, and your delete
reported flag will be set, and voila you may delete the device.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arlie Davis
Sent: Monday, October 31, 2005 2:40 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Driver Verifier and bus enumeration

With Driver Verifier set to “verify everything”, I’m hitting this error:

***********************************************************************
* THIS VALIDATION BUG IS FATAL AND WILL CAUSE THE VERIFIER TO HALT *
* WINDOWS (BUGCHECK) WHEN THE MACHINE IS NOT UNDER A KERNEL DEBUGGER! *
***********************************************************************

WDM DRIVER ERROR: [SS1HWADV.sys @ 0xEFD460B2] An IRP dispatch handler
for a
PDO has deleted it’s device object, but the hardware
has
not been reported as missing in a bus relations query.
DeviceObject = 81EE0400 - Dispatch = EFD460B2 - Irp =
82E88F48
IRP_MJ_PNP.IRP_MN_REMOVE_DEVICE -
[ DevObj=821D8428, FileObject=00000000, Parameters=00000000 00000000
00000000 00000000 ]
http://www.microsoft.com/hwdq/bc/default.asp?os=5.1.2600&major=0xc9&mino
r=0x
221&lang=0x9
Break, Ignore, Zap, Remove, Disable all (bizrd)?

The situation is this: My bus enumerator exposes a child PDO, PNP loads
the
driver for it, binds that driver to my child PDO. That driver fails
during
IRP_MN_START_DEVICE, and so PNP tears down the device stack. So my
child
PDO receives IRP_MN_REMOVE_DEVICE, and I process it. I remove the
device
from the device list of the parent bus enumerator device, I tear down
all
child device state, then I call IoDeleteDevice on the child PDO, then I
return. Immediately after returning, Driver Verifier reports the above
error.

I’ve tried to find more information on this error, and how to fix the
problem, but have found nothing useful. I have tried removing my device
from the bus device’s list, then calling IoInvalidateDeviceRelations on
the
bus device, but this has had no effect.

Any clues would be appreciated.

– arlie


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com