How to access PDO of the device from its Function driver.

This probably is a novice question:

How to access the PDO of a device created by the bus driver from its function driver?

I understand that the PDO is at the bottom of the device node stack. I have been trying to figure out the appropriate data structure to access the device node stack and point to the bottom object of the stack.

Thanks much!
Vidya

If you’re a driver on the stack you get the PDO as part of the AddDevice call.

If you’re a driver outside the stack you should talk to the stack and not to the PDO directly. If you send I/O directly to the PDO you can potentially screw up whatever the stack is doing.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Dharmaraju, Vidyadhari
Sent: Wednesday, August 20, 2008 1:44 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to access PDO of the device from its Function driver.

This probably is a novice question:

How to access the PDO of a device created by the bus driver from its function driver?

I understand that the PDO is at the bottom of the device node stack. I have been trying to figure out the appropriate data structure to access the device node stack and point to the bottom object of the stack.

Thanks much!
Vidya


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

From what I understand, we get the PDO of the underlying device (or the PDO of the immediate parent of the device) in AddDevice Call.

But, I need the PDO of the device itself. I will not use the device’s PDO to send any I/O directly to it. I need it do some PDO matching in the PDO list that the bus driver maintains.

Vidya

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Wednesday, August 20, 2008 1:51 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How to access PDO of the device from its Function driver.

If you’re a driver on the stack you get the PDO as part of the AddDevice call.

If you’re a driver outside the stack you should talk to the stack and not to the PDO directly. If you send I/O directly to the PDO you can potentially screw up whatever the stack is doing.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Dharmaraju, Vidyadhari
Sent: Wednesday, August 20, 2008 1:44 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to access PDO of the device from its Function driver.

This probably is a novice question:

How to access the PDO of a device created by the bus driver from its function driver?

I understand that the PDO is at the bottom of the device node stack. I have been trying to figure out the appropriate data structure to access the device node stack and point to the bottom object of the stack.

Thanks much!
Vidya


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Dharmaraju, Vidyadhari wrote:

From what I understand, we get the PDO of the underlying device (or the PDO of the immediate parent of the device) in AddDevice Call.

But, I need the PDO of the device itself. I will not use the device’s PDO to send any I/O directly to it. I need it do some PDO matching in the PDO list that the bus driver maintains.

Perhaps you should draw the driver stack on a whiteboard to convince
yourself that you’re talking about the same thing. The PDO of the
device is the PDO that the driver gets in AddDevice, which is also the
PDO that the bus driver created that initially triggered the driver to
be loaded. There is no other PDO here.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Perhaps what you want is to send a query device relations (target relations)
PnP irp down your stack. This is used sometimes to find out what hardware
device is associated with some higher level device. See the docs for
IRP_MN_QUERY_DEVICE_RELATIONS.

Jan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
Dharmaraju, Vidyadhari
Sent: Wednesday, August 20, 2008 2:20 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How to access PDO of the device from its
Function driver.

From what I understand, we get the PDO of the underlying
device (or the PDO of the immediate parent of the device) in
AddDevice Call.

But, I need the PDO of the device itself. I will not use the
device’s PDO to send any I/O directly to it. I need it do
some PDO matching in the PDO list that the bus driver maintains.

Vidya

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Wednesday, August 20, 2008 1:51 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How to access PDO of the device from its
Function driver.

If you’re a driver on the stack you get the PDO as part of
the AddDevice call.

If you’re a driver outside the stack you should talk to the
stack and not to the PDO directly. If you send I/O directly
to the PDO you can potentially screw up whatever the stack is doing.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
Dharmaraju, Vidyadhari
Sent: Wednesday, August 20, 2008 1:44 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to access PDO of the device from its
Function driver.

This probably is a novice question:

How to access the PDO of a device created by the bus driver
from its function driver?

I understand that the PDO is at the bottom of the device node
stack. I have been trying to figure out the appropriate data
structure to access the device node stack and point to the
bottom object of the stack.

Thanks much!
Vidya


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online
at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online
at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online
at http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET NOD32 Antivirus, version of
virus signature database 3372 (20080820) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3372 (20080820) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com