Re: User-mode handle & USB device plug/unplug

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Maxim S. Shatskih (maxim_at_storagecraft.com)
Date: 08/10/04


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.
>
>


Relevant Pages

  • Re: EyeTV USB
    ... l'ingresso per l'antenna e l'uscita USB. ... Ciao ... Leo ... Prev by Date: ...
    (it.comp.macintosh)
  • Re: USB Host controller on Windows
    ... USB protocol. ... If i use the host controller on ... PC,what is the procedure to access the USB port of the target board. ... Leo Havmøller. ...
    (microsoft.public.development.device.drivers)
  • Re: OS independent , Platform independent USB device driver
    ... the kernel-level interfaces to user-mode. ... you really do have to write a user-mode device driver. ... on the USB spec. ...
    (comp.os.linux.development.system)
  • Re: USB Functionnality with 25meg image, is it possible?
    ... to whole 25 meg dependencies that comes with PnP. ... think in Linux we need 25 meg of data to activate the USB ... The difference between the both is the PnP (User-mode) component. ...
    (microsoft.public.windowsxp.embedded)
  • Re: USBPORT/USBEHCI fails read_bulk URB
    ... Anyway i am passing a 512 byte user-mode buffer for USB BULK_READ ... operations (IN tokens) from the USB device. ...
    (microsoft.public.development.device.drivers)