Getting original device in filter chain

I have a need to get the original device object in a filter chain. I use
IoGetDeviceObjectPointer to get the device object, but this returns the
highest filter installed at the time of the call. Is there any easy way to
either walk down the filter chain or else to have the filter chain NOT
resolved? I don’t offhand see any handy API’s or structure link to do this.

As a possible strategy, I’ve thought about finding the driver object and
then walking it’s allocated device list. This might be a bit ugly figuring
out the correct device though.

I also need things to work on NT4 as well as newer OS’s.

Thanks.

  • Jan

There is a function that’s available starting with the Windows XP IFSKIT
called IoGetDeviceAttachmentBaseRef. Unfortunately with the way the IO
manager data strucutures were structured its impossible to write the
function in NT4.


This posting is provided “AS IS” with no warranties, and confers no rights.
“Jan Bottorff” wrote in message news:xxxxx@ntdev…
>
> I have a need to get the original device object in a filter chain. I use
> IoGetDeviceObjectPointer to get the device object, but this returns the
> highest filter installed at the time of the call. Is there any easy way to
> either walk down the filter chain or else to have the filter chain NOT
> resolved? I don’t offhand see any handy API’s or structure link to do
this.
>
> As a possible strategy, I’ve thought about finding the driver object and
> then walking it’s allocated device list. This might be a bit ugly figuring
> out the correct device though.
>
> I also need things to work on NT4 as well as newer OS’s.
>
> Thanks.
>
> - Jan
>
>
>

For PnP, send MN_QUERY_RELATIONS/TargetDeviceRelation, this will
return a PDO pointer.

Max

----- Original Message -----
From: “Jan Bottorff”
To: “NT Developers Interest List”
Sent: Friday, June 14, 2002 10:41 PM
Subject: [ntdev] Getting original device in filter chain

> I have a need to get the original device object in a filter chain. I
use
> IoGetDeviceObjectPointer to get the device object, but this returns
the
> highest filter installed at the time of the call. Is there any easy
way to
> either walk down the filter chain or else to have the filter chain
NOT
> resolved? I don’t offhand see any handy API’s or structure link to
do this.
>
> As a possible strategy, I’ve thought about finding the driver object
and
> then walking it’s allocated device list. This might be a bit ugly
figuring
> out the correct device though.
>
> I also need things to work on NT4 as well as newer OS’s.
>
> Thanks.
>
> - Jan
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>