Updating the driver for a single device instance

Hi!

I have a number of serial communications ports in my computer. (ie managed
by Serial.Sys). I need to be able to programmatically replace the driver for
just one of the devices. I can do it manually using Update Driver from
Device Manager but I need to automate the process.

UpdateDriverForPlugAndPlayDevices() will change the driver for all of the
device instances. How is Device Manager capable of only doing one instance?

I’ve seen references to an undocumented InstallSelectedDevice() API. Is that
the way to do it? If so, does anyone have any documentation for it?

I looked at devmgr.dll with Dependency Walker and noticed that it doesn’t
hook to newdev.dll (where UpdateDriverForPlugAndPlayDevices() and
InstallSelectedDevice() live.) I did see lots of calls to SetupDi…() and
CM_…() stuff, is there a sequence of those calls that will update the
driver for just one instance of a device? Does anyone have an example?

Thanks for your help!

— tom
tom allebrandi
xxxxx@ytram.com

[I sent this out last week but have not seen any responses. I’m guessing
that either

a) No one else saw it;
b) What I’m asking for/about isn’t making sense and could be worded better?

— tom]

Hi!

I have a number of serial communications ports in my computer. (ie managed
by Serial.Sys). I need to be able to programmatically replace the driver for
just one of the devices. I can do it manually using Update Driver from
Device Manager but I need to automate the process.

UpdateDriverForPlugAndPlayDevices() will change the driver for all of the
device instances. How is Device Manager capable of only doing one instance?

I’ve seen references to an undocumented InstallSelectedDevice() API. Is that
the way to do it? If so, does anyone have any documentation for it?

I looked at devmgr.dll with Dependency Walker and noticed that it doesn’t
hook to newdev.dll (where UpdateDriverForPlugAndPlayDevices() and
InstallSelectedDevice() live.) I did see lots of calls to SetupDi…() and
CM_…() stuff, is there a sequence of those calls that will update the
driver for just one instance of a device? Does anyone have an example?

Thanks for your help!

— tom
tom allebrandi
xxxxx@ytram.com