Stop a USB device.
-
I need my application to stop a USB device, so I do not get the windows 'Unsafe Removal' message when the device is disconnected. Anyone know how to do this ?
-
I need my application to stop a USB device, so I do not get the windows 'Unsafe Removal' message when the device is disconnected. Anyone know how to do this ?
Hi, Not sure how it can be done from an appln, but if u writing the driver for your USB device, and in the IRP_MN_QUERY_CAPABILITIES handler, if u set the following flag, get the pointer to the current IRP and in that, stack->Parameters.DeviceCapabilities.Capabilities->SurpriseRemovalOK = TRUE; U will not get the Unsafe removal dialog.. regds, Shiva P
-
Hi, Not sure how it can be done from an appln, but if u writing the driver for your USB device, and in the IRP_MN_QUERY_CAPABILITIES handler, if u set the following flag, get the pointer to the current IRP and in that, stack->Parameters.DeviceCapabilities.Capabilities->SurpriseRemovalOK = TRUE; U will not get the Unsafe removal dialog.. regds, Shiva P
This will not help me as my device is using some default driver. I wonder if it could be done via 'DeviceIoControl'. I am able to connect to my device by using CreateFile, but using DeviceIoControl with IOCTL_CANCEL_IO does not work (last error = 0x32).