From: Owen Smith Date: Mon, 11 Sep 2017 20:08:29 +0000 (-0700) Subject: Handle DBT_DEVICEREMOVEPENDING and DBT_DEVICEREMOVECOMPLETE X-Git-Tag: 9.0.0-rc1~33 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7fab255f9182c50430ea9d5b0e523d7e0365501c;p=pvdrivers%2Fwin%2Fxencons.git Handle DBT_DEVICEREMOVEPENDING and DBT_DEVICEREMOVECOMPLETE When surprise removed, DBT_DEVICEQUERYREMOVE is not called, and the handles opened by the service need closing before the driver gets the IRP_MN_REMOVE_DEVICE Irp. Signed-off-by: Owen Smith --- diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 89f5f56..08ae0f2 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -1122,6 +1122,8 @@ MonitorCtrlHandlerEx( break; case DBT_DEVICEQUERYREMOVE: + case DBT_DEVICEREMOVEPENDING: + case DBT_DEVICEREMOVECOMPLETE: if (Header->dbch_devicetype == DBT_DEVTYP_HANDLE) { PDEV_BROADCAST_HANDLE Device = EventData;