I developed the bus driver, which is just enumerates its devices.
After the child PDO-device has been removed by IRP_MN_REMOVE_DEVICE, the flag DNF_NON_STOPPED_REBALANCE still present in the DevNode->Flags !
This cause an “Assertion failed” in pnpsubs.c, line 5840
So, as described in DDK, actually I does not delete the PDO-device-object by IoDeleveDevice(), because the child-device is physically present on the bus.
What is wrong ? Somebody can help me ?
*********************** Extraction from WinDbg log ***********************
IRP_MN_QUERY_DEVICE_RELATIONS
[…]
IRP_MN_QUERY_REMOVE_DEVICE
[…]
IRP_MN_REMOVE_DEVICE
kd> !devobj ff327778
Device object (ff327778) is for:
0000002b \Driver\CronyxOmega DriverObject ff4ec958
Current Irp 00000000 RefCount 0 Type 00000022 Flags 00003044
DevExt ff327830 DevObjExt ff327988 DevNode ff4b5ce8
ExtensionFlags (0xa0000008) DOE_REMOVE_PROCESSED, DOE_RAW_FDO,
DOE_DESIGNATED_FDO
Device queue is not busy.
kd> !devnode ff4b5ce8
DevNode 0xff4b5ce8 for PDO 0xff327778
Parent 0xfcd9e868 Sibling 0xff425d88 Child 0000000000
InstancePath is “CronyxOmega\UART16750\CronyxOmega&VER_01&BOARD_00&PORT_000”
EnumerationMutex is held
Flags (0x00058058) DNF_PROCESSED, DNF_ENUMERATED,
DNF_ADDED, DNF_RESOURCE_REQUIREMENTS_CHANGED,
DNF_NON_STOPPED_REBALANCE, DNF_STARTED
CapabilityFlags (0x00000140) UniqueID, RawDeviceOK
LockCount = 1
[…]
ntoskrnl!IopRestartDeviceNode+145:
*** Assertion failed: !(DeviceNode->Flags & ~(DNF_MADEUP | DNF_ENUMERATED | DNF_HAS_BOOT_CONFIG | DNF_BOOT_CONFIG_RESERVED | DNF_NO_RESOURCE_REQUIRED))
*** Source File: F:\nt\private\ntos\io\pnpsubs.c, line 5840
kd> !devobj ff327778
Device object (ff327778) is for:
0000002b \Driver\CronyxOmega DriverObject ff4ec958
Current Irp 00000000 RefCount 0 Type 00000022 Flags 00003044
DevExt ff327830 DevObjExt ff327988 DevNode ff4b5ce8
ExtensionFlags (0xa0000010) DOE_START_PENDING, DOE_RAW_FDO,
DOE_DESIGNATED_FDO
Device queue is not busy.
kd> !devnode ff4b5ce8
DevNode 0xff4b5ce8 for PDO 0xff327778
Parent 0xfcd9e868 Sibling 0xff425d88 Child 0000000000
InstancePath is “CronyxOmega\UART16750\CronyxOmega&VER_01&BOARD_00&PORT_000”
EnumerationMutex is held
Flags (0x00010010) DNF_ENUMERATED, DNF_NON_STOPPED_REBALANCE
CapabilityFlags (0x00000140) UniqueID, RawDeviceOK
LockCount = 1
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com