Again, I am failing to explain what I am trying to do.
Say you have a “root-enumerated” device (like the toaster bus for example).
In order to install the toaster bus you have a few options available to you.
You can use the Add New Hardware Wizard and you can also install it with a
user mode app of your creation (check out devcon sample in DDK). Now, in
order to install this new virtual device – following the source in the
devcon sample – you need to call UpdateDriverForPlugAndPlayDevices
somewhere along the way. However, this presents a problem when you wish to
install multiple devices with the same hardware ID. Since
UpdateDriverForPlugAndPlayDevices only accepts a hardware ID, there is no
way for it to distinguish between multiple devices with the same hardware
ID.
This leads to problems when you have a device already installed and
operating, and then you wish to install another.
UpdateDriverForPlugAndPlayDevices will attempt to update both devices;
meaning that the first device must be stopped and removed, thus disrupting
it’s operation (no good and very undesirable).
Is this making sense at all?..Good, moving on
(seriously though,
please tell me if I’m spouting off incomprehensible garbage)
I have two ideas on how this can be fixed.
- Install the driver for a specific device without using
UpdateDriverForPlugAndPlayDevices.
- Always create unique hardware IDs when installing a new device.
Number 1 is why I am here as I do not know if it is at all possible.
Number 2 can be accomplished quite easily from the user mode app (since the
user mode app sets the hardware ID before calling
UpdateDriverForPlugAndPlayDevices). However, there are a few other problems
with this method that I do not know how to tackle.
A. If a device is added using the Add New Hardware Wizard, the hardware ID
is set by the wizard. This hardware ID is retrieved from the INF and
therefore will always be the same for each device installed using the Add
New Hardware Wizard. I thought of trying to modify the hardware ID with a
co-installer but I’d like to get feedback from somewhere before even
attempting it.
B. Even if the hardware IDs are guaranteed to be unique, I then have no
practical way of matching the INF to every device. I cannot use compatible
IDs because the bus driver reports them, and since the devices are
“root-enumerated” their bus (root) has no clue what the devices are all
about. If IRP_MN_QUERY_ID can in fact be safely handled from a function
driver then I could use compatible IDs (Function and filter drivers do not
handle this IRP. – from DDK).
If anyone has some ideas about how this issue might be resolved, please feel
free to send suggestions…and if there needs to be more explaination I am
happy to give it.
Thanks, Chris
“Del Fredricks” wrote in message
news:xxxxx@ntdev…
>
> Look at the “enum” source under the exe directory for the toaster sample.
> It demonstrates the plugin and unplug calls made to the driver to create
and
> destroy devices from user mode applications.
>
> “Chris Dore” wrote in message
> news:xxxxx@ntdev…
> >
> > Sorry, I should have made it a bit clearer. The creation of new devices
> is
> > done from user mode app and not from a bus driver.
> >
> > Hope this helps, Chris
> >
> > “Gary G. Little” wrote in message
> > news:xxxxx@ntdev…
> > >
> > > Have you checked the toaster example in the DDK? Did you invalidate
the
> > bus?
> > >
> > > –
> > > Gary G. Little
> > > Have Computer, Will Travel …
> > > 909-698-3191
> > > 909-551-2105
> > > http://www.wd-3.com
> > >
> > > “Chris Dore” wrote in message
> > > news:xxxxx@ntdev…
> > > >
> > > > Hi,
> > > >
> > > > I have multiple devices installed, all having the same hardware ID.
> Is
> > > > there a documented way or installing a driver for a single instance
of
> > the
> > > > device?
> > > > I programatically create new virtual devices and I have other issues
> > > > stopping me from creating unique hardware IDs. Once I have created
a
> > > device
> > > > I need to install its driver. However, because
> > > > UpdateDriverForPlugAndPlayDevices updates all devices with the
> specified
> > > > HWID it “corrupts”/unloads existing installed and running devices by
> > > > unloading them.
> > > >
> > > > If anyone has a solution to this or would like more information
please
> > > ask.
> > > > Thanks, Chris
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>
>
>
>