Device Object parameter of adddevice routine

Hi

There are two parameters for AddDevice routine. First one is the
driver object and the second is Device object.

How do Plug and Play (PnP) Manager knows which device object should be
passed to the second parameter of AddDevice routine so that new device
object is created and attached it with the device object passed as an
argument.

How to attach the driver above or below to already existing driver.
that is what entries should be there inside .inf file for that driver

Regards
Rohit

Hi Rohit,

PNP manager collects all the data about newly attached device into
device structure, checks the driver for this device based upon Vendor ID
and device ID, if present then calls the AddDevice function of this
driver.

Hope this helps.

Dev

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Rohit Gauba,
Noida
Sent: Tuesday, July 05, 2005 12:11 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Device Object parameter of adddevice routine

Hi

There are two parameters for AddDevice routine. First one is the
driver object and the second is Device object.

How do Plug and Play (PnP) Manager knows which device object should be
passed to the second parameter of AddDevice routine so that new device
object is created and attached it with the device object passed as an
argument.

How to attach the driver above or below to already existing driver.
that is what entries should be there inside .inf file for that driver

Regards
Rohit


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

How do Plug and Play (PnP) Manager knows which device object should be
passed to the second parameter of AddDevice routine so that new device
object is created and attached it with the device object passed as an
argument.

> AddDevice has the physical device object(PDO) of bus driver, which
has enumerated this device. You create a functional device object(FDO)
in your driver in adddevice routine and attach it to this physical
device object.

The 2nd parameter is always the PDO (physical devobj) for the stack.
When you call IoAttachDeviceToDeviceStack, the io manager walks up the
device objects attached to the PDO and adds your devobj to the top. The
return value from IoAttachDeviceToDeviceStack is the devobj that you
attached to and should send I/O to (such as pnp and power irps). You
should not use the PDO value itself for sending i/o down the stack,
always the returned value from IoAttachDeviceToDeviceStack (which might
be the same as the PDO, but might not).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@wipro.com
Sent: Tuesday, July 05, 2005 12:01 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Device Object parameter of adddevice routine

How do Plug and Play (PnP) Manager knows which device object should be
passed to the second parameter of AddDevice routine so that new device
object is created and attached it with the device object passed as an
argument.

> AddDevice has the physical device object(PDO) of bus driver, which
has enumerated this device. You create a functional device object(FDO)
in your driver in adddevice routine and attach it to this physical
device object.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

The second parameter to AddDevice is always a PDO.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Rohit Gauba, Noida”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, July 05, 2005 10:41 AM
Subject: [ntdev] Device Object parameter of adddevice routine

Hi

There are two parameters for AddDevice routine. First one is the
driver object and the second is Device object.

How do Plug and Play (PnP) Manager knows which device object should be
passed to the second parameter of AddDevice routine so that new device
object is created and attached it with the device object passed as an
argument.

How to attach the driver above or below to already existing driver.
that is what entries should be there inside .inf file for that driver

Regards
Rohit


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com