[Applies to KMDF only]
The WdfFdoQueryForInterface method obtains access to another driver's GUID-identified interface.
NTSTATUS WdfFdoQueryForInterface( _In_ WDFDEVICE Device, _In_ LPCGUID InterfaceType, _Out_ PINTERFACE Interface, _In_ USHORT Size, _In_ USHORT Version, _In_opt_ PVOID InterfaceSpecificData );
A pointer to a GUID that identifies the interface.
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.
The size, in bytes, of the driver-allocated structure that represents the requested interface.
The version number of the requested interface. The format of this value is defined by the driver that exports the requested interface.
Additional interface-specific information. This parameter is optional and can be NULL.
If the operation succeeds, the method returns STATUS_SUCCESS. Additional return values include:
||The device object is invalid or if the Device, InterfaceType, or Interface parameter is NULL.|
||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.
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.
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 );
|Minimum KMDF version||1.0|
|Header||wdffdo.h (include Wdf.h)|
|Library||Wdf01000.sys (see Framework Library Versioning.)|
|DDI compliance rules||DriverCreate, KmdfIrql, KmdfIrql2|