Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219/*++
Copyright (c) Microsoft Corporation. All rights reserved.
_WdfVersionBuild_
Module Name:
WdfQueryInterface.h
Abstract:
This file contains the DDIs for handling query interface
Environment:
kernel mode only
Revision History:
--*/
//// NOTE: This header is generated by stubwork. Please make any// modifications to the corresponding template files// (.x or .y) and use stubwork to regenerate the header//
#ifndef _WDFQUERYINTERFACE_H_#define _WDFQUERYINTERFACE_H_
#ifndef WDF_EXTERN_C #ifdef __cplusplus #define WDF_EXTERN_C extern "C" #define WDF_EXTERN_C_START extern "C" { #define WDF_EXTERN_C_END } #else #define WDF_EXTERN_C #define WDF_EXTERN_C_START #define WDF_EXTERN_C_END #endif#endif
WDF_EXTERN_C_START
#if (NTDDI_VERSION >= NTDDI_WIN2K)
typedef_Function_class_(EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST)_IRQL_requires_same__IRQL_requires_max_(PASSIVE_LEVEL)NTSTATUSSTDCALLEVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST( _In_ WDFDEVICE Device, _In_ LPGUID InterfaceType, _Inout_ PINTERFACE ExposedInterface, _Inout_opt_ PVOID ExposedInterfaceSpecificData );
typedef EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST *PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST;
typedef struct _WDF_QUERY_INTERFACE_CONFIG { // // Size of this structure in bytes. // ULONG Size;
// // Interface to be returned to the caller. Optional if BehaviorType is set // to WdfQueryInterfaceTypePassThrough or ImportInterface is set to TRUE. // PINTERFACE Interface;
// // The GUID identifying the interface // CONST GUID * InterfaceType;
// // Valid only for PDOs. The framework will allocate a new request and // forward it down the parent's device stack. // BOOLEAN SendQueryToParentStack;
// // Driver supplied callback which is called after some basic interface // validation has been performed (size, version, and guid checking). This // is an optional parameter and may be NULL unless ImportInterface is // specified. // // If the callback returns !NT_SUCCESS, this error will be returned to the // caller and the query interface will fail. // // In this callback, the caller is free to modify the ExposedInterface in // any manner of its choosing. For instance, the callback may change any // field in the interface. The callback may also alloate a dynamic context // to be associated with the interface; the InterfaceReference and // InterfaceDereference functions may also be overridden. // // If ImportInterface is set to TRUE, then this is a required field and the // callback must initialize the interface (the framework will leave the // ExposedInterface buffer exactly as it received it) since the framework // has no way of knowing which fields to fill in and which to leave alone. // PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST EvtDeviceProcessQueryInterfaceRequest;
// // If TRUE, the interface provided by the caller contains data that the // driver is interested in. By setting to this field to TRUE, the // EvtDeviceProcessQueryInterfaceRequest callback must initialize the // ExposedInterface. // // If FALSE, the entire ExposedInterface is initialized through a memory // copy before the EvtDeviceProcessQueryInterfaceRequest is called. // BOOLEAN ImportInterface;
} WDF_QUERY_INTERFACE_CONFIG, *PWDF_QUERY_INTERFACE_CONFIG;
FORCEINLINEVOIDWDF_QUERY_INTERFACE_CONFIG_INIT( _Out_ PWDF_QUERY_INTERFACE_CONFIG InterfaceConfig, _In_opt_ PINTERFACE Interface, _In_ CONST GUID* InterfaceType, _In_opt_ PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST EvtDeviceProcessQueryInterfaceRequest ){ RtlZeroMemory(InterfaceConfig, sizeof(WDF_QUERY_INTERFACE_CONFIG));
InterfaceConfig->Size = sizeof(WDF_QUERY_INTERFACE_CONFIG); InterfaceConfig->Interface = Interface; InterfaceConfig->InterfaceType = InterfaceType; InterfaceConfig->EvtDeviceProcessQueryInterfaceRequest = EvtDeviceProcessQueryInterfaceRequest;}
//// WDF Function: WdfDeviceAddQueryInterface//typedef_Must_inspect_result__IRQL_requires_max_(PASSIVE_LEVEL)WDFAPINTSTATUS(STDCALL *PFN_WDFDEVICEADDQUERYINTERFACE)( _In_ PWDF_DRIVER_GLOBALS DriverGlobals, _In_ WDFDEVICE Device, _In_ PWDF_QUERY_INTERFACE_CONFIG InterfaceConfig );
_Must_inspect_result__IRQL_requires_max_(PASSIVE_LEVEL)FORCEINLINENTSTATUSWdfDeviceAddQueryInterface( _In_ WDFDEVICE Device, _In_ PWDF_QUERY_INTERFACE_CONFIG InterfaceConfig ){ return ((PFN_WDFDEVICEADDQUERYINTERFACE) WdfFunctions[WdfDeviceAddQueryInterfaceTableIndex])(WdfDriverGlobals, Device, InterfaceConfig);}
//// The following functions can be assigned to INTERFACE::InterfaceReference// and INTERFACE::InterfaceDeference//// o WdfDeviceInterfaceReferenceNoOp// o WdfDeviceInterfaceDereferenceNoOp//// Thes 2 functions do nothing when called. These are appropriate for// interfaces which can be queried for and used independent of the PNP state of// the WDFDEVICE the interface was retrieved from.//FORCEINLINEVOIDNTAPIWdfDeviceInterfaceReferenceNoOp( _In_ PVOID Context ){ UNREFERENCED_PARAMETER(Context);}
FORCEINLINEVOIDNTAPIWdfDeviceInterfaceDereferenceNoOp( _In_ PVOID Context ){ UNREFERENCED_PARAMETER(Context);}
#endif // (NTDDI_VERSION >= NTDDI_WIN2K)
WDF_EXTERN_C_END
#endif // _WDFQUERYINTERFACE_H_