Installing PCI filter driver without reboot.

Let’s try one last time, what are you really trying to do? You are
proposing a solution that will crash a lot of platforms, by reading the
PCI config space registers. Trying zero in on the problem you are
really trying to solve you mentioned getting access to the HBA
registers, but what are you going to do with those? Even accessing them
can cause problems, so WHAT PROBLEM ARE YOU TRYING TO SOLVE???

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

Ok. Let me explain again what I’m trying to do.

HBA memory registers have Capabilities like the sata mode supported
(SATAII, SATAIII), and other properties. I need to check whether the disks
in a system are connected to the SATA III ports or not, in case they are
available. So I need to check if there is any storage controller in the
system which has SATAIII capability.

Anirudha

On Sat, Aug 11, 2012 at 8:10 PM, Don Burn wrote:

> Let’s try one last time, what are you really trying to do? You are
> proposing a solution that will crash a lot of platforms, by reading the PCI
> config space registers. Trying zero in on the problem you are really
> trying to solve you mentioned getting access to the HBA registers, but what
> are you going to do with those? Even accessing them can cause problems, so
> WHAT PROBLEM ARE YOU TRYING TO SOLVE???
>
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> —
> 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
>

So instead of a PCI filter driver, create a driver that uses
IoRegisterPlugPlayNotification to open the storage drivers, then use
IRP_MN_READ_CONFIG to get the registers. You are making this way too
hard for what you need.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Anirudha Kumar” wrote in message
news:xxxxx@ntdev:

> Ok. Let me explain again what I’m trying to do.
>
> HBA memory registers have Capabilities like the sata mode supported
> (SATAII, SATAIII), and other properties. I need to check whether the disks
> in a system are connected to the SATA III ports or not, in case they are
> available. So I need to check if there is any storage controller in the
> system which has SATAIII capability.
>
> Anirudha
>
> On Sat, Aug 11, 2012 at 8:10 PM, Don Burn wrote:
>
> > Let’s try one last time, what are you really trying to do? You are
> > proposing a solution that will crash a lot of platforms, by reading the PCI
> > config space registers. Trying zero in on the problem you are really
> > trying to solve you mentioned getting access to the HBA registers, but what
> > are you going to do with those? Even accessing them can cause problems, so
> > WHAT PROBLEM ARE YOU TRYING TO SOLVE???
> >
> >
> >
> > Don Burn
> > Windows Filesystem and Driver Consulting
> > Website: http://www.windrvr.com
> > Blog: http://msmvps.com/blogs/WinDrvr
> >
> >
> >
> >
> > —
> > 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
> >

Thanks for info Don Burn.

I’ll start looking in to this. Can you point me to some sample code or
documentation?

Thanks for reply.

Anirudha

On Mon, Aug 13, 2012 at 3:48 PM, Don Burn wrote:

> So instead of a PCI filter driver, create a driver that uses
> IoRegisterPlugPlayNotification to open the storage drivers, then use
> IRP_MN_READ_CONFIG to get the registers. You are making this way too hard
> for what you need.
>
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> “Anirudha Kumar” wrote in message news:xxxxx@ntdev
> :
>
>
> Ok. Let me explain again what I’m trying to do.
>>
>> HBA memory registers have Capabilities like the sata mode supported
>> (SATAII, SATAIII), and other properties. I need to check whether the disks
>> in a system are connected to the SATA III ports or not, in case they are
>> available. So I need to check if there is any storage controller in the
>> system which has SATAIII capability.
>>
>> Anirudha
>>
>> On Sat, Aug 11, 2012 at 8:10 PM, Don Burn wrote:
>>
>> > Let’s try one last time, what are you really trying to do? You are
>> > proposing a solution that will crash a lot of platforms, by reading the
>> PCI
>> > config space registers. Trying zero in on the problem you are really
>> > trying to solve you mentioned getting access to the HBA registers, but
>> what
>> > are you going to do with those? Even accessing them can cause
>> problems, so
>> > WHAT PROBLEM ARE YOU TRYING TO SOLVE???
>> >
>> >
>> >
>> > Don Burn
>> > Windows Filesystem and Driver Consulting
>> > Website: http://www.windrvr.com
>> > Blog: http://msmvps.com/blogs/WinDrvr
>> >
>> >
>> >
>> >
>> > —
>> > 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
>

Well http://www.hollistech.com/ under resources has a good paper on
using IRP_MN_READ_CONFIG. There is a Hard Disk Controller device
interface GUID which you can use to find the devices.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Anirudha Kumar” wrote in message
news:xxxxx@ntdev:

> Thanks for info Don Burn.
>
> I’ll start looking in to this. Can you point me to some sample code or
> documentation?
>
> Thanks for reply.
>
> Anirudha
>
> On Mon, Aug 13, 2012 at 3:48 PM, Don Burn wrote:
>
> > So instead of a PCI filter driver, create a driver that uses
> > IoRegisterPlugPlayNotification to open the storage drivers, then use
> > IRP_MN_READ_CONFIG to get the registers. You are making this way too hard
> > for what you need.
> >
> >
> >
> > Don Burn
> > Windows Filesystem and Driver Consulting
> > Website: http://www.windrvr.com
> > Blog: http://msmvps.com/blogs/WinDrvr
> >
> >
> >
> >
> > “Anirudha Kumar” wrote in message news:xxxxx@ntdev
> > :
> >
> >
> > Ok. Let me explain again what I’m trying to do.
> >>
> >> HBA memory registers have Capabilities like the sata mode supported
> >> (SATAII, SATAIII), and other properties. I need to check whether the disks
> >> in a system are connected to the SATA III ports or not, in case they are
> >> available. So I need to check if there is any storage controller in the
> >> system which has SATAIII capability.
> >>
> >> Anirudha
> >>
> >> On Sat, Aug 11, 2012 at 8:10 PM, Don Burn wrote:
> >>
> >> > Let’s try one last time, what are you really trying to do? You are
> >> > proposing a solution that will crash a lot of platforms, by reading the
> >> PCI
> >> > config space registers. Trying zero in on the problem you are really
> >> > trying to solve you mentioned getting access to the HBA registers, but
> >> what
> >> > are you going to do with those? Even accessing them can cause
> >> problems, so
> >> > WHAT PROBLEM ARE YOU TRYING TO SOLVE???
> >> >
> >> >
> >> >
> >> > Don Burn
> >> > Windows Filesystem and Driver Consulting
> >> > Website: http://www.windrvr.com
> >> > Blog: http://msmvps.com/blogs/WinDrvr
> >> >
> >> >
> >> >
> >> >
> >> > —
> >> > 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
> >

But AFAIK, handling of QUERY_INTERFACE is optional for functional drivers.
So, it cannot be guaranteed that you can get the bus interface of any
storage controller. For eg, Intel storage driver that comes with newer
chipsets don’t support this request. If I cannot get the bus interface I
cant send Read_Config either.

The thing is, main requirement for using READ_CONFIG is that you need a bus
device object and PCI bus gives no name to the bus device that it creates.
Also, the controllers on that bus are not mandated to handle
QUERY_INTERFACE. So, there is no way left to get the bus device interface
or object.

On Mon, Aug 13, 2012 at 5:12 PM, Don Burn wrote:

> Well http://www.hollistech.com/ under resources has a good paper on using
> IRP_MN_READ_CONFIG. There is a Hard Disk Controller device interface GUID
> which you can use to find the devices.
>
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> “Anirudha Kumar” wrote in message news:xxxxx@ntdev
> :
>
>
> Thanks for info Don Burn.
>>
>> I’ll start looking in to this. Can you point me to some sample code or
>> documentation?
>>
>> Thanks for reply.
>>
>> Anirudha
>>
>> On Mon, Aug 13, 2012 at 3:48 PM, Don Burn wrote:
>>
>> > So instead of a PCI filter driver, create a driver that uses
>> > IoRegisterPlugPlayNotification to open the storage drivers, then use
>> > IRP_MN_READ_CONFIG to get the registers. You are making this way too
>> hard
>> > for what you need.
>> >
>> >
>> >
>> > Don Burn
>> > Windows Filesystem and Driver Consulting
>> > Website: http://www.windrvr.com
>> > Blog: http://msmvps.com/blogs/WinDrvr
>> >
>> >
>> >
>> >
>> > “Anirudha Kumar” wrote in message
>> news:xxxxx@ntdev
>> > :
>> >
>> >
>> > Ok. Let me explain again what I’m trying to do.
>> >>
>> >> HBA memory registers have Capabilities like the sata mode supported
>> >> (SATAII, SATAIII), and other properties. I need to check whether the
>> disks
>> >> in a system are connected to the SATA III ports or not, in case they
>> are
>> >> available. So I need to check if there is any storage controller in the
>> >> system which has SATAIII capability.
>> >>
>> >> Anirudha
>> >>
>> >> On Sat, Aug 11, 2012 at 8:10 PM, Don Burn wrote:
>> >>
>> >> > Let’s try one last time, what are you really trying to do? You are
>> >> > proposing a solution that will crash a lot of platforms, by reading
>> the
>> >> PCI
>> >> > config space registers. Trying zero in on the problem you are really
>> >> > trying to solve you mentioned getting access to the HBA registers,
>> but
>> >> what
>> >> > are you going to do with those? Even accessing them can cause
>> >> problems, so
>> >> > WHAT PROBLEM ARE YOU TRYING TO SOLVE???
>> >> >
>> >> >
>> >> >
>> >> > Don Burn
>> >> > Windows Filesystem and Driver Consulting
>> >> > Website: http://www.windrvr.com
>> >> > Blog: http://msmvps.com/blogs/WinDrvr
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > —
>> >> > 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
>> >
>>
>
>
> —
> 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
>

Query interface is optional, but if you don’t handle it you should pass
it to the lower driver. You are querying the bus driver, and that needs
to go through there are upper layers that assume they can get that data
(think device manager for one).

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Anirudha Kumar” wrote in message
news:xxxxx@ntdev:

> But AFAIK, handling of QUERY_INTERFACE is optional for functional drivers.
> So, it cannot be guaranteed that you can get the bus interface of any
> storage controller. For eg, Intel storage driver that comes with newer
> chipsets don’t support this request. If I cannot get the bus interface I
> cant send Read_Config either.
>
> The thing is, main requirement for using READ_CONFIG is that you need a bus
> device object and PCI bus gives no name to the bus device that it creates.
> Also, the controllers on that bus are not mandated to handle
> QUERY_INTERFACE. So, there is no way left to get the bus device interface
> or object.
>
>
>
> On Mon, Aug 13, 2012 at 5:12 PM, Don Burn wrote:
>
> > Well http://www.hollistech.com/ under resources has a good paper on using
> > IRP_MN_READ_CONFIG. There is a Hard Disk Controller device interface GUID
> > which you can use to find the devices.
> >
> >
> >
> > Don Burn
> > Windows Filesystem and Driver Consulting
> > Website: http://www.windrvr.com
> > Blog: http://msmvps.com/blogs/WinDrvr
> >
> >
> >
> >
> > “Anirudha Kumar” wrote in message news:xxxxx@ntdev
> > :
> >
> >
> > Thanks for info Don Burn.
> >>
> >> I’ll start looking in to this. Can you point me to some sample code or
> >> documentation?
> >>
> >> Thanks for reply.
> >>
> >> Anirudha
> >>
> >> On Mon, Aug 13, 2012 at 3:48 PM, Don Burn wrote:
> >>
> >> > So instead of a PCI filter driver, create a driver that uses
> >> > IoRegisterPlugPlayNotification to open the storage drivers, then use
> >> > IRP_MN_READ_CONFIG to get the registers. You are making this way too
> >> hard
> >> > for what you need.
> >> >
> >> >
> >> >
> >> > Don Burn
> >> > Windows Filesystem and Driver Consulting
> >> > Website: http://www.windrvr.com
> >> > Blog: http://msmvps.com/blogs/WinDrvr
> >> >
> >> >
> >> >
> >> >
> >> > “Anirudha Kumar” wrote in message
> >> news:xxxxx@ntdev
> >> > :
> >> >
> >> >
> >> > Ok. Let me explain again what I’m trying to do.
> >> >>
> >> >> HBA memory registers have Capabilities like the sata mode supported
> >> >> (SATAII, SATAIII), and other properties. I need to check whether the
> >> disks
> >> >> in a system are connected to the SATA III ports or not, in case they
> >> are
> >> >> available. So I need to check if there is any storage controller in the
> >> >> system which has SATAIII capability.
> >> >>
> >> >> Anirudha
> >> >>
> >> >> On Sat, Aug 11, 2012 at 8:10 PM, Don Burn wrote:
> >> >>
> >> >> > Let’s try one last time, what are you really trying to do? You are
> >> >> > proposing a solution that will crash a lot of platforms, by reading
> >> the
> >> >> PCI
> >> >> > config space registers. Trying zero in on the problem you are really
> >> >> > trying to solve you mentioned getting access to the HBA registers,
> >> but
> >> >> what
> >> >> > are you going to do with those? Even accessing them can cause
> >> >> problems, so
> >> >> > WHAT PROBLEM ARE YOU TRYING TO SOLVE???
> >> >> >
> >> >> >
> >> >> >
> >> >> > Don Burn
> >> >> > Windows Filesystem and Driver Consulting
> >> >> > Website: http://www.windrvr.com
> >> >> > Blog: http://msmvps.com/blogs/WinDrvr
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > —
> >> >> > 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
> >> >
> >>
> >
> >
> > —
> > 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
> >

How will I query the Bus driver? That is the whole question. There’s no way
to communicate with the bus driver from another driver.

Anirudha

On Mon, Aug 13, 2012 at 5:43 PM, Don Burn wrote:

> Query interface is optional, but if you don’t handle it you should pass it
> to the lower driver. You are querying the bus driver, and that needs to go
> through there are upper layers that assume they can get that data (think
> device manager for one).
>
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> “Anirudha Kumar” wrote in message news:xxxxx@ntdev
> :
>
>
> But AFAIK, handling of QUERY_INTERFACE is optional for functional drivers.
>> So, it cannot be guaranteed that you can get the bus interface of any
>> storage controller. For eg, Intel storage driver that comes with newer
>> chipsets don’t support this request. If I cannot get the bus interface I
>> cant send Read_Config either.
>>
>> The thing is, main requirement for using READ_CONFIG is that you need a
>> bus
>> device object and PCI bus gives no name to the bus device that it creates.
>> Also, the controllers on that bus are not mandated to handle
>> QUERY_INTERFACE. So, there is no way left to get the bus device interface
>> or object.
>>
>>
>>
>> On Mon, Aug 13, 2012 at 5:12 PM, Don Burn wrote:
>>
>> > Well http://www.hollistech.com/ under resources has a good paper on
>> using
>> > IRP_MN_READ_CONFIG. There is a Hard Disk Controller device interface
>> GUID
>> > which you can use to find the devices.
>> >
>> >
>> >
>> > Don Burn
>> > Windows Filesystem and Driver Consulting
>> > Website: http://www.windrvr.com
>> > Blog: http://msmvps.com/blogs/WinDrvr
>> >
>> >
>> >
>> >
>> > “Anirudha Kumar” wrote in message
>> news:xxxxx@ntdev
>> > :
>> >
>> >
>> > Thanks for info Don Burn.
>> >>
>> >> I’ll start looking in to this. Can you point me to some sample code or
>> >> documentation?
>> >>
>> >> Thanks for reply.
>> >>
>> >> Anirudha
>> >>
>> >> On Mon, Aug 13, 2012 at 3:48 PM, Don Burn wrote:
>> >>
>> >> > So instead of a PCI filter driver, create a driver that uses
>> >> > IoRegisterPlugPlayNotification to open the storage drivers, then use
>> >> > IRP_MN_READ_CONFIG to get the registers. You are making this way too
>> >> hard
>> >> > for what you need.
>> >> >
>> >> >
>> >> >
>> >> > Don Burn
>> >> > Windows Filesystem and Driver Consulting
>> >> > Website: http://www.windrvr.com
>> >> > Blog: http://msmvps.com/blogs/WinDrvr
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > “Anirudha Kumar” wrote in message
>> >> news:xxxxx@ntdev
>> >> > :
>> >> >
>> >> >
>> >> > Ok. Let me explain again what I’m trying to do.
>> >> >>
>> >> >> HBA memory registers have Capabilities like the sata mode supported
>> >> >> (SATAII, SATAIII), and other properties. I need to check whether the
>> >> disks
>> >> >> in a system are connected to the SATA III ports or not, in case they
>> >> are
>> >> >> available. So I need to check if there is any storage controller in
>> the
>> >> >> system which has SATAIII capability.
>> >> >>
>> >> >> Anirudha
>> >> >>
>> >> >> On Sat, Aug 11, 2012 at 8:10 PM, Don Burn wrote:
>> >> >>
>> >> >> > Let’s try one last time, what are you really trying to do? You
>> are
>> >> >> > proposing a solution that will crash a lot of platforms, by
>> reading
>> >> the
>> >> >> PCI
>> >> >> > config space registers. Trying zero in on the problem you are
>> really
>> >> >> > trying to solve you mentioned getting access to the HBA registers,
>> >> but
>> >> >> what
>> >> >> > are you going to do with those? Even accessing them can cause
>> >> >> problems, so
>> >> >> > WHAT PROBLEM ARE YOU TRYING TO SOLVE???
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > Don Burn
>> >> >> > Windows Filesystem and Driver Consulting
>> >> >> > Website: http://www.windrvr.com
>> >> >> > Blog: http://msmvps.com/blogs/WinDrvr
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > —
>> >> >> > 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
>> >> >
>> >>
>> >
>> >
>> > —
>> > 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
>

Of course there is, this is a driver stack. When you send a request to
a device it either services it, or sends it to the lower device and the
lowest device is the bus driver!

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Anirudha Kumar” wrote in message
news:xxxxx@ntdev:

