Is it possible to export just one function in interface from child and get rest from parent

Hi,

I have my child device driver wherein all functions that are part of
BUS_INTERFACE_STANDARD Query Interface same
as my parent device-driver except for the GetBusData function which needs
some extra code on top of parents
implementation.

Q#1: Is it possible to just define this fuction part of the interface
and let WDF framework get the rest from the parent
using SendQueryToParentStack; parameter… It doesnt seem to be
from DDK documentation. But want to verify it
one last time before rewriting the code.

Q#2: Or is it possible from parent device driver to figure out when it
receives QueryInterface request whether it was
originally intended for its child and got redirected because
the child specified “SendQueryToParentStack;” option?

This way I can define two different functions GetChildBusData an
GetParentBusData with the rest of the interface
functions same within my parent device and within my parent driver whether
the request was forwarded or not,
return the appropriate interface in my reply accordingly…

All this to save few lines of code :wink: provided there is a mechanism… Wud
like to make use of KMDF adv. as much as possible.

Pls let me know if this is not clear…

Thanks,
-Praveen

If you set SendQueryToParentStack in WDF_QUERY_INTERFACE_CONFIG, KMDF
will send the QI irp from the PDO down the parent’s stack. If you set
EvtDeviceProcessQueryInterfaceRequest, you will be called before the QI
irp is fwd’ed down the stack, allowing you to set the one field you
want. If you want the parent to also set fields, the parent WDFDEVICE
should also call WdfDeviceAddQueryInterface for the same interface GUID
and specify its own EvtDeviceProcessQueryInterfaceRequest to fill in the
rest of the structure.

OTOH, why not just fill in the entire interface in the child WDFDEVICE’s
EvtDeviceProcessQueryInterfaceRequest and forgo sending it down the
parent’s stack? You already know how the FDO is going to fill in the
remaining fields of the structure, so just do it in one place and do not
specify SendQueryToParentStack. If you need the parent WDFDEVICE’s PDO
to answer the QI, then the first suggestion is what you should do.

As for the parent’s EvtDeviceProcessQueryInterfaceRequest figuring out
if it was a fwd’ed request from the child or a request just sent to the
parent, I think you would be able to tell by looking at the field that
the child device sets. If != child function pointer, it didn’t come
from the child stack.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Praveen Kumar
Amritaluru
Sent: Monday, July 24, 2006 6:50 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Is it possible to export just one function in interface
from child and get rest from parent

Hi,

I have my child device driver wherein all functions that are part of
BUS_INTERFACE_STANDARD Query Interface same as my parent device-driver
except for the GetBusData function which needs some extra code on top of
parents implementation.

Q#1: Is it possible to just define this fuction part of the
interface
and let WDF framework get the rest from the parent
using SendQueryToParentStack; parameter… It doesnt seem
to be from DDK documentation. But want to verify it
one last time before rewriting the code.

Q#2: Or is it possible from parent device driver to figure out when
it
receives QueryInterface request whether it was
originally intended for its child and got redirected
because the child specified “SendQueryToParentStack;” option?

This way I can define two different functions GetChildBusData an
GetParentBusData with the rest of the interface
functions same within my parent device and within my parent driver
whether the request was forwarded or not,
return the appropriate interface in my reply accordingly…

All this to save few lines of code :wink: provided there is a mechanism…
Wud like to make use of KMDF adv. as much as possible.

Pls let me know if this is not clear…

Thanks,
-Praveen


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer