In the sfilter sample of the IFS there is an element of the device extension that the filter creates called AttachedToDeviceObject. Inside the DeviceObject structure there is a guy call AttachedDevice. Both are PDEVICE_OBJECT.

Now why does the sfilter sample need AttachedToDeviceObject if the other already has been defined? Clearly there is a difference because I'm running into a situation where I rely on AttachedToDeviceObject to call to IoCreateFileSpecifyDeviceObjectHint , and therefore avoid getting called back on my own call.

But I find that after I make this call , which appears to return successfully, I cannot use IoCreateFile without things breaking up. In the case where they do break up , I find that AttachedDevice element of the DeviceObject in question is 0, yet the AttachedToDeviceObject appears valid.

What exactly are the semantics of these elements?

Any thoughts?

--
Gak -
Finecats

Re: AttachedDevice vs. AttachedToDeviceObject by Calvin

Calvin
Wed Jun 23 15:40:14 CDT 2004

They are totally different DO's.

Let's say your device object is pDevObjA, then
pDevObjA->AttachedDevice is upper DO while AttachedToDeviceObject is the
lower DO underneath pDevObjA.
pDevObjA is sandwiched between pDevObjA->AttachedDevice (upper) and
AttachedToDeviceObject (lower).

-
Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com


"finecats" <finecats@nospam.nospam> wrote in message
news:FB1A2CC7-E1B6-46FC-B41A-76C56BC7EEAD@microsoft.com...
> In the sfilter sample of the IFS there is an element of the device
extension that the filter creates called AttachedToDeviceObject. Inside
the DeviceObject structure there is a guy call AttachedDevice. Both are
PDEVICE_OBJECT.
>
> Now why does the sfilter sample need AttachedToDeviceObject if the other
already has been defined? Clearly there is a difference because I'm running
into a situation where I rely on AttachedToDeviceObject to call to
IoCreateFileSpecifyDeviceObjectHint , and therefore avoid getting called
back on my own call.
>
> But I find that after I make this call , which appears to return
successfully, I cannot use IoCreateFile without things breaking up. In the
case where they do break up , I find that AttachedDevice element of the
DeviceObject in question is 0, yet the AttachedToDeviceObject appears valid.
>
> What exactly are the semantics of these elements?
>
> Any thoughts?
>
> --
> Gak -
> Finecats