34#if defined(EVENT_TRACING)
35#include "InterruptObject.tmh"
251 "Destroy Interrupt destroyed without calling WdfObjectDelete, or "
252 "by Framework processing DeviceRemove. Possible reference count problem?");
259 "Destroy Interrupt destroyed without calling WdfObjectDelete, or "
260 "by Framework processing DeviceRemove. Possible reference count problem?");
291 if (
NULL == fxWakeInterruptMachine) {
296 "WDFDEVICE 0x%p failed to allocate FxWakeInterruptMachine. %!STATUS!.",
306 "WDFDEVICE 0x%p failed to initialize FxWakeInterruptMachine. %!STATUS!.",
314 fxWakeInterruptMachine
320 "WDFDEVICE 0x%p failed to init FxWakeInterruptMachine. %!STATUS!.",
334 "WDFDEVICE 0x%p created wake interrupt",
339 if (
NULL != fxWakeInterruptMachine) {
340 delete fxWakeInterruptMachine;
405 "Wake Interrupt ISR is stuck waiting for the device"
406 "to power back up and driver calllback to be processed",
441 "not enough memory to allocate WDFINTERRUPT for WDFDEVICE %p, "
458 "FxInterrupt Commit failed %!STATUS!",
status);
640 (
PVOID*)&pFxSpinLock);
677 "The specified object 0x%p is not a valid parent for a "
678 "WDFINTERRUPT, WDF_INTERRUPT_CONFIG structure 0x%p passed, "
695 passiveCallbacks =
TRUE;
698 passiveCallbacks =
FALSE;
701 passiveCallbacks =
TRUE;
704 passiveCallbacks =
FALSE;
751 WDFWAITLOCK waitLock =
NULL;
765 "Could not allocate waitlock, %!STATUS!",
796 "Could not allocate workitem, %!STATUS!",
952 if (CmDescTrans->u.Interrupt.Group > 0 &&
979 "Driver cannot specify PassiveHandling for MSI interrupts.");
1017 CmDescRaw->u.MessageInterrupt.Raw.MessageCount > 1) {
1064 "Is MSI? %d, MSI-ID %d, AffinityPolicy %!WDF_INTERRUPT_POLICY!, "
1065 "Priority %!WDF_INTERRUPT_PRIORITY!, Group %d, Affinity 0x%I64x, "
1066 "Irql 0x%x, Vector 0x%x\n",
1098 ULONG messageNumber;
1159 "You cannot apply policy at this stage for WDFINTERRUPT 0x%p "
1160 "For interrupts created in EvtDevicePrepareHardware you must use "
1161 "EvtDeviceFilter APIs or use a pre-process routine to handle the "
1162 "IRP_MN_FILTER_RESOURCE_REQUIREMENT, %!STATUS!",
1278 "IoConnectInterrupt(Ex) Failed,"
1282 " Synchronize IRQL 0x%x,"
1285 " ProcessorGroup %d,"
1286 " ProcessorEnableMask 0x%I64x,"
1307#if FX_IS_KERNEL_MODE
1326 "EvtInterruptEnable WDFDEVICE %p, WDFINTERRUPT %p, PKINTERRUPT %p "
1464 "EvtInterruptDisable WDFDEVICE %p, WDFINTERRUPT %p, "
1465 "PKINTERRUPT %p returned %!STATUS!",
1477#if FX_IS_KERNEL_MODE
1510#if FX_IS_KERNEL_MODE
1563#if FX_IS_KERNEL_MODE
1600 "Force disconnect called on WDFDEVICE %p, WDFINTERRUPT %p, PKINTERRUPT %p",
1634 "Force connect called on WDFDEVICE %p, WDFINTERRUPT %p, PKINTERRUPT %p",
1725 p->ReturnVal =
p->Interrupt->InterruptEnableInvokeCallback();
1789 p->ReturnVal =
p->Interrupt->InterruptDisableInvokeCallback();
1822#if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
1834#if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
1838 FX_VERIFY(INTERNAL, TRAPMSG(
"Not expected"));
1873#pragma prefast(push)
1874#pragma prefast(disable:__WARNING_UNEXPECTED_IRQL_CHANGE, "Used unannotated pointers previously")
1886 ASSERTMSG(
"Can't synchronize when the interrupt isn't connected: ",
1887 kinterrupt !=
NULL);
1889 if (
NULL != kinterrupt) {
1910 ASSERTMSG(
"TryToAcquireLock is only available for passive-level "
1923 return FxWaitLockInternal::IsLockAcquired(
1928#pragma prefast(push)
1929#pragma prefast(disable:__WARNING_UNEXPECTED_IRQL_CHANGE, "Used unannotated pointers previously")
1941 ASSERTMSG(
"Can't synchronize when the interrupt isn't connected: ",
1942 kinterrupt !=
NULL);
1944 if (
NULL != kinterrupt) {
1945#pragma prefast(suppress:__WARNING_CALLER_FAILING_TO_HOLD, "Unable to annotate ReleaseLock for this case.");
1955#pragma prefast(suppress:__WARNING_CALLER_FAILING_TO_HOLD, "Unable to annotate ReleaseLock for this case.");
1971 if (
p->Interrupt->m_PassiveHandling) {
1978 p->Interrupt->AcquireLock();
1979 result =
p->Callback(
p->Interrupt->GetHandle(),
p->Context);
1980 p->Interrupt->ReleaseLock();
1983 result =
p->Callback(
p->Interrupt->GetHandle(),
p->Context);
2004#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
2005 ASSERTMSG(
"Can't synchronize when the interrupt isn't connected: ",
2006 kinterrupt !=
NULL);
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
static FxDeviceBase * _SearchForDevice(__in FxObject *Object, __out_opt IFxHasCallbacks **Callbacks)
ULONG __inline GetDeviceObjectFlags(VOID)
WDFDEVICE __inline GetHandle(VOID)
MdDeviceObject __inline GetDeviceObject(VOID)
__inline WDF_DEVICE_PNP_STATE GetDevicePnpState()
virtual VOID SetDeviceTelemetryInfoFlags(_In_ FxDeviceInfoFlags Flag)
PFN_WDF_INTERRUPT_ENABLE m_EvtInterruptEnable
PWDF_INTERRUPT_INFO GetInfo(VOID)
BOOLEAN m_DisposeWaitLock
static MdInterruptSynchronizeRoutineType _InterruptDisableThunk
static MdInterruptSynchronizeRoutineType _InterruptSynchronizeThunk
VOID FlushAndRundown(VOID)
_Must_inspect_result_ NTSTATUS Connect(__in ULONG NotifyFlags)
VOID FlushQueuedDpcs(VOID)
_Must_inspect_result_ NTSTATUS ForceReconnect(VOID)
BOOLEAN m_PassiveHandling
BOOLEAN IsLevelTriggered(__in ULONG Flags)
VOID ReportActive(_In_ BOOLEAN Internal=FALSE)
struct _KINTERRUPT * GetInterruptPtr(VOID)
static EVT_SYSTEMWORKITEM _InterruptWorkItemCallback
FxCallbackLock * m_CallbackLock
static MdDeferredRoutineType _InterruptDpcThunk
VOID FlushQueuedWorkitem(VOID)
VOID InvokeWakeInterruptEvtIsr(VOID)
BOOLEAN m_IsEdgeTriggeredNonMsiInterrupt
RD_INTERRUPT_CONTEXT m_RdInterruptContext
static MdInterruptSynchronizeRoutineType _InterruptMarkDisconnecting
BOOLEAN m_CreatedInPrepareHardware
volatile KIRQL m_SynchronizeIrql
WDF_INTERRUPT_PRIORITY m_Priority
PFN_WDF_INTERRUPT_DPC m_EvtInterruptDpc
BOOLEAN m_ForceDisconnected
VOID AssignResources(__in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescRaw, __in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescTrans)
__inline BOOLEAN IsWakeCapable(VOID)
VOID OnPostReleaseHardware(VOID)
NTSTATUS InterruptDisable(VOID)
__inline BOOLEAN IsPassiveConnect(VOID)
PCM_PARTIAL_RESOURCE_DESCRIPTOR m_CmTranslatedResource
BOOLEAN Synchronize(__in PFN_WDF_INTERRUPT_SYNCHRONIZE Callback, __in WDFCONTEXT Context)
_Must_inspect_result_ NTSTATUS Initialize(__in CfxDevice *Device, __in FxObject *Parent, __in PWDF_INTERRUPT_CONFIG Configuration)
BOOLEAN IsSoftDisconnectCapable(VOID)
NTSTATUS InterruptEnableInvokeCallback(VOID)
struct _KINTERRUPT * m_InterruptCaptured
VOID SetPolicyInternal(__in WDF_INTERRUPT_POLICY Policy, __in WDF_INTERRUPT_PRIORITY Priority, __in PGROUP_AFFINITY TargetProcessorSet)
FxWakeInterruptMachine * m_WakeInterruptMachine
PFN_WDF_INTERRUPT_ISR m_EvtInterruptIsr
virtual ~FxInterrupt(VOID)
static _Must_inspect_result_ NTSTATUS _CreateAndInit(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device, __in_opt FxObject *Parent, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in PWDF_INTERRUPT_CONFIG Configuration, __out FxInterrupt **Interrupt)
BOOLEAN WakeInterruptIsr(VOID)
BOOLEAN m_PassiveHandlingByRedirector
FxInterruptWaitblock * m_InterruptWaitblock
static MdInterruptServiceRoutineType _InterruptThunk
VOID DisconnectInternal(VOID)
WDF_TRI_STATE m_ShareVector
PFN_WDF_INTERRUPT_DISABLE m_EvtInterruptDisable
static BOOLEAN _IsMessageInterrupt(__in USHORT ResourceFlags)
VOID SetPolicy(__in WDF_INTERRUPT_POLICY Policy, __in WDF_INTERRUPT_PRIORITY Priority, __in PGROUP_AFFINITY TargetProcessorSet)
VOID FlushAndRundownInternal(VOID)
VOID AssignResourcesInternal(__in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescRaw, __in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescTrans, __in PWDF_INTERRUPT_INFO InterruptConfig)
_Must_inspect_result_ NTSTATUS Disconnect(__in ULONG NotifyFlags)
BOOLEAN QueueWorkItemForIsr(VOID)
VOID RevokeResources(VOID)
FxInterrupt(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
BOOLEAN m_UseSoftDisconnect
_Must_inspect_result_ NTSTATUS ConnectInternal(VOID)
virtual VOID DeleteObject(VOID)
NTSTATUS InterruptDisableInvokeCallback(VOID)
VOID SetActiveForWake(__in BOOLEAN ActiveForWake)
WDF_INTERRUPT_POLICY m_Policy
_Must_inspect_result_ NTSTATUS CreateWakeInterruptMachine(VOID)
GROUP_AFFINITY m_Processors
_Must_inspect_result_ NTSTATUS InitializeInternal(__in FxObject *Parent, __in PWDF_INTERRUPT_CONFIG Configuration)
BOOLEAN TryToAcquireLock(VOID)
struct _KINTERRUPT * m_Interrupt
BOOLEAN IsActiveForWake(VOID)
FxSystemWorkItem * m_SystemWorkItem
WDF_INTERRUPT_INFO m_InterruptInfo
virtual BOOLEAN Dispose(VOID)
_Must_inspect_result_ NTSTATUS InitializeWorker(__in FxObject *Parent, __in PWDF_INTERRUPT_CONFIG Configuration)
PFN_WDF_INTERRUPT_WORKITEM m_EvtInterruptWorkItem
static MdInterruptSynchronizeRoutineType _InterruptEnableThunk
VOID ReportInactive(_In_ BOOLEAN Internal=FALSE)
_Must_inspect_result_ NTSTATUS ForceDisconnect(VOID)
VOID RevokeResourcesInternal(VOID)
NTSTATUS InterruptEnable(VOID)
VOID MarkPassiveDispose(__in FxObjectLockState State=ObjectLock)
virtual VOID DeleteObject(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
static _Must_inspect_result_ NTSTATUS _GetEffectiveLock(__in FxObject *Object, __in_opt IFxHasCallbacks *Callbacks, __in BOOLEAN AutomaticLocking, __in BOOLEAN PassiveCallbacks, __out FxCallbackLock **CallbackLock, __out_opt FxObject **CallbackLockObject)
CfxDeviceBase * m_DeviceBase
VOID MarkNoDeleteDDI(__in FxObjectLockState State=ObjectLock)
VOID DeleteFromFailedCreate(VOID)
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
VOID AddInterruptObject(__in FxInterrupt *Interrupt)
ULONG m_InterruptObjectCount
VOID WakeInterruptCreated(VOID)
VOID RemoveInterruptObject(__in FxInterrupt *Interrupt)
VOID SetInterruptSpinLock(VOID)
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PVOID WdmObject, __out FxSystemWorkItem **pObject)
__inline BOOLEAN TryToEnqueue(__in PFN_WDF_SYSTEMWORKITEM CallbackFunc, __in PVOID Parameter)
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS DriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in_opt FxObject *ParentObject, __in BOOLEAN AssignDriverAsDefaultParent, __out WDFWAITLOCK *LockHandle)
static VOID _ProcessEventInner(__inout FxPkgPnp *PkgPnp, __inout FxPostProcessInfo *Info, __in PVOID WorkerContext)
VOID ProcessEvent(__in FxWakeInterruptEvents Event)
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in EVENT_TYPE Type, __in BOOLEAN InitialState)
MxEvent * GetSelfPointer(VOID)
static __inline KIRQL MxAcquireInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt)
static __inline VOID MxReleaseInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt, _In_ KIRQL OldIrql)
static __inline BOOLEAN MxInsertQueueDpc(__inout PRKDPC Dpc, __in_opt PVOID SystemArgument1, __in_opt PVOID SystemArgument2)
static __inline KIRQL MxGetCurrentIrql()
CLIPBOARD_GLOBALS Globals
#define NT_SUCCESS(StatCode)
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
#define InitializeListHead(ListHead)
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
PFX_DRIVER_GLOBALS fxDriverGlobals
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Fdo, FX_TYPE_DEVICE,(PVOID *)&pFdo)
FxVerifierDbgBreakPoint(pFxDriverGlobals)
_Must_inspect_result_ __inline BOOLEAN FxIsPassiveLevelInterruptSupported(VOID)
@ WaitSignalBreakUnderDebugger
@ WaitSignalBreakUnderVerifier
_Must_inspect_result_ __inline BOOLEAN FxIsProcessorGroupSupported(VOID)
BOOLEAN _SynchronizeExecution(__in MdInterrupt Interrupt, __in MdInterruptSynchronizeRoutine SynchronizeRoutine, __in PVOID SynchronizeContext)
FxInterrupt * pFxInterrupt
@ NotifyResourcesExplicitPowerup
@ NotifyResourcesForceDisconnect
@ NotifyResourcesExplicitPowerDown
@ NotifyResourcesSurpriseRemoved
@ NotifyResourcesDisconnectInactive
@ NotifyResourcesArmedForWake
return &pObject m_DescriptorClone
@ DeviceInfoLineBasedEdgeTriggeredInterrupt
@ DeviceInfoMsi22MultiMessageInterrupt
@ DeviceInfoMsiXOrSingleMsi22Interrupt
@ DeviceInfoLineBasedLevelTriggeredInterrupt
@ DeviceInfoPassiveLevelInterrupt
GLenum const GLfloat * params
struct _WDF_INTERRUPT_CONFIG_V1_9 * PWDF_INTERRUPT_CONFIG_V1_9
struct _WDF_INTERRUPT_CONFIG_V1_11_BETA * PWDF_INTERRUPT_CONFIG_V1_11_BETA
struct _WDF_INTERRUPT_CONFIG_V1_11_BETA WDF_INTERRUPT_CONFIG_V1_11_BETA
struct _WDF_INTERRUPT_CONFIG_V1_9 WDF_INTERRUPT_CONFIG_V1_9
_In_ PKSPIN_CONNECT Connect
#define CM_RESOURCE_INTERRUPT_LATCHED
#define _Must_inspect_result_
#define ASSERTMSG(msg, exp)
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
FxLibraryGlobalsType FxLibraryGlobals
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_INFORMATION
_Must_inspect_result_ NTSTATUS Initialize(__in PFX_DRIVER_GLOBALS DriverGlobals)
PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
BOOLEAN IsUserModeFramework
_Must_inspect_result_ NTSTATUS Init(__inout FxPkgPnp *Pnp, __in PFN_PNP_EVENT_WORKER WorkerRoutine, __in PVOID WorkerContext=NULL)
VOID WaitForSignal(__in MxEvent *Event, __in PCSTR ReasonForWaiting, __in PVOID Handle, __in ULONG WarningTimeoutInSec, __in ULONG WaitSignalFlags)
PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptTranslated
WDF_TRI_STATE ShareVector
PFN_WDF_INTERRUPT_WORKITEM EvtInterruptWorkItem
PFN_WDF_INTERRUPT_DPC EvtInterruptDpc
BOOLEAN AutomaticSerialization
PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptRaw
PFN_WDF_INTERRUPT_ENABLE EvtInterruptEnable
PFN_WDF_INTERRUPT_ISR EvtInterruptIsr
PFN_WDF_INTERRUPT_DISABLE EvtInterruptDisable
PFN_WDF_INTERRUPT_DISABLE EvtInterruptDisable
PFN_WDF_INTERRUPT_DPC EvtInterruptDpc
WDF_TRI_STATE ShareVector
PFN_WDF_INTERRUPT_ENABLE EvtInterruptEnable
BOOLEAN AutomaticSerialization
PFN_WDF_INTERRUPT_ISR EvtInterruptIsr
KAFFINITY TargetProcessorSet
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE Device
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
EVT_WDF_INTERRUPT_DISABLE * PFN_WDF_INTERRUPT_DISABLE
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY _In_ KAFFINITY TargetProcessorSet
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG Configuration
@ WdfIrqPriorityUndefined
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
enum _WDF_INTERRUPT_PRIORITY WDF_INTERRUPT_PRIORITY
enum _WDF_INTERRUPT_POLICY WDF_INTERRUPT_POLICY
EVT_WDF_INTERRUPT_DPC * PFN_WDF_INTERRUPT_DPC
EVT_WDF_INTERRUPT_ISR * PFN_WDF_INTERRUPT_ISR
FORCEINLINE VOID WDF_INTERRUPT_INFO_INIT(_Out_ PWDF_INTERRUPT_INFO Info)
EVT_WDF_INTERRUPT_WORKITEM * PFN_WDF_INTERRUPT_WORKITEM
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
@ WdfIrqPolicyOneCloseProcessor
EVT_WDF_INTERRUPT_SYNCHRONIZE * PFN_WDF_INTERRUPT_SYNCHRONIZE
EVT_WDF_INTERRUPT_ENABLE * PFN_WDF_INTERRUPT_ENABLE
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY Policy
FORCEINLINE VOID WDF_OBJECT_ATTRIBUTES_INIT(_Out_ PWDF_OBJECT_ATTRIBUTES Attributes)
#define STATUS_WDF_INCOMPATIBLE_EXECUTION_LEVEL
enum _WDF_TRI_STATE WDF_TRI_STATE
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
_In_opt_ PVOID DeferredContext