Skip to content

Latest commit

 

History

History
149 lines (108 loc) · 4.78 KB

nf-wdffdo-wdffdoqueryforinterface.md

File metadata and controls

149 lines (108 loc) · 4.78 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:wdffdo.WdfFdoQueryForInterface
WdfFdoQueryForInterface function (wdffdo.h)
The WdfFdoQueryForInterface method obtains access to another driver's GUID-identified interface.
wdf\wdffdoqueryforinterface.htm
wdf
02/26/2018
WdfFdoQueryForInterface function
DFDeviceObjectFdoPdoRef_949fcc50-3604-4970-9516-666da06e3c9e.xml, WdfFdoQueryForInterface, WdfFdoQueryForInterface method, kmdf.wdffdoqueryforinterface, wdf.wdffdoqueryforinterface, wdffdo/WdfFdoQueryForInterface
wdffdo.h
Wdf.h
Universal
1.0
DriverCreate, KmdfIrql, KmdfIrql2
Wdf01000.sys (see Framework Library Versioning.)
PASSIVE_LEVEL
Windows
WdfFdoQueryForInterface
wdffdo/WdfFdoQueryForInterface
APIRef
kbSyntax
LibDef
Wdf01000.sys
Wdf01000.sys.dll
WdfFdoQueryForInterface

WdfFdoQueryForInterface function

-description

[Applies to KMDF only]

The WdfFdoQueryForInterface method obtains access to another driver's GUID-identified interface.

-parameters

-param Fdo [in]

A handle to a framework device object.

-param InterfaceType [in]

A pointer to a GUID that identifies the interface.

-param Interface [out]

A pointer to a driver-allocated structure that receives the requested interface. This structure is defined by the driver that exports the requested interface and must begin with an INTERFACE structure.

-param Size [in]

The size, in bytes, of the driver-allocated structure that represents the requested interface.

-param Version [in]

The version number of the requested interface. The format of this value is defined by the driver that exports the requested interface.

-param InterfaceSpecificData [in, optional]

Additional interface-specific information. This parameter is optional and can be NULL.

-returns

If the operation succeeds, the method returns STATUS_SUCCESS. Additional return values include:

Return code Description
STATUS_INVALID_PARAMETER
The device object is invalid or if the Device, InterfaceType, or Interface parameter is NULL.
STATUS_INSUFFICIENT_RESOURCES
The framework could not allocate a request to send to another driver.
 

The method might also return other NTSTATUS values.

A system bug check occurs if the driver supplies an invalid object handle.

-remarks

Your driver can call WdfFdoQueryForInterface to obtain access to a driver-defined interface that was created by a driver that is in the same driver stack that your driver is in. To access a driver-defined interface that was created by a driver that is in a different driver stack, your driver must call WdfIoTargetQueryForInterface.

Framework-based drivers define interfaces by calling WdfDeviceAddQueryInterface.

For more information about WdfFdoQueryForInterface, see Using Driver-Defined Interfaces.

Examples

The following code example is from the Toaster sample function driver. This example obtains access to an interface that the toaster sample bus driver defines.

status = WdfFdoQueryForInterface(
                                 Device,
                                 &GUID_TOASTER_INTERFACE_STANDARD,
                                 (PINTERFACE) &fdoData->BusInterface, // Object context space
                                 sizeof(TOASTER_INTERFACE_STANDARD),
                                 1,
                                 NULL
                                 );

-see-also

WdfIoTargetQueryForInterface