How can I install my non-PnP virtual hardware wdm driver without having to
use the Add Hardware Wizard?
My driver is based on the “testcap” wdm videocap example driver.
I want to spare the end user the trouble of having to install the driver
manually with the Add Hardware Wizard, and do it “automatically” from inside
a user app/console or installer.
Thus I need to do the same thing that the AHW does after the user selects
the .inf file at
( Add New Hardware device ) –> ( Install the hardware manually from list )
–> (Sound, video and game controllers ) –> ( Have disk…).
The only things that the AHW needs from the user to be able to install the
driver successfully seems to be
- That the driver is for a Sound, video or game controller device
- Location of .inf file
- Location of .sys file
Seems I need to create/find a function of the kind
InstallMyDriver(DEVICE_TYPE dType, UNICODE_STRING infFileFullPath,
UNICODE_STRING sysFileFullPath)
{
/* What goes in here…?*/
}
I have read many posts from other people asking for similar things, but none
of them seem to have find out how to do this.
I have also looked at and tested the “devcon” and “install” samples to do
this aswell. Both fails to install the testcap sample driver. Probably
because the testcap driver is non PnP and not using actual hardware.
Can someone please shed some light on how to do this?
Thanks!
Johan
[DDK newbie]
Hitta rätt på nätet med MSN Sök http://search.msn.se/
look for 'root enumerated' and 'device install'.
Toaster DDK sample may help.
Or have a look in Walter Oney's excellent book:
Microsoft Windows Driver Model (2nd Ed.)
ISBN: 0-7356-1803-8
Where again, was your limit for handling checks ? 
Norbert.
"A perfectionist is one who takes infinite pains and gives them to
others. - Alan Benner"
---- snip ----
>look for ‘root enumerated’ and ‘device install’.
Ok, I searched…but perhaps I am not searching in the correct places…
Or have a look in Walter Oney’s excellent book:
Microsoft Windows Driver Model (2nd Ed.)
ISBN: 0-7356-1803-8
Is there an example in that book on how to install non-Pnp devices
specifically without using the AHW? I saw another post where someone wanted
to do this, and he had that book. But perhaps he had the 1st edition (?) 
Where again, was your limit for handling checks ? 
Ha! I knew that one would come back and bite me…
Let me clarify, for Mark’s “Hollistech Windows Driver Name Certification
Process” the limit is infinitely high.
But for other purposes it could
be lower…
Do you know how to do this exactly? Installing the testcap driver without
using the AHW, that is.
I guess it isnt more than 15-20 lines of code, but the trick is to know what
those lines are…
/Johan
Auktioner: Tjäna en hacka på gamla prylar http://tradera.msn.se
Hmm,
so let me clarify:
Your driver is an PnP-Driver. It has PnP-handlers and an
AddDevice-Routine, or ? What you do not have is real PnP-Hardware.
So there is no bus driver in the system that would autodetect your
virtual hardware. But we have the chance to do a root enumeration.
That means we generate a device-node for the PnP-process. Having
installed this root enumerated device-node will trigger the
installation of your driver ( and let it find it again after reboot).
have a look:
InstallRootEnumeratedDriver
of the src/setup/install ddk-sample. It does just this.
You need to have a matching .inf file.
Using testcap.inf as a basis. There the HWID would be 'TESTCAP'.
Norbert.
"Work is a four letter word."
---- snip ----
Ooops,
looks like kernel streaming drivers have no PnP or AddDevice handling.
They are handled as a miniport.
That's not my domain.
But my comments concerning install should hold.
Norbert.
"The best executive is the one who has sense enough to pick good men
to do what he wants done, and self-restraint enough to keep from
meddling with them while they do it. - Teddy Roosevelt"
---- snip ----
Hmm,
so let me clarify:
Your driver is an PnP-Driver. It has PnP-handlers and an
AddDevice-Routine, or ? What you do not have is real PnP-Hardware.
So there is no bus driver in the system that would autodetect your
virtual hardware. But we have the chance to do a root enumeration.
That means we generate a device-node for the PnP-process. Having
installed this root enumerated device-node will trigger the
installation of your driver ( and let it find it again after reboot).
have a look:
InstallRootEnumeratedDriver
of the src/setup/install ddk-sample. It does just this.
You need to have a matching .inf file.
Using testcap.inf as a basis. There the HWID would be 'TESTCAP'.
Norbert.
"Work is a four letter word."
---- snip ----
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stollmann.de
To unsubscribe send a blank email to xxxxx@lists.osr.com
---- snip ----
Somewhere around, at least in the NT4 DDK, is the Instdrvr example that
shows how to install and remove an NT4 non-PNP style driver on demand.
Installing, starting, stopping, and removing an arbitrary driver probably
works out to 3-4 pages of code total.
I don’t recall exactly what your device was, so this technique may or may
not be appropriate.
Loren
They do have those, they are just in the “port” driver. It’s not precise to
call a “miniport” a “driver”. It’s more like “half-a-driver”. Neither it nor
“port” can do anything without each other, the “port” being a set of
convenience functions. Unfortunately, DDK’s language is generally not
precise. If DDK often uses terms “device” and “driver” interchangeably, what
could one expect about port/miniport stuff…
“Norbert Kawulski” wrote in message news:xxxxx@ntdev…
> Ooops,
> looks like kernel streaming drivers have no PnP or AddDevice handling.
> They are handled as a miniport.
> That’s not my domain.
> But my comments concerning install should hold.
> Norbert.
> --------
> “The best executive is the one who has sense enough to pick good men
> to do what he wants done, and self-restraint enough to keep from
> meddling with them while they do it. - Teddy Roosevelt”
> ---- snip ----
> > Hmm,
> > so let me clarify:
> > Your driver is an PnP-Driver. It has PnP-handlers and an
> > AddDevice-Routine, or ? What you do not have is real PnP-Hardware.
> > So there is no bus driver in the system that would autodetect your
> > virtual hardware. But we have the chance to do a root enumeration.
> > That means we generate a device-node for the PnP-process. Having
> > installed this root enumerated device-node will trigger the
> > installation of your driver ( and let it find it again after reboot).
>
> > have a look:
> > InstallRootEnumeratedDriver
>
> > of the src/setup/install ddk-sample. It does just this.
>
> > You need to have a matching .inf file.
> > Using testcap.inf as a basis. There the HWID would be ‘TESTCAP’.
>
>
>
> > Norbert.
> > --------
> > “Work is a four letter word.”
> > ---- snip ----
>
>
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
>
> > You are currently subscribed to ntdev as: xxxxx@stollmann.de
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> ---- snip ----
>
>
I did a root-enumerated KS driver a while back. Bloody pain, espeically
since it had to work all the way back to Win95 or 98 or some such. I recall
writing an installer for it, but I’ve largely blotted all of that code from
my memory now. I’m pretty sure you ended up going thru AHW just to click
Yes a dozen times or so.
Loren
>have a look:
InstallRootEnumeratedDriver
of the src/setup/install ddk-sample. It does just this.
You need to have a matching .inf file.
Using testcap.inf as a basis. There the HWID would be ‘TESTCAP’.
Thanks Norbert, I got this working now 
I had errors when trying to use the install sample to install the testcap
driver earlier, and I did not investigate it further since looking at the
source code revealed it used the function UpdateDriverForPlugAndPlayDevices.
Since that function is not named UpdateDriverForDevices but
ForPlugAndPlayDevices I incorrectly assumed it would only work for PnP
devices. Turns out it works for non PnP devices aswell, which leads me
wondering why it is named the way it is. (?)
Johan
Hitta rätt på nätet med MSN Sök http://search.msn.se/