Enable\Disable a bus device in the device manager

When I disable my bus device in the device manager, each child devices
received a IRP_MN_QUERY_REMOVE_DEVICE, then right after that my bus FDO
receive an IRP_MN_QUERY_REMOVE instead of having this call after that all
child devices are deleted (IRP_MN_REMOVE_DEVICE).

When I delete the bus device in the device manager, each child devices
received a IRP_MN_QUERY_REMOVE, then a IRP_MN_REMOVE_DEVICE. After that
all child are deleted, the bus FDO get called with a
IRP_MN_QUERY_REMOVE_DEVICE.

Why the PNP Manager is not handling the “disable” and “delete” device the
same way?

> Why the PNP Manager is not handling the “disable” and “delete” device the

same way?

“Disable” is not “delete”. Disable retains the PDO for future reuse when re-enabled.

Max

Event if we delete the device in the device manager, the PDO(s) are not
deleted, it’s only the FDO of the child devices that are deleted.
For the case of the disable, that’s the same thing, we keep the bus PDO(s)
and the FDO of the child devices are deleted.

Tresult is the same in the two cases but the PNP Manager is not handling
them with the same call order. Why?