Re: User-mode handle & USB device plug/unplug
From: Maxim S. Shatskih (maxim_at_storagecraft.com)
Date: 08/10/04
- Next message: Tim Roberts: "Re: USB Audio Device. What Kind of driver I need to write?"
- Previous message: Edward Hsu: "AVStream : AVStream Splitters"
- In reply to: Leo Havmøller: "User-mode handle & USB device plug/unplug"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 10 Aug 2004 08:06:14 +0400
Observed this on some app working with USB storage flash drives.
The working way is to register a handle-based PnP notification in the app
and close the handle on device removal.
-- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation maxim@storagecraft.com http://www.storagecraft.com "Leo Havmøller" <leh@nospamrtx.dk> wrote in message news:eZvzVxefEHA.3292@TK2MSFTNGP10.phx.gbl... > Consider a USB device with a driver that exposes a COM port. > Device object and symbolic link is created in the AddDevice handler as > usual. > > If a user-mode handle is open, and the USB device is removed, only > StopDevice is performed i.e. RemoveDevice is not called because of the open > handle (normally the user-mode application would register for device > notification and close the handle there, but very few (if any) applications > do this for COM ports). > > Now when the device is re-plugged, AddDevice is called again. Because its > the same device, the same symbolic link should be used. The link cannot be > created because the name is already in use. > Closing and re-opening the COM port does not rectify the situation. The > user-mode handle must be closed and the USB device must be > unplugged/replugged to bring things back to a working state. > > Is there some WDM-standard way of circumventing this problem? > > Leo Havmøller. > >
- Next message: Tim Roberts: "Re: USB Audio Device. What Kind of driver I need to write?"
- Previous message: Edward Hsu: "AVStream : AVStream Splitters"
- In reply to: Leo Havmøller: "User-mode handle & USB device plug/unplug"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|