Re: USB detection - how do I tell when Windows is done??
From: Marc Reinig (Marco_at_newsgroups.nospam)
Date: 02/24/05
- Next message: Frank Schwab: "Creating a null .INF file"
- Previous message: Matt Kane: "Purify and spooler components"
- In reply to: Daniel Miller: "USB detection - how do I tell when Windows is done??"
- Next in thread: Daniel Miller: "Re: USB detection - how do I tell when Windows is done??"
- Reply: Daniel Miller: "Re: USB detection - how do I tell when Windows is done??"
- Reply: Robert Marquardt: "Re: USB detection - how do I tell when Windows is done??"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Frank Schwab: "Creating a null .INF file"
- Previous message: Matt Kane: "Purify and spooler components"
- In reply to: Daniel Miller: "USB detection - how do I tell when Windows is done??"
- Next in thread: Daniel Miller: "Re: USB detection - how do I tell when Windows is done??"
- Reply: Daniel Miller: "Re: USB detection - how do I tell when Windows is done??"
- Reply: Robert Marquardt: "Re: USB detection - how do I tell when Windows is done??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|