> How will I query the Bus driver? That is the whole question. There’s no way
> to communicate with the bus driver from another driver.
>
> Anirudha
>
> On Mon, Aug 13, 2012 at 5:43 PM, Don Burn wrote:
>
> > Query interface is optional, but if you don’t handle it you should pass it
> > to the lower driver. You are querying the bus driver, and that needs to go
> > through there are upper layers that assume they can get that data (think
> > device manager for one).
> >
> >
> >
> > Don Burn
> > Windows Filesystem and Driver Consulting
> > Website: http://www.windrvr.com
> > Blog: http://msmvps.com/blogs/WinDrvr
> >
> >
> >
> >
> > “Anirudha Kumar” wrote in message news:xxxxx@ntdev
> > :
> >
> >
> > But AFAIK, handling of QUERY_INTERFACE is optional for functional drivers.
> >> So, it cannot be guaranteed that you can get the bus interface of any
> >> storage controller. For eg, Intel storage driver that comes with newer
> >> chipsets don’t support this request. If I cannot get the bus interface I
> >> cant send Read_Config either.
> >>
> >> The thing is, main requirement for using READ_CONFIG is that you need a
> >> bus
> >> device object and PCI bus gives no name to the bus device that it creates.
> >> Also, the controllers on that bus are not mandated to handle
> >> QUERY_INTERFACE. So, there is no way left to get the bus device interface
> >> or object.
> >>
> >>
> >>
> >> On Mon, Aug 13, 2012 at 5:12 PM, Don Burn wrote:
> >>
> >> > Well http://www.hollistech.com/ under resources has a good paper on
> >> using
> >> > IRP_MN_READ_CONFIG. There is a Hard Disk Controller device interface
> >> GUID
> >> > which you can use to find the devices.
> >> >
> >> >
> >> >
> >> > Don Burn
> >> > Windows Filesystem and Driver Consulting
> >> > Website: http://www.windrvr.com
> >> > Blog: http://msmvps.com/blogs/WinDrvr
> >> >
> >> >
> >> >
> >> >
> >> > “Anirudha Kumar” wrote in message
> >> news:xxxxx@ntdev
> >> > :
> >> >
> >> >
> >> > Thanks for info Don Burn.
> >> >>
> >> >> I’ll start looking in to this. Can you point me to some sample code or
> >> >> documentation?
> >> >>
> >> >> Thanks for reply.
> >> >>
> >> >> Anirudha
> >> >>
> >> >> On Mon, Aug 13, 2012 at 3:48 PM, Don Burn wrote:
> >> >>
> >> >> > So instead of a PCI filter driver, create a driver that uses
> >> >> > IoRegisterPlugPlayNotification to open the storage drivers, then use
> >> >> > IRP_MN_READ_CONFIG to get the registers. You are making this way too
> >> >> hard
> >> >> > for what you need.
> >> >> >
> >> >> >
> >> >> >
> >> >> > Don Burn
> >> >> > Windows Filesystem and Driver Consulting
> >> >> > Website: http://www.windrvr.com
> >> >> > Blog: http://msmvps.com/blogs/WinDrvr
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > “Anirudha Kumar” wrote in message
> >> >> news:xxxxx@ntdev
> >> >> > :
> >> >> >
> >> >> >
> >> >> > Ok. Let me explain again what I’m trying to do.
> >> >> >>
> >> >> >> HBA memory registers have Capabilities like the sata mode supported
> >> >> >> (SATAII, SATAIII), and other properties. I need to check whether the
> >> >> disks
> >> >> >> in a system are connected to the SATA III ports or not, in case they
> >> >> are
> >> >> >> available. So I need to check if there is any storage controller in
> >> the
> >> >> >> system which has SATAIII capability.
> >> >> >>
> >> >> >> Anirudha
> >> >> >>
> >> >> >> On Sat, Aug 11, 2012 at 8:10 PM, Don Burn wrote:
> >> >> >>
> >> >> >> > Let’s try one last time, what are you really trying to do? You
> >> are
> >> >> >> > proposing a solution that will crash a lot of platforms, by
> >> reading
> >> >> the
> >> >> >> PCI
> >> >> >> > config space registers. Trying zero in on the problem you are
> >> really
> >> >> >> > trying to solve you mentioned getting access to the HBA registers,
> >> >> but
> >> >> >> what
> >> >> >> > are you going to do with those? Even accessing them can cause
> >> >> >> problems, so
> >> >> >> > WHAT PROBLEM ARE YOU TRYING TO SOLVE???
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > Don Burn
> >> >> >> > Windows Filesystem and Driver Consulting
> >> >> >> > Website: http://www.windrvr.com
> >> >> >> > Blog: http://msmvps.com/blogs/WinDrvr
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > —
> >> >> >> > 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
> >> >> >
> >> >>
> >> >
> >> >
> >> > —
> >> > 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
> >

I wrote a driver which uses IoGetDevicePointer with the device name of the
storage controller to get its device object. Then sends a QUERY_INTERFACE
to this device object. I get STATUS_NOT_SUPPORTED as the response.
According to you controller driver should pass this request to the bus
driver in case it doesn’t handles it but that’s not what’s happening here.

Can you give sort of a pseudo code or steps involved in the approach you
are suggesting?

Anirudha

On Mon, Aug 13, 2012 at 5:55 PM, Don Burn wrote:

