ReactOS  0.4.15-dev-3207-ga415bd4
fxrequestapi.cpp File Reference
#include "coreprivshared.hpp"
Include dependency graph for fxrequestapi.cpp:

Go to the source code of this file.

Macros

#define WDF_REQUEST_REUSE_VALID_FLAGS_V1_9   (WDF_REQUEST_REUSE_SET_NEW_IRP)
 
#define WDF_REQUEST_REUSE_VALID_FLAGS   (WDF_REQUEST_REUSE_SET_NEW_IRP | WDF_REQUEST_REUSE_MUST_COMPLETE)
 
#define GLOBALS_ACTION(globals)   ((ULONG)(ULONG_PTR)(globals))
 
#define PGLOBALS_ACTION(globals)   ((PULONG)(PULONG_PTR)(globals))
 
#define GLOBALS_DEVICE(globals)   ((FxDevice*)(ULONG_PTR)(globals))
 
#define PGLOBALS_DEVICE(globals)   ((FxDevice**)(PULONG_PTR)(globals))
 
#define WDFREQUEST_FXREQUEST(handle)   ((FxRequest*)(handle))
 
#define WDFIOTARGET_FXIOTARGET(handle)   ((FxIoTarget*)(handle))
 

Functions

 FX_DECLARE_VF_FUNCTION_P1 (NTSTATUS, VerifyRequestComplete, _In_ FxRequest *)
 
 FX_DECLARE_VF_FUNCTION_P1 (NTSTATUS, VerifyWdfRequestIsCanceled, _In_ FxRequest *)
 
 FX_DECLARE_VF_FUNCTION_P1 (NTSTATUS, VerifyWdfRequestForwardToIoQueue, _In_ FxRequest *)
 
 FX_DECLARE_VF_FUNCTION_P1 (NTSTATUS, VerifyWdfRequestForwardToParentDeviceIoQueue, _In_ FxRequest *)
 
_Must_inspect_result_ __drv_maxIRQL (DISPATCH_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfRequestCreate)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 if (Target !=NULL)
 
 if (RequestAttributes !=NULL &&RequestAttributes->ParentObject !=NULL)
 
 FxPointerNotNull (pFxDriverGlobals, Request)
 
 if (NT_SUCCESS(status))
 
 FxPointerNotNull (pFxDriverGlobals, Irp)
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Request, FX_TYPE_REQUEST,(PVOID *)&pRequest, &pFxDriverGlobals)
 
 FxPointerNotNull (pFxDriverGlobals, ReuseParams)
 
 if (ReuseParams->Size !=sizeof(WDF_REQUEST_REUSE_PARAMS))
 
 if (pFxDriverGlobals->IsVersionGreaterThanOrEqualTo(1, 11))
 
 if (ReuseParams->Flags &~validFlags)
 
return pRequest Reuse (ReuseParams)
 
 FxObjectHandleGetPtr (pFxDriverGlobals, IoTarget, FX_TYPE_IO_TARGET,(PVOID *)&pTarget)
 
return pRequest ValidateTarget (pTarget)
 
_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyRequestComplete (_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ FxRequest *pRequest)
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Request, FX_TYPE_REQUEST,(PVOID *)&pRequest)
 
 if (!NT_SUCCESS(status))
 
pRequest Complete (RequestStatus)
 
pRequest CompleteWithPriority (RequestStatus, PriorityBoost)
 
pRequest CompleteWithInformation (RequestStatus, Information)
 
pRequest SetInformation (Information)
 
return pRequest GetInformation ()
 
 FxPointerNotNull (pFxDriverGlobals, Memory)
 
 if (pRequest->GetFxIrp() ->GetMajorFunction()==IRP_MJ_READ)
 
 if (majorFunction==IRP_MJ_WRITE)
 
 if ((majorFunction==IRP_MJ_DEVICE_CONTROL)||(majorFunction==IRP_MJ_INTERNAL_DEVICE_CONTROL))
 
 FxPointerNotNull (pFxDriverGlobals, Buffer)
 
 if (Length !=NULL)
 
_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS WDFAPI STDCALL WDFEXPORT(WdfRequestRetrieveUnsafeUserInputBuffer)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxPointerNotNull (pFxDriverGlobals, InputBuffer)
 
 if (pFxDriverGlobals->FxVerifierOn)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
 
 FxVerifierDbgBreakPoint (pFxDriverGlobals)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither ioctl and read " "WDFREQUEST 0x%p, %!STATUS!", Request, status)
 
 FxPointerNotNull (pFxDriverGlobals, Mdl)
 
void CheckUnionAssumptions (VOID)
 
 if (!NT_SUCCESS(FxValidateRequestOptions(WDFREQUEST_FXREQUEST(Request) ->GetDriverGlobals(), Options, WDFREQUEST_FXREQUEST(Request))))
 
 FxObjectHandleGetPtr (WDFREQUEST_FXREQUEST(Request) ->GetDriverGlobals(), Target, FX_TYPE_IO_TARGET,(PVOID *) &Target)
 
 if (Options !=NULL &&(Options->Flags &(WDF_REQUEST_SEND_OPTION_SYNCHRONOUS|WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET)) !=0x0)
 
else if (WDFREQUEST_FXREQUEST(Request) ->IsCompletionRoutineSet()==FALSE &&WDFREQUEST_FXREQUEST(Request) ->IsAllocatedFromIo())
 
 if (GLOBALS_ACTION(DriverGlobals) &SubmitSend)
 
return pRequest GetStatus ()
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGREQUEST, "Enter: WDFREQUEST %p to be cancelled", Request)
 
_Must_inspect_result_ __drv_maxIRQL (APC_LEVEL) BOOLEAN STDCALL WDFEXPORT(WdfRequestIsFrom32BitProcess)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Request, FX_TYPE_REQUEST,(PVOID *) &pRequest, &pFxDriverGlobals)
 
 if (irp->GetIrp()==NULL)
 
 if (irp->HasStack(2)==FALSE)
 
irp CopyCurrentIrpStackLocationToNext ()
 
pRequest VerifierSetFormatted ()
 
 FxPointerNotNull (pFxDriverGlobals, Stack)
 
 if (pIrp==NULL)
 
 if (pIrp->GetCurrentIrpStackLocationIndex()< 2)
 
pIrp CopyToNextIrpStackLocation (Stack)
 
pRequest SetCompletionRoutine (CompletionRoutine, CompletionContext)
 
 FxPointerNotNull (pFxDriverGlobals, Parameters)
 
 if (Parameters->Size !=sizeof(WDF_REQUEST_PARAMETERS))
 
VOID pRequest GetParameters (Parameters)
 
 FxPointerNotNull (pFxDriverGlobals, Params)
 
 if (Params->Size !=sizeof(WDF_REQUEST_COMPLETION_PARAMS))
 
pRequest CopyCompletionParams (Params)
 
return pRequest CreateTimer ()
 
 if (pRequest->GetDriverGlobals() ->IsVerificationEnabled(1, 9, OkForDownLevel))
 
else if (NULL==pFO)
 
return pFO GetHandle ()
 
_Must_inspect_result_ __in WDFREQUEST __in_bcount (Length) PVOID Buffer
 
 FxPointerNotNull (pFxDriverGlobals, MemoryObject)
 
return pRequest GetRequestorMode ()
 
 if (pRequest->GetCurrentQueue()==NULL)
 
 return (WDFQUEUE) pRequest -> GetCurrentQueue() ->GetObjectHandle()
 
_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyWdfRequestForwardToIoQueue (_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ FxRequest *request)
 
 FxObjectHandleGetPtrAndGlobals (cxDriverGlobals, DestinationQueue, FX_TYPE_QUEUE,(PVOID *)&queue, &fxDriverGlobals)
 
 FxObjectHandleGetPtr (fxDriverGlobals, Request, FX_TYPE_REQUEST,(PVOID *)&request)
 
 if (request->GetCurrentQueue() !=NULL)
 
_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyWdfRequestForwardToParentDeviceIoQueue (_In_ PFX_DRIVER_GLOBALS fxDriverGlobals, _In_ FxRequest *request)
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), ParentDeviceQueue, FX_TYPE_QUEUE,(PVOID *)&queue, &fxDriverGlobals)
 
 FxPointerNotNull (fxDriverGlobals, ForwardOptions)
 
 if (ForwardOptions->Size !=sizeof(WDF_REQUEST_FORWARD_OPTIONS))
 
 if ((ForwardOptions->Flags &~WDF_REQUEST_FORWARD_OPTION_SEND_AND_FORGET) !=0)
 
return pRequest GetCurrentQueue () -> Requeue(pRequest)
 
 FxPointerNotNull (pFxDriverGlobals, EvtRequestCancel)
 
 UNREFERENCED_PARAMETER (status)
 
 ASSERT (status==STATUS_SUCCESS)
 
_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyWdfRequestIsCanceled (_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ FxRequest *pRequest)
 
return pRequest IsCancelled ()
 
pRequest StopAcknowledge (Requeue)
 
return pRequest IsReserved ()
 

Variables

_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES RequestAttributes
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in_opt WDFIOTARGET Target
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in_opt WDFIOTARGET __out WDFREQUEST * Request
 
FxRequestpRequest
 
FxIoTargetpTarget
 
NTSTATUS status
 
 pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
 else
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in MdIrp Irp
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in MdIrp __in BOOLEAN RequestFreesIrp
 
__in WDFREQUEST __in PWDF_REQUEST_REUSE_PARAMS ReuseParams
 
ULONG validFlags
 
_Must_inspect_result_ __in WDFREQUEST __in WDFIOTARGET IoTarget
 
__in WDFREQUEST __in NTSTATUS RequestStatus
 
__in WDFREQUEST __in NTSTATUS __in CCHAR PriorityBoost
 
__in WDFREQUEST __in NTSTATUS __in ULONG_PTR Information
 
_Must_inspect_result_ __in WDFREQUEST __out WDFMEMORY * Memory
 
IFxMemorypMemory = NULL
 
PVOID pBuffer
 
size_t length
 
UCHAR majorFunction = pRequest->GetFxIrp()->GetMajorFunction()
 
_Must_inspect_result_ __in WDFREQUEST __in size_t RequiredLength
 
_Must_inspect_result_ __in WDFREQUEST __in size_t __deref_out_bcount Length PVOIDBuffer = NULL
 
_Must_inspect_result_ __in WDFREQUEST __in size_t __deref_out_bcount Length PVOID __out_opt size_tLength
 
_Must_inspect_result_ __in WDFREQUEST __in size_t __deref_out_bcount_opt Length PVOIDInputBuffer = NULL
 
FxDevicepDevice = FxDevice::GetFxDevice(irp->GetDeviceObject())
 
FxIrpirp = pRequest->GetFxIrp()
 
_Must_inspect_result_ __in WDFREQUEST __in size_t __deref_out_bcount_opt Length PVOIDOutputBuffer = NULL
 
_Must_inspect_result_ __in WDFREQUEST __deref_out PMDLMdl
 
_Must_inspect_result_ __in WDFREQUEST __in WDFIOTARGET __in_opt PWDF_REQUEST_SEND_OPTIONS Options
 
BOOLEAN result = pRequest->Cancel()
 
pRequest m_NextStackLocationFormatted = TRUE
 
__in WDFREQUEST __in PIO_STACK_LOCATION Stack
 
FxIrppIrp = pRequest->GetSubmitFxIrp()
 
__in WDFREQUEST __in_opt PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
 
__in WDFREQUEST __in_opt PFN_WDF_REQUEST_COMPLETION_ROUTINE __in_opt WDFCONTEXT CompletionContext
 
 return
 
__in WDFREQUEST __out PWDF_REQUEST_PARAMETERS Parameters
 
__in WDFREQUEST __out PWDF_REQUEST_COMPLETION_PARAMS Params
 
FxFileObjectpFO = NULL
 
_Must_inspect_result_ __in WDFREQUEST __in size_t __out WDFMEMORY * MemoryObject
 
_Must_inspect_result_ __in WDFREQUEST __in WDFQUEUE DestinationQueue
 
PFX_DRIVER_GLOBALS cxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
FxRequestrequest
 
FxIoQueuequeue
 
Done __pad2__
 
_Must_inspect_result_ __in WDFREQUEST __in WDFQUEUE ParentDeviceQueue
 
_Must_inspect_result_ __in WDFREQUEST __in WDFQUEUE __in PWDF_REQUEST_FORWARD_OPTIONS ForwardOptions
 
Done __pad3__
 
__in WDFREQUEST __in PFN_WDF_REQUEST_CANCEL EvtRequestCancel
 
__in WDFREQUEST __in BOOLEAN Requeue
 

Macro Definition Documentation

◆ GLOBALS_ACTION

#define GLOBALS_ACTION (   globals)    ((ULONG)(ULONG_PTR)(globals))

Definition at line 1858 of file fxrequestapi.cpp.

◆ GLOBALS_DEVICE

#define GLOBALS_DEVICE (   globals)    ((FxDevice*)(ULONG_PTR)(globals))

Definition at line 1861 of file fxrequestapi.cpp.

◆ PGLOBALS_ACTION

#define PGLOBALS_ACTION (   globals)    ((PULONG)(PULONG_PTR)(globals))

Definition at line 1859 of file fxrequestapi.cpp.

◆ PGLOBALS_DEVICE

#define PGLOBALS_DEVICE (   globals)    ((FxDevice**)(PULONG_PTR)(globals))

Definition at line 1862 of file fxrequestapi.cpp.

◆ WDF_REQUEST_REUSE_VALID_FLAGS

#define WDF_REQUEST_REUSE_VALID_FLAGS   (WDF_REQUEST_REUSE_SET_NEW_IRP | WDF_REQUEST_REUSE_MUST_COMPLETE)

Definition at line 249 of file fxrequestapi.cpp.

◆ WDF_REQUEST_REUSE_VALID_FLAGS_V1_9

#define WDF_REQUEST_REUSE_VALID_FLAGS_V1_9   (WDF_REQUEST_REUSE_SET_NEW_IRP)

Definition at line 246 of file fxrequestapi.cpp.

◆ WDFIOTARGET_FXIOTARGET

#define WDFIOTARGET_FXIOTARGET (   handle)    ((FxIoTarget*)(handle))

Definition at line 1865 of file fxrequestapi.cpp.

◆ WDFREQUEST_FXREQUEST

