ReactOS  0.4.15-dev-1636-gf634010
wdfqueryinterface.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _WDF_QUERY_INTERFACE_CONFIG
 

Macros

#define WDF_EXTERN_C
 
#define WDF_EXTERN_C_START
 
#define WDF_EXTERN_C_END
 

Typedefs

typedef EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST * PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST
 
typedef struct _WDF_QUERY_INTERFACE_CONFIG WDF_QUERY_INTERFACE_CONFIG
 
typedef struct _WDF_QUERY_INTERFACE_CONFIGPWDF_QUERY_INTERFACE_CONFIG
 
typedef _Must_inspect_result_ _IRQL_requires_max_(PASSIVE_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFDEVICEADDQUERYINTERFACE) (_In_ PWDF_DRIVER_GLOBALS DriverGlobals
 
typedef _Must_inspect_result_ _In_ WDFDEVICE Device
 
typedef _Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_QUERY_INTERFACE_CONFIG InterfaceConfig
 

Functions

WDF_EXTERN_C_START typedef _Function_class_ (EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS STDCALL EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST(_In_ WDFDEVICE Device
 
FORCEINLINE VOID WDF_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)
 
_Must_inspect_result_ _IRQL_requires_max_ (PASSIVE_LEVEL) FORCEINLINE NTSTATUS WdfDeviceAddQueryInterface(_In_ WDFDEVICE Device
 
FORCEINLINE VOID WdfDeviceInterfaceReferenceNoOp (_In_ PVOID Context)
 
FORCEINLINE VOID WdfDeviceInterfaceDereferenceNoOp (_In_ PVOID Context)
 

Variables

WDF_EXTERN_C_START typedef _In_ LPGUID InterfaceType
 
WDF_EXTERN_C_START typedef _In_ LPGUID _Inout_ PINTERFACE ExposedInterface
 
WDF_EXTERN_C_START typedef _In_ LPGUID _Inout_ PINTERFACE _Inout_opt_ PVOID ExposedInterfaceSpecificData
 

Macro Definition Documentation

◆ WDF_EXTERN_C

#define WDF_EXTERN_C

Definition at line 38 of file wdfqueryinterface.h.

◆ WDF_EXTERN_C_END

#define WDF_EXTERN_C_END

Definition at line 40 of file wdfqueryinterface.h.

◆ WDF_EXTERN_C_START

#define WDF_EXTERN_C_START

Definition at line 39 of file wdfqueryinterface.h.

Typedef Documentation

◆ _IRQL_requires_max_

typedef _Must_inspect_result_ _IRQL_requires_max_(PASSIVE_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFDEVICEADDQUERYINTERFACE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals

Definition at line 152 of file wdfqueryinterface.h.

◆ Device

typedef _Must_inspect_result_ _In_ WDFDEVICE Device

Definition at line 159 of file wdfqueryinterface.h.

◆ InterfaceConfig

Initial value:
{
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_QUERY_INTERFACE_CONFIG InterfaceConfig
#define WdfFunctions
Definition: wdf.h:66
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ _In_ WDFDEVICE Device

Definition at line 159 of file wdfqueryinterface.h.

◆ PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST

typedef EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST* PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST

Definition at line 69 of file wdfqueryinterface.h.

◆ PWDF_QUERY_INTERFACE_CONFIG

◆ WDF_QUERY_INTERFACE_CONFIG

Function Documentation

◆ _Function_class_()

WDF_EXTERN_C_START typedef _Function_class_ ( EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST  )

◆ _IRQL_requires_max_()

_Must_inspect_result_ _IRQL_requires_max_ ( PASSIVE_LEVEL  )

Definition at line 64 of file Messaging.c.

75 {
76  PFLT_SERVER_PORT_OBJECT PortObject;
78 
79  /* The caller must allow at least one connection */
80  if (MaxConnections == 0)
81  {
83  }
84 
85  /* The request must be for a kernel handle */
86  if (!(ObjectAttributes->Attributes & OBJ_KERNEL_HANDLE))
87  {
89  }
90 
91  /*
92  * Get rundown protection on the target to stop the owner
93  * from unloading whilst this port object is open. It gets
94  * removed in the FltpServerPortClose callback
95  */
97  if (!NT_SUCCESS(Status))
98  {
99  return Status;
100  }
101 
102  /* Create the server port object for this filter */
106  KernelMode,
107  NULL,
108  sizeof(FLT_SERVER_PORT_OBJECT),
109  0,
110  0,
111  (PVOID *)&PortObject);
112  if (NT_SUCCESS(Status))
113  {
114  /* Zero out the struct */
115  RtlZeroMemory(PortObject, sizeof(FLT_SERVER_PORT_OBJECT));
116 
117  /* Increment the ref count on the target filter */
119 
120  /* Setup the filter port object */
121  PortObject->Filter = Filter;
122  PortObject->ConnectNotify = ConnectNotifyCallback;
124  PortObject->MessageNotify = MessageNotifyCallback;
125  PortObject->Cookie = ServerPortCookie;
126  PortObject->MaxConnections = MaxConnections;
127 
128  /* Insert the object */
129  Status = ObInsertObject(PortObject,
130  NULL,
132  0,
133  NULL,
135  if (NT_SUCCESS(Status))
136  {
137  /* Lock the connection list */
139 
140  /* Add the new port object to the connection list and increment the count */
143 
144  /* Unlock the connection list*/
146  }
147  }
148 
149  if (!NT_SUCCESS(Status))
150  {
151  /* Allow the filter to be cleaned up */
153  }
154 
155  return Status;
156 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _Outptr_ PFLT_PORT * ServerPort
Definition: fltkernel.h:1873
PFLT_CONNECT_NOTIFY ConnectNotify
Definition: fltmgrint.h:191
VOID FLTAPI FltObjectDereference(_Inout_ PVOID Object)
Definition: Object.c:53
LONG NTSTATUS
Definition: precomp.h:26
#define InsertTailList(ListHead, Entry)
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
ULONG FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
Definition: Object.c:322
LIST_ENTRY mList
Definition: fltmgrint.h:56
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
#define FILE_READ_DATA
Definition: nt_native.h:628
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
Definition: oblife.c:952
Status
Definition: gdiplustypes.h:24
POBJECT_TYPE ServerPortObjectType
Definition: Messaging.c:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
Definition: fltkernel.h:1873
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
Definition: fltkernel.h:1873
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
Definition: obhandle.c:2932
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
NTSTATUS FLTAPI FltObjectReference(_Inout_ PVOID Object)
Definition: Object.c:41
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
Definition: fltkernel.h:1873
#define NULL
Definition: types.h:112
FAST_MUTEX mLock
Definition: fltmgrint.h:55
PFLT_MESSAGE_NOTIFY MessageNotify
Definition: fltmgrint.h:193
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY _In_ LONG MaxConnections
Definition: fltkernel.h:1873
PFLT_DISCONNECT_NOTIFY DisconnectNotify
Definition: fltmgrint.h:192
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback
Definition: fltkernel.h:1873
FLT_MUTEX_LIST_HEAD ConnectionList
Definition: fltmgrint.h:121

◆ WDF_QUERY_INTERFACE_CONFIG_INIT()

FORCEINLINE VOID WDF_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 
)

Definition at line 131 of file wdfqueryinterface.h.

137 {
139 
141  InterfaceConfig->Interface = Interface;
142  InterfaceConfig->InterfaceType = InterfaceType;
143  InterfaceConfig->EvtDeviceProcessQueryInterfaceRequest =
144  EvtDeviceProcessQueryInterfaceRequest;
145 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_QUERY_INTERFACE_CONFIG InterfaceConfig
struct _WDF_QUERY_INTERFACE_CONFIG WDF_QUERY_INTERFACE_CONFIG
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
WDF_EXTERN_C_START typedef _In_ LPGUID InterfaceType
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ WdfDeviceInterfaceDereferenceNoOp()

FORCEINLINE VOID WdfDeviceInterfaceDereferenceNoOp ( _In_ PVOID  Context)

Definition at line 202 of file wdfqueryinterface.h.

205 {
207 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

◆ WdfDeviceInterfaceReferenceNoOp()

FORCEINLINE VOID WdfDeviceInterfaceReferenceNoOp ( _In_ PVOID  Context)

Definition at line 193 of file wdfqueryinterface.h.

196 {
198 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

Variable Documentation

◆ ExposedInterface

WDF_EXTERN_C_START typedef _In_ LPGUID _Inout_ PINTERFACE ExposedInterface

Definition at line 62 of file wdfqueryinterface.h.

Referenced by FxDeviceProcessQueryInterfaceRequest::Invoke().

◆ ExposedInterfaceSpecificData

WDF_EXTERN_C_START typedef _In_ LPGUID _Inout_ PINTERFACE _Inout_opt_ PVOID ExposedInterfaceSpecificData

Definition at line 62 of file wdfqueryinterface.h.

Referenced by FxDeviceProcessQueryInterfaceRequest::Invoke().

◆ InterfaceType