> Of course there is, this is a driver stack. When you send a request to a
> device it either services it, or sends it to the lower device and the
> lowest device is the bus driver!
>
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> “Anirudha Kumar” wrote in message news:xxxxx@ntdev
> :
>
>
> How will I query the Bus driver? That is the whole question. There’s no
>> way
>> to communicate with the bus driver from another driver.
>>
>> Anirudha
>>
>> On Mon, Aug 13, 2012 at 5:43 PM, Don Burn wrote:
>>
>> > Query interface is optional, but if you don’t handle it you should pass
>> it
>> > to the lower driver. You are querying the bus driver, and that needs
>> to go
>> > through there are upper layers that assume they can get that data (think
>> > device manager for one).
>> >
>> >
>> >
>> > Don Burn
>> > Windows Filesystem and Driver Consulting
>> > Website: http://www.windrvr.com
>> > Blog: http://msmvps.com/blogs/WinDrvr
>> >
>> >
>> >
>> >
>> > “Anirudha Kumar” wrote in message
>> news:xxxxx@ntdev
>> > :
>> >
>> >
>> > But AFAIK, handling of QUERY_INTERFACE is optional for functional
>> drivers.
>> >> So, it cannot be guaranteed that you can get the bus interface of any
>> >> storage controller. For eg, Intel storage driver that comes with newer
>> >> chipsets don’t support this request. If I cannot get the bus interface
>> I
>> >> cant send Read_Config either.
>> >>
>> >> The thing is, main requirement for using READ_CONFIG is that you need a
>> >> bus
>> >> device object and PCI bus gives no name to the bus device that it
>> creates.
>> >> Also, the controllers on that bus are not mandated to handle
>> >> QUERY_INTERFACE. So, there is no way left to get the bus device
>> interface
>> >> or object.
>> >>
>> >>
>> >>
>> >> On Mon, Aug 13, 2012 at 5:12 PM, Don Burn wrote:
>> >>
>> >> > Well http://www.hollistech.com/ under resources has a good paper on
>> >> using
>> >> > IRP_MN_READ_CONFIG. There is a Hard Disk Controller device interface
>> >> GUID
>> >> > which you can use to find the devices.
>> >> >
>> >> >
>> >> >
>> >> > Don Burn
>> >> > Windows Filesystem and Driver Consulting
>> >> > Website: http://www.windrvr.com
>> >> > Blog: http://msmvps.com/blogs/WinDrvr
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > “Anirudha Kumar” wrote in message
>> >> news:xxxxx@ntdev
>> >> > :
>> >> >
>> >> >
>> >> > Thanks for info Don Burn.
>> >> >>
>> >> >> I’ll start looking in to this. Can you point me to some sample code
>> or
>> >> >> documentation?
>> >> >>
>> >> >> Thanks for reply.
>> >> >>
>> >> >> Anirudha
>> >> >>
>> >> >> On Mon, Aug 13, 2012 at 3:48 PM, Don Burn wrote:
>> >> >>
>> >> >> > So instead of a PCI filter driver, create a driver that uses
>> >> >> > IoRegisterPlugPlayNotification to open the storage drivers, then
>> use
>> >> >> > IRP_MN_READ_CONFIG to get the registers. You are making this way
>> too
>> >> >> hard
>> >> >> > for what you need.
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > Don Burn
>> >> >> > Windows Filesystem and Driver Consulting
>> >> >> > Website: http://www.windrvr.com
>> >> >> > Blog: http://msmvps.com/blogs/WinDrvr
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > “Anirudha Kumar” wrote in message
>> >> >> news:xxxxx@ntdev
>> >> >> > :
>> >> >> >
>> >> >> >
>> >> >> > Ok. Let me explain again what I’m trying to do.
>> >> >> >>
>> >> >> >> HBA memory registers have Capabilities like the sata mode
>> supported
>> >> >> >> (SATAII, SATAIII), and other properties. I need to check whether
>> the
>> >> >> disks
>> >> >> >> in a system are connected to the SATA III ports or not, in case
>> they
>> >> >> are
>> >> >> >> available. So I need to check if there is any storage controller
>> in
>> >> the
>> >> >> >> system which has SATAIII capability.
>> >> >> >>
>> >> >> >> Anirudha
>> >> >> >>
>> >> >> >> On Sat, Aug 11, 2012 at 8:10 PM, Don Burn
>> wrote:
>> >> >> >>
>> >> >> >> > Let’s try one last time, what are you really trying to do? You
>> >> are
>> >> >> >> > proposing a solution that will crash a lot of platforms, by
>> >> reading
>> >> >> the
>> >> >> >> PCI
>> >> >> >> > config space registers. Trying zero in on the problem you are
>> >> really
>> >> >> >> > trying to solve you mentioned getting access to the HBA
>> registers,
>> >> >> but
>> >> >> >> what
>> >> >> >> > are you going to do with those? Even accessing them can cause
>> >> >> >> problems, so
>> >> >> >> > WHAT PROBLEM ARE YOU TRYING TO SOLVE???
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > Don Burn
>> >> >> >> > Windows Filesystem and Driver Consulting
>> >> >> >> > Website: http://www.windrvr.com
>> >> >> >> > Blog: http://msmvps.com/blogs/WinDrvr
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > —
>> >> >> >> > 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
>> >> >> >
>> >> >>
>> >> >
>> >> >
>> >> > —
>> >> > 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
>> >
>>
>
>
> —
> 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
>

On 13-Aug-2012 15:37, Anirudha Kumar wrote:

I wrote a driver which uses IoGetDevicePointer with the device name of
the storage controller to get its device object. Then sends a
QUERY_INTERFACE to this device object. I get STATUS_NOT_SUPPORTED as the
response.

Many WDM function drivers simply
fail any PnP IRP outside of the bare minimum that they must handle.
Because, their designers believed that whoever needs to reach to
the bus beneath, can make a lower filter.
So is there any solution for you? Maybe, but it probably will involve
some dirty hackery which patrons of this list don’t like to touch.

All hardware belongs to one of three sorts: Designed
for Windows: just works as Microsoft intended; Compatible with Windows:
works thru some reasonable hackery, and Everything Else. Your device
just is not the 1st sort…

– pa

Once you open the stack, send a query device relations / target device relation to get the pdo. Once you have the pdo, send the query interface directly to it, bypassing the fdo. You should only do this if the fdo does not fwd query interfaces down the stack (which is a wdm rule/driver verifier rule violation)

d

debt from my phone


From: Pavel A
Sent: 8/13/2012 7:49 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Installing PCI filter driver without reboot.

On 13-Aug-2012 15:37, Anirudha Kumar wrote:

I wrote a driver which uses IoGetDevicePointer with the device name of
the storage controller to get its device object. Then sends a
QUERY_INTERFACE to this device object. I get STATUS_NOT_SUPPORTED as the
response.

Many WDM function drivers simply
fail any PnP IRP outside of the bare minimum that they must handle.
Because, their designers believed that whoever needs to reach to
the bus beneath, can make a lower filter.
So is there any solution for you? Maybe, but it probably will involve
some dirty hackery which patrons of this list don’t like to touch.

All hardware belongs to one of three sorts: Designed
for Windows: just works as Microsoft intended; Compatible with Windows:
works thru some reasonable hackery, and Everything Else. Your device
just is not the 1st sort…

– pa


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

The driver will probably fail QDR, exactly like it failed QI…
–pa

On 13-Aug-2012 18:40, Doron Holan wrote:

Once you open the stack, send a query device relations / target device
relation to get the pdo. Once you have the pdo, send the query interface
directly to it, bypassing the fdo. You should only do this if the fdo
does not fwd query interfaces down the stack (which is a wdm rule/driver
verifier rule violation)

d

debt from my phone

Pavel A wrote:

Many WDM function drivers simply
fail any PnP IRP outside of the bare minimum that they must handle.

Such a driver will fail both WHQL and the Driver Verifier.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

You can’t fail QDR/TargetDeviceRelations, otherwise you couldn’t open a handle IIRC

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Pavel A
Sent: Monday, August 13, 2012 10:27 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Installing PCI filter driver without reboot.

The driver will probably fail QDR, exactly like it failed QI…
–pa

On 13-Aug-2012 18:40, Doron Holan wrote:

Once you open the stack, send a query device relations / target device
relation to get the pdo. Once you have the pdo, send the query
interface directly to it, bypassing the fdo. You should only do this
if the fdo does not fwd query interfaces down the stack (which is a
wdm rule/driver verifier rule violation)

d

debt from my phone


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

I tried the Query Interface approach. Following is the result:

Device stack from device tree utility looks like this:

FDO - \Driver\PCI
PDO - \Device\NTPNP_PCI0009
[PCI\VEN_xxxx&DEV_xxxx&SUBSYS_xxxxxxxx&REV_xx] <------ AHCI Controller
Device ID
FDO - \Device\00000048
FDO - \Device\Ide\iaStor0

In my driver I’m sending calling IoGetDevicePointer with
“NTPNP_PCI0009” as device name and sending IRP_MN_QUERY_INTERFACE to
the device pointer received. Following is the IRP tracker log:

Call 0x8891DE70-64 (UNKNOWN) \Device\Ide\iaStor0 PNP QUERY_INTERFACE
Call 0x8891DE70-64 \Device\Ide\iaStor0 \Device\00000049 PNP QUERY_INTERFACE
Call 0x8891DE70-64 \Device\00000049 \Device\NTPNP_PCI0009 PNP QUERY_INTERFACE
Comp 0x8891DE70-64 \Device\NTPNP_PCI0009 PNP QUERY_INTERFACE NOT_SUPPORTED,
Info = 0x0

From my understanding, for the AHCI Controller devnode, the PDO
“\Device\NTPNP_PCI0009” has been created by pci.sys (standard pci
driver) during enumeration and FDO “\Device\Ide\iaStor0” has been
created by the iaStor.sys (Intel storport driver). My IRP goes to this
devnode and is completed by PDO created by pci.sys with
STATUS_NOT_SUPPORTED. But when I install an upper filter driver in PCI
devnode and send the same IRP to this filter driver, I observe the
following:

Device stack from device tree utility looks like this:

FDO - \Driver\PCI
FDO - \Device\MyPciFilter

IRP tracker log looks like this:

Call 0x88867A38-712 (UNKNOWN) \Device\PhyMemPCIFilter PNP QUERY_INTERFACE
Call 0x88867A38-712 \Device\PhyMemPCIFilter (0x8B0F8A90)
PCI PNP QUERY_INTERFACE
Call 0x88867A38-712 (0x8B0F8A90)
PCI \Device\0000003d PNP QUERY_INTERFACE
Comp 0x88867A38-712 \Device\0000003d PNP QUERY_INTERFACE SUCCESS,
Info = 0x0
CompRoutine 0x88867A38-712 (0x8B0F8A90)
PCI PNP QUERY_INTERFACE MORE_PROCESSING_REQUIRED
Comp 0x88867A38-712 (0x8B0F8A90)
PCI PNP QUERY_INTERFACE SUCCESS, Info = 0x0

So, the same driver behaves one way when the request reaches a PDO
created by it and differently when the same request reaches the FDO
created by it? Is it because the PDO and the FDO belong to different
devnode?

@Doron
Given the above configuration, will the approach suggested by you
(QUERY_DEVICE_RELATIONS) work???

Anirudha

On Mon, Aug 13, 2012 at 11:44 PM, Doron Holan wrote:
>
> You can’t fail QDR/TargetDeviceRelations, otherwise you couldn’t open a handle IIRC
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Pavel A
> Sent: Monday, August 13, 2012 10:27 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Installing PCI filter driver without reboot.
>
> The driver will probably fail QDR, exactly like it failed QI…
> --pa
>
> On 13-Aug-2012 18:40, Doron Holan wrote:
> > Once you open the stack, send a query device relations / target device
> > relation to get the pdo. Once you have the pdo, send the query
> > interface directly to it, bypassing the fdo. You should only do this
> > if the fdo does not fwd query interfaces down the stack (which is a
> > wdm rule/driver verifier rule violation)
> >
> > d
> >
> > debt from my phone
>
>
> —
> 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

It isn’t really hackery, it is a pci bus filter driver, but the OP
wants to be able to access pci space without rebooting the system, so
the op has painted himself into a corner of conflicting requirements.
The op needs to take the advice upthread to allow the reboot. Also I
am not convinced that the information he wants is not available
through wmi or through defined AHCI requests.

Mark Roddy

On Mon, Aug 13, 2012 at 10:45 AM, Pavel A wrote:
> On 13-Aug-2012 15:37, Anirudha Kumar wrote:
>>
>> I wrote a driver which uses IoGetDevicePointer with the device name of
>> the storage controller to get its device object. Then sends a
>> QUERY_INTERFACE to this device object. I get STATUS_NOT_SUPPORTED as the
>> response.
>
>
> Many WDM function drivers simply
> fail any PnP IRP outside of the bare minimum that they must handle.
> Because, their designers believed that whoever needs to reach to
> the bus beneath, can make a lower filter.
> So is there any solution for you? Maybe, but it probably will involve some
> dirty hackery which patrons of this list don’t like to touch.
>
> All hardware belongs to one of three sorts: Designed for
> Windows: just works as Microsoft intended; Compatible with Windows: works
> thru some reasonable hackery, and Everything Else. Your device just is not
> the 1st sort…
>
> – pa
>
>
> —
> 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

Well, I’m pretty sure the information i need is not there in WMI. There is
no point in digging into that again. And what do you mean by “defined AHCI
requests”???
On Tue, Aug 14, 2012 at 6:35 PM, Mark Roddy wrote:

> It isn’t really hackery, it is a pci bus filter driver, but the OP
> wants to be able to access pci space without rebooting the system, so
> the op has painted himself into a corner of conflicting requirements.
> The op needs to take the advice upthread to allow the reboot. Also I
> am not convinced that the information he wants is not available
> through wmi or through defined AHCI requests.
>
> Mark Roddy
>
>
> On Mon, Aug 13, 2012 at 10:45 AM, Pavel A wrote:
> > On 13-Aug-2012 15:37, Anirudha Kumar wrote:
> >>
> >> I wrote a driver which uses IoGetDevicePointer with the device name of
> >> the storage controller to get its device object. Then sends a
> >> QUERY_INTERFACE to this device object. I get STATUS_NOT_SUPPORTED as the
> >> response.
> >
> >
> > Many WDM function drivers simply
> > fail any PnP IRP outside of the bare minimum that they must handle.
> > Because, their designers believed that whoever needs to reach to
> > the bus beneath, can make a lower filter.
> > So is there any solution for you? Maybe, but it probably will involve
> some
> > dirty hackery which patrons of this list don’t like to touch.
> >
> > All hardware belongs to one of three sorts: Designed for
> > Windows: just works as Microsoft intended; Compatible with Windows: works
> > thru some reasonable hackery, and Everything Else. Your device just is
> not
> > the 1st sort…
> >
> > – pa
> >
> >
> > —
> > 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
>

IoGetDevicePointer() opens the top device in the stack. In your case
(without a filter) it is the iastor0 device.
So the iastor driver either rejected QI or something sits between it and
pci.sys that device tree does not show?
( iaStor0 is \Device\00000048 but the IRP log shows \Device\00000049. Is
this a typo?)

– pa

“Anirudha Kumar” <> wrote in message news:xxxxx@ntdev…

I tried the Query Interface approach. Following is the result:

Device stack from device tree utility looks like this:

FDO - \Driver\PCI
PDO - \Device\NTPNP_PCI0009
[PCI\VEN_xxxx&DEV_xxxx&SUBSYS_xxxxxxxx&REV_xx] <------ AHCI Controller
Device ID
FDO - \Device\00000048
FDO - \Device\Ide\iaStor0

In my driver I’m sending calling IoGetDevicePointer with
“NTPNP_PCI0009” as device name and sending IRP_MN_QUERY_INTERFACE to
the device pointer received. Following is the IRP tracker log:

Call 0x8891DE70-64 (UNKNOWN) \Device\Ide\iaStor0 PNP QUERY_INTERFACE
Call 0x8891DE70-64 \Device\Ide\iaStor0 \Device\00000049 PNP
QUERY_INTERFACE
Call 0x8891DE70-64 \Device\00000049 \Device\NTPNP_PCI0009 PNP
QUERY_INTERFACE
Comp 0x8891DE70-64 \Device\NTPNP_PCI0009 PNP QUERY_INTERFACE
NOT_SUPPORTED,
Info = 0x0

From my understanding, for the AHCI Controller devnode, the PDO
“\Device\NTPNP_PCI0009” has been created by pci.sys (standard pci
driver) during enumeration and FDO “\Device\Ide\iaStor0” has been
created by the iaStor.sys (Intel storport driver). My IRP goes to this
devnode and is completed by PDO created by pci.sys with
STATUS_NOT_SUPPORTED. But when I install an upper filter driver in PCI
devnode and send the same IRP to this filter driver, I observe the
following:

Device stack from device tree utility looks like this:

FDO - \Driver\PCI
FDO - \Device\MyPciFilter

IRP tracker log looks like this:

Call 0x88867A38-712 (UNKNOWN) \Device\PhyMemPCIFilter PNP
QUERY_INTERFACE
Call 0x88867A38-712 \Device\PhyMemPCIFilter (0x8B0F8A90)
PCI PNP QUERY_INTERFACE
Call 0x88867A38-712 (0x8B0F8A90)
PCI \Device\0000003d PNP QUERY_INTERFACE
Comp 0x88867A38-712 \Device\0000003d PNP QUERY_INTERFACE SUCCESS,
Info = 0x0
CompRoutine 0x88867A38-712 (0x8B0F8A90)
PCI PNP QUERY_INTERFACE MORE_PROCESSING_REQUIRED
Comp 0x88867A38-712 (0x8B0F8A90)
PCI PNP QUERY_INTERFACE SUCCESS, Info = 0x0

So, the same driver behaves one way when the request reaches a PDO
created by it and differently when the same request reaches the FDO
created by it? Is it because the PDO and the FDO belong to different
devnode?

@Doron
Given the above configuration, will the approach suggested by you
(QUERY_DEVICE_RELATIONS) work???

Anirudha

On Mon, Aug 13, 2012 at 11:44 PM, Doron Holan <> wrote:
>
> You can’t fail QDR/TargetDeviceRelations, otherwise you couldn’t open a
> handle IIRC
>
> d
>
> -----Original Message-----
> From: Pavel A
> Sent: Monday, August 13, 2012 10:27 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Installing PCI filter driver without reboot.
>
> The driver will probably fail QDR, exactly like it failed QI…
> --pa
>
> On 13-Aug-2012 18:40, Doron Holan wrote:
> > Once you open the stack, send a query device relations / target device
> > relation to get the pdo. Once you have the pdo, send the query
> > interface directly to it, bypassing the fdo. You should only do this
> > if the fdo does not fwd query interfaces down the stack (which is a
> > wdm rule/driver verifier rule violation)
> >
> > d
> >
> > debt from my phone

Hi Pavel,

Its a typo (sorry about that). The PDO \Device\NTPNP_PCI0009 must have
been created by the pci.sys driver, right??? So iaStor must be passing
it down to \Device\NTPNP_PCI0009 which will be handled by pci.sys. IRP
tracker shows the request has been handled by \Device\NTPNP_PCI0009
meaning pci.sys (Am i right???). So, pci.sys is rejecting the QI
request when handling it for PDO \Device\NTPNP_PCI0009. Is my
understanding correct???

Anirudha

On Wed, Aug 15, 2012 at 2:00 AM, Pavel A. wrote:
> IoGetDevicePointer() opens the top device in the stack. In your case
> (without a filter) it is the iastor0 device.
> So the iastor driver either rejected QI or something sits between it and
> pci.sys that device tree does not show?
> ( iaStor0 is \Device\00000048 but the IRP log shows \Device\00000049. Is
> this a typo?)
>
> – pa
>
> “Anirudha Kumar” <> wrote in message news:xxxxx@ntdev…
>>
>> I tried the Query Interface approach. Following is the result:
>>
>> Device stack from device tree utility looks like this:
>>
>> FDO - \Driver\PCI
>> PDO - \Device\NTPNP_PCI0009
>> [PCI\VEN_xxxx&DEV_xxxx&SUBSYS_xxxxxxxx&REV_xx] <------ AHCI Controller
>> Device ID
>> FDO - \Device\00000048
>> FDO - \Device\Ide\iaStor0
>>
>> In my driver I’m sending calling IoGetDevicePointer with
>> “NTPNP_PCI0009” as device name and sending IRP_MN_QUERY_INTERFACE to
>> the device pointer received. Following is the IRP tracker log:
>>
>> Call 0x8891DE70-64 (UNKNOWN) \Device\Ide\iaStor0 PNP QUERY_INTERFACE
>> Call 0x8891DE70-64 \Device\Ide\iaStor0 \Device\00000049 PNP
>> QUERY_INTERFACE
>> Call 0x8891DE70-64 \Device\00000049 \Device\NTPNP_PCI0009 PNP
>> QUERY_INTERFACE
>> Comp 0x8891DE70-64 \Device\NTPNP_PCI0009 PNP QUERY_INTERFACE
>> NOT_SUPPORTED,
>> Info = 0x0
>>
>> From my understanding, for the AHCI Controller devnode, the PDO
>> “\Device\NTPNP_PCI0009” has been created by pci.sys (standard pci
>> driver) during enumeration and FDO “\Device\Ide\iaStor0” has been
>> created by the iaStor.sys (Intel storport driver). My IRP goes to this
>> devnode and is completed by PDO created by pci.sys with
>> STATUS_NOT_SUPPORTED. But when I install an upper filter driver in PCI
>> devnode and send the same IRP to this filter driver, I observe the
>> following:
>>
>> Device stack from device tree utility looks like this:
>>
>> FDO - \Driver\PCI
>> FDO - \Device\MyPciFilter
>>
>> IRP tracker log looks like this:
>>
>> Call 0x88867A38-712 (UNKNOWN) \Device\PhyMemPCIFilter PNP
>> QUERY_INTERFACE
>> Call 0x88867A38-712 \Device\PhyMemPCIFilter (0x8B0F8A90)
>> PCI PNP QUERY_INTERFACE
>> Call 0x88867A38-712 (0x8B0F8A90)
>> PCI \Device\0000003d PNP QUERY_INTERFACE
>> Comp 0x88867A38-712 \Device\0000003d PNP QUERY_INTERFACE SUCCESS,
>> Info = 0x0
>> CompRoutine 0x88867A38-712 (0x8B0F8A90)
>> PCI PNP QUERY_INTERFACE MORE_PROCESSING_REQUIRED
>> Comp 0x88867A38-712 (0x8B0F8A90)
>> PCI PNP QUERY_INTERFACE SUCCESS, Info = 0x0
>>
>>
>> So, the same driver behaves one way when the request reaches a PDO
>> created by it and differently when the same request reaches the FDO
>> created by it? Is it because the PDO and the FDO belong to different
>> devnode?
>>
>> @Doron
>> Given the above configuration, will the approach suggested by you
>> (QUERY_DEVICE_RELATIONS) work???
>>
>>
>> Anirudha
>>
>>
>>
>> On Mon, Aug 13, 2012 at 11:44 PM, Doron Holan <> wrote:
>>>
>>>
>>> You can’t fail QDR/TargetDeviceRelations, otherwise you couldn’t open a
>>> handle IIRC
>>>
>>> d
>>>
>>> -----Original Message-----
>>> From: Pavel A
>>> Sent: Monday, August 13, 2012 10:27 AM
>>> To: Windows System Software Devs Interest List
>>> Subject: Re:[ntdev] Installing PCI filter driver without reboot.
>>>
>>> The driver will probably fail QDR, exactly like it failed QI…
>>> --pa
>>>
>>> On 13-Aug-2012 18:40, Doron Holan wrote:
>>> > Once you open the stack, send a query device relations / target device
>>> > relation to get the pdo. Once you have the pdo, send the query
>>> > interface directly to it, bypassing the fdo. You should only do this
>>> > if the fdo does not fwd query interfaces down the stack (which is a
>>> > wdm rule/driver verifier rule violation)
>>> >
>>> > d
>>> >
>>> > debt from my phone
>>
>>
>
> —
> 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