Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[puzzle] how a device is found?

0 views
Skip to first unread message

Danial.F

unread,
Jun 21, 2008, 6:33:01 PM6/21/08
to
I write a kmdf driver, simple and no interaction with any physical device,
and set it to a function driver in inf file. Then, I load the driver through
device manager, a new device appears. The question is : I dont associate a
real physical device with my driver, there is not a device but how can os
find a device for me? Is the device a virtual device? How the device stack is
formed? what is the physical device object(pdo)?


Pavel A.

unread,
Jun 21, 2008, 7:10:04 PM6/21/08
to
"Danial.F" <Dan...@discussions.microsoft.com> wrote in message
news:5A5BEE92-1F92-4FC9...@microsoft.com...

This is so called "root-enumerated device".
The "root" bus driver that is responsible for enumerating it,
always tells to the PnP that the device is present.
Otherwise, it is almost a normal PnP bus.

--PA

Danial.F

unread,
Jun 21, 2008, 7:29:00 PM6/21/08
to

so, you mean that root bus driver cheats pnp? root bus driver creates a fake
device then tells pnp the device is present? then pnp loads my driver?

could you please explain the detailed procedure of creating such a fake
device stack when I click device manager?

Thanks!

Pavel A.

unread,
Jun 21, 2008, 8:27:55 PM6/21/08
to
"Danial.F" <Dan...@discussions.microsoft.com> wrote in message
news:10728121-D5C8-4C97...@microsoft.com...

>
> so, you mean that root bus driver cheats pnp? root bus driver creates a
> fake
> device then tells pnp the device is present? then pnp loads my driver?

Yes and yes.

> could you please explain the detailed procedure of creating such a fake
> device stack when I click device manager?

No, sorry, I won't. Please read DDK documentation.
Dev. manager just installs your driver for whatever hardware ID you specify
in the INF.

Good luck,

--PA

Tim Roberts

unread,
Jun 22, 2008, 12:21:38 AM6/22/08
to
Danial.F <Dan...@discussions.microsoft.com> wrote:
>
>so, you mean that root bus driver cheats pnp? root bus driver creates a fake
>device then tells pnp the device is present? then pnp loads my driver?

It's not "cheating". It's the same way ALL device stacks are created. When
the PCI bus driver notices a new device, it creates a PDO and gives it a
name like "PCI\VEN_xxxx&DEV_xxxx". When the USB bus driver notices a new
device, it creates a PDO and gives it a name like "USB\VID_xxxx&PID_xxxx".
In both cases, it's PnP's job to find a driver for it.

Your case is exactly the same. The only difference is that you are TELLING
the root bus driver how to name the device.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

Danial.F

unread,
Jun 22, 2008, 3:57:00 AM6/22/08
to
Thanks!
Yes, I can name my device ID whatever I want, e.g. mybus\mydevice, in inf,
and in device manager, I can see that the hardware ID is mybus\mydevice. But,
the device instance id is root\unknown\0000. Can I specify this device
instance id when I install the driver? e.g. root\mydevice\1234 or other? How
to do it? in inf also?

Doron Holan [MSFT]

unread,
Jun 22, 2008, 9:48:06 PM6/22/08
to
no, you cannot specify the instance ID

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Danial.F" <Dan...@discussions.microsoft.com> wrote in message

news:29D92438-60DB-4A3F...@microsoft.com...

0 new messages