1

Topic: Comparison FDO and it PDO

There are two USB flash.


Questions concerning Storage Device FDO and Logical Unit PDO, created usbstor.sys.

In current case FDO turn out from lower filter USBSTOR, and PDO undertake from FS the filter, and accordingly it is necessary to learn what volume is on what flash...


FDO1-Storage Device FDO, Created usbstor.sys

\

\--PDO1 (USBSTOR\Disk1....)


FDO2-Storage Device FDO, Created usbstor.sys

\

\--PDO2 (USBSTOR\Disk2....)



How knowing DEVICE_OBJECT FDO1, FDO2 and PDO1, PDO2 to learn, what PDO1 over FDO1 and PDO2 over FDO2?



Correctly I understand:

1. What it is impossible to receive DEVICE_OBJECT FDO, knowing PDO?

2. What it is impossible to interrogate (c the help irp requests or functions) FDO and to learn PDO which are under it?

3. It is theoretically possible to take NextDevice from DEVICE_OBJECT PDO and recursively to walk on all DEVICE_OBJECT created usbstor.sys and the first DEVICE_OBJECT with type FILE_DEVICE_BUS_EXTENDER and is underlaying FDO. But in this case, while we sort out NextDevice, somebody can be deleted or added and then actions are unpredictable.


Generally really to resolve this task?

2

Re: Comparison FDO and it PDO

Please, respect colleagues and do not admit excessive citing. For not respecting I will remind that there are forum and resource rules + sanctions for non-observance of these. The moderator


Correctly I understand:
1. What it is impossible to receive DEVICE_OBJECT FDO, knowing PDO?
2. What it is impossible to interrogate (c the help irp requests or functions) FDO and to learn PDO which are under it?
3. It is theoretically possible to take NextDevice from DEVICE_OBJECT PDO and recursively to walk on all DEVICE_OBJECT created usbstor.sys and the first DEVICE_OBJECT with type FILE_DEVICE_BUS_EXTENDER and is underlaying FDO. But in this case, while we sort out NextDevice, somebody can be deleted or added and then actions are unpredictable.

Generally really to resolve this task?


At first, I recommend to look at this f-iju:
http://msdn.microsoft.com/en-us/library/ff548365 (VS.85).aspx - she allows to receive the lowermost driver in a stack. Secondly, to bypass a stack it is possible, but for this purpose it is necessary to use any f-iju which increases the counter of object references. It guarantees that the object will not be remote.

3

Re: Comparison FDO and it PDO

Hello, the Anonymous author, you wrote:

At first, I recommend to look at this f-iju:
http://msdn.microsoft.com/en-us/library/ff548365 (VS.85).aspx - she allows to receive the lowermost driver in a stack. Secondly, to bypass a stack it is possible, but for this purpose it is necessary to use any f-iju which increases the counter of object references. It guarantees that the object will not be remote.

From MSDN:

The
IoGetDeviceAttachmentBaseRef routine returns a pointer to the lowest-level device object in a file system or device driver stack.

=> If we cause it for FDO usbstor we receive same FDO...