34#if defined(EVENT_TRACING)
35#include "FxIoQueue.hpp.tmh"
553#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
577#if (FX_CORE_MODE==FX_CORE_USER_MODE)
636 VerifyCancelForDriver,
648 VerifyValidateCompletedRequest,
668 "Enter: WDFQUEUE 0x%p, WDFREQUEST 0x%p",
687 DispatchInternalEvents(
irql);
707 "Enter: WDFQUEUE 0x%p, WDFREQUEST 0x%p",
742 "Enter: WDFQUEUE 0x%p, WDFREQUEST 0x%p",
762 DispatchInternalEvents(
irql);
865 VerifyGetRequestUpdateFlags,
872 VerifyGetRequestRestoreFlags,
905 VerifyForwardRequest,
921 VerifyQueueDriverCreatedRequest,
935 ProcessAcknowledgedRequests(
956 VerifyRequestCancelable,
1007 DispatchInternalEvents(
1053 if (ExecutionLevel !=
NULL) {
1057 if (SynchronizationScope !=
NULL) {
1321 VerifyForwardRequestUpdateFlags,
1336 VerifyForwardRequestToParent,
1393 ProcessIdleComplete(
1399 ProcessPurgeComplete(
1411 ProcessCancelledRequests(
1417 ProcessCancelledRequestsOnQueue(
1673 EVT_IRP_QUEUE_CANCEL
1682 EVT_IRP_QUEUE_CANCEL
1694 EVT_WDF_IO_QUEUE_STATE
1698 EVT_WDF_IO_QUEUE_STATE
1707#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
PFN_WDF_IO_ALLOCATE_REQUEST_RESOURCES Method
_Must_inspect_result_ NTSTATUS Invoke(__in WDFQUEUE Queue, __in WDFREQUEST Request)
DECLSPEC_NORETURN VOID FatalError(__in NTSTATUS Status)
__inline VOID InsertInDriverOwnedList(__in FxRequest *Request)
__inline FxCxDeviceInfo * GetCxDeviceInfo(VOID)
_Must_inspect_result_ NTSTATUS QueueIdle(__in BOOLEAN CancelQueueRequests, __in_opt PFN_WDF_IO_QUEUE_STATE IdleComplete, __in_opt WDFCONTEXT Context)
__inline FxPkgIo * GetPackage(VOID)
FxObject * m_CallbackLockObjectPtr
__inline VOID PostRequestCompletedCallback(__in FxRequest *Request)
_Must_inspect_result_ NTSTATUS ForwardRequest(__in FxIoQueue *pDestQueue, __in FxRequest *pRequest)
FxSystemWorkItem * m_SystemWorkItem
FX_DECLARE_VF_FUNCTION_P1(NTSTATUS, VerifyPeekRequest, _In_ FxRequest *)
_Must_inspect_result_ NTSTATUS QueueDrainSynchronously(VOID)
FxIoQueueNode m_IoPkgListNode
static __inline FxIoQueue * _FromPowerSListEntry(__in PSINGLE_LIST_ENTRY Entry)
__drv_requiresIRQL(DISPATCH_LEVEL) VOID ProcessReadyNotify(__out PKIRQL PreviousIrql)
__inline BOOLEAN IsForwardProgressQueue(VOID)
WDFCONTEXT m_ReadyNotifyContext
FxIoQueueIoDefault m_IoDefault
FX_DECLARE_VF_FUNCTION_P1(NTSTATUS, VerifyRequeue, _In_ FxRequest *)
BOOLEAN m_RequeueDeferredDispatcher
__inline VOID PreRemoveFromDriverOwnedList(__in FxRequest *Request)
MxEvent m_RequestWaitEventUm
static __inline FxIoQueue * _FromIoPkgListEntry(__in PLIST_ENTRY Entry)
WDF_SYNCHRONIZATION_SCOPE m_SynchronizationScope
__inline BOOLEAN IsState(__in WDF_IO_QUEUE_STATE State)
BOOLEAN m_IsDevicePowerPolicyOwner
static EVT_WDF_IO_QUEUE_STATE _IdleComplete
__inline VOID RemoveFromDriverOwnedList(__in FxRequest *Request)
BOOLEAN IsPagingIo(__in MdIrp Irp)
PFXIO_FORWARD_PROGRESS_CONTEXT m_FwdProgContext
static MdCancelRoutineType _WdmCancelRoutineForReservedIrp
volatile BOOLEAN m_CancelDispatchedRequests
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS DriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in PWDF_IO_QUEUE_CONFIG Config, __in_opt FxDriver *Caller, __in FxPkgIo *PkgIo, __in BOOLEAN InitialPowerStateOn, __deref_out FxIoQueue **Object)
FxCallbackSpinLock m_CallbackSpinLock
__inline VOID SetInterruptQueue(VOID)
__inline FxDriver * GetDriver(VOID)
VOID VerifierVerifyFwdProgListsLocked(VOID)
_Must_inspect_result_ NTSTATUS RequestCancelable(__in FxRequest *pRequest, __in BOOLEAN Cancelable, __in_opt PFN_WDF_REQUEST_CANCEL EvtRequestCancel, __in BOOLEAN FailIfIrpIsCancelled)
volatile LONG m_TwoPhaseCompletions
FxCallbackMutexLock m_CallbackMutexLock
FxIoQueueIoDeviceControl m_IoDeviceControl
_Must_inspect_result_ NTSTATUS QueueRequest(__in FxRequest *pRequest)
WDF_EXECUTION_LEVEL m_ExecutionLevel
_Must_inspect_result_ NTSTATUS QueueRequestFromForward(__in FxRequest *pRequest)
FxIoQueueIoState m_PurgeComplete
static EVT_SYSTEMWORKITEM _DeferredDispatchThreadThunk
volatile LONG m_DriverIoCount
__in_opt FxRequest * NewRequest
FxIoQueueIoCanceledOnQueue m_IoCanceledOnQueue
FX_DECLARE_VF_FUNCTION_P1_EX(, SHORT, 0, VerifyForwardRequestUpdateFlags, _In_ FxRequest *)
VOID GetRequestCount(__out_opt PULONG pQueuedRequests, __out_opt PULONG pDriverPendingRequests)
volatile BOOLEAN m_Disposing
volatile ULONG m_Dispatching
_Must_inspect_result_ BOOLEAN CanThreadDispatchEventsLocked(__in KIRQL PreviousIrql)
_Must_inspect_result_ NTSTATUS ReadyNotify(__in PFN_WDF_IO_QUEUE_STATE QueueReady, __in_opt WDFCONTEXT Context)
FX_DECLARE_VF_FUNCTION_P2(NTSTATUS, VerifyRequestCancelable, _In_ FxRequest *, _In_ BOOLEAN)
__inline VOID SetCxDeviceInfo(__in FxCxDeviceInfo *CxDeviceInfo)
_Must_inspect_result_ NTSTATUS QueueIdleSynchronously(__in BOOLEAN CancelRequests)
__inline VOID SetTransitionFromEmpty(VOID)
_Must_inspect_result_ NTSTATUS GetReservedRequest(__in MdIrp Irp, __deref_out_opt FxRequest **ReservedRequest)
BOOLEAN IsIoEventHandlerRegistered(__in WDF_REQUEST_TYPE RequestType)
static EVT_IRP_QUEUE_CANCEL _IrpCancelForDriver
__inline VOID RequestCompletedCallback(__in FxRequest *Request)
__inline VOID PreRequestCompletedCallback(__in FxRequest *Request)
__inline VOID PostRemoveFromDriverOwnedList(VOID)
FxIrpQueue m_DriverCancelable
VOID ReturnReservedRequest(__in FxRequest *ReservedRequest)
VOID FlushByFileObject(__in MdFileObject FileObject)
FxIoQueueIoInternalDeviceControl m_IoInternalDeviceControl
volatile BOOLEAN m_ForceTransitionFromEmptyWhenAddingNewRequest
_Must_inspect_result_ NTSTATUS AssignForwardProgressPolicy(__in PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY Policy)
friend VOID GetTriageInfo(VOID)
__inline CfxDevice * GetDevice(VOID)
__drv_requiresIRQL(DISPATCH_LEVEL) BOOLEAN ProcessCancelledRequests(__out PKIRQL PreviousIrql)
WDF_IO_QUEUE_DISPATCH_TYPE m_Type
VOID DeferredDispatchRequestsFromDpc(VOID)
FX_DECLARE_VF_FUNCTION_P2(NTSTATUS, VerifyForwardRequestToParent, _In_ FxIoQueue *, _In_ FxRequest *)
__inline BOOLEAN IsPowerManaged()
VOID PutBackReservedRequest(__in FxRequest *ReservedRequest)
__inline VOID CheckTransitionFromEmpty(VOID)
BOOLEAN m_SupportForwardProgress
FX_IO_QUEUE_STATE m_QueueState
FxCallbackLock * m_IoCancelCallbackLockPtr
FxCxDeviceInfo * m_CxDeviceInfo
NTSTATUS InsertNewRequestLocked(__deref_in FxRequest **Request, __in KIRQL PreviousIrql)
__inline BOOLEAN IsState(__in FX_IO_QUEUE_STATE State)
ULONG m_MaxParallelQueuePresentedRequests
VOID CancelIrps(__in PLIST_ENTRY IrpListHead)
__in __drv_restoresIRQL KIRQL PreviousIrql
_Must_inspect_result_ NTSTATUS GetRequest(__in_opt MdFileObject FileObject, __in_opt FxRequest *TagRequest, __deref_out FxRequest **pOutRequest)
MxEvent m_FinishDisposing
_Releases_lock_(this->m_SpinLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) BOOLEAN DispatchEvents(__in __drv_restoresIRQL KIRQL PreviousIrql
_Must_inspect_result_ NTSTATUS PeekRequest(__in_opt FxRequest *TagRequest, __in_opt MdFileObject FileObject, __out_opt PWDF_REQUEST_PARAMETERS Parameters, __deref_out FxRequest **pOutRequest)
FxIoQueueIoState m_ReadyNotify
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
_Must_inspect_result_ MdIrp GetForwardProgressIrpLocked(__in_opt PFILE_OBJECT FileObject)
VOID CancelForDriver(__in FxRequest *pRequest)
WDFCONTEXT m_PurgeCompleteContext
VOID StartPowerTransitionOff(VOID)
VOID FreeAllReservedRequests(__in BOOLEAN Verify)
SINGLE_LIST_ENTRY m_PowerSListEntry
_Releases_lock_(this->m_SpinLock.m_Lock) VOID CancelForQueue(__in FxRequest *pRequest
VOID SetStateForShutdown(VOID)
_Must_inspect_result_ NTSTATUS QueuePurge(__in BOOLEAN CancelQueueRequests, __in BOOLEAN CancelDriverRequests, __in_opt PFN_WDF_IO_QUEUE_STATE PurgeComplete, __in_opt WDFCONTEXT Context)
virtual VOID GetConstraints(__out WDF_EXECUTION_LEVEL *ExecutionLevel, __out WDF_SYNCHRONIZATION_SCOPE *SynchronizationScope)
_Must_inspect_result_ NTSTATUS QueuePurgeSynchronously(VOID)
FxIoQueueIoState m_IdleComplete
__inline BOOLEAN IsPowerStateNotifyingDriver(VOID)
_Must_inspect_result_ NTSTATUS RequestCompleteEvent(__in FxRequest *Request)
_Must_inspect_result_ NTSTATUS QueueForwardProgressIrpLocked(__in MdIrp Irp)
_Must_inspect_result_ NTSTATUS AllocateReservedRequest(__deref_out FxRequest **Request)
__drv_requiresIRQL(DISPATCH_LEVEL) BOOLEAN ProcessCancelledRequestsOnQueue(__out PKIRQL PreviousIrql)
WDFQUEUE __inline GetHandle(VOID)
VOID ResetStateForRestart(VOID)
__drv_requiresIRQL(DISPATCH_LEVEL) BOOLEAN ProcessPowerEvents(__out PKIRQL PreviousIrql)
__inline VOID SetPowerState(__in FXIOQUEUE_POWER_STATE PowerState)
__drv_requiresIRQL(DISPATCH_LEVEL) VOID ProcessPurgeComplete(__out PKIRQL PreviousIrql)
FX_DECLARE_VF_FUNCTION_P1(NTSTATUS, VerifyGetRequestUpdateFlags, _In_ FxRequest *)
VOID PurgeForwardProgressIrps(__in_opt MdFileObject FileObject)
LIST_ENTRY m_PowerDriverNotified
FxIoQueueIoWrite m_IoWrite
BOOLEAN m_AllowZeroLengthRequests
__inline NTSTATUS InsertNewRequest(__in FxRequest **Request, __in KIRQL PreviousIrql)
static MdDeferredRoutineType _DeferredDispatchDpcThunk
_Must_inspect_result_ NTSTATUS QueueDriverCreatedRequest(__in FxRequest *Request, __in BOOLEAN ParentQueue)
FX_DECLARE_VF_FUNCTION_P2(NTSTATUS, VerifyForwardRequest, _In_ FxIoQueue *, _In_ FxRequest *)
FX_DECLARE_VF_FUNCTION_P1(VOID, VerifyGetRequestRestoreFlags, _In_ FxRequest *)
VOID FlushQueuedDpcs(VOID)
_Must_inspect_result_ NTSTATUS ConfigureConstraints(__in_opt PWDF_OBJECT_ATTRIBUTES ObjectAttributes, __in_opt FxDriver *Caller)
VOID ResumeProcessingForPower(VOID)
LIST_ENTRY m_CanceledOnQueueList
FX_DECLARE_VF_FUNCTION_P2(NTSTATUS, VerifyQueueDriverCreatedRequest, _In_ FxRequest *, _Inout_ SHORT *)
FxIoQueueIoResume m_IoResume
VOID GetForwardProgressIrps(__in PLIST_ENTRY IrpListHead, __in_opt MdFileObject FileObject)
_Must_inspect_result_ NTSTATUS QueueDrain(__in_opt PFN_WDF_IO_QUEUE_STATE DrainComplete, __in_opt WDFCONTEXT Context)
volatile BOOLEAN m_TransitionFromEmpty
__drv_requiresIRQL(DISPATCH_LEVEL) VOID ProcessAcknowledgedRequests(__in FxRequest *Request
WDFCONTEXT m_IdleCompleteContext
volatile BOOLEAN m_Deleted
VOID InsertQueueDpc(VOID)
FXIOQUEUE_POWER_STATE m_PowerState
FxCallbackLock * m_CallbackLockPtr
virtual FxCallbackLock * GetCallbackLockPtr(__deref_out FxObject **LockObject)
volatile BOOLEAN m_PowerReferenced
__inline NTSTATUS InvokeAllocateResourcesCallback(__in FxRequest *Request)
VOID StopProcessingForPower(__in FxIoStopProcessingForPowerAction Action)
virtual BOOLEAN Dispose(VOID)
_Must_inspect_result_ NTSTATUS ForwardRequestWorker(__in FxRequest *Request, __in FxIoQueue *DestQueue)
__drv_requiresIRQL(DISPATCH_LEVEL) VOID ProcessIdleComplete(__out PKIRQL PreviousIrql)
VOID SetState(__in FX_IO_QUEUE_SET_STATE NewStatus)
VOID StartPowerTransitionOn(VOID)
VOID DeferredDispatchRequestsFromWorkerThread(VOID)
VOID DispatchRequestToDriver(__in FxRequest *pRequest)
static EVT_IRP_QUEUE_CANCEL _IrpCancelForQueue
static EVT_WDF_IO_QUEUE_STATE _PurgeComplete
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
__drv_restoresIRQL KIRQL __in BOOLEAN Unlock
VOID MarkNoDeleteDDI(__in FxObjectLockState State=ObjectLock)
static PVOID __inline _ToHandle(__in FxObject *Object)
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
FxDriver * GetDriver(VOID)
_Must_inspect_result_ NTSTATUS __inline PowerReference(__in BOOLEAN WaitForD0, __in_opt PVOID Tag=NULL, __in_opt LONG Line=0, __in_opt PSTR File=NULL)
#define _Releases_lock_(lock)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
#define __drv_restoresIRQL
#define __drv_requiresIRQL(irql)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define InitializeListHead(ListHead)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
return pObject GetObjectHandle()
DeviceInit Pdo ForwardRequestToParent
_Must_inspect_result_ NTSTATUS _In_ FxRequest * TagRequest
_Must_inspect_result_ NTSTATUS _In_ FxIoQueue * DestQueue
_Must_inspect_result_ NTSTATUS _In_ FxIoQueue * pDestQueue
@ FxIoQueueSetAcceptRequests
@ FxIoQueueClearDispatchRequests
@ FxIoQueueSetDispatchRequests
@ FxIoQueueClearAcceptRequests
@ FxIoQueueNodeTypeInvalid
@ FxIoQueueNodeTypeBookmark
@ FxIoQueueDispatchRequests
@ FxIoQueueAcceptRequests
@ FxIoQueueDriverNoRequests
struct _FXIO_FORWARD_PROGRESS_CONTEXT * PFXIO_FORWARD_PROGRESS_CONTEXT
@ FxIoQueuePowerStartingTransition
@ FxIoQueuePowerPurgeDriverNotified
@ FxIoQueuePowerRestarting
@ FxIoQueuePowerStoppingDriverNotified
@ FxIoQueuePowerRestartingNotifyingDriver
@ FxIoQueuePowerStoppingNotifyingDriver
@ FxIoQueuePowerPurgeNotifyingDriver
@ FxIoQueuePowerRestartingDriverNotified
enum FxIoQueuePowerState FXIOQUEUE_POWER_STATE
enum _FX_IO_QUEUE_STATE FX_IO_QUEUE_STATE
enum _FX_IO_QUEUE_SET_STATE FX_IO_QUEUE_SET_STATE
struct _FXIO_FORWARD_PROGRESS_CONTEXT FXIO_FORWARD_PROGRESS_CONTEXT
return pTarget GetState()
#define FX_DECLARE_VF_FUNCTION_P1(rt, fnName, at1)
FxIoStopProcessingForPowerAction
@ FxListEntryForwardProgress
PFILE_OBJECT MdFileObject
KDEFERRED_ROUTINE MdDeferredRoutineType
WUDF_DRIVER_CANCEL MdCancelRoutineType
#define _Must_inspect_result_
#define DECLSPEC_NORETURN
#define UNREFERENCED_PARAMETER(P)
#define TRACE_LEVEL_VERBOSE
base of all file and directory entries
FxIoQueueNode(const FxIoQueueNode &)
static BOOLEAN _IsValidNodeType(__in FxIoQueueNodeType NodeType)
static FxIoQueueNode * _FromListEntry(__in PLIST_ENTRY Entry)
FxIoQueueNode(FxIoQueueNodeType NodeType)
__inline BOOLEAN IsNodeType(__in FxIoQueueNodeType NodeType)
FxIoQueueNode & operator=(const FxIoQueueNode &)
LIST_ENTRY m_ReservedRequestInUseList
WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY m_Policy
FxIoQueueForwardProgressAllocateResourcesReserved m_IoReservedResourcesAllocate
LIST_ENTRY m_PendedIrpList
MxLockNoDynam m_PendedReserveLock
FxIoQueueForwardProgressAllocateResources m_IoResourcesAllocate
LIST_ENTRY m_ReservedRequestList
FxIoQueueForwardProgressExamineIrp m_IoExamineIrp
ULONG m_NumberOfReservedRequests
#define LockObject(Object)
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
enum _WDF_REQUEST_TYPE WDF_REQUEST_TYPE
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFQUEUE _In_ _Strict_type_match_ WDF_REQUEST_TYPE RequestType
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY Policy
EVT_WDF_IO_QUEUE_STATE * PFN_WDF_IO_QUEUE_STATE
_In_ WDFQUEUE _In_opt_ PFN_WDF_IO_QUEUE_STATE PurgeComplete
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_IO_QUEUE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES QueueAttributes
@ WdfIoQueueDriverNoRequests
@ WdfIoQueueAcceptRequests
@ WdfIoQueueDispatchRequests
WDF_EXTERN_C_START enum _WDF_IO_QUEUE_DISPATCH_TYPE WDF_IO_QUEUE_DISPATCH_TYPE
enum _WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ PFN_WDF_IO_QUEUE_STATE QueueReady
enum _WDF_IO_QUEUE_STATE WDF_IO_QUEUE_STATE
_In_ WDFQUEUE _In_opt_ PFN_WDF_IO_QUEUE_STATE DrainComplete
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
WDF_EXTERN_C_START enum _WDF_EXECUTION_LEVEL WDF_EXECUTION_LEVEL
enum _WDF_SYNCHRONIZATION_SCOPE WDF_SYNCHRONIZATION_SCOPE
_Must_inspect_result_ _In_ WDFREQUEST _In_ WDFQUEUE _In_ PWDF_REQUEST_FORWARD_OPTIONS ForwardOptions
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
_In_ WDFREQUEST _In_ BOOLEAN Requeue
EVT_WDF_REQUEST_CANCEL * PFN_WDF_REQUEST_CANCEL
_In_ WDFREQUEST _In_ PFN_WDF_REQUEST_CANCEL EvtRequestCancel
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock