ReactOS 0.4.16-dev-197-g92996da
fxrequestvalidatefunctions.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WDF_REQUEST_SEND_OPTIONS_VALID_FLAGS
 

Functions

NTSTATUS __inline FxValidateRequestOptions (_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PWDF_REQUEST_SEND_OPTIONS Options, _In_opt_ FxRequestBase *Request=NULL)
 

Macro Definition Documentation

◆ WDF_REQUEST_SEND_OPTIONS_VALID_FLAGS

#define WDF_REQUEST_SEND_OPTIONS_VALID_FLAGS
Value:

Definition at line 36 of file fxrequestvalidatefunctions.hpp.

Function Documentation

◆ FxValidateRequestOptions()

NTSTATUS __inline FxValidateRequestOptions ( _In_ PFX_DRIVER_GLOBALS  FxDriverGlobals,
_In_ PWDF_REQUEST_SEND_OPTIONS  Options,
_In_opt_ FxRequestBase Request = NULL 
)

Definition at line 54 of file fxrequestvalidatefunctions.hpp.

59{
60 if (Options == NULL) {
61 return STATUS_SUCCESS;
62 }
63
64 if (Options->Size != sizeof(WDF_REQUEST_SEND_OPTIONS)) {
65 //
66 // Size is wrong, bale out
67 //
69 "Options %p Size incorrect, expected %d, got %d",
71 Options->Size);
72
74 }
75
76 if ((Options->Flags & ~WDF_REQUEST_SEND_OPTIONS_VALID_FLAGS) != 0) {
77 //
78 // Invalid flags
79 //
81 "Options %p Flags 0x%x invalid, valid mask is 0x%x",
82 Options, Options->Flags,
84
86 }
87
88#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
90
93 //
94 // If WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET is set, no other bits
95 // can be set.
96 //
98 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGAPIERROR,
99 "Options %p, if WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET (0x%x) is "
100 "set, no other Flags 0x%x can be set",
102
104 }
105
106#else // FX_CORE_USER_MODE
107
111 //
112 // If WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET is set, no other bits
113 // can be set except impersonation flags.
114 //
116 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGAPIERROR,
117 "Options %p, if WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET (0x%x) is "
118 "set, no other Flags 0x%x can be set except impersonation flags "
119 "%!status!",
122
124 }
125
126 //
127 // Verify the send option flags.
128 //
130 //
131 // The request must be a create request (which also means it can never
132 // be a driver-created request).
133 //
134 if (Request == NULL ||
135 Request->IsAllocatedFromIo() == FALSE ||
136 Request->GetSubmitFxIrp()->GetMajorFunction() != IRP_MJ_CREATE) {
138 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGAPIERROR,
139 "WDF_REQUEST_SEND_OPTION impersonation flags may only "
140 "be set on Create requests. %!status!",
142
144 }
145
149 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGAPIERROR,
150 "Driver must set WDF_REQUEST_SEND_OPTION_IMPERSONATION_"
151 "IGNORE_FAILURE with WDF_REQUEST_SEND_OPTION_IMPERSONATE_CLIENT."
152 " %!status!", STATUS_INVALID_PARAMETER);
153
155 }
156 }
157
158#endif // FX_CORE_MODE
159
160 return STATUS_SUCCESS;
161}
#define TRACINGAPIERROR
Definition: dbgtrace.h:60
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define WDF_REQUEST_SEND_OPTION_IMPERSONATION_FLAGS
Definition: fxrequest.hpp:78
#define WDF_REQUEST_SEND_OPTIONS_VALID_FLAGS
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3534
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
@ WDF_REQUEST_SEND_OPTION_IMPERSONATE_CLIENT
Definition: wdfrequest.h:112
@ WDF_REQUEST_SEND_OPTION_IMPERSONATION_IGNORE_FAILURE
Definition: wdfrequest.h:113

Referenced by __in_xcount(), FxUsbPipe::_SendTransfer(), FxIoTargetSendIo(), and FxIoTargetSendIoctl().