PDO in non-wdm driver

Hi,

How to obtain the PDO in a non-wdm driver ? In a WDM driver PDO is passed
in the AddDevice() function. But in my non-wdm driver, there is only
DriverEntry() function from which I have to access the PDO.

Thanks
Surendra

Not so long ago I learned a pretty interesting technique to find this out.

The idea is to send an IRP_MN_QUERY_DEVICE_RELATIONS down your device stack.
The only device object which will (forgive me… : should) respond to this
IRP is the physical device object and it includes its PDEVICE_OBJECT in the
returned structure. Read the DDK for more info. Yes, this technique is
documented. :slight_smile: At the bottom of the “IRP_MN_QUERY_DEVICE_RELATIONS” topic
for those interested. Happy hacking!

Mat

-----Original Message-----
From: Surendra [mailto:xxxxx@hotmail.com]
Sent: Wednesday, April 30, 2003 3:30 PM
To: NT Developers Interest List
Subject: [ntdev] PDO in non-wdm driver

Hi,

How to obtain the PDO in a non-wdm driver ? In a WDM driver PDO is passed
in the AddDevice() function. But in my non-wdm driver, there is only
DriverEntry() function from which I have to access the PDO.

Thanks
Surendra


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

ONLY do this if you pass TargetDeviceRelations as the relations type.

Doing this with bus relations is illegal in the PNP world and could
result in the device driver and PNP getting out of sync.

-p

This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: Mathieu Routhier [mailto:xxxxx@guillemot.com]
Sent: Wednesday, April 30, 2003 1:04 PM
To: NT Developers Interest List

Not so long ago I learned a pretty interesting technique to find this
out.

The idea is to send an IRP_MN_QUERY_DEVICE_RELATIONS down your device
stack.
The only device object which will (forgive me… : should) respond to
this IRP is the physical device object and it includes its
PDEVICE_OBJECT in the returned structure. Read the DDK for more info.
Yes, this technique is documented. :slight_smile: At the bottom of the
“IRP_MN_QUERY_DEVICE_RELATIONS” topic for those interested. Happy
hacking!

Mat

-----Original Message-----
From: Surendra [mailto:xxxxx@hotmail.com]
Sent: Wednesday, April 30, 2003 3:30 PM
To: NT Developers Interest List
Subject: [ntdev] PDO in non-wdm driver

Hi,

How to obtain the PDO in a non-wdm driver ? In a WDM driver PDO is
passed in the AddDevice() function. But in my non-wdm driver, there is
only
DriverEntry() function from which I have to access the PDO.

Thanks
Surendra


You are currently subscribed to ntdev as: xxxxx@guillemot.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Thank you, yes, I should have mentioned it. But the DDK docs do it already
:slight_smile:

Mat

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Wednesday, April 30, 2003 5:39 PM
To: NT Developers Interest List
Subject: [ntdev] RE: PDO in non-wdm driver

ONLY do this if you pass TargetDeviceRelations as the relations type.

Doing this with bus relations is illegal in the PNP world and could
result in the device driver and PNP getting out of sync.

-p

This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: Mathieu Routhier [mailto:xxxxx@guillemot.com]
Sent: Wednesday, April 30, 2003 1:04 PM
To: NT Developers Interest List

Not so long ago I learned a pretty interesting technique to find this
out.

The idea is to send an IRP_MN_QUERY_DEVICE_RELATIONS down your device
stack.
The only device object which will (forgive me… : should) respond to
this IRP is the physical device object and it includes its
PDEVICE_OBJECT in the returned structure. Read the DDK for more info.
Yes, this technique is documented. :slight_smile: At the bottom of the
“IRP_MN_QUERY_DEVICE_RELATIONS” topic for those interested. Happy
hacking!

Mat

-----Original Message-----
From: Surendra [mailto:xxxxx@hotmail.com]
Sent: Wednesday, April 30, 2003 3:30 PM
To: NT Developers Interest List
Subject: [ntdev] PDO in non-wdm driver

Hi,

How to obtain the PDO in a non-wdm driver ? In a WDM driver PDO is
passed in the AddDevice() function. But in my non-wdm driver, there is
only
DriverEntry() function from which I have to access the PDO.

Thanks
Surendra


You are currently subscribed to ntdev as: xxxxx@guillemot.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> Not so long ago I learned a pretty interesting technique to find
this out.

The idea is to send an IRP_MN_QUERY_DEVICE_RELATIONS down your
device stack.
The only device object which will (forgive me… : should) respond
to this

Yes, do not forget for TargetDeviceRelations.

Max