26#include "FxInterruptThreadpoolUm.hpp"
29#include "InterruptObjectUm.tmh"
104 "Waitblock creation failed for CWdfInterrupt object"
114 hr =
deviceStack->InitializeInterrupt((WUDF_INTERRUPT_CONTEXT)
this,
126 PUMDF_VERSION_DATA driverVersion =
deviceStack->GetMinDriverVersion();
128 BOOL preserveCompat =
129 deviceStack->ShouldPreserveIrpCompletionStatusCompatibility();
131 status = CHostFxUtil::NtStatusFromHr(
133 driverVersion->MajorNumber,
134 driverVersion->MinorNumber,
142 "failed to initialize interrupt "
184 StartThreadpoolWaitQueue();
193 &isRdConnectingOrConnected);
196 if (isRdConnectingOrConnected) {
206 "Multiple connection attempts for !WDFINTERRUPT 0x%p",
211 CHECK(
"Multiple interrupt connection attempts",
FALSE),
223 StopAndFlushThreadpoolWaitQueue();
226 PUMDF_VERSION_DATA driverVersion =
deviceStack->GetMinDriverVersion();
227 BOOL preserveCompat =
228 deviceStack->ShouldPreserveIrpCompletionStatusCompatibility();
230 status = CHostFxUtil::NtStatusFromHr(
232 driverVersion->MajorNumber,
233 driverVersion->MinorNumber,
239 "Connect message to reflector returned failure "
257 InterruptControlType controlType;
265 controlType = InterruptControlTypeDisconnect;
271 "Disconnect message to reflector returned failure "
274 FX_VERIFY_WITH_NAME(INTERNAL, TRAPMSG(
"Disconnect message to reflector returned failure. "),
289 StopAndFlushThreadpoolWaitQueue();
324 "SetPolicy message to reflector returned failure "
367 InterruptControlType controlType;
383 controlType = InterruptControlTypeResetInterruptInfo;
389 "ResetInterruptInfo message to reflector returned failure "
404 InterruptControlType controlType;
420 controlType = InterruptControlTypeRevokeResources;
426 "RevokeResources message to reflector returned failure "
448 InterruptControlTypeFlushQueuedDpcs);
453 "FlushQueuedDpcs message to reflector returned failure "
457 TRAPMSG(
"FlushQueuedDpcs message to reflector returned failure"),
482 "Failed to assign interrupt resource to interrupt object"
483 "because interrupt resource is for level-triggered interrupt"
484 "which is not supported on this platform. See the docs for info on"
485 "supported platforms. %!hresult!\n",
hr);
488 "Failed to assign interrupt resource to interrupt object"
489 "because interrupt resource is for level-triggered interrupt"
490 "which is not supported on this platform. See the docs for info on"
491 "supported platforms."),
509 "The resource descriptor indicates that this is a shared "
510 "edge-triggered interrupt. UMDF only supports sharing of "
511 "level-triggered interrupts. Please check if your device "
512 "firmware mistakenly declares this resource as shared "
513 "instead of device exclusive. If the resource is in fact "
514 "shared, then UMDF does not support this device.\n");
532 "AssignResources message to reflector returned failure "
542FxInterrupt::ThreadpoolWaitCallback(
551 EventWriteEVENT_UMDF_FX_INTERRUPT_NOTIFICATION_RECEIVED(
578 QueueSingleWaitOnInterruptEvent();
596 "AcknowledgeInterrupt message to reflector returned "
597 "failure. Check UMDF log for failure reason. %!hresult!",
hr);
600 "reflector returned failure. Check UMDF log for failure reason. "),
609FxInterrupt::QueueSingleWaitOnInterruptEvent(
617FxInterrupt::StartThreadpoolWaitQueue(
623 QueueSingleWaitOnInterruptEvent();
627FxInterrupt::StopAndFlushThreadpoolWaitQueue(
674 TP_WAIT_RESULT WaitResult
683 fxInterrupt->ThreadpoolWaitCallback();
696 StopAndFlushThreadpoolWaitQueue();
798 FX_VERIFY(INTERNAL,
CHECK(
"Must be Passive Interrupt", isPassive));
static KSYNCHRONIZE_ROUTINE SynchronizeRoutine
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
virtual void Lock(__out PKIRQL PreviousIrql)=0
virtual void Unlock(__in KIRQL PreviousIrql)=0
WDFDEVICE __inline GetHandle(VOID)
FxInterruptThreadpool * GetInterruptThreadpool(VOID)
IWudfDeviceStack2 * GetDeviceStack2(VOID)
VOID SetInterruptThreadpool(_In_ FxInterruptThreadpool *Pool)
IWudfDeviceStack * GetDeviceStack(VOID)
static HRESULT _CreateAndInit(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _Out_ FxInterruptThreadpool **ppThreadpool)
static HRESULT _CreateAndInit(_In_ FxInterruptThreadpool *Threadpool, _In_ FxInterrupt *Interrupt, _In_ PTP_WAIT_CALLBACK WaitCallback, _Out_ FxInterruptWaitblock **Waitblock)
VOID WaitForOutstandingCallbackToComplete(VOID)
VOID SetThreadpoolWait(VOID)
HANDLE GetEventHandle(VOID)
VOID ClearThreadpoolWait(VOID)
BOOLEAN m_DisposeWaitLock
VOID FlushQueuedDpcs(VOID)
BOOLEAN IsLevelTriggered(__in ULONG Flags)
FxCallbackLock * m_CallbackLock
VOID FlushQueuedWorkitem(VOID)
RD_INTERRUPT_CONTEXT m_RdInterruptContext
PFN_WDF_INTERRUPT_DPC m_EvtInterruptDpc
__inline BOOLEAN IsPassiveHandling(VOID)
__inline BOOLEAN IsWakeCapable(VOID)
VOID SetPolicyInternal(__in WDF_INTERRUPT_POLICY Policy, __in WDF_INTERRUPT_PRIORITY Priority, __in PGROUP_AFFINITY TargetProcessorSet)
PFN_WDF_INTERRUPT_ISR m_EvtInterruptIsr
BOOLEAN WakeInterruptIsr(VOID)
BOOLEAN m_PassiveHandlingByRedirector
FxInterruptWaitblock * m_InterruptWaitblock
static MdInterruptServiceRoutineType _InterruptThunk
VOID DisconnectInternal(VOID)
WDF_TRI_STATE m_ShareVector
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 ConnectInternal(VOID)
VOID WorkItemHandler(VOID)
BOOLEAN QueueDpcForIsr(VOID)
_Must_inspect_result_ NTSTATUS InitializeInternal(__in FxObject *Parent, __in PWDF_INTERRUPT_CONFIG Configuration)
FxSystemWorkItem * m_SystemWorkItem
VOID FilterResourceRequirements(__inout PIO_RESOURCE_DESCRIPTOR IoResourceDescriptor)
WDF_INTERRUPT_INFO m_InterruptInfo
PFN_WDF_INTERRUPT_WORKITEM m_EvtInterruptWorkItem
VOID RevokeResourcesInternal(VOID)
virtual VOID DeleteObject(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
#define NT_SUCCESS(StatCode)
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
FX_TRACK_DRIVER(fxDriverGlobals)
IWudfDeviceStack * deviceStack
FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK(ERROR_STRING_HW_ACCESS_NOT_ALLOWED,(pDevice->IsDirectHardwareAccessAllowed()==TRUE)), DriverGlobals->DriverName)
_Must_inspect_result_ __inline BOOLEAN FxIsPassiveLevelInterruptSupported(VOID)
BOOLEAN _SynchronizeExecution(__in MdInterrupt Interrupt, __in MdInterruptSynchronizeRoutine SynchronizeRoutine, __in PVOID SynchronizeContext)
KSYNCHRONIZE_ROUTINE * MdInterruptSynchronizeRoutine
#define _Must_inspect_result_
#define ASSERTMSG(msg, exp)
#define UNREFERENCED_PARAMETER(P)
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_ERROR
_Must_inspect_result_ BOOLEAN IsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
_In_ WDFDPC _In_ BOOLEAN Wait
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY _In_ KAFFINITY TargetProcessorSet
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG Configuration
_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
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY Policy
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
struct _TP_CALLBACK_INSTANCE * PTP_CALLBACK_INSTANCE
enum _CM_SHARE_DISPOSITION CM_SHARE_DISPOSITION
@ CmResourceShareDeviceExclusive
@ CmResourceShareUndetermined
_In_ PKSYNCHRONIZE_ROUTINE _In_opt_ __drv_aliasesMem PVOID SynchronizeContext
_Inout_opt_ PVOID Parameter