hi all,
Is there a way to get the PDO and FDO list of the driver sitting below
in the stack?
Albert
hi all,
Is there a way to get the PDO and FDO list of the driver sitting below
in the stack?
Albert
You can get the top of the stack via IoGetAttachedDeviceReference and
the PDO by sending an IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
(TargetDeviceRelation) (and remember to deref the PDO afterwards).
Anything in between is *not* enumerable in a safe or documented manner.
Why do you need to know the FDO?
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
Sent: Monday, August 08, 2005 10:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] of device objects
hi all,
Is there a way to get the PDO and FDO list of the driver sitting below
in the stack?
Albert
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
actually, I am writing a filter for a lower level driver, which has
created some PDO and FDOs.
Well, I just wanted to know the list of FDO and PDO, since I might
need to handle some IOCTL calls myself, build some IRPs and send down
depending whether it is an FDO or a PDO.
A
On 8/9/05, Doron Holan wrote:
> You can get the top of the stack via IoGetAttachedDeviceReference and
> the PDO by sending an IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> (TargetDeviceRelation) (and remember to deref the PDO afterwards).
> Anything in between is not enumerable in a safe or documented manner.
>
> Why do you need to know the FDO?
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Monday, August 08, 2005 10:58 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] of device objects
>
> hi all,
>
> Is there a way to get the PDO and FDO list of the driver sitting below
> in the stack?
>
> Albert
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Filters should run on particular devices, not on “drivers”. So it’s
confusing to me too why your filter would care about any device in any
other stack, which is what it sounds like you’re asking.
Are you trying to figure out if the device you’re attached to is an FDO
or a PDO?
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
Sent: Tuesday, August 09, 2005 12:26 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] of device objects
actually, I am writing a filter for a lower level driver, which has
created some PDO and FDOs.
Well, I just wanted to know the list of FDO and PDO, since I might need
to handle some IOCTL calls myself, build some IRPs and send down
depending whether it is an FDO or a PDO.
A
On 8/9/05, Doron Holan wrote:
> You can get the top of the stack via IoGetAttachedDeviceReference and
> the PDO by sending an IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> (TargetDeviceRelation) (and remember to deref the PDO afterwards).
> Anything in between is not enumerable in a safe or documented
manner.
>
> Why do you need to know the FDO?
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Monday, August 08, 2005 10:58 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] of device objects
>
> hi all,
>
> Is there a way to get the PDO and FDO list of the driver sitting below
> in the stack?
>
> Albert
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
well sir, as a matter of fact I do? can you tell me how?
On 8/9/05, Peter Wieland wrote:
> Filters should run on particular devices, not on “drivers”. So it’s
> confusing to me too why your filter would care about any device in any
> other stack, which is what it sounds like you’re asking.
>
> Are you trying to figure out if the device you’re attached to is an FDO
> or a PDO?
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Tuesday, August 09, 2005 12:26 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] of device objects
>
> actually, I am writing a filter for a lower level driver, which has
> created some PDO and FDOs.
>
> Well, I just wanted to know the list of FDO and PDO, since I might need
> to handle some IOCTL calls myself, build some IRPs and send down
> depending whether it is an FDO or a PDO.
>
> A
>
>
>
>
>
> On 8/9/05, Doron Holan wrote:
> > You can get the top of the stack via IoGetAttachedDeviceReference and
> > the PDO by sending an IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > (TargetDeviceRelation) (and remember to deref the PDO afterwards).
> > Anything in between is not enumerable in a safe or documented
> manner.
> >
> > Why do you need to know the FDO?
> >
> > d
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > Sent: Monday, August 08, 2005 10:58 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] of device objects
> >
> > hi all,
> >
> > Is there a way to get the PDO and FDO list of the driver sitting below
>
> > in the stack?
> >
> > Albert
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
> > ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
In your add device routine you get a pointer to the PDO. When you call
IoAttachDeviceToDeviceStack you get a pointer to the device directly
below you. If those are the same pointer you’re attached directly to
the PDO.
However I suspect you really want to know if you’re above or below the
FDO.
That’s determined by whether you’re in the upper filter list or the
lower filter list which is controlled by the INF for the device or by
your installer (if you have a separate one for your filter). Either way
the filter is installed you could simply put a registry entry into the
devnode that tells your driver that it’s above or below the FDO and thus
the mode it operates in.
Or are you loading your filter twice in the stack (once above the FDO
and once below) and you want each to figure out where it lies in the
hierarchy?
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
Sent: Tuesday, August 09, 2005 8:34 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] of device objects
well sir, as a matter of fact I do? can you tell me how?
On 8/9/05, Peter Wieland wrote:
> Filters should run on particular devices, not on “drivers”. So it’s
> confusing to me too why your filter would care about any device in any
> other stack, which is what it sounds like you’re asking.
>
> Are you trying to figure out if the device you’re attached to is an
> FDO or a PDO?
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Tuesday, August 09, 2005 12:26 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] of device objects
>
> actually, I am writing a filter for a lower level driver, which has
> created some PDO and FDOs.
>
> Well, I just wanted to know the list of FDO and PDO, since I might
> need to handle some IOCTL calls myself, build some IRPs and send down
> depending whether it is an FDO or a PDO.
>
> A
>
>
>
>
>
> On 8/9/05, Doron Holan wrote:
> > You can get the top of the stack via IoGetAttachedDeviceReference
> > and the PDO by sending an IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > (TargetDeviceRelation) (and remember to deref the PDO afterwards).
> > Anything in between is not enumerable in a safe or documented
> manner.
> >
> > Why do you need to know the FDO?
> >
> > d
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > Sent: Monday, August 08, 2005 10:58 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] of device objects
> >
> > hi all,
> >
> > Is there a way to get the PDO and FDO list of the driver sitting
> > below
>
> > in the stack?
> >
> > Albert
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
> > ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
thats right, instead of writing two drivers, to filter the same device
i wanted one code to work below and above, is there a way of
determining it?
On 8/9/05, Peter Wieland wrote:
> In your add device routine you get a pointer to the PDO. When you call
> IoAttachDeviceToDeviceStack you get a pointer to the device directly
> below you. If those are the same pointer you’re attached directly to
> the PDO.
>
> However I suspect you really want to know if you’re above or below the
> FDO.
>
> That’s determined by whether you’re in the upper filter list or the
> lower filter list which is controlled by the INF for the device or by
> your installer (if you have a separate one for your filter). Either way
> the filter is installed you could simply put a registry entry into the
> devnode that tells your driver that it’s above or below the FDO and thus
> the mode it operates in.
>
> Or are you loading your filter twice in the stack (once above the FDO
> and once below) and you want each to figure out where it lies in the
> hierarchy?
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Tuesday, August 09, 2005 8:34 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] of device objects
>
> well sir, as a matter of fact I do? can you tell me how?
>
>
>
>
> On 8/9/05, Peter Wieland wrote:
> > Filters should run on particular devices, not on “drivers”. So it’s
> > confusing to me too why your filter would care about any device in any
>
> > other stack, which is what it sounds like you’re asking.
> >
> > Are you trying to figure out if the device you’re attached to is an
> > FDO or a PDO?
> >
> > -p
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > Sent: Tuesday, August 09, 2005 12:26 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] of device objects
> >
> > actually, I am writing a filter for a lower level driver, which has
> > created some PDO and FDOs.
> >
> > Well, I just wanted to know the list of FDO and PDO, since I might
> > need to handle some IOCTL calls myself, build some IRPs and send down
> > depending whether it is an FDO or a PDO.
> >
> > A
> >
> >
> >
> >
> >
> > On 8/9/05, Doron Holan wrote:
> > > You can get the top of the stack via IoGetAttachedDeviceReference
> > > and the PDO by sending an IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > > (TargetDeviceRelation) (and remember to deref the PDO afterwards).
> > > Anything in between is not enumerable in a safe or documented
> > manner.
> > >
> > > Why do you need to know the FDO?
> > >
> > > d
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > > Sent: Monday, August 08, 2005 10:58 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] of device objects
> > >
> > > hi all,
> > >
> > > Is there a way to get the PDO and FDO list of the driver sitting
> > > below
> >
> > > in the stack?
> > >
> > > Albert
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > argument:
> > > ‘’
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > argument: ‘’
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
> > ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
To me the simplest solution would be to build two separate drivers.
Generate one lib during the build with the majority of your code in it
and then two DLLs which link in the lib.
It’s a bit more to copy around and it takes up more memory but we’re
presumably still not talking about that much. If you’re worried about
that you could make a single export driver that contains the bulk of the
code and two small drivers that link against the export driver.
Otherwise I’d suggest you send an IRP_MN_QUERY_INTERFACE down the stack
for some interface GUID you make up and support in your driver. The DDK
says you can do this in AddDevice. If the query fails then there’s no
instance of your driver below you and you’re the lower driver. If it
succeeds then you’re the upper driver.
You could even go so far as to check whether both things happen (your
query succeeds and then later you receive a query from some other
driver) in which case someone has put your driver in the stack 3 times.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
Sent: Tuesday, August 09, 2005 9:20 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] of device objects
thats right, instead of writing two drivers, to filter the same device i
wanted one code to work below and above, is there a way of determining
it?
On 8/9/05, Peter Wieland wrote:
> In your add device routine you get a pointer to the PDO. When you
> call IoAttachDeviceToDeviceStack you get a pointer to the device
> directly below you. If those are the same pointer you’re attached
> directly to the PDO.
>
> However I suspect you really want to know if you’re above or below the
> FDO.
>
> That’s determined by whether you’re in the upper filter list or the
> lower filter list which is controlled by the INF for the device or by
> your installer (if you have a separate one for your filter). Either
> way the filter is installed you could simply put a registry entry into
> the devnode that tells your driver that it’s above or below the FDO
> and thus the mode it operates in.
>
> Or are you loading your filter twice in the stack (once above the FDO
> and once below) and you want each to figure out where it lies in the
> hierarchy?
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Tuesday, August 09, 2005 8:34 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] of device objects
>
> well sir, as a matter of fact I do? can you tell me how?
>
>
>
>
> On 8/9/05, Peter Wieland wrote:
> > Filters should run on particular devices, not on “drivers”. So it’s
> > confusing to me too why your filter would care about any device in
> > any
>
> > other stack, which is what it sounds like you’re asking.
> >
> > Are you trying to figure out if the device you’re attached to is an
> > FDO or a PDO?
> >
> > -p
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > Sent: Tuesday, August 09, 2005 12:26 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] of device objects
> >
> > actually, I am writing a filter for a lower level driver, which has
> > created some PDO and FDOs.
> >
> > Well, I just wanted to know the list of FDO and PDO, since I might
> > need to handle some IOCTL calls myself, build some IRPs and send
> > down depending whether it is an FDO or a PDO.
> >
> > A
> >
> >
> >
> >
> >
> > On 8/9/05, Doron Holan wrote:
> > > You can get the top of the stack via IoGetAttachedDeviceReference
> > > and the PDO by sending an IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > > (TargetDeviceRelation) (and remember to deref the PDO afterwards).
> > > Anything in between is not enumerable in a safe or documented
> > manner.
> > >
> > > Why do you need to know the FDO?
> > >
> > > d
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > Pinto
> > > Sent: Monday, August 08, 2005 10:58 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] of device objects
> > >
> > > hi all,
> > >
> > > Is there a way to get the PDO and FDO list of the driver sitting
> > > below
> >
> > > in the stack?
> > >
> > > Albert
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > argument:
> > > ‘’
> > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > argument: ‘’
> > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
> > ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
thanks peter, but still, is there a way to know whether I am attaching
to the FDO?
On 8/9/05, Albert Pinto wrote:
> thats right, instead of writing two drivers, to filter the same device
> i wanted one code to work below and above, is there a way of
> determining it?
>
>
>
> On 8/9/05, Peter Wieland wrote:
> > In your add device routine you get a pointer to the PDO. When you call
> > IoAttachDeviceToDeviceStack you get a pointer to the device directly
> > below you. If those are the same pointer you’re attached directly to
> > the PDO.
> >
> > However I suspect you really want to know if you’re above or below the
> > FDO.
> >
> > That’s determined by whether you’re in the upper filter list or the
> > lower filter list which is controlled by the INF for the device or by
> > your installer (if you have a separate one for your filter). Either way
> > the filter is installed you could simply put a registry entry into the
> > devnode that tells your driver that it’s above or below the FDO and thus
> > the mode it operates in.
> >
> > Or are you loading your filter twice in the stack (once above the FDO
> > and once below) and you want each to figure out where it lies in the
> > hierarchy?
> >
> > -p
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > Sent: Tuesday, August 09, 2005 8:34 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] of device objects
> >
> > well sir, as a matter of fact I do? can you tell me how?
> >
> >
> >
> >
> > On 8/9/05, Peter Wieland wrote:
> > > Filters should run on particular devices, not on “drivers”. So it’s
> > > confusing to me too why your filter would care about any device in any
> >
> > > other stack, which is what it sounds like you’re asking.
> > >
> > > Are you trying to figure out if the device you’re attached to is an
> > > FDO or a PDO?
> > >
> > > -p
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > > Sent: Tuesday, August 09, 2005 12:26 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re: [ntdev] of device objects
> > >
> > > actually, I am writing a filter for a lower level driver, which has
> > > created some PDO and FDOs.
> > >
> > > Well, I just wanted to know the list of FDO and PDO, since I might
> > > need to handle some IOCTL calls myself, build some IRPs and send down
> > > depending whether it is an FDO or a PDO.
> > >
> > > A
> > >
> > >
> > >
> > >
> > >
> > > On 8/9/05, Doron Holan wrote:
> > > > You can get the top of the stack via IoGetAttachedDeviceReference
> > > > and the PDO by sending an IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > > > (TargetDeviceRelation) (and remember to deref the PDO afterwards).
> > > > Anything in between is not enumerable in a safe or documented
> > > manner.
> > > >
> > > > Why do you need to know the FDO?
> > > >
> > > > d
> > > >
> > > > -----Original Message-----
> > > > From: xxxxx@lists.osr.com
> > > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > > > Sent: Monday, August 08, 2005 10:58 PM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: [ntdev] of device objects
> > > >
> > > > hi all,
> > > >
> > > > Is there a way to get the PDO and FDO list of the driver sitting
> > > > below
> > >
> > > > in the stack?
> > > >
> > > > Albert
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument:
> > > > ‘’
> > > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument: ‘’
> > > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > argument:
> > > ‘’
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > argument: ‘’
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> > ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
Not officially since a driver shouldn’t care whether it’s directly
attached to the FDO. If you’re above the FDO you can use the interface
it provides (in terms of read/write/ioctl, PNP interfaces, etc…) and
that’s all a driver should need.
You could read the service property of the device and see if that
matches the driver name of the device you’re attached to. This won’t
tell you what service it is (if you were hoping to spelunk through their
device extension or something - a common reason why one wants to know
that they’re attached to the FDO) but it will tell you where you are.
I would like to understand why you feel this is necessary.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
Sent: Tuesday, August 09, 2005 10:04 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] of device objects
thanks peter, but still, is there a way to know whether I am attaching
to the FDO?
On 8/9/05, Albert Pinto wrote:
> thats right, instead of writing two drivers, to filter the same device
> i wanted one code to work below and above, is there a way of
> determining it?
>
>
>
> On 8/9/05, Peter Wieland wrote:
> > In your add device routine you get a pointer to the PDO. When you
> > call IoAttachDeviceToDeviceStack you get a pointer to the device
> > directly below you. If those are the same pointer you’re attached
> > directly to the PDO.
> >
> > However I suspect you really want to know if you’re above or below
> > the FDO.
> >
> > That’s determined by whether you’re in the upper filter list or the
> > lower filter list which is controlled by the INF for the device or
> > by your installer (if you have a separate one for your filter).
> > Either way the filter is installed you could simply put a registry
> > entry into the devnode that tells your driver that it’s above or
> > below the FDO and thus the mode it operates in.
> >
> > Or are you loading your filter twice in the stack (once above the
> > FDO and once below) and you want each to figure out where it lies in
> > the hierarchy?
> >
> > -p
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > Sent: Tuesday, August 09, 2005 8:34 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] of device objects
> >
> > well sir, as a matter of fact I do? can you tell me how?
> >
> >
> >
> >
> > On 8/9/05, Peter Wieland wrote:
> > > Filters should run on particular devices, not on “drivers”. So
> > > it’s confusing to me too why your filter would care about any
> > > device in any
> >
> > > other stack, which is what it sounds like you’re asking.
> > >
> > > Are you trying to figure out if the device you’re attached to is
> > > an FDO or a PDO?
> > >
> > > -p
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > Pinto
> > > Sent: Tuesday, August 09, 2005 12:26 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re: [ntdev] of device objects
> > >
> > > actually, I am writing a filter for a lower level driver, which
> > > has created some PDO and FDOs.
> > >
> > > Well, I just wanted to know the list of FDO and PDO, since I might
> > > need to handle some IOCTL calls myself, build some IRPs and send
> > > down depending whether it is an FDO or a PDO.
> > >
> > > A
> > >
> > >
> > >
> > >
> > >
> > > On 8/9/05, Doron Holan wrote:
> > > > You can get the top of the stack via
> > > > IoGetAttachedDeviceReference and the PDO by sending an
> > > > IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > > > (TargetDeviceRelation) (and remember to deref the PDO
afterwards).
> > > > Anything in between is not enumerable in a safe or documented
> > > manner.
> > > >
> > > > Why do you need to know the FDO?
> > > >
> > > > d
> > > >
> > > > -----Original Message-----
> > > > From: xxxxx@lists.osr.com
> > > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > > Pinto
> > > > Sent: Monday, August 08, 2005 10:58 PM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: [ntdev] of device objects
> > > >
> > > > hi all,
> > > >
> > > > Is there a way to get the PDO and FDO list of the driver sitting
> > > > below
> > >
> > > > in the stack?
> > > >
> > > > Albert
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument:
> > > > ‘’
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument: ‘’
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > argument:
> > > ‘’
> > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > argument: ‘’
> > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
> > ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
if i want to filter out IOCTL calls to a lower level driver sittin
above it, this driver creates PDOs adn FDOs, what I want is to
intercept the IOCTLs for that driver, stop them at my level, do the
processing and send them up, the lower level driver should be
oblivious of this. To process IOCTLs i need to determine whether the
device for which the IOCTL was meant is an FDO or a PDO
On 8/9/05, Peter Wieland wrote:
> Not officially since a driver shouldn’t care whether it’s directly
> attached to the FDO. If you’re above the FDO you can use the interface
> it provides (in terms of read/write/ioctl, PNP interfaces, etc…) and
> that’s all a driver should need.
>
> You could read the service property of the device and see if that
> matches the driver name of the device you’re attached to. This won’t
> tell you what service it is (if you were hoping to spelunk through their
> device extension or something - a common reason why one wants to know
> that they’re attached to the FDO) but it will tell you where you are.
>
> I would like to understand why you feel this is necessary.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Tuesday, August 09, 2005 10:04 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] of device objects
>
> thanks peter, but still, is there a way to know whether I am attaching
> to the FDO?
>
>
>
> On 8/9/05, Albert Pinto wrote:
> > thats right, instead of writing two drivers, to filter the same device
>
> > i wanted one code to work below and above, is there a way of
> > determining it?
> >
> >
> >
> > On 8/9/05, Peter Wieland wrote:
> > > In your add device routine you get a pointer to the PDO. When you
> > > call IoAttachDeviceToDeviceStack you get a pointer to the device
> > > directly below you. If those are the same pointer you’re attached
> > > directly to the PDO.
> > >
> > > However I suspect you really want to know if you’re above or below
> > > the FDO.
> > >
> > > That’s determined by whether you’re in the upper filter list or the
> > > lower filter list which is controlled by the INF for the device or
> > > by your installer (if you have a separate one for your filter).
> > > Either way the filter is installed you could simply put a registry
> > > entry into the devnode that tells your driver that it’s above or
> > > below the FDO and thus the mode it operates in.
> > >
> > > Or are you loading your filter twice in the stack (once above the
> > > FDO and once below) and you want each to figure out where it lies in
>
> > > the hierarchy?
> > >
> > > -p
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > > Sent: Tuesday, August 09, 2005 8:34 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re: [ntdev] of device objects
> > >
> > > well sir, as a matter of fact I do? can you tell me how?
> > >
> > >
> > >
> > >
> > > On 8/9/05, Peter Wieland wrote:
> > > > Filters should run on particular devices, not on “drivers”. So
> > > > it’s confusing to me too why your filter would care about any
> > > > device in any
> > >
> > > > other stack, which is what it sounds like you’re asking.
> > > >
> > > > Are you trying to figure out if the device you’re attached to is
> > > > an FDO or a PDO?
> > > >
> > > > -p
> > > >
> > > > -----Original Message-----
> > > > From: xxxxx@lists.osr.com
> > > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > > Pinto
> > > > Sent: Tuesday, August 09, 2005 12:26 AM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: Re: [ntdev] of device objects
> > > >
> > > > actually, I am writing a filter for a lower level driver, which
> > > > has created some PDO and FDOs.
> > > >
> > > > Well, I just wanted to know the list of FDO and PDO, since I might
>
> > > > need to handle some IOCTL calls myself, build some IRPs and send
> > > > down depending whether it is an FDO or a PDO.
> > > >
> > > > A
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On 8/9/05, Doron Holan wrote:
> > > > > You can get the top of the stack via
> > > > > IoGetAttachedDeviceReference and the PDO by sending an
> > > > > IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > > > > (TargetDeviceRelation) (and remember to deref the PDO
> afterwards).
> > > > > Anything in between is not enumerable in a safe or documented
> > > > manner.
> > > > >
> > > > > Why do you need to know the FDO?
> > > > >
> > > > > d
> > > > >
> > > > > -----Original Message-----
> > > > > From: xxxxx@lists.osr.com
> > > > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > > > Pinto
> > > > > Sent: Monday, August 08, 2005 10:58 PM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: [ntdev] of device objects
> > > > >
> > > > > hi all,
> > > > >
> > > > > Is there a way to get the PDO and FDO list of the driver sitting
>
> > > > > below
> > > >
> > > > > in the stack?
> > > > >
> > > > > Albert
> > > > >
> > > > > —
> > > > > Questions? First check the Kernel Driver FAQ at
> > > > > http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > > argument:
> > > > > ‘’
> > > > > To unsubscribe send a blank email to
> > > > > xxxxx@lists.osr.com
> > > > >
> > > > > —
> > > > > Questions? First check the Kernel Driver FAQ at
> > > > > http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > > argument: ‘’
> > > > > To unsubscribe send a blank email to
> > > > > xxxxx@lists.osr.com
> > > > >
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument:
> > > > ‘’
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument: ‘’
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
> > > ‘’
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Well, I see 2 ways that you are getting at the PDOs
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
Sent: Tuesday, August 09, 2005 10:52 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] of device objects
if i want to filter out IOCTL calls to a lower level driver sittin
above it, this driver creates PDOs adn FDOs, what I want is to
intercept the IOCTLs for that driver, stop them at my level, do the
processing and send them up, the lower level driver should be
oblivious of this. To process IOCTLs i need to determine whether the
device for which the IOCTL was meant is an FDO or a PDO
On 8/9/05, Peter Wieland wrote:
> Not officially since a driver shouldn’t care whether it’s directly
> attached to the FDO. If you’re above the FDO you can use the
interface
> it provides (in terms of read/write/ioctl, PNP interfaces, etc…) and
> that’s all a driver should need.
>
> You could read the service property of the device and see if that
> matches the driver name of the device you’re attached to. This won’t
> tell you what service it is (if you were hoping to spelunk through
their
> device extension or something - a common reason why one wants to know
> that they’re attached to the FDO) but it will tell you where you are.
>
> I would like to understand why you feel this is necessary.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Tuesday, August 09, 2005 10:04 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] of device objects
>
> thanks peter, but still, is there a way to know whether I am attaching
> to the FDO?
>
>
>
> On 8/9/05, Albert Pinto wrote:
> > thats right, instead of writing two drivers, to filter the same
device
>
> > i wanted one code to work below and above, is there a way of
> > determining it?
> >
> >
> >
> > On 8/9/05, Peter Wieland wrote:
> > > In your add device routine you get a pointer to the PDO. When you
> > > call IoAttachDeviceToDeviceStack you get a pointer to the device
> > > directly below you. If those are the same pointer you’re attached
> > > directly to the PDO.
> > >
> > > However I suspect you really want to know if you’re above or below
> > > the FDO.
> > >
> > > That’s determined by whether you’re in the upper filter list or
the
> > > lower filter list which is controlled by the INF for the device or
> > > by your installer (if you have a separate one for your filter).
> > > Either way the filter is installed you could simply put a registry
> > > entry into the devnode that tells your driver that it’s above or
> > > below the FDO and thus the mode it operates in.
> > >
> > > Or are you loading your filter twice in the stack (once above the
> > > FDO and once below) and you want each to figure out where it lies
in
>
> > > the hierarchy?
> > >
> > > -p
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
Pinto
> > > Sent: Tuesday, August 09, 2005 8:34 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re: [ntdev] of device objects
> > >
> > > well sir, as a matter of fact I do? can you tell me how?
> > >
> > >
> > >
> > >
> > > On 8/9/05, Peter Wieland wrote:
> > > > Filters should run on particular devices, not on “drivers”. So
> > > > it’s confusing to me too why your filter would care about any
> > > > device in any
> > >
> > > > other stack, which is what it sounds like you’re asking.
> > > >
> > > > Are you trying to figure out if the device you’re attached to is
> > > > an FDO or a PDO?
> > > >
> > > > -p
> > > >
> > > > -----Original Message-----
> > > > From: xxxxx@lists.osr.com
> > > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > > Pinto
> > > > Sent: Tuesday, August 09, 2005 12:26 AM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: Re: [ntdev] of device objects
> > > >
> > > > actually, I am writing a filter for a lower level driver, which
> > > > has created some PDO and FDOs.
> > > >
> > > > Well, I just wanted to know the list of FDO and PDO, since I
might
>
> > > > need to handle some IOCTL calls myself, build some IRPs and send
> > > > down depending whether it is an FDO or a PDO.
> > > >
> > > > A
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On 8/9/05, Doron Holan wrote:
> > > > > You can get the top of the stack via
> > > > > IoGetAttachedDeviceReference and the PDO by sending an
> > > > > IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > > > > (TargetDeviceRelation) (and remember to deref the PDO
> afterwards).
> > > > > Anything in between is not enumerable in a safe or
documented
> > > > manner.
> > > > >
> > > > > Why do you need to know the FDO?
> > > > >
> > > > > d
> > > > >
> > > > > -----Original Message-----
> > > > > From: xxxxx@lists.osr.com
> > > > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > > > Pinto
> > > > > Sent: Monday, August 08, 2005 10:58 PM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: [ntdev] of device objects
> > > > >
> > > > > hi all,
> > > > >
> > > > > Is there a way to get the PDO and FDO list of the driver
sitting
>
> > > > > below
> > > >
> > > > > in the stack?
> > > > >
> > > > > Albert
> > > > >
> > > > > —
> > > > > Questions? First check the Kernel Driver FAQ at
> > > > > http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > > argument:
> > > > > ‘’
> > > > > To unsubscribe send a blank email to
> > > > > xxxxx@lists.osr.com
> > > > >
> > > > > —
> > > > > Questions? First check the Kernel Driver FAQ at
> > > > > http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > > argument: ‘’
> > > > > To unsubscribe send a blank email to
> > > > > xxxxx@lists.osr.com
> > > > >
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument:
> > > > ‘’
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument: ‘’
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
> > > ‘’
> > > To unsubscribe send a blank email to
xxxxx@lists.osr.com
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> > > To unsubscribe send a blank email to
xxxxx@lists.osr.com
> > >
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
So you load one instance above the FDO and another below the PDO as you
were planning to do. Both call down the stack looking for an interface
implemented by a lower instance of your driver.
The instance below the FDO won’t find any interface below it, so it can
assume it’s attached below the PDO. Any I/O controls it receives will
be directed to the PDO.
The instance above the FDO will find an interface below it (implemented
by the lower filter) and can assume it’s attached above the FDO. Any
I/O controls it receives will be directed to the FDO.
I still don’t see why you need to be attached directly to the FDO or the
PDO.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
Sent: Tuesday, August 09, 2005 10:52 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] of device objects
if i want to filter out IOCTL calls to a lower level driver sittin above
it, this driver creates PDOs adn FDOs, what I want is to intercept the
IOCTLs for that driver, stop them at my level, do the processing and
send them up, the lower level driver should be oblivious of this. To
process IOCTLs i need to determine whether the device for which the
IOCTL was meant is an FDO or a PDO
On 8/9/05, Peter Wieland wrote:
> Not officially since a driver shouldn’t care whether it’s directly
> attached to the FDO. If you’re above the FDO you can use the
> interface it provides (in terms of read/write/ioctl, PNP interfaces,
> etc…) and that’s all a driver should need.
>
> You could read the service property of the device and see if that
> matches the driver name of the device you’re attached to. This won’t
> tell you what service it is (if you were hoping to spelunk through
> their device extension or something - a common reason why one wants to
> know that they’re attached to the FDO) but it will tell you where you
are.
>
> I would like to understand why you feel this is necessary.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Tuesday, August 09, 2005 10:04 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] of device objects
>
> thanks peter, but still, is there a way to know whether I am attaching
> to the FDO?
>
>
>
> On 8/9/05, Albert Pinto wrote:
> > thats right, instead of writing two drivers, to filter the same
> > device
>
> > i wanted one code to work below and above, is there a way of
> > determining it?
> >
> >
> >
> > On 8/9/05, Peter Wieland wrote:
> > > In your add device routine you get a pointer to the PDO. When you
> > > call IoAttachDeviceToDeviceStack you get a pointer to the device
> > > directly below you. If those are the same pointer you’re attached
> > > directly to the PDO.
> > >
> > > However I suspect you really want to know if you’re above or below
> > > the FDO.
> > >
> > > That’s determined by whether you’re in the upper filter list or
> > > the lower filter list which is controlled by the INF for the
> > > device or by your installer (if you have a separate one for your
filter).
> > > Either way the filter is installed you could simply put a registry
> > > entry into the devnode that tells your driver that it’s above or
> > > below the FDO and thus the mode it operates in.
> > >
> > > Or are you loading your filter twice in the stack (once above the
> > > FDO and once below) and you want each to figure out where it lies
> > > in
>
> > > the hierarchy?
> > >
> > > -p
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > Pinto
> > > Sent: Tuesday, August 09, 2005 8:34 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re: [ntdev] of device objects
> > >
> > > well sir, as a matter of fact I do? can you tell me how?
> > >
> > >
> > >
> > >
> > > On 8/9/05, Peter Wieland wrote:
> > > > Filters should run on particular devices, not on “drivers”. So
> > > > it’s confusing to me too why your filter would care about any
> > > > device in any
> > >
> > > > other stack, which is what it sounds like you’re asking.
> > > >
> > > > Are you trying to figure out if the device you’re attached to is
> > > > an FDO or a PDO?
> > > >
> > > > -p
> > > >
> > > > -----Original Message-----
> > > > From: xxxxx@lists.osr.com
> > > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > > Pinto
> > > > Sent: Tuesday, August 09, 2005 12:26 AM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: Re: [ntdev] of device objects
> > > >
> > > > actually, I am writing a filter for a lower level driver, which
> > > > has created some PDO and FDOs.
> > > >
> > > > Well, I just wanted to know the list of FDO and PDO, since I
> > > > might
>
> > > > need to handle some IOCTL calls myself, build some IRPs and send
> > > > down depending whether it is an FDO or a PDO.
> > > >
> > > > A
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On 8/9/05, Doron Holan wrote:
> > > > > You can get the top of the stack via
> > > > > IoGetAttachedDeviceReference and the PDO by sending an
> > > > > IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS
> > > > > (TargetDeviceRelation) (and remember to deref the PDO
> afterwards).
> > > > > Anything in between is not enumerable in a safe or
> > > > > documented
> > > > manner.
> > > > >
> > > > > Why do you need to know the FDO?
> > > > >
> > > > > d
> > > > >
> > > > > -----Original Message-----
> > > > > From: xxxxx@lists.osr.com
> > > > > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert
> > > > > Pinto
> > > > > Sent: Monday, August 08, 2005 10:58 PM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: [ntdev] of device objects
> > > > >
> > > > > hi all,
> > > > >
> > > > > Is there a way to get the PDO and FDO list of the driver
> > > > > sitting
>
> > > > > below
> > > >
> > > > > in the stack?
> > > > >
> > > > > Albert
> > > > >
> > > > > —
> > > > > Questions? First check the Kernel Driver FAQ at
> > > > > http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > > argument:
> > > > > ‘’
> > > > > To unsubscribe send a blank email to
> > > > > xxxxx@lists.osr.com
> > > > >
> > > > > —
> > > > > Questions? First check the Kernel Driver FAQ at
> > > > > http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > > argument: ‘’
> > > > > To unsubscribe send a blank email to
> > > > > xxxxx@lists.osr.com
> > > > >
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument:
> > > > ‘’
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: unknown lmsubst tag
> > > argument: ‘’
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
> > > ‘’
> > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com