31#if defined(EVENT_TRACING)
52 m_InCallerContextCallback(FxDriverGlobals)
77 "Constructed FxPkgIo 0x%p",
this);
99 "Destroyed FxPkgIo 0x%p",
this);
113 "WDFDEVICE 0x%p !devobj 0x%p %!IRPMJ!, IRP_MN %x, IRP 0x%p",
138 &m_DynamicDispatchInfoListHead ?
142 next != &m_DynamicDispatchInfoListHead;
154 "DispatchContext 0x%p is invalid, %!STATUS!",
211 "Driver cannot change the IRP type in its dispatch "
212 "callback Irp 0x%p, %!IRPMJ!, IRP_MN %x, Device 0x%p, "
250 return info->Dispatch[
index].EvtDeviceDynamicDispatch(
289 "No queue configured for WDFDEVICE 0x%p, failing IRP 0x%p,"
350 BOOLEAN isForwardProgressQueue;
356 inCriticalRegion =
FALSE;
357 isForwardProgressQueue =
Queue !=
NULL &&
Queue->IsForwardProgressQueue();
360 ASSERT((IoInCallerCtx !=
NULL && IoInCallerCtx->m_Method !=
NULL) ||
372 Mx::MxEnterCriticalRegion();
373 inCriticalRegion =
TRUE;
377 reqAttribs = &
Queue->GetCxDeviceInfo()->RequestAttributes;
389 if (isForwardProgressQueue &&
404 if (isForwardProgressQueue) {
419 "Could not create WDFREQUEST, %!STATUS!",
status);
425 if (isForwardProgressQueue) {
452 if (IoInCallerCtx !=
NULL &&
453 IoInCallerCtx->m_Method !=
NULL &&
480 if (inCriticalRegion) {
481 Mx::MxLeaveCriticalRegion();
519 "Default Queue Already Configured for "
520 "FxPkgIo 0x%p, WDFDEVICE 0x%p %!STATUS!",
this,
537 Queue->MarkNoDeleteDDI();
568 status =
Request->VerifyRequestIsInCallerContext(FxDriverGlobals);
570 status =
Request->VerifyRequestIsDriverOwned(FxDriverGlobals);
574 Request->ClearVerifierFlagsLocked(
617 SHORT origVerifierFlags = 0;
631 status = VerifyEnqueueRequestUpdateFlags(FxDriverGlobals,
655 "No queue configured for WDFDEVICE 0x%p, "
656 "failing WDFREQUEST 0x%p %!STATUS!",
742 "Cannot send-and-forget WDFREQUEST 0x%p with formatted IO"
743 " context for filter WDFDEVICE 0x%p, %!STATUS!",
779 VerifyEnqueueRequestRestoreFlags(FxDriverGlobals,
pRequest, origVerifierFlags);
812 "Invalid MajorFunction %!IRPMJ!, %!STATUS!",
840 if (driverIndex == curIndex) {
848 "Driver %p has already set a dispatch callback for "
849 "%!IRPMJ!, %!STATUS!",
850 CxDeviceInfo ==
NULL ?
852 CxDeviceInfo->Driver->GetHandle(),
866 else if (driverIndex > curIndex) {
872 else if (driverIndex < curIndex) {
882 if (dispatchInfo ==
NULL) {
886 "Couldn't create object DynamicDispatchInfo, %!STATUS!",
924 "Must have EvtIoDefault or %!WDF_REQUEST_TYPE! "
925 "specific dispatch event registered for "
927 TargetQueue->GetObjectHandle(),
940 "Default WDFQUEUE 0x%p cannot be configured to "
941 "dispatch specific type of request, %!STATUS!",
942 TargetQueue->GetObjectHandle(),
954 "%!WDF_REQUEST_TYPE! is already configured for"
956 TargetQueue->GetObjectHandle(),
1009 if (pSearchDevice ==
NULL) {
1014 "QueueAttributes->ParentObject 0x%p must have WDFDEVICE as an "
1015 "eventual ancestor, %!STATUS!",
1025 "Attributes->ParentObject 0x%p ancestor is WDFDEVICE %p, but "
1026 "not the same WDFDEVICE 0x%p passed to WdfIoQueueCreate, "
1128 "I/O Package already has a default queue. "
1129 "SetFilter must be called before creating "
1130 "a default queue %!STATUS!",
1187 "Perform %!FxIoStopProcessingForPowerAction! for all queues of "
1230 queue->StartPowerTransitionOff();
1279 "Power resume all queues of WDFDEVICE 0x%p",
1312 queue->ResumeProcessingForPower();
1321 queue->StartPowerTransitionOn();
1355 "Restart queues from purged state for WDFDEVICE 0x%p due to "
1372 queue->ResetStateForRestart();
1421 "Currently framework allow flushing of queues "
1422 "by fileobject on cleanup only at PASSIVE_LEVEL");
1507 for (le = listHead->
Blink; le != listHead; le = le->
Blink) {
1521 for (le = listHead->
Flink; le != listHead; le = le->
Flink) {
1541 CCHAR queueIndex, curIndex;
1552 for (le = listHead->
Blink; le != listHead; le = le->
Blink) {
1570 if (curIndex < queueIndex || curIndex == queueIndex) {
1583 IoQueue->SetStateForShutdown();
1668 ple = QueueBookmark->m_ListEntry.Flink;
1766 failAllocation =
FALSE;
1771 failAllocation =
TRUE;
1780 if (failAllocation) {
static FxDeviceBase * _SearchForDevice(__in FxObject *Object, __out_opt IFxHasCallbacks **Callbacks)
__inline FxDriver * GetDriver(VOID)
WDFDEVICE __inline GetHandle(VOID)
MdDeviceObject __inline GetAttachedDevice(VOID)
MdDeviceObject __inline GetDeviceObject(VOID)
FxCxDeviceInfo * GetCxDeviceInfo(__in FxDriver *CxDriver)
__inline PWDF_OBJECT_ATTRIBUTES GetRequestAttributes(VOID)
__inline BOOLEAN IsCxInIoPath(VOID)
static __inline CCHAR GetCxDriverIndex(__in FxCxDeviceInfo *CxDeviceInfo)
PFN_WDF_IO_IN_CALLER_CONTEXT m_Method
static __inline FxIoQueue * _FromPowerSListEntry(__in PSINGLE_LIST_ENTRY Entry)
static __inline FxIoQueue * _FromIoPkgListEntry(__in PLIST_ENTRY Entry)
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)
_Must_inspect_result_ NTSTATUS QueueRequestFromForward(__in FxRequest *pRequest)
__inline VOID SetCxDeviceInfo(__in FxCxDeviceInfo *CxDeviceInfo)
BOOLEAN IsIoEventHandlerRegistered(__in WDF_REQUEST_TYPE RequestType)
UCHAR GetMajorFunction(VOID)
VOID CompleteRequest(__in_opt CCHAR PriorityBoost=IO_NO_INCREMENT)
ULONG GetParameterIoctlCode(VOID)
VOID SkipCurrentIrpStackLocation(VOID)
VOID SetStatus(__in NTSTATUS Status)
VOID SetInformation(__in ULONG_PTR Information)
UCHAR GetMinorFunction(VOID)
NTSTATUS CallDriver(__in MdDeviceObject DeviceObject)
PVOID __inline GetObjectHandle(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
ULONG __inline AddRef(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
CfxDeviceBase * m_DeviceBase
__drv_restoresIRQL KIRQL __in BOOLEAN Unlock
VOID MarkNoDeleteDDI(__in FxObjectLockState State=ObjectLock)
virtual ULONG Release(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
VOID DeleteFromFailedCreate(VOID)
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
_Must_inspect_result_ NTSTATUS SetFilter(__in BOOLEAN Value)
_Must_inspect_result_ NTSTATUS CreateQueue(__in PWDF_IO_QUEUE_CONFIG Config, __in PWDF_OBJECT_ATTRIBUTES QueueAttributes, __in_opt FxDriver *Caller, __deref_out FxIoQueue **ppQueue)
FxIoQueue * m_DispatchTable[IRP_MJ_MAXIMUM_FUNCTION+1]
_Must_inspect_result_ NTSTATUS FlushAllQueuesByFileObject(__in MdFileObject FileObject)
FxPkgIo(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device)
_Must_inspect_result_ NTSTATUS VerifierFreeRequestToTestForwardProgess(__in FxRequest *Request)
FxIoQueue * GetFirstIoQueueLocked(__in FxIoQueueNode *QueueBookmark, __in PVOID Tag)
virtual _Must_inspect_result_ NTSTATUS Dispatch(__inout MdIrp Irp)
FxDriver * GetDriver(VOID)
_Must_inspect_result_ NTSTATUS ConfigureForwarding(__inout FxIoQueue *TargetQueue, __in WDF_REQUEST_TYPE RequestType)
_Must_inspect_result_ NTSTATUS ResumeProcessingForPower()
FxIoQueue * m_DefaultQueue
VOID ResetStateForRestart(VOID)
VOID RemoveIoQueue(__inout FxIoQueue *IoQueue)
_Must_inspect_result_ NTSTATUS __fastcall DispatchStep1(__inout MdIrp Irp, __in WDFCONTEXT DispatchContext)
_Must_inspect_result_ NTSTATUS EnqueueRequest(__in CfxDevice *Device, __inout FxRequest *pRequest)
BOOLEAN m_QueuesAreShuttingDown
VOID AddIoQueue(__inout FxIoQueue *IoQueue)
__inline FxIoInCallerContext * GetIoInCallerContextCallback(__in_opt FxCxDeviceInfo *CxDeviceInfo)
_Must_inspect_result_ NTSTATUS __fastcall DispatchStep2(__inout MdIrp Irp, __in_opt FxIoInCallerContext *IoInCallerCtx, __in_opt FxIoQueue *Queue)
NTSTATUS DispathToInCallerContextCallback(__in FxIoInCallerContext *InCallerContextInfo, __in FxRequest *Request, __inout MdIrp Irp)
LIST_ENTRY m_IoQueueListHead
FxIoQueue * GetNextIoQueueLocked(__in FxIoQueueNode *QueueBookmark, __in PVOID Tag)
VOID RemoveQueueReferences(__inout FxIoQueue *pQueue)
_Must_inspect_result_ NTSTATUS StopProcessingForPower(__in FxIoStopProcessingForPowerAction Action)
_Must_inspect_result_ NTSTATUS ConfigureDynamicDispatching(__in UCHAR MajorFunction, __in_opt FxCxDeviceInfo *CxDeviceInfo, __in PFN_WDFDEVICE_WDM_IRP_DISPATCH EvtDeviceWdmIrpDispatch, __in_opt WDFCONTEXT DriverContext)
VOID GetIoQueueListLocked(__in PSINGLE_LIST_ENTRY SListHead, __inout FxIoIteratorList ListType)
LIST_ENTRY m_DynamicDispatchInfoListHead
_Must_inspect_result_ NTSTATUS InitializeDefaultQueue(__in CfxDevice *Device, __inout FxIoQueue *Queue)
__inline BOOLEAN HasContext(VOID)
SHORT GetVerifierFlagsLocked(VOID)
VOID PreProcessSendAndForget(VOID)
FxRequestCompletionState SetCompletionState(__in FxRequestCompletionState NewState)
static _Must_inspect_result_ NTSTATUS _CreateForPackage(__in CfxDevice *Device, __in PWDF_OBJECT_ATTRIBUTES RequestAttributes, __in MdIrp Irp, __deref_out FxRequest **Request)
__inline PVOID GetInternalContext(VOID)
VOID PostProcessSendAndForget(VOID)
static __inline VOID MxQueryTickCount(__out PLARGE_INTEGER TickCount)
static __inline KIRQL MxGetCurrentIrql()
#define NT_SUCCESS(StatCode)
VOID CompleteIrp(IN PIRP Irp, IN NTSTATUS Status, IN ULONG_PTR Information)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
PFX_DRIVER_GLOBALS fxDriverGlobals
return pDevice GetDriver() -> GetHandle()
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ WDFDRIVER _In_ UCHAR _In_ PFN_WDFDEVICE_WDM_IRP_DISPATCH EvtDeviceWdmIrpDispatch
FX_TRACK_DRIVER(fxDriverGlobals)
FxIoInCallerContext * ioInCallerCtx
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Fdo, FX_TYPE_DEVICE,(PVOID *)&pFdo)
FxVerifierDbgBreakPoint(pFxDriverGlobals)
__inline ULONG FxRandom(__inout PULONG RandomSeed)
@ FxIoQueueNodeTypeBookmark
#define FX_VF_METHOD(classname, fnName)
static VOID GetIoQueueList_ProcessQueueListEntry(PLIST_ENTRY QueueLE, PSINGLE_LIST_ENTRY SListHead, PVOID Tag)
_Must_inspect_result_ NTSTATUS _In_ WDFCONTEXT DispatchContext
_Must_inspect_result_ NTSTATUS _In_ FxRequest _Inout_ SHORT * OrigVerifierFlags
_Must_inspect_result_ NTSTATUS _In_ FxRequest * Request
#define FX_IN_DISPATCH_CALLBACK
#define IO_ITERATOR_POWER_TAG
@ FxIoQueueIteratorListPowerOn
@ FxIoQueueIteratorListPowerOff
#define IO_ITERATOR_FLUSH_TAG
FxIoStopProcessingForPowerAction
@ FxIoStopProcessingForPowerHold
@ FxIoStopProcessingForPowerPurgeNonManaged
@ FxIoStopProcessingForPowerPurgeManaged
#define FXREQUEST_STATE_TAG
@ FXREQUEST_FLAG_DRIVER_INPROCESS_CONTEXT
@ FXREQUEST_FLAG_DRIVER_OWNED
@ FxRequestCompletionStateIoPkg
@ FxRequestCompletionStateNone
__inline BOOLEAN IsFxVerifierTestForwardProgressFailRandom(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
__inline BOOLEAN IsFxVerifierTestForwardProgressFailAll(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
__inline BOOLEAN IsFxVerifierTestForwardProgress(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
#define _Must_inspect_result_
PFILE_OBJECT MdFileObject
#define UNREFERENCED_PARAMETER(P)
static unsigned __int64 next
#define IRP_MJ_DEVICE_CONTROL
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_INFORMATION
static FxIoQueueNode * _FromListEntry(__in PLIST_ENTRY Entry)
__inline BOOLEAN IsNodeType(__in FxIoQueueNodeType NodeType)
PFN_WDFDEVICE_WDM_IRP_DISPATCH EvtDeviceDynamicDispatch
static __inline int Mj2Index(UCHAR MajorFunction)
FxCxDeviceInfo * CxDeviceInfo
Info Dispatch[DynamicDispatchMax]
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
struct _SINGLE_LIST_ENTRY * Next
struct _LIST_ENTRY * PLIST_ENTRY
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE Device
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
_In_ UCHAR _In_ UCHAR _In_ ULONG _In_ WDFCONTEXT DriverContext
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_In_ UCHAR _In_ UCHAR _In_ ULONG _In_ WDFCONTEXT _Inout_ PIRP _In_ WDFCONTEXT DispatchContext
EVT_WDFDEVICE_WDM_IRP_DISPATCH * PFN_WDFDEVICE_WDM_IRP_DISPATCH
enum _WDF_REQUEST_TYPE WDF_REQUEST_TYPE
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFQUEUE _In_ _Strict_type_match_ WDF_REQUEST_TYPE RequestType
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_IO_QUEUE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES QueueAttributes
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MJ_MAXIMUM_FUNCTION
FORCEINLINE VOID PushEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PSINGLE_LIST_ENTRY Entry)
FORCEINLINE PSINGLE_LIST_ENTRY PopEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead)