ReactOS 0.4.15-dev-7942-gd23573b
fxioqueueapi.cpp File Reference
#include "ioprivshared.hpp"
#include "fxpkgio.hpp"
#include "fxioqueue.hpp"
Include dependency graph for fxioqueueapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (DISPATCH_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfIoQueueCreate)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
 
 FxPointerNotNull (pFxDriverGlobals, Config)
 
 if (!NT_SUCCESS(status))
 
 if (Config->Size !=sizeof(WDF_IO_QUEUE_CONFIG) &&Config->Size !=sizeof(WDF_IO_QUEUE_CONFIG_V1_9) &&Config->Size !=sizeof(WDF_IO_QUEUE_CONFIG_V1_7))
 
 if (!Config->DefaultQueue &&Queue==NULL)
 
 if (Config->DefaultQueue)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIO, "Created WDFQUEUE 0x%p", pQueue->GetObjectHandle())
 
 if (Queue !=NULL)
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Queue, FX_TYPE_QUEUE,(PVOID *)&pQueue)
 
return pQueue GetState (QueueCount, DriverCount)
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Queue, FX_TYPE_QUEUE,(PVOID *) &pQueue)
 
 return (WDFDEVICE) pQueue -> GetDevice() ->GetHandle()
 
pQueue QueueStart ()
 
__in WDFQUEUE __drv_when (Context !=0, __in) __drv_when(Context
 
__in WDFQUEUE __in_opt PFN_WDF_IO_QUEUE_STATE __drv_when (StopComplete !=0, __in) __drv_when(StopComplete
 
 __drv_maxIRQL (PASSIVE_LEVEL) VOID STDCALL WDFEXPORT(WdfIoQueueStopSynchronously)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Queue, FX_TYPE_QUEUE,(PVOID *)&pQueue, &pFxDriverGlobals)
 
 FxPointerNotNull (pQueue->GetDriverGlobals(), OutRequest)
 
 if (NT_SUCCESS(status))
 
 ASSERT (status !=STATUS_NOT_FOUND)
 
 FxPointerNotNull (pFxDriverGlobals, OutRequest)
 
 FxObjectHandleGetPtr (pFxDriverGlobals, FileObject, FX_TYPE_FILEOBJECT,(PVOID *)&pFO)
 
 FxObjectHandleGetPtr (pFxDriverGlobals, TagRequest, FX_TYPE_REQUEST,(PVOID *)&pTagRequest)
 
 if (TagRequest !=NULL)
 
 if (FileObject !=NULL)
 
 if ((Parameters !=NULL) &&(Parameters->Size< sizeof(WDF_REQUEST_PARAMETERS)))
 
 FxPointerNotNull (pFxDriverGlobals, ForwardProgressPolicy)
 
 if (pQueue->IsForwardProgressQueue())
 
 if (ForwardProgressPolicy->Size !=sizeof(WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY))
 
 switch (ForwardProgressPolicy->ForwardProgressReservedPolicy)
 
 if (ForwardProgressPolicy->TotalForwardProgressRequests==0)
 

Variables

_Must_inspect_result_ __in WDFDEVICE Device
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_IO_QUEUE_CONFIG Config
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_IO_QUEUE_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES QueueAttributes
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_IO_QUEUE_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES __out_opt WDFQUEUE * Queue
 
PFX_DRIVER_GLOBALS pFxDriverGlobals
 
CfxDevicepDevice
 
FxPkgIopPkgIo = NULL
 
FxIoQueuepQueue = NULL
 
NTSTATUS status
 
return STATUS_SUCCESS
 
__in WDFQUEUE __out_opt PULONG QueueCount
 
__in WDFQUEUE __out_opt PULONG __out_opt PULONG DriverCount
 
 return
 
__in WDFQUEUE __in_opt PFN_WDF_IO_QUEUE_STATE StopComplete
 
__in WDFQUEUE __in_opt PFN_WDF_IO_QUEUE_STATE __in_opt WDFCONTEXT Context
 
__in WDFQUEUE __in_opt PFN_WDF_IO_QUEUE_STATE StopAndPurgeComplete
 
FxIoQueuequeue
 
PFX_DRIVER_GLOBALS fxDriverGlobals
 
_Must_inspect_result_ __in WDFQUEUE __out WDFREQUEST * OutRequest
 
FxRequestpOutputRequest = NULL
 
 else
 
_Must_inspect_result_ __in WDFQUEUE __in WDFFILEOBJECT FileObject
 
FxFileObjectpFO = NULL
 
MdFileObject pWdmFO = NULL
 
_Must_inspect_result_ __in WDFQUEUE __in WDFREQUEST TagRequest
 
FxRequestpTagRequest = NULL
 
_Must_inspect_result_ __in WDFQUEUE __in_opt WDFREQUEST __in_opt WDFFILEOBJECT __inout_opt PWDF_REQUEST_PARAMETERS Parameters
 
__in WDFQUEUE __in_opt PFN_WDF_IO_QUEUE_STATE DrainComplete
 
__in WDFQUEUE __in_opt PFN_WDF_IO_QUEUE_STATE PurgeComplete
 
_Must_inspect_result_ __in WDFQUEUE __in_opt PFN_WDF_IO_QUEUE_STATE QueueReady
 
_Must_inspect_result_ __in WDFQUEUE __in PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY ForwardProgressPolicy
 

Function Documentation

◆ __drv_maxIRQL() [1/2]

◆ __drv_maxIRQL() [2/2]

__drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_when() [1/2]

__in WDFQUEUE __drv_when ( Context = 0,
__in   
)

◆ __drv_when() [2/2]

__in WDFQUEUE __in_opt PFN_WDF_IO_QUEUE_STATE __drv_when ( StopComplete = 0,
__in   
)

◆ ASSERT()

ASSERT ( status = STATUS_NOT_FOUND)

◆ DoTraceLevelMessage()

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_VERBOSE  ,
TRACINGIO  ,
"Created WDFQUEUE 0x%p"  ,
pQueue->  GetObjectHandle() 
)

Referenced by if(), and switch().

◆ FxObjectHandleGetPtr() [1/4]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Queue  ,
FX_TYPE_QUEUE  ,
(PVOID *) &  pQueue 
)

◆ FxObjectHandleGetPtr() [2/4]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Queue  ,
FX_TYPE_QUEUE  ,
(PVOID *)&  pQueue 
)

Referenced by if().

◆ FxObjectHandleGetPtr() [3/4]

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
FileObject  ,
FX_TYPE_FILEOBJECT  ,
(PVOID *)&  pFO 
)

◆ FxObjectHandleGetPtr() [4/4]

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
TagRequest  ,
FX_TYPE_REQUEST  ,
(PVOID *)&  pTagRequest 
)

◆ FxObjectHandleGetPtrAndGlobals() [1/2]

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Device  ,
FX_TYPE_DEVICE  ,
(PVOID *)&  pDevice,
pFxDriverGlobals 
)

◆ FxObjectHandleGetPtrAndGlobals() [2/2]

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Queue  ,
FX_TYPE_QUEUE  ,
(PVOID *)&  pQueue,
pFxDriverGlobals 
)

◆ FxPointerNotNull() [1/4]

FxPointerNotNull ( pFxDriverGlobals  ,
Config   
)

◆ FxPointerNotNull() [2/4]

FxPointerNotNull ( pFxDriverGlobals  ,
ForwardProgressPolicy   
)

◆ FxPointerNotNull() [3/4]

FxPointerNotNull ( pFxDriverGlobals  ,
OutRequest   
)

◆ FxPointerNotNull() [4/4]

FxPointerNotNull ( pQueue->  GetDriverGlobals(),
OutRequest   
)

◆ GetState()

return pQueue GetState ( QueueCount  ,
DriverCount   
)

◆ if() [1/12]

if ( !Config->DefaultQueue &&  Queue = NULL)

Definition at line 147 of file fxioqueueapi.cpp.

147 {
149
152 "Parameter to receive WDFQUEUE handle is not optional "
153 "for non default queue %!STATUS!", status);
154
155 return status;
156 }
#define TRACINGIO
Definition: dbgtrace.h:66
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIO, "Created WDFQUEUE 0x%p", pQueue->GetObjectHandle())
NTSTATUS status
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define STATUS_INVALID_PARAMETER_4
Definition: ntstatus.h:478
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97

◆ if() [2/12]

if ( NT_SUCCESSstatus)

Definition at line 124 of file fxioqueueapi.cpp.

124 {
125 return status;
126 }

◆ if() [3/12]

Definition at line 1051 of file fxioqueueapi.cpp.

1051 {
1054 "Invalid WDF_REQUEST_PARAMETERS size %d %!STATUS!",
1055 Parameters->Size, status);
1056 return status;
1057 }
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869

◆ if() [4/12]

if ( Config->  DefaultQueue)

Definition at line 168 of file fxioqueueapi.cpp.

168 {
169
170 if(pDevice->IsLegacy()) {
171 //
172 // This is a controldevice. Make sure the create is called after the device
173 // is initialized and ready to accept I/O.
174 //
178 "Default queue can only be created before WdfControlDeviceFinishInitializing"
179 "on the WDFDEVICE %p is called %!STATUS!",
180 Device,
183 }
184
185 } else {
186 //
187 // This is either FDO or PDO. Make sure it's not started yet.
188 //
193 "Default queue can only be created before the WDFDEVICE 0x%p "
194 "is started, %!STATUS!", Device, status);
195 return status;
196 }
197 }
198 }
ULONG __inline GetDeviceObjectFlags(VOID)
Definition: fxdevice.hpp:192
__inline BOOLEAN IsLegacy(VOID)
Definition: fxdevice.hpp:1209
__inline WDF_DEVICE_PNP_STATE GetDevicePnpState()
Definition: fxdevice.hpp:1149
#define TRACINGPNP
Definition: dbgtrace.h:67
#define FALSE
Definition: types.h:117
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
CfxDevice * pDevice
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
@ WdfDevStatePnpInit
Definition: wdfdevice.h:69

◆ if() [5/12]

Definition at line 129 of file fxioqueueapi.cpp.

131 {
133
135 "WDF_IO_QUEUE_CONFIG Size 0x%x, "
136 "expected for v1.7 size 0x%x or v1.9 size 0x%x or "
137 "current version size 0x%x, %!STATUS!",
138 Config->Size, sizeof(WDF_IO_QUEUE_CONFIG_V1_7),
140 sizeof(WDF_IO_QUEUE_CONFIG), status);
141 return status;
142 }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476

◆ if() [6/12]

if ( FileObject = NULL)

Definition at line 1037 of file fxioqueueapi.cpp.

1037 {
1039 FileObject,
1041 (PVOID*)&pFO);
1042 //
1043 // Get the real WDM fileobject
1044 //
1046 }
__inline MdFileObject GetWdmFileObject(VOID)
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Queue, FX_TYPE_QUEUE,(PVOID *)&pQueue)
FxFileObject * pFO
MdFileObject pWdmFO
@ FX_TYPE_FILEOBJECT
Definition: fxtypes.h:71
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550

◆ if() [7/12]

Definition at line 1387 of file fxioqueueapi.cpp.

1387 {
1390 "WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY Size 0x%x, "
1391 "expected 0x%x, %!STATUS!",
1393 return status;
1394 }
_Must_inspect_result_ _In_ WDFQUEUE _In_ PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY ForwardProgressPolicy
Definition: wdfio.h:1103

◆ if() [8/12]

if ( ForwardProgressPolicy->  TotalForwardProgressRequests = = 0)

Definition at line 1420 of file fxioqueueapi.cpp.

1420 {
1423 "Need to have more than 0 reserved Requests %!STATUS!",
1424 status);
1425
1426 return status;
1427 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

◆ if() [9/12]

if ( NT_SUCCESS(status )

Definition at line 672 of file fxioqueueapi.cpp.

672 {
673 *OutRequest = (WDFREQUEST)pOutputRequest->GetObjectHandle();
674 } else {
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603
FxRequest * pOutputRequest
_Must_inspect_result_ _In_ WDFQUEUE _Out_ WDFREQUEST * OutRequest
Definition: wdfio.h:800

◆ if() [10/12]

if ( pQueue->  IsForwardProgressQueue())

Definition at line 1372 of file fxioqueueapi.cpp.

1372 {
1373 //
1374 // Queue is already configured for forward progress
1375 //
1378 "Queue is already configured for forward progress %!STATUS!",
1379 status);
1381 return status;
1382 }
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ if() [11/12]

if ( Queue = NULL)

Definition at line 243 of file fxioqueueapi.cpp.

243 {
244 *Queue = (WDFQUEUE)pQueue->GetObjectHandle();
245 }
FxIoQueue * pQueue
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225

◆ if() [12/12]

if ( TagRequest = NULL)

Definition at line 1026 of file fxioqueueapi.cpp.

1026 {
1028 TagRequest,
1030 (PVOID*)&pTagRequest);
1031 }
_Must_inspect_result_ __in WDFQUEUE __in WDFREQUEST TagRequest
FxRequest * pTagRequest
@ FX_TYPE_REQUEST
Definition: fxtypes.h:53

◆ QueueStart()

pQueue QueueStart ( )

◆ return()

return ( WDFDEVICE  ) -> GetDevice() ->GetHandle()

◆ switch()

switch ( ForwardProgressPolicy->  ForwardProgressReservedPolicy)

Definition at line 1399 of file fxioqueueapi.cpp.

1399 {
1401 if (ForwardProgressPolicy->ForwardProgressReservePolicySettings.Policy.ExaminePolicy.EvtIoWdmIrpForForwardProgress == NULL) {
1404 "Examine callback can't be null for WdfIoForwardProgressReservedPolicyUseExamine "
1405 " %!STATUS!",
1406 status);
1407
1408 return status;
1409 }
1410 break;
1411
1412 default:
1413 break;
1414
1415 }
#define NULL
Definition: types.h:112
@ WdfIoForwardProgressReservedPolicyUseExamine
Definition: wdfio.h:468

Variable Documentation

◆ Config

◆ Context

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 397 of file fxioqueueapi.cpp.

◆ Device

Definition at line 57 of file fxioqueueapi.cpp.

◆ DrainComplete

◆ DriverCount

__in WDFQUEUE __out_opt PULONG __out_opt PULONG DriverCount
Initial value:

Definition at line 262 of file fxioqueueapi.cpp.

Referenced by FxIoQueue::GetState().

◆ else

else
Initial value:

Definition at line 674 of file fxioqueueapi.cpp.

◆ FileObject

_Must_inspect_result_ __in WDFQUEUE __in_opt WDFREQUEST __in_opt WDFFILEOBJECT FileObject

Definition at line 692 of file fxioqueueapi.cpp.

◆ ForwardProgressPolicy

◆ fxDriverGlobals

PFX_DRIVER_GLOBALS fxDriverGlobals

Definition at line 590 of file fxioqueueapi.cpp.

◆ OutRequest

Initial value:

Definition at line 623 of file fxioqueueapi.cpp.

◆ Parameters

Definition at line 889 of file fxioqueueapi.cpp.

◆ pDevice

CfxDevice* pDevice

Definition at line 101 of file fxioqueueapi.cpp.

Referenced by if().

◆ pFO

Definition at line 741 of file fxioqueueapi.cpp.

Referenced by if().

◆ pFxDriverGlobals

PFX_DRIVER_GLOBALS pFxDriverGlobals

Definition at line 100 of file fxioqueueapi.cpp.

Referenced by __drv_maxIRQL(), if(), and switch().

◆ pOutputRequest

FxRequest * pOutputRequest = NULL

Definition at line 660 of file fxioqueueapi.cpp.

Referenced by if().

◆ pPkgIo

pPkgIo = NULL

Definition at line 102 of file fxioqueueapi.cpp.

◆ pQueue

FxIoQueue* pQueue = NULL

Definition at line 103 of file fxioqueueapi.cpp.

Referenced by __drv_maxIRQL(), and if().

◆ pTagRequest

FxRequest * pTagRequest = NULL

Definition at line 845 of file fxioqueueapi.cpp.

Referenced by if().

◆ PurgeComplete

◆ pWdmFO

MdFileObject pWdmFO = NULL

Definition at line 742 of file fxioqueueapi.cpp.

Referenced by if().

◆ Queue

Initial value:

Definition at line 63 of file fxioqueueapi.cpp.

◆ queue

Definition at line 539 of file fxioqueueapi.cpp.

◆ QueueAttributes

◆ QueueCount

__in WDFQUEUE __out_opt PULONG QueueCount

Definition at line 260 of file fxioqueueapi.cpp.

◆ QueueReady

◆ return

return

Definition at line 381 of file fxioqueueapi.cpp.

◆ status

Initial value:
@ FX_VALIDATE_OPTION_SYNCHRONIZATION_SCOPE_ALLOWED
@ FX_VALIDATE_OPTION_EXECUTION_LEVEL_ALLOWED
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_IO_QUEUE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES QueueAttributes
Definition: wdfio.h:617

Definition at line 104 of file fxioqueueapi.cpp.

Referenced by __drv_maxIRQL(), if(), and switch().

◆ STATUS_SUCCESS

return STATUS_SUCCESS

Definition at line 247 of file fxioqueueapi.cpp.

◆ StopAndPurgeComplete

◆ StopComplete

Definition at line 394 of file fxioqueueapi.cpp.

◆ TagRequest

_Must_inspect_result_ __in WDFQUEUE __in_opt WDFREQUEST TagRequest

Definition at line 786 of file fxioqueueapi.cpp.

Referenced by if().