Add virtual device into the PNP tree

Hi,

I’m trying to write a virtual USB stack. The arch for the same is:

Function driver
|
Virtual HUB driver ( VHUB )

The motive is to load a function driver for a non existent HW.
The VHUB is based on the WDK sample \src\general\event.

As an experiment, I’m sending an IOCTL to the VHUB from an app. On receiving this IOCTL,
the VHUB creates a PDO for the device. Now I want to inform the Pnp Manager about the new device, using IoInvalidateDeviceRelations(). But since the first parameter to this is the PDO for the device, I can’t use it, since I don’t have the PDO for virtual HUB.

Is this approach feasible?
How can I add my newly created device object into the PNP tree?

Any help is greatly appriciated.

Thanks

The event sample is a legacy driver so is not going to work for what you
are trying to do. You should be looking at the bus driver in the
toaster sample, using KMDF. This is an example of a driver that plugs
into the PnP environment and enumerates new devices.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@gmail.com” wrote in message
news:xxxxx@ntdev:

> Hi,
>
> I’m trying to write a virtual USB stack. The arch for the same is:
>
> Function driver
> |
> Virtual HUB driver ( VHUB )
>
> The motive is to load a function driver for a non existent HW.
> The VHUB is based on the WDK sample \src\general\event.
>
> As an experiment, I’m sending an IOCTL to the VHUB from an app. On receiving this IOCTL,
> the VHUB creates a PDO for the device. Now I want to inform the Pnp Manager about the new device, using IoInvalidateDeviceRelations(). But since the first parameter to this is the PDO for the device, I can’t use it, since I don’t have the PDO for virtual HUB.
>
> Is this approach feasible?
> How can I add my newly created device object into the PNP tree?
>
> Any help is greatly appriciated.
>
> Thanks

Thanks for the help :slight_smile: