Re: USB detection - how do I tell when Windows is done??

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Marc Reinig (Marco_at_newsgroups.nospam)
Date: 02/24/05


Date: Thu, 24 Feb 2005 10:05:12 -0800

Windows is not meant to be a production tester. So the enumeration takes as
long as it takes.

As far as knowing when Windows is through enumerating each device, monitor
WM_DEVICECHANGE and look DBT_DEVICEARRIVAL .

Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics

"Daniel Miller" <gorlash@community.nospam> wrote in message
news:Xns96075F6E2C375dancarddupercom@207.46.248.16...
>I have a 12-slot USB tester here, running WinXP Pro SP1. I'm using the
> Host enumeration method documented in UsbView to determine what devices
> are present after powering up the machine. I'm having a problem, though.
> Windows is busy trying to detect these devices at the same time as I am,
> and it takes a Looooong time to finish the job, especially when it's
> never seen any of the specific devices before (i.e., 30-50 seconds to
> finish processing 12 devices, if they all have new serial numbers).
>
> The problem that I've found is this; if I put a long delay in the code,
> and make sure Windows is done before I start enumerating devices,
> everything works fine. However, if I start off calling the enumeration
> functions before Windows is done, various problems occur; either Windows
> does not ultimately register some of the devices properly, or they appear
> to work but don't get normal data transfer rates, or various other
> anomalies.
>
> Details: My enumeration process is: call the UsbView enumeration
> functions (which are DeviceIOControl calls with various IOCTL_USB_
> variants). If any of them fail, stop and wait five seconds, then try
> again. BTW, this is all being done from a user application, not a device
> driver.
>
> Once this works successfully, I open the devices using CreateFile, and do
> some other data collection. However, in this case, I'm not going that
> far. I'm finding that just calling these enumeration functions while
> Windows is still busy working on the devices, is suffient to cause
> problems later, as I described previously.
>
> So, my questions are these:
>
> 1. Is there some way I can programmatically determine when Windows is
> done doing its work, without me accessing the devices themselves, so I
> can tell when its okay for me to proceed??
>
> 2. Is there some way to speed up Windows' enumeration processes?? Having
> to wait 30-50 seconds each time a new bank of parts is inserted, is not
> going to be a good thing in a production environment.
>
> I would be *very* grateful for assistance with these problems.
>
> Dan Miller



Relevant Pages

  • RE: Null session in Windows XP
    ... Null session in Windows XP ... would fully prevent this enumeration. ... >I have a problem with restricting null user access to Windows XP. ...
    (Focus-Microsoft)
  • Re: Null session in Windows XP
    ... Null sessions can *always* be established to NT4, Windows 2000, and Windows ... would fully prevent this enumeration. ... >I have a problem with restricting null user access to Windows XP. ...
    (Focus-Microsoft)
  • Re: Null Session
    ... That depends on what you were intending to do with the null session? ... Mostly it is used for Microsoft Windows enumeration of accounts, ... If the Windows system has the restrictanonymous (restrictanonymoussam ... If you are after other enumeration attacks, have a look at SNMP, ...
    (Pen-Test)
  • Re: USB detection - how do I tell when Windows is done??
    ... Windows is busy trying to detect these devices at ... or they appear to work but don't get normal data transfer ... I'm finding that just calling these enumeration ...
    (microsoft.public.development.device.drivers)
  • RE: Null session in Windows XP
    ... Null session in Windows XP ... would fully prevent this enumeration. ... >I have a problem with restricting null user access to Windows XP. ...
    (Focus-Microsoft)