Finding originator of IRP

Hi Experts,

I am placing my filter driver b/w two drivers as a sandwich filter. Top
driver creates the device objects which later application opens handles to
them.

Top driver creates IRPs after getting requests from application and forward
the same to my filter driver. Is there any way I can figure out for which
device object this IRPs is created. Looking for generic solution as filter
driver can be placed any level down in stack.

For more clarity consider example:


App
Top driver: TD


Filter driver: FD
Lower driver: LD

TD make device objects Dev1, Dev2 Dev3 so on.

Application opens handle to Dev2 and send request for read data. TD makes
read IRP and forward to FD. No now FD wants to know for which device ( out
Dev1, Dev2, Dev3) is IRP for. Is there any way to figure this out?

Thanks
Sunil

If Dev1, Dev2 Dev3 so on are all pnp devices and you are filtering each stack, there will be a 1:1 relationship. Your filter will only see io sent to the TD (unless that driver is doing some kind of complicated MUXing)

d

debt from my phone


From: Sunil Kumar
Sent: 5/28/2012 6:12 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Finding originator of IRP

Hi Experts,

I am placing my filter driver b/w two drivers as a sandwich filter. Top driver creates the device objects which later application opens handles to them.

Top driver creates IRPs after getting requests from application and forward the same to my filter driver. Is there any way I can figure out for which device object this IRPs is created. Looking for generic solution as filter driver can be placed any level down in stack.

For more clarity consider example:


App
Top driver: TD


Filter driver: FD
Lower driver: LD

TD make device objects Dev1, Dev2 Dev3 so on.

Application opens handle to Dev2 and send request for read data. TD makes read IRP and forward to FD. No now FD wants to know for which device ( out Dev1, Dev2, Dev3) is IRP for. Is there any way to figure this out?

Thanks
Sunil
— 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

Yeah its kind a muxing but not exactly. I can say I want to do some custome
actions for Dev1.

Thanks
sunil

On Mon, May 28, 2012 at 7:57 AM, Doron Holan wrote:

> If Dev1, Dev2 Dev3 so on are all pnp devices and you are filtering each
> stack, there will be a 1:1 relationship. Your filter will only see io sent
> to the TD (unless that driver is doing some kind of complicated MUXing)
>
> d
>
> debt from my phone
> ------------------------------
> From: Sunil Kumar
> Sent: 5/28/2012 6:12 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Finding originator of IRP
>
> Hi Experts,
>
> I am placing my filter driver b/w two drivers as a sandwich filter. Top
> driver creates the device objects which later application opens handles to
> them.
>
> Top driver creates IRPs after getting requests from application and
> forward the same to my filter driver. Is there any way I can figure out for
> which device object this IRPs is created. Looking for generic solution as
> filter driver can be placed any level down in stack.
>
> For more clarity consider example:
> _______________
> | App |
> -------------------------
> | Top driver: TD |
> -------------------------
> -------------------------
> | Filter driver: FD |
> --------------------------
> | Lower driver: LD |
> --------------------------
>
> TD make device objects Dev1, Dev2 Dev3 so on.
>
> Application opens handle to Dev2 and send request for read data. TD makes
> read IRP and forward to FD. No now FD wants to know for which device ( out
> Dev1, Dev2, Dev3) is IRP for. Is there any way to figure this out?
>
> Thanks
> Sunil
> — 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
>

What problem are you trying to solve. AFAIK, the file object pointer is
only guaranteed to be valid in the top-level driver, and is generally not
passed to lower-level drivers.
joe

Hi Experts,

I am placing my filter driver b/w two drivers as a sandwich filter. Top
driver creates the device objects which later application opens handles to
them.

Top driver creates IRPs after getting requests from application and
forward
the same to my filter driver. Is there any way I can figure out for which
device object this IRPs is created. Looking for generic solution as filter
driver can be placed any level down in stack.

For more clarity consider example:


App
Top driver: TD


Filter driver: FD
Lower driver: LD

TD make device objects Dev1, Dev2 Dev3 so on.

Application opens handle to Dev2 and send request for read data. TD makes
read IRP and forward to FD. No now FD wants to know for which device ( out
Dev1, Dev2, Dev3) is IRP for. Is there any way to figure this out?

Thanks
Sunil


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