I am trying to disable a device from the devcon, though the driver passes the IRP “IRP_MN_QUERY_REMOVE_DEVICE” down the stack and returns with success, PnP manager is sending “IRP_MN_CANCEL_REMOVE_DEVICE” instead of “IRP_MN_REMOVE_DEVICE”. I have looked at the setup.dev.log, PnP Manager is failing “IRP_MN_QUERY_REMOVE_DEVICE” with error
Query-removal was vetoed by ROOT\XXXX\0000? (veto type 5: PNP_VetoOutstandingOpen)
! dvi: Setting needs reboot
! dvi: Query-and-Remove failed: 0x17: CR_REMOVE_VETOED.
This driver is a Virtual Bus driver, I am trying to update the driver without a reboot required. Before disabling the Bus driver FDO, I made sure that all the child devices of this Bus device are removed and no applications opened a handle to this device.
How to proceed further on debugging to find out who opened a handle to this device?
From: xxxxx@gmail.commailto:xxxxx Sent: ?11/?1/?2014 2:23 AM To: Windows System Software Devs Interest Listmailto:xxxxx Subject: [ntdev] Why the PnP manager is failing the IRP_MN_QUERY_REMOVE_DEVICE ?
Hello everyone,
I am trying to disable a device from the devcon, though the driver passes the IRP “IRP_MN_QUERY_REMOVE_DEVICE” down the stack and returns with success, PnP manager is sending “IRP_MN_CANCEL_REMOVE_DEVICE” instead of “IRP_MN_REMOVE_DEVICE”. I have looked at the setup.dev.log, PnP Manager is failing “IRP_MN_QUERY_REMOVE_DEVICE” with error
Query-removal was vetoed by ROOT\XXXX\0000? (veto type 5: PNP_VetoOutstandingOpen) ! dvi: Setting needs reboot ! dvi: Query-and-Remove failed: 0x17: CR_REMOVE_VETOED.
This driver is a Virtual Bus driver, I am trying to update the driver without a reboot required. Before disabling the Bus driver FDO, I made sure that all the child devices of this Bus device are removed and no applications opened a handle to this device.
How to proceed further on debugging to find out who opened a handle to this device?
>How to proceed further on debugging to find out who opened a handle to this device?
Because your driver handles IRP_MJ_CREATE/IRP_MJ_CLEANUP IRPs, you can trace who is actually opening/closing handles for the device. If you use KMDF, look at the documentation for WdfDeviceInitSetFileObjectConfig.