Hi,
I have a driver where I want to attach to multiple device objects (targets).
Has this been done before? Once attached to the various targets, my driver
will get all IRPs destined for them. I want to 'process' some of these the
IRPs (READS, WRITES, IOCTLs. etc.), but not all of them. So... when I
determine that I don't need to handle an IRP, how do I determine which of the
target device objects to pass it on to?
Thanks in advance,
-bob

Re: attaching to multiple device objects by Don

Don
Tue Jan 03 13:54:18 CST 2006

This is a classic filter driver case, you create a seperate device object
for each target, you store the device object you are targeting in the device
extension of the your device object. For the operations you care about you
handle them, for all others you send them to the lower driver. Note: if the
devices are PNP you do care about IRP_MJ_PNP


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"Bob" <Bob@discussions.microsoft.com> wrote in message
news:100BB738-3AAC-410A-BD6D-B47165CA3CCE@microsoft.com...
> Hi,
> I have a driver where I want to attach to multiple device objects
> (targets).
> Has this been done before? Once attached to the various targets, my
> driver
> will get all IRPs destined for them. I want to 'process' some of these
> the
> IRPs (READS, WRITES, IOCTLs. etc.), but not all of them. So... when I
> determine that I don't need to handle an IRP, how do I determine which of
> the
> target device objects to pass it on to?
> Thanks in advance,
> -bob



Re: attaching to multiple device objects by Calvin

Calvin
Tue Jan 03 14:01:18 CST 2006

You will have a driver that creates multiple device objects, one for each
target device stack.

--
Calvin Guan (Windows DDK MVP)
NetXtreme Longhorn Miniport Prime
Broadcom Corp. www.broadcom.com

"Bob" <Bob@discussions.microsoft.com> wrote in message
news:100BB738-3AAC-410A-BD6D-B47165CA3CCE@microsoft.com...
> Hi,
> I have a driver where I want to attach to multiple device objects
> (targets).
> Has this been done before? Once attached to the various targets, my
> driver
> will get all IRPs destined for them. I want to 'process' some of these
> the
> IRPs (READS, WRITES, IOCTLs. etc.), but not all of them. So... when I
> determine that I don't need to handle an IRP, how do I determine which of
> the
> target device objects to pass it on to?
> Thanks in advance,
> -bob



Re: attaching to multiple device objects by Bob

Bob
Tue Jan 03 14:23:02 CST 2006

hmmm... but I don't want to create multiple device objects... the point of my
driver is to stripe across multiple devices. I want to create one device
object (C1) to attach to several target devices. I then want to create
another device object (V1) that attaches to C1 (the V1 device is accessible
via a symlink). I/O done to V1 then will be automatically striped across all
the devices attached to C1 via my driver. HOWEVER, if an application opens
one if the target devices directly (i.e not via V1) then I/O's from that
application do not get striped and need to be passed through.
Since C1 will get ALL IRPs (not just those from V1), it's the last part I'm
having trouble with...
-bob

"Calvin Guan" wrote:

> You will have a driver that creates multiple device objects, one for each
> target device stack.
>
> --
> Calvin Guan (Windows DDK MVP)
> NetXtreme Longhorn Miniport Prime
> Broadcom Corp. www.broadcom.com
>
> "Bob" <Bob@discussions.microsoft.com> wrote in message
> news:100BB738-3AAC-410A-BD6D-B47165CA3CCE@microsoft.com...
> > Hi,
> > I have a driver where I want to attach to multiple device objects
> > (targets).
> > Has this been done before? Once attached to the various targets, my
> > driver
> > will get all IRPs destined for them. I want to 'process' some of these
> > the
> > IRPs (READS, WRITES, IOCTLs. etc.), but not all of them. So... when I
> > determine that I don't need to handle an IRP, how do I determine which of
> > the
> > target device objects to pass it on to?
> > Thanks in advance,
> > -bob
>
>
>

Re: attaching to multiple device objects by Don

Don
Tue Jan 03 14:48:47 CST 2006

Then do not attach to the devices, make you device query for the interfaces,
then call the appropriate device objects. You do not have to attach to a
device to call to it.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"Bob" <Bob@discussions.microsoft.com> wrote in message
news:61992461-D630-4884-9C94-5D9A0297DC6B@microsoft.com...
> hmmm... but I don't want to create multiple device objects... the point of
> my
> driver is to stripe across multiple devices. I want to create one device
> object (C1) to attach to several target devices. I then want to create
> another device object (V1) that attaches to C1 (the V1 device is
> accessible
> via a symlink). I/O done to V1 then will be automatically striped across
> all
> the devices attached to C1 via my driver. HOWEVER, if an application
> opens
> one if the target devices directly (i.e not via V1) then I/O's from that
> application do not get striped and need to be passed through.
> Since C1 will get ALL IRPs (not just those from V1), it's the last part
> I'm
> having trouble with...
> -bob
>
> "Calvin Guan" wrote:
>
>> You will have a driver that creates multiple device objects, one for each
>> target device stack.
>>
>> --
>> Calvin Guan (Windows DDK MVP)
>> NetXtreme Longhorn Miniport Prime
>> Broadcom Corp. www.broadcom.com
>>
>> "Bob" <Bob@discussions.microsoft.com> wrote in message
>> news:100BB738-3AAC-410A-BD6D-B47165CA3CCE@microsoft.com...
>> > Hi,
>> > I have a driver where I want to attach to multiple device objects
>> > (targets).
>> > Has this been done before? Once attached to the various targets, my
>> > driver
>> > will get all IRPs destined for them. I want to 'process' some of these
>> > the
>> > IRPs (READS, WRITES, IOCTLs. etc.), but not all of them. So... when I
>> > determine that I don't need to handle an IRP, how do I determine which
>> > of
>> > the
>> > target device objects to pass it on to?
>> > Thanks in advance,
>> > -bob
>>
>>
>>



Re: attaching to multiple device objects by Bob

Bob
Tue Jan 03 15:10:05 CST 2006

aha! That's the missing piece.

So... Since I have the target object names, I can use
IoGetDeviceObjectPointer to effectively 'open' the device. I can then build
IRPs as needed and not have to worry about all the other I/O that would
normally be directed through a filter driver.

Thanks!
-bob

"Don Burn" wrote:

> Then do not attach to the devices, make you device query for the interfaces,
> then call the appropriate device objects. You do not have to attach to a
> device to call to it.
>
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
>
>
> "Bob" <Bob@discussions.microsoft.com> wrote in message
> news:61992461-D630-4884-9C94-5D9A0297DC6B@microsoft.com...
> > hmmm... but I don't want to create multiple device objects... the point of
> > my
> > driver is to stripe across multiple devices. I want to create one device
> > object (C1) to attach to several target devices. I then want to create
> > another device object (V1) that attaches to C1 (the V1 device is
> > accessible
> > via a symlink). I/O done to V1 then will be automatically striped across
> > all
> > the devices attached to C1 via my driver. HOWEVER, if an application
> > opens
> > one if the target devices directly (i.e not via V1) then I/O's from that
> > application do not get striped and need to be passed through.
> > Since C1 will get ALL IRPs (not just those from V1), it's the last part
> > I'm
> > having trouble with...
> > -bob
> >
> > "Calvin Guan" wrote:
> >
> >> You will have a driver that creates multiple device objects, one for each
> >> target device stack.
> >>
> >> --
> >> Calvin Guan (Windows DDK MVP)
> >> NetXtreme Longhorn Miniport Prime
> >> Broadcom Corp. www.broadcom.com
> >>
> >> "Bob" <Bob@discussions.microsoft.com> wrote in message
> >> news:100BB738-3AAC-410A-BD6D-B47165CA3CCE@microsoft.com...
> >> > Hi,
> >> > I have a driver where I want to attach to multiple device objects
> >> > (targets).
> >> > Has this been done before? Once attached to the various targets, my
> >> > driver
> >> > will get all IRPs destined for them. I want to 'process' some of these
> >> > the
> >> > IRPs (READS, WRITES, IOCTLs. etc.), but not all of them. So... when I
> >> > determine that I don't need to handle an IRP, how do I determine which
> >> > of
> >> > the
> >> > target device objects to pass it on to?
> >> > Thanks in advance,
> >> > -bob
> >>
> >>
> >>
>
>
>