SetupDi madness

Who here has plumbed the depths of SetupDi* and retained their soul?

I need to do the equivalent of UpdateDriverForPlugAndPlayDevices, but only
for a specific device. I’m working on an install app for a virtual device.
There may be “many” (20 - 100) instances of this virtual device driver
installed on a system. UpdateDriverForPlugAndPlayDevices does its magic for
every device instance of my virtual device, even those that are happily
installed and working. Beyond a handful of device instances, its unusably
slow.

Is all of the functionality of UpdateDriverForPlugAndPlayDevices exposed
through SetupDi functions? I’ve looked, and the documentation is enough to
make me contemplate suicide.

I can create device instances with specific hardware IDs, but I don’t see a
way to force the class installer to use a specific INF file + its drivers
for that device instance. SetupDiInstallDevice complains that no driver is
selected; fine, I’d love to select my driver *without* having SetupDi* scan
through the entire INF database, which is slow and risks choosing the wrong
driver.

– arlie

Arlie,

you wrote on Friday, August 12, 2005, 22:21:01:

AD> I need to do the equivalent of UpdateDriverForPlugAndPlayDevices,
AD> but only for a specific device.  I’m working on an install app for a
AD> virtual device.  There may be “many” (20 - 100) instances of this
AD> virtual device driver installed on a system. 
AD> UpdateDriverForPlugAndPlayDevices does its magic for every device
AD> instance of my virtual device, even those that are happily installed
AD> and working.  Beyond a handful of device instances, its unusably
AD> slow.

I once had pretty much the same problem, see
http://groups.google.de/group/microsoft.public.development.device.drivers/browse_frm/thread/1e6d46b84c438d03/4ede2e7f3afe2cfd?lnk=st&q=Rewriting+UpdateDriverForPlugAndPlayDevices&rnum=1&hl=en#4ede2e7f3afe2cfd

I finally got it working, I can send you the code off list if you want
(needs a small modification because you are likely installing a real
device). Or ask for the undocumented InstallSelectedDriver API mentioned
by Elias in that thread.


Ralf.

Arlie,

I wrote on Monday, August 15, 2005, 09:05:14:

RB> Or ask for the undocumented InstallSelectedDriver API mentioned by
RB> Elias in that thread.

Cool, seems to be officially documented now:
http://support.microsoft.com/kb/889763


Ralf.