#define WDFREQUEST_FXREQUEST (   handle)    ((FxRequest*)(handle))

Definition at line 1864 of file fxrequestapi.cpp.

Function Documentation

◆ __drv_maxIRQL() [1/3]

◆ __drv_maxIRQL() [2/3]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_maxIRQL() [3/3]

_Must_inspect_result_ __drv_maxIRQL ( APC_LEVEL  )

◆ __in_bcount()

_Must_inspect_result_ __in WDFREQUEST __in_bcount ( Length  )

◆ ASSERT()

◆ CheckUnionAssumptions()

void CheckUnionAssumptions ( VOID  )

Definition at line 1829 of file fxrequestapi.cpp.

1849 {
1850  // ActionUnion check
1851  WDFCASSERT(sizeof(ULONG) <= sizeof(PWDF_DRIVER_GLOBALS));
1852  // RequestUnion check
1853  WDFCASSERT(sizeof(FxRequest*) <= sizeof(WDFREQUEST));
1854  // TargetUnion check
1855  WDFCASSERT(sizeof(FxIoTarget*) <= sizeof(WDFIOTARGET));
1856 }
WDFCASSERT(sizeof(WDF_DRIVER_CONFIG_V1_0)==sizeof(WDF_DRIVER_CONFIG_V1_1))
unsigned int ULONG
Definition: retypes.h:1

◆ Complete()

◆ CompleteWithInformation()

pRequest CompleteWithInformation ( RequestStatus  ,
Information   
)

◆ CompleteWithPriority()

pRequest CompleteWithPriority ( RequestStatus  ,
PriorityBoost   
)

◆ CopyCompletionParams()

pRequest CopyCompletionParams ( Params  )

◆ CopyCurrentIrpStackLocationToNext()

irp CopyCurrentIrpStackLocationToNext ( )

◆ CopyToNextIrpStackLocation()

pIrp CopyToNextIrpStackLocation ( Stack  )

◆ CreateTimer()

return pRequest CreateTimer ( )

◆ DoTraceLevelMessage() [1/3]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_ERROR  ,
TRACINGREQUEST  ,
"Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %  p,
%!STATUS!"  ,
Request  ,
status   
)

◆ DoTraceLevelMessage() [2/3]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_ERROR  ,
TRACINGREQUEST  ,
"Error: This call is valid only on method-neither ioctl and read " "WDFREQUEST 0x%  p,
%!STATUS!"  ,
Request  ,
status   
)

◆ DoTraceLevelMessage() [3/3]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_VERBOSE  ,
TRACINGREQUEST  ,
"Enter: WDFREQUEST %p to be cancelled"  ,
Request   
)

◆ FX_DECLARE_VF_FUNCTION_P1() [1/4]

FX_DECLARE_VF_FUNCTION_P1 ( NTSTATUS  ,
VerifyRequestComplete  ,
_In_ FxRequest  
)

◆ FX_DECLARE_VF_FUNCTION_P1() [2/4]

FX_DECLARE_VF_FUNCTION_P1 ( NTSTATUS  ,
VerifyWdfRequestIsCanceled  ,
_In_ FxRequest  
)

◆ FX_DECLARE_VF_FUNCTION_P1() [3/4]

FX_DECLARE_VF_FUNCTION_P1 ( NTSTATUS  ,
VerifyWdfRequestForwardToIoQueue  ,
_In_ FxRequest  
)

◆ FX_DECLARE_VF_FUNCTION_P1() [4/4]

FX_DECLARE_VF_FUNCTION_P1 ( NTSTATUS  ,
VerifyWdfRequestForwardToParentDeviceIoQueue  ,
_In_ FxRequest  
)

◆ FxObjectHandleGetPtr() [1/4]

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
IoTarget  ,
FX_TYPE_IO_TARGET  ,
(PVOID *)&  pTarget 
)

◆ FxObjectHandleGetPtr() [2/4]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Request  ,
FX_TYPE_REQUEST  ,
(PVOID *)&  pRequest 
)

◆ FxObjectHandleGetPtr() [3/4]

FxObjectHandleGetPtr ( WDFREQUEST_FXREQUEST(Request) ->GetDriverGlobals()  ,
Target  ,
FX_TYPE_IO_TARGET  ,
(PVOID *) &  Target 
)

◆ FxObjectHandleGetPtr() [4/4]

FxObjectHandleGetPtr ( fxDriverGlobals  ,
Request  ,
FX_TYPE_REQUEST  ,
(PVOID *)&  request 
)

◆ FxObjectHandleGetPtrAndGlobals() [1/4]

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Request  ,
FX_TYPE_REQUEST  ,
(PVOID *)&  pRequest,
pFxDriverGlobals 
)

Referenced by if().

◆ FxObjectHandleGetPtrAndGlobals() [2/4]

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Request  ,
FX_TYPE_REQUEST  ,
(PVOID *) &  pRequest,
pFxDriverGlobals 
)

◆ FxObjectHandleGetPtrAndGlobals() [3/4]

FxObjectHandleGetPtrAndGlobals ( cxDriverGlobals  ,
DestinationQueue  ,
FX_TYPE_QUEUE  ,
(PVOID *)&  queue,
fxDriverGlobals 
)

◆ FxObjectHandleGetPtrAndGlobals() [4/4]

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
ParentDeviceQueue  ,
FX_TYPE_QUEUE  ,
(PVOID *)&  queue,
fxDriverGlobals 
)

◆ FxPointerNotNull() [1/13]

FxPointerNotNull ( pFxDriverGlobals  ,
Request   
)

◆ FxPointerNotNull() [2/13]

FxPointerNotNull ( pFxDriverGlobals  ,
Irp   
)

◆ FxPointerNotNull() [3/13]

FxPointerNotNull ( pFxDriverGlobals  ,
ReuseParams   
)

◆ FxPointerNotNull() [4/13]

FxPointerNotNull ( pFxDriverGlobals  ,
Memory   
)

◆ FxPointerNotNull() [5/13]

FxPointerNotNull ( pFxDriverGlobals  ,
Buffer   
)

◆ FxPointerNotNull() [6/13]

FxPointerNotNull ( pFxDriverGlobals  ,
InputBuffer   
)

◆ FxPointerNotNull() [7/13]

FxPointerNotNull ( pFxDriverGlobals  ,
Mdl   
)

◆ FxPointerNotNull() [8/13]

FxPointerNotNull ( pFxDriverGlobals  ,
Stack   
)

◆ FxPointerNotNull() [9/13]

FxPointerNotNull ( pFxDriverGlobals  ,
Parameters   
)

◆ FxPointerNotNull() [10/13]

FxPointerNotNull ( pFxDriverGlobals  ,
Params   
)

◆ FxPointerNotNull() [11/13]

FxPointerNotNull ( pFxDriverGlobals  ,
MemoryObject   
)

◆ FxPointerNotNull() [12/13]

FxPointerNotNull ( fxDriverGlobals  ,
ForwardOptions   
)

◆ FxPointerNotNull() [13/13]

FxPointerNotNull ( pFxDriverGlobals  ,
EvtRequestCancel   
)

◆ FxVerifierDbgBreakPoint()

◆ GetCurrentQueue()

return pRequest GetCurrentQueue ( ) -> Requeue(pRequest)

◆ GetHandle()

return pFO GetHandle ( )

Referenced by if().

◆ GetInformation()

return pRequest GetInformation ( )

◆ GetParameters()

VOID pRequest GetParameters ( Parameters  )

Referenced by DECLARE_INTERFACE_().

◆ GetRequestorMode()

return pRequest GetRequestorMode ( )

◆ GetStatus()

◆ if() [1/28]

if ( Target = NULL)

Definition at line 109 of file fxrequestapi.cpp.

109  {
111  Target,
113  (PVOID*)&pTarget,
115  }
FxIoTarget * pTarget
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Request, FX_TYPE_REQUEST,(PVOID *)&pRequest, &pFxDriverGlobals)
pFxDriverGlobals
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

◆ if() [2/28]

if ( RequestAttributes = NULL && RequestAttributes->ParentObject != NULL)

Definition at line 122 of file fxrequestapi.cpp.

123  {
124 
127  RequestAttributes->ParentObject,
129  }
VOID __inline FxObjectHandleGetGlobals(__in PFX_DRIVER_GLOBALS CallersGlobals, __in WDFOBJECT Handle, __out PFX_DRIVER_GLOBALS *ObjectGlobals)
Definition: fxhandle.h:453
_In_ PWDFDEVICE_INIT _In_ PWDF_OBJECT_ATTRIBUTES RequestAttributes
Definition: wdfdevice.h:3428
pFxDriverGlobals

◆ if() [3/28]

if ( NT_SUCCESS(status )

Definition at line 143 of file fxrequestapi.cpp.

143  {
144  *Request = pRequest->GetHandle();
145 
146 #if FX_VERBOSE_TRACE
149  "Created WDFREQUEST %p, %!STATUS!",
150  *Request, status);
151 #endif // FX_VERBOSE_TRACE
152  }
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define TRACINGREQUEST
Definition: dbgtrace.h:65
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
pFxDriverGlobals
FxRequest * pRequest
__inline WDFREQUEST GetHandle(VOID)
Definition: ps.c:97

◆ if() [4/28]

Definition at line 302 of file fxrequestapi.cpp.

302  {
304  "ReuseParams Size %d, expected %d %!STATUS!",
305  ReuseParams->Size, sizeof(WDF_REQUEST_REUSE_PARAMS),
308  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ WDFREQUEST _In_ PWDF_REQUEST_REUSE_PARAMS ReuseParams
Definition: wdfrequest.h:551
#define TRACINGREQUEST
Definition: dbgtrace.h:65
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27

◆ if() [5/28]

if ( pFxDriverGlobals->  IsVersionGreaterThanOrEqualTo1, 11)

Definition at line 310 of file fxrequestapi.cpp.

310  {
312  }
ULONG validFlags
#define WDF_REQUEST_REUSE_VALID_FLAGS

◆ if() [6/28]

if ( ReuseParams->Flags &~  validFlags)

Definition at line 317 of file fxrequestapi.cpp.

317  {
319  "ReuseParams Flags 0x%x, valid mask 0x%x, %!STATUS!",
320  ReuseParams->Flags,
321  (ULONG) ~validFlags,
324  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ WDFREQUEST _In_ PWDF_REQUEST_REUSE_PARAMS ReuseParams
Definition: wdfrequest.h:551
#define TRACINGREQUEST
Definition: dbgtrace.h:65
ULONG validFlags
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
unsigned int ULONG
Definition: retypes.h:1

◆ if() [7/28]

if ( NT_SUCCESSstatus)

Definition at line 437 of file fxrequestapi.cpp.

437  {
438  return;
439  }

◆ if() [8/28]

if ( pRequest->  GetFxIrp) ->GetMajorFunction( = IRP_MJ_READ)

Definition at line 773 of file fxrequestapi.cpp.

773  {
775 
778  "This call is not valid on the Read request, you should call"
779  " WdfRequestRetrieveOutputMemory to get the Memory for WDFREQUEST "
780  "0x%p, %!STATUS!", Request, status);
781 
782  return status;
783  }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define TRACINGREQUEST
Definition: dbgtrace.h:65
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
NTSTATUS status
pFxDriverGlobals
Definition: ps.c:97

◆ if() [9/28]

Definition at line 889 of file fxrequestapi.cpp.

889  {
891 
894  "This call is not valid on the Write request, you should call"
895  " WdfRequestRetrieveInputMemory to get the Memory for WDFREQUEST "
896  "0x%p, %!STATUS!", Request, status);
897 
898  return status;
899  }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define TRACINGREQUEST
Definition: dbgtrace.h:65
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
NTSTATUS status
pFxDriverGlobals
Definition: ps.c:97

◆ if() [10/28]

Definition at line 901 of file fxrequestapi.cpp.

902  {
904  }
PVOID pBuffer
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
IFxMemory * pMemory
_Must_inspect_result_ NTSTATUS GetDeviceControlOutputMemoryObject(__deref_out IFxMemory **MemoryObject, __out PVOID *Buffer, __out size_t *Length)
Definition: fxrequest.cpp:1524
FxRequest * pRequest
Definition: ps.c:97

◆ if() [11/28]

if ( Length = NULL)

Definition at line 1012 of file fxrequestapi.cpp.

1012  {
1013  *Length = 0;
1014  }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101

◆ if() [12/28]

if ( pFxDriverGlobals->  FxVerifierOn)

Definition at line 1309 of file fxrequestapi.cpp.

1309  {
1310  KIRQL irql;
1311 
1312  pRequest->Lock(&irql);
1313 
1314  status = pRequest->VerifyRequestIsInCallerContext(pFxDriverGlobals);
1315 
1316  pRequest->Unlock(irql);
1317 
1318  if (!NT_SUCCESS(status)) {
1319  return status;
1320  }
1321  }
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS status
pFxDriverGlobals
FxRequest * pRequest
Definition: ps.c:97

◆ if() [13/28]

if ( NT_SUCCESSFxValidateRequestOptions( WDFREQUEST_FXREQUEST(Request) ->GetDriverGlobals(), Options, WDFREQUEST_FXREQUEST(Request)))

Definition at line 1924 of file fxrequestapi.cpp.

1926  {
1927 
1929 
1931  return FALSE;
1932  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
FxVerifierDbgBreakPoint(pFxDriverGlobals)
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define FALSE
Definition: types.h:117
#define WDFREQUEST_FXREQUEST(handle)

◆ if() [14/28]

if ( Options = NULL && (Options->Flags & (WDF_REQUEST_SEND_OPTION_SYNCHRONOUS |                           WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET)) != 0x0)

Definition at line 1943 of file fxrequestapi.cpp.

1945  {
1946 
1948  //
1949  // This sets impersonation flags for UMDF. Noop for KMDF.
1950  //
1951  WDFREQUEST_FXREQUEST(Request)->SetImpersonationFlags(Options->Flags);
1952 
1954  (void) WDFIOTARGET_FXIOTARGET(Target)->SubmitSync(
1956  Options,
1958  );
1959  }
1961  if (WDFREQUEST_FXREQUEST(Request)->IsAllocatedFromIo() == FALSE) {
1963  WDFREQUEST_FXREQUEST(Request)->GetDriverGlobals(),
1965  "WDFREQUEST %p must be a WDFQUEUE presented request",
1967 
1968  WDFREQUEST_FXREQUEST(Request)->SetStatus(
1970  );
1971 
1973  }
1974  else if (WDFREQUEST_FXREQUEST(Request)->HasContext()) {
1975  //
1976  // Cannot send-and-forget a request with formatted IO context.
1977  //
1979  WDFREQUEST_FXREQUEST(Request)->GetDriverGlobals(),
1981  "Cannot send-and-forget WDFREQUEST 0x%p with formatted IO"
1982  " context, %!STATUS!",
1985 
1986  WDFREQUEST_FXREQUEST(Request)->SetStatus(
1988  );
1989 
1991 
1993  WDFREQUEST_FXREQUEST(Request)->GetDriverGlobals());
1994  }
1995  else {
1996  //
1997  // We split processing into pre and post processing to reduce
1998  // stack usage (by not making the call to IoCallDriver in a
1999  // deep function.
2000  //
2001 
2002  //
2003  // This will skip the current stack location
2004  //
2005  WDFREQUEST_FXREQUEST(Request)->PreProcessSendAndForget();
2006 
2007  //
2008  // This sets impersonation flags for UMDF. Noop for KMDF.
2009  //
2010  WDFREQUEST_FXREQUEST(Request)->SetImpersonationFlags(Options->Flags);
2011 
2012  MdIrp submitIrp = WDFREQUEST_FXREQUEST(Request)->GetSubmitIrp();
2013 
2014  WDFIOTARGET_FXIOTARGET(Target)->Send(submitIrp);
2015 
2016  //
2017  // This will free the request memory and pop the queue
2018  //
2019  WDFREQUEST_FXREQUEST(Request)->PostProcessSendAndForget();
2020  return TRUE;
2021  }
2022  }
2023  }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define WDFIOTARGET_FXIOTARGET(handle)
#define TRUE
Definition: types.h:120
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
FxVerifierDbgBreakPoint(pFxDriverGlobals)
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
DriverGlobals
#define PGLOBALS_ACTION(globals)
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
#define FALSE
Definition: types.h:117
IWudfIrp * MdIrp
Definition: mxum.h:103
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3531
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define WDFREQUEST_FXREQUEST(handle)
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
return pFO GetHandle()

◆ if() [15/28]

else if ( WDFREQUEST_FXREQUEST(Request) ->IsCompletionRoutineSet()  = FALSE && WDFREQUEST_FXREQUEST(Request)->IsAllocatedFromIo())

Definition at line 2024 of file fxrequestapi.cpp.

2025  {
2026  //
2027  // Cannot send an asynchronous queue presented request without a
2028  // completion routine.
2029  //
2031  WDFREQUEST_FXREQUEST(Request)->GetDriverGlobals(),
2033  "WDFREQUEST %p is a WDFQUEUE presented request with no"
2034  " completion routine, %!STATUS!",
2037 
2038  WDFREQUEST_FXREQUEST(Request)->SetStatus(
2040  );
2041 
2043 
2045  WDFREQUEST_FXREQUEST(Request)->GetDriverGlobals());
2046  }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
FxVerifierDbgBreakPoint(pFxDriverGlobals)
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
DriverGlobals
#define PGLOBALS_ACTION(globals)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define WDFREQUEST_FXREQUEST(handle)
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
return pFO GetHandle()

◆ if() [16/28]

else if ( GLOBALS_ACTION(DriverGlobals) &  SubmitSend)

Definition at line 2090 of file fxrequestapi.cpp.

2090  {
2091 
2093 
2095 
2096 #if FX_VERBOSE_TRACE
2098  WDFREQUEST_FXREQUEST(Request)->GetDriverGlobals(),
2100  "Sending FxRequest %p (WDFREQUEST %p), Irp %p",
2103  WDFREQUEST_FXREQUEST(Request)->GetSubmitIrp());
2104 #endif // FX_VERBOSE_TRACE
2105 
2106  MdIrp submitIrp = WDFREQUEST_FXREQUEST(Request)->GetSubmitIrp();
2107 
2108  WDFIOTARGET_FXIOTARGET(Target)->Send(submitIrp);
2109  }
#define WDFIOTARGET_FXIOTARGET(handle)
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
DriverGlobals
#define PGLOBALS_ACTION(globals)
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
IWudfIrp * MdIrp
Definition: mxum.h:103
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
#define GLOBALS_ACTION(globals)
#define WDFREQUEST_FXREQUEST(handle)
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
ASSERT(status==STATUS_SUCCESS)
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
return pFO GetHandle()

◆ if() [17/28]

if ( irp->  GetIrp() = NULL)

Definition at line 2287 of file fxrequestapi.cpp.

2287  {
2291  (ULONG_PTR) Request);
2292  return; // not reached
2293  }
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
pFxDriverGlobals

◆ if() [18/28]

if ( irp->  HasStack2 = FALSE)

Definition at line 2299 of file fxrequestapi.cpp.

2299  {
2303  (ULONG_PTR) irp->GetIrp());
2304  return; // not reached
2305  }
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
pFxDriverGlobals
MdIrp GetIrp(VOID)
Definition: fxirpum.cpp:15
FxIrp * irp

◆ if() [19/28]

if ( pIrp  = NULL)

Definition at line 2368 of file fxrequestapi.cpp.

2368  {
2372  (ULONG_PTR) Request);
2373  return; // not reached
2374  }
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
pFxDriverGlobals

◆ if() [20/28]

if ( )

Definition at line 2380 of file fxrequestapi.cpp.

2380  {
2384  (ULONG_PTR) pIrp);
2385  return; // not reached
2386  }
FxIrp * pIrp
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
pFxDriverGlobals

◆ if() [21/28]

Definition at line 2465 of file fxrequestapi.cpp.

2465  {
2467  "Params size %d incorrect, expected %d",
2468  Parameters->Size, sizeof(WDF_REQUEST_PARAMETERS));
2469 
2471 
2472  return;
2473  }
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
FxVerifierDbgBreakPoint(pFxDriverGlobals)
#define TRACINGREQUEST
Definition: dbgtrace.h:65
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27

◆ if() [22/28]

Definition at line 2515 of file fxrequestapi.cpp.

2515  {
2518  "Params Size 0x%x, expected 0x%x",
2519  Params->Size, sizeof(WDF_REQUEST_COMPLETION_PARAMS));
2521  return;
2522  }
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
FxVerifierDbgBreakPoint(pFxDriverGlobals)
#define TRACINGREQUEST
Definition: dbgtrace.h:65
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27

◆ if() [23/28]

if ( pRequest->  GetDriverGlobals) ->IsVerificationEnabled( 1, 9, OkForDownLevel)

Definition at line 2688 of file fxrequestapi.cpp.

2689  {
2690  KIRQL irql;
2691 
2692  pRequest->Lock(&irql);
2693  status = pRequest->VerifyRequestIsDriverOwned(pFxDriverGlobals);
2694  pRequest->Unlock(irql);
2695  if (!NT_SUCCESS(status)) {
2696  return NULL;
2697  }
2698  }
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
pFxDriverGlobals
#define NULL
Definition: types.h:112
FxRequest * pRequest
Definition: ps.c:97

◆ if() [24/28]

else if ( NULL  = pFO)

Definition at line 2706 of file fxrequestapi.cpp.

2706  {
2707  //
2708  // Success and NULL file object: driver during init told us that it
2709  // knows how to handle NULL file objects.
2710  //
2711  return NULL;
2712  }
#define NULL
Definition: types.h:112

◆ if() [25/28]

if ( pRequest->  GetCurrentQueue() = NULL)

Definition at line 3009 of file fxrequestapi.cpp.

3009  {
3010  //
3011  // For a driver-created request, the queue can be NULL. It is not
3012  // necessarily an error to call WdfRequestGetIoQueue on a driver-
3013  // created request, because the caller may not really know whether or
3014  // not the request is driver-created.
3015  //
3016  // For example, it is possible for a class extension to create a request
3017  // and pass it to the client driver, in which case the client driver
3018  // wouldn't really know whether or not it was driver-created. Or a
3019  // client driver is might be using a helper library for some of its
3020  // tasks and it might pass in a request object to the helper library. In
3021  // this case, the helper library wouldn't really know whether or not the
3022  // request was driver-created. Therefore, the log message below is at
3023  // verbose level and not at error or warning level.
3024  //
3028  "WDFREQUEST %p doesn't belong to any queue",
3029  Request);
3030  return NULL;
3031  }
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define TRACINGREQUEST
Definition: dbgtrace.h:65
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
pFxDriverGlobals
#define NULL
Definition: types.h:112

◆ if() [26/28]

if ( request->GetCurrentQueue() !  = NULL)

Definition at line 3163 of file fxrequestapi.cpp.

3163  {
3164  status = request->GetCurrentQueue()->ForwardRequest(queue, request);
3165  goto Done;
3166  }
Definition: _queue.h:59
Definition: tftpd.h:85
Definition: ps.c:97

◆ if() [27/28]

Definition at line 3314 of file fxrequestapi.cpp.

3314  {
3315  //
3316  // Size is wrong, bale out
3317  //
3320  "ForwardOptions %p Size incorrect, expected %d, "
3321  "got %d, %!STATUS!",
3323  ForwardOptions->Size,
3324  status);
3325 
3326  goto Done;
3327  }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFREQUEST _In_ WDFQUEUE _In_ PWDF_REQUEST_FORWARD_OPTIONS ForwardOptions
Definition: wdfrequest.h:1731
#define TRACINGAPIERROR
Definition: dbgtrace.h:60
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
PFX_DRIVER_GLOBALS fxDriverGlobals
Definition: ps.c:97

◆ if() [28/28]

Definition at line 3329 of file fxrequestapi.cpp.

3329  {
3330  //
3331  // Invalid flag
3332  //
3335  "ForwardOptions %p Flags 0x%x invalid, "
3336  "valid mask is 0x%x, %!STATUS!",
3339  status);
3340 
3341  goto Done;
3342  }
_Must_inspect_result_ _In_ WDFREQUEST _In_ WDFQUEUE _In_ PWDF_REQUEST_FORWARD_OPTIONS ForwardOptions
Definition: wdfrequest.h:1731
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define TRACINGAPIERROR
Definition: dbgtrace.h:60
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
PFX_DRIVER_GLOBALS fxDriverGlobals
Definition: ps.c:97

◆ IsCancelled()

return pRequest IsCancelled ( )

◆ IsReserved()

return pRequest IsReserved ( )

◆ return()

return ( WDFQUEUE  ) -> GetCurrentQueue() ->GetObjectHandle()

◆ Reuse()

Referenced by FxUsbUmFormatRequest().

◆ SetCompletionRoutine()

pRequest SetCompletionRoutine ( CompletionRoutine  ,
CompletionContext   
)

◆ SetInformation()

pRequest SetInformation ( Information  )

◆ StopAcknowledge()

pRequest StopAcknowledge ( Requeue  )

◆ UNREFERENCED_PARAMETER()

UNREFERENCED_PARAMETER ( status  )

◆ ValidateTarget()

return pRequest ValidateTarget ( pTarget  )

◆ VerifierSetFormatted()

pRequest VerifierSetFormatted ( )

◆ VerifyRequestComplete()

_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyRequestComplete ( _In_ PFX_DRIVER_GLOBALS  FxDriverGlobals,
_In_ FxRequest pRequest 
)

Definition at line 362 of file fxrequestapi.cpp.

366 {
368  KIRQL irql;
369 
371 
372  pRequest->Lock(&irql);
373 
374  status = pRequest->VerifyRequestIsDriverOwned(FxDriverGlobals);
375  if (NT_SUCCESS(status)) {
376  status = pRequest->VerifyRequestCanBeCompleted(FxDriverGlobals);
377  }
378 
379  pRequest->Unlock(irql);
380  return status;
381 }
LONG NTSTATUS
Definition: precomp.h:26
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define PAGED_CODE_LOCKED()
Definition: kefuncs.h:1429
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS status
FxRequest * pRequest
Definition: ps.c:97

◆ VerifyWdfRequestForwardToIoQueue()

_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyWdfRequestForwardToIoQueue ( _In_ PFX_DRIVER_GLOBALS  FxDriverGlobals,
_In_ FxRequest request 
)

Definition at line 3055 of file fxrequestapi.cpp.

3059 {
3061 
3063 
3064  //
3065  // * Is request I/O allocated but without a queue? This should not happen.
3066  // * Is WDF driver v1.9 or below trying to use this feature? We don't allow it.
3067  //
3068  if (request->IsAllocatedDriver() == FALSE ||
3069  FxDriverGlobals->IsVersionGreaterThanOrEqualTo(1,11) == FALSE) {
3072  "WDFREQUEST %p doesn't belong to any queue, %!STATUS!",
3073  request->GetHandle(), status);
3074  FxVerifierDbgBreakPoint(FxDriverGlobals);
3075  return status;
3076  }
3077 
3078  //
3079  // Make sure current IRP stack location is valid. See helper routine for error msgs.
3080  //
3081  status = request->VerifyRequestCanBeCompleted(FxDriverGlobals);
3082  return status;
3083 }
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
FxVerifierDbgBreakPoint(pFxDriverGlobals)
#define TRACINGREQUEST
Definition: dbgtrace.h:65
#define FALSE
Definition: types.h:117
#define PAGED_CODE_LOCKED()
Definition: kefuncs.h:1429
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
NTSTATUS status
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: tftpd.h:85
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: ps.c:97

◆ VerifyWdfRequestForwardToParentDeviceIoQueue()

_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyWdfRequestForwardToParentDeviceIoQueue ( _In_ PFX_DRIVER_GLOBALS  fxDriverGlobals,
_In_ FxRequest request 
)

Definition at line 3187 of file fxrequestapi.cpp.

3191 {
3192  NTSTATUS status;
3193  FxIrp* irp;
3194 
3196 
3197  //
3198  // * Is request I/O allocated but without a queue? This should not happen.
3199  // * Is WDF driver v1.9 or below trying to use this feature? We don't allow it.
3200  //
3201  if (request->IsAllocatedDriver() == FALSE ||
3205  "WDFREQUEST %p doesn't belong to any queue, %!STATUS!",
3206  request->GetHandle(), status);
3208  goto Done;
3209  }
3210 
3211  //
3212  // Make sure current IRP stack location is valid.
3213  //
3214  status = request->VerifyRequestCanBeCompleted(fxDriverGlobals);
3215  if (!NT_SUCCESS(status)) {
3216  goto Done;
3217  }
3218 
3219  //
3220  // Make sure IRP has space for at least another stack location.
3221  //
3222  irp = request->GetFxIrp();
3223 
3224  ASSERT(irp->GetIrp() != NULL);
3225 
3226  if (irp->GetCurrentIrpStackLocationIndex() <= 1) {
3229  "IRP %p of WDFREQUEST %p doesn't enough stack "
3230  "locations, %!STATUS!",
3231  irp, request->GetHandle(), status);
3233  goto Done;
3234  }
3235 
3236 Done:
3237  return status;
3238 }
CCHAR GetCurrentIrpStackLocationIndex()
Definition: fxirpum.cpp:521
LONG NTSTATUS
Definition: precomp.h:26
Definition: fxirp.hpp:28
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
FxVerifierDbgBreakPoint(pFxDriverGlobals)
#define TRACINGREQUEST
Definition: dbgtrace.h:65
#define FALSE
Definition: types.h:117
#define PAGED_CODE_LOCKED()
Definition: kefuncs.h:1429
_Must_inspect_result_ BOOLEAN IsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
Definition: globalskm.cpp:92
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGREQUEST, "Error: This call is valid only on method-neither " "ioctl and write WDFREQUEST %p, %!STATUS!", Request, status)
NTSTATUS status
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
MdIrp GetIrp(VOID)
Definition: fxirpum.cpp:15
PFX_DRIVER_GLOBALS fxDriverGlobals
#define NULL
Definition: types.h:112
Definition: tftpd.h:85
ASSERT(status==STATUS_SUCCESS)
FxIrp * irp
Definition: ps.c:97

◆ VerifyWdfRequestIsCanceled()

_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyWdfRequestIsCanceled ( _In_ PFX_DRIVER_GLOBALS  FxDriverGlobals,
_In_ FxRequest pRequest 
)

Definition at line 3637 of file fxrequestapi.cpp.

3641 {
3642  NTSTATUS status;
3643  KIRQL irql;
3644 
3646 
3647  pRequest->Lock(&irql);
3648 
3649  status = pRequest->VerifyRequestIsDriverOwned(FxDriverGlobals);
3650  if (NT_SUCCESS(status)) {
3651  status = pRequest->VerifyRequestIsNotCancelable(FxDriverGlobals);
3652  }
3653 
3654  pRequest->Unlock(irql);
3655  return status;
3656 }
LONG NTSTATUS
Definition: precomp.h:26
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define PAGED_CODE_LOCKED()
Definition: kefuncs.h:1429
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS status
FxRequest * pRequest
Definition: ps.c:97

Variable Documentation

◆ __pad2__

Done __pad2__

Definition at line 3182 of file fxrequestapi.cpp.

◆ __pad3__

Done __pad3__

Definition at line 3370 of file fxrequestapi.cpp.

◆ Buffer

* Buffer = NULL

Definition at line 928 of file fxrequestapi.cpp.

◆ CompletionContext

◆ CompletionRoutine

◆ cxDriverGlobals

cxDriverGlobals = GetFxDriverGlobals(DriverGlobals)

Definition at line 3136 of file fxrequestapi.cpp.

◆ DestinationQueue

Initial value:

Definition at line 3134 of file fxrequestapi.cpp.

◆ else

else
Initial value:
{
FxIoTarget * pTarget
#define NULL
Definition: types.h:112

Definition at line 116 of file fxrequestapi.cpp.

◆ EvtRequestCancel

◆ ForwardOptions

Initial value:

Definition at line 3290 of file fxrequestapi.cpp.

◆ Information

Initial value:
{
FxRequest * pRequest

Definition at line 551 of file fxrequestapi.cpp.

◆ InputBuffer

Definition at line 1226 of file fxrequestapi.cpp.

◆ IoTarget

_Must_inspect_result_ __in WDFREQUEST __in WDFIOTARGET IoTarget
Initial value:

Definition at line 341 of file fxrequestapi.cpp.

◆ Irp

◆ irp

Definition at line 1323 of file fxrequestapi.cpp.

Referenced by FxDevice::_AcquireOptinRemoveLock(), _IRQL_requires_max_(), FxPkgFdo::_PnpStartDeviceCompletionRoutine(), FxPkgPdo::_QueryCapsWorkItem(), FxQueryInterface::_QueryForInterface(), CallUSBD(), FxIoQueue::CancelIrps(), CancelSelectSuspend(), ClasspCompleteOffloadRead(), ClasspCompleteOffloadWrite(), ClasspContinueOffloadWrite(), ClasspDequeueIdleRequest(), ClasspFailurePredict(), ClasspInitializeGesn(), ClasspInitializePolling(), ClasspPrepareMcnIrp(), ClasspReceivePopulateTokenInformation(), ClasspReceivePopulateTokenInformationTransferPacketDone(), ClasspReceiveWriteUsingTokenInformation(), ClasspReceiveWriteUsingTokenInformationTransferPacketDone(), ClasspReleaseQueue(), ClasspRetryRequestDpc(), ClasspSendMediaStateIrp(), ClasspServiceIdleRequest(), ClasspUpdateDiskProperties(), ClassSendDeviceIoControlSynchronous(), ClassSendSrbSynchronous(), ClassSendStartUnit(), FxPkgPnp::ClearPendingDevicePowerIrp(), FxPkgPnp::ClearPendingPnpIrp(), FxPkgPnp::ClearPendingSystemPowerIrp(), FxRequest::CompleteInternal(), FxPkgPnp::CompletePowerRequest(), FxRequest::CopyCurrentIrpStackLocationToNext(), FxIoTarget::CopyFileObjectAndFlags(), FxIoContext::CopyParameters(), DequeueDeferredClientIrp(), DeviceSendIoctlAsynchronously(), DeviceZPODDGetPowerupReason(), DiskInfoExceptionCheck(), DiskInitFdo(), DiskPerformSmartCommand(), DiskReregWorker(), DiskSendFailurePredictIoctl(), DiskStartFdo(), FxPkgPnp::Dispatch(), FxDevice::DispatchPreprocessedIrp(), FxDevice::DispatchWithLock(), DispatchWorker(), FxPostProcessInfo::Evaluate(), FlopticalFormatMedia(), FxIoTarget::FormatIoctlRequest(), FxIoTarget::FormatIoRequest(), FreeBT_GetPortStatus(), FreeBT_ResetParentPort(), FX_VF_METHOD(), FxFormatUsbRequest(), FxRequestSystemBuffer::GetBuffer(), FxRequestOutputBuffer::GetBuffer(), FxRequestSystemBuffer::GetBufferSize(), FxRequestOutputBuffer::GetBufferSize(), FxRequestSystemBuffer::GetFlags(), FxRequestOutputBuffer::GetFlags(), FxRequestSystemBuffer::GetMdl(), FxRequestOutputBuffer::GetMdl(), GetStackCapabilities(), FxIoTargetRemote::GetTargetDeviceRelations(), HoldIoRequestsWorkerRoutine(), if(), FxRequest::Impersonate(), FxIrpQueue::InsertIrpInQueue(), FxPkgPnp::IsDevicePowerUpIrpPending(), IsPreprocessIrp(), FxPkgGeneral::OnClose(), FxIrpQueue::PeekNextIrpFromQueue(), PiceSendIoctl(), FxPkgPnp::PnpEventInitQueryRemove(), FxPkgPnp::PnpEventInitQueryRemoveCanceled(), FxPkgPnp::PnpEventQueryRemovePending(), FxPkgPnp::PnpEventQueryStopPending(), FxPkgPnp::PnpFinishProcessingIrp(), FxPkgPnp::PnpMatchResources(), FxPkgFdo::PnpSendStartDeviceDownTheStackOverload(), FxPkgPnp::PowerCompletePendedWakeIrp(), FxPkgPnp::PowerGotoDxIoStopped(), FxPkgPnp::PowerGotoDxIoStoppedNP(), FxPkgPnp::PowerPolicyCancelWaitWake(), FxPkgPnp::PowerPolicyCompleteSystemPowerIrp(), FxPkgPnp::PowerPolicyGetPendingSystemState(), FxPkgFdo::PowerReleasePendingDeviceIrp(), FxPkgPdo::PowerReleasePendingDeviceIrp(), PreprocessIrp(), print_irp_flags(), FxRequest::ProbeAndLockForRead(), FxRequest::ProbeAndLockForWrite(), FxPkgPnp::QueryForD3ColdInterface(), FxRequest::Release(), FxIoContext::ReleaseAndRestore(), FxIrpQueue::RemoveIrpFromQueueByContext(), RequestCompletion(), RequestDispatchSpecialIoctls(), RequestGetCurrentStackLocationFlags(), RequestHandleReadWrite(), RequestProcessInternalDeviceControl(), RequestSetupMcnSyncIrp(), RequestSynchronizeProcessWithSerialQueue(), RequestValidateRawRead(), RequestValidateReadWrite(), ResetBus(), ScratchBuffer_ResetItems(), ScratchBuffer_SetupReadWriteSrb(), ScsiFlopProcessError(), ScsiFlopStartDevice(), FxUsbDevice::SelectConfig(), FxIoTargetSelf::Send(), FxIoTarget::SetCompletionRoutine(), FxIrp::SetIrp(), FxPkgPnp::SetPendingPnpIrpStatus(), SubmitIdleRequestIrp(), FxIoContext::SwapIrpBuffer(), UDFPhReadSynchronous(), UDFPhSendIOCTL(), UDFPhWriteSynchronous(), USBPORT_CancelActiveTransferIrp(), USBPORT_CancelPendingTransferIrp(), USBPORT_FindIrpInTable(), USBPORT_FindUrbInIrpTable(), VerifyWdfRequestForwardToParentDeviceIoQueue(), VfdDeviceThread(), and FxRequestBase::~FxRequestBase().

◆ length

Definition at line 750 of file fxrequestapi.cpp.

◆ Length

◆ m_NextStackLocationFormatted

pRequest m_NextStackLocationFormatted = TRUE

Definition at line 2307 of file fxrequestapi.cpp.

◆ majorFunction

◆ Mdl

* Mdl
Initial value:

Definition at line 1680 of file fxrequestapi.cpp.

◆ Memory

_Must_inspect_result_ __in WDFREQUEST __out WDFMEMORY* Memory
Initial value:

Definition at line 744 of file fxrequestapi.cpp.

◆ MemoryObject

Initial value:

Definition at line 2764 of file fxrequestapi.cpp.

◆ Options

Initial value:
{
FxObjectHandleGetPtr(pFxDriverGlobals, IoTarget, FX_TYPE_IO_TARGET,(PVOID *)&pTarget)
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597

Definition at line 1911 of file fxrequestapi.cpp.

◆ OutputBuffer

Definition at line 1430 of file fxrequestapi.cpp.

◆ Parameters

◆ Params

◆ ParentDeviceQueue

Definition at line 3248 of file fxrequestapi.cpp.

◆ pBuffer

PVOID pBuffer

Definition at line 749 of file fxrequestapi.cpp.

Referenced by if().

◆ pDevice

Definition at line 1278 of file fxrequestapi.cpp.

◆ pFO

pFO = NULL

Definition at line 2670 of file fxrequestapi.cpp.

◆ pFxDriverGlobals

Definition at line 107 of file fxrequestapi.cpp.

Referenced by if().

◆ pIrp

◆ pMemory

FxRequestMemory* pMemory = NULL

Definition at line 748 of file fxrequestapi.cpp.

Referenced by if().

◆ pRequest

FxRequest* pRequest

Definition at line 103 of file fxrequestapi.cpp.

Referenced by if(), VerifyRequestComplete(), and VerifyWdfRequestIsCanceled().

◆ PriorityBoost

Initial value:
{
LONG NTSTATUS
Definition: precomp.h:26
Definition: ps.c:97

Definition at line 483 of file fxrequestapi.cpp.

◆ pTarget

FxIoTarget* pTarget

Definition at line 104 of file fxrequestapi.cpp.

Referenced by if().

◆ queue

◆ Request

__in WDFREQUEST Request
Initial value:

Definition at line 101 of file fxrequestapi.cpp.

◆ request

◆ RequestAttributes

◆ RequestFreesIrp

◆ RequestStatus

__in WDFREQUEST __in NTSTATUS RequestStatus
Initial value:
{
LONG NTSTATUS
Definition: precomp.h:26
Definition: ps.c:97

Definition at line 416 of file fxrequestapi.cpp.

◆ Requeue

__in WDFREQUEST __in BOOLEAN Requeue
Initial value:
{
FxRequest * pRequest

Definition at line 3743 of file fxrequestapi.cpp.

◆ RequiredLength

_Must_inspect_result_ __in WDFREQUEST __in size_t RequiredLength

Definition at line 925 of file fxrequestapi.cpp.

◆ result

Definition at line 2172 of file fxrequestapi.cpp.

◆ return

return

Definition at line 2430 of file fxrequestapi.cpp.

◆ ReuseParams

◆ Stack

Initial value:

Definition at line 2345 of file fxrequestapi.cpp.

◆ status

Initial value:
FxIoTarget * pTarget
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES RequestAttributes, __in_opt MdIrp Irp, __in_opt FxIoTarget *Target, __in FxRequestIrpOwnership Ownership, __in FxRequestConstructorCaller Caller, __deref_out FxRequest **Request)
Definition: fxrequest.cpp:161
_In_ PWDFDEVICE_INIT _In_ PWDF_OBJECT_ATTRIBUTES RequestAttributes
Definition: wdfdevice.h:3428
pFxDriverGlobals
#define NULL
Definition: types.h:112
FxRequest * pRequest

Definition at line 105 of file fxrequestapi.cpp.

Referenced by if(), VerifyRequestComplete(), VerifyWdfRequestForwardToIoQueue(), VerifyWdfRequestForwardToParentDeviceIoQueue(), and VerifyWdfRequestIsCanceled().

◆ Target

_Must_inspect_result_ __in WDFREQUEST __in WDFIOTARGET Target

Definition at line 72 of file fxrequestapi.cpp.

◆ validFlags

ULONG validFlags

Definition at line 292 of file fxrequestapi.cpp.

Referenced by if().