35 #if defined(EVENT_TRACING) 36 #include "PnpStateMachine.tmh" 62 #if FX_STATE_MACHINE_VERIFY 63 #define VALIDATE_PNP_STATE(_CurrentState, _NewState) \ 64 ValidatePnpStateEntryFunctionReturnValue((_CurrentState), (_NewState)) 66 #define VALIDATE_PNP_STATE(_CurrentState, _NewState) (0) 67 #endif //FX_STATE_MACHINE_VERIFY 852 "WDFDEVICE 0x%p !devobj 0x%p current pnp state %!WDF_DEVICE_PNP_STATE! " 853 "dropping event %!FxPnpEvent! because of a full queue",
864 ASSERT(!
"The PnP queue is full. This shouldn't be able to happen.");
871 "WDFDEVICE 0x%p !devobj 0x%p current pnp state %!WDF_DEVICE_PNP_STATE! " 872 "dropping event %!FxPnpEvent! because of a closed queue",
916 ProcessOnDifferentThread
924 if (FxWaitLockInternal::IsLockAcquired(
status)) {
963 This->m_PnpMachine.m_StateMachineLock.AcquireLock(
964 This->GetDriverGlobals()
981 This->m_PnpMachine.m_StateMachineLock.ReleaseLock(
982 This->GetDriverGlobals()
1051 if (
entry->StateInfo.Bits.QueueOpen ==
FALSE) {
1069 if (
entry->FirstTargetState.PnpEvent ==
event) {
1070 newState =
entry->FirstTargetState.TargetState;
1074 else if (
entry->OtherTargetStates !=
NULL) {
1080 if (
entry->OtherTargetStates[
i].PnpEvent ==
event) {
1081 newState =
entry->OtherTargetStates[
i].TargetState;
1091 "WDFDEVICE 0x%p !devobj 0x%p current pnp state " 1092 "%!WDF_DEVICE_PNP_STATE! dropping event %!FxPnpEvent!",
1098 if ((
entry->StateInfo.Bits.KnownDroppedEvents &
event) == 0) {
1103 "WDFDEVICE 0x%p !devobj %p current state " 1104 "%!WDF_DEVICE_PNP_STATE!, policy event %!FxPnpEvent! is not" 1105 " a known dropped event, known dropped events are " 1111 entry->StateInfo.Bits.KnownDroppedEvents);
1183 "WDFDEVICE 0x%p !devobj 0x%p entering PnP State " 1184 "%!WDF_DEVICE_PNP_STATE! from %!WDF_DEVICE_PNP_STATE!",
1197 data.Data.LeaveState.CurrentState = currentState;
1198 data.Data.LeaveState.NewState = newState;
1216 data.Data.EnterState.CurrentState = currentState;
1217 data.Data.EnterState.NewState = newState;
1226 currentState = newState;
1234 newState =
entry->StateFunc(
this);
1252 data.Data.PostProcessState.CurrentState = currentState;
1283 return This->PnpEventCheckForDevicePresenceOverload();
1307 return This->PnpEventEjectHardwareOverload();
1328 if (
This->PnpSendStartDeviceDownTheStackOverload() ==
FALSE) {
1359 This->PnpFinishProcessingIrp(
TRUE);
1388 This->QueryForReenumerationInterface();
1397 if (matched ==
FALSE) {
1433 if (
This->IsPowerPolicyOwner()) {
1443 "could not query caps for stack, %!STATUS!",
status);
1452 This->PnpPowerPolicyStart();
1481 status =
This->PnpEnableInterfacesAndRegisterWmi();
1548 status =
This->m_DeviceQueryRemove.Invoke(
This->m_Device->GetHandle());
1564 "EvtDeviceQueryRemove failed, %!STATUS!",
status);
1569 "EvtDeviceQueryRemove returned an invalid status " 1570 "STATUS_NOT_SUPPORTED");
1610 status =
This->PnpPowerReferenceDuringQueryPnp();
1627 "StopIdle on WDFDEVICE %p failed, %!STATUS!, failing query remove",
1692 completeQuery =
TRUE;
1694 if (
This->m_DeviceStopCount != 0) {
1697 "Failing QueryRemoveDevice because the driver " 1698 "has indicated that it cannot be stopped, count %d",
1699 This->m_DeviceStopCount);
1703 else if (
This->IsInSpecialUse()) {
1706 "Failing QueryRemoveDevice due to open special file counts " 1707 "(paging %d, hiber %d, dump %d, boot %d)",
1719 completeQuery =
FALSE;
1723 if (completeQuery) {
1767 This->PnpPowerPolicyStop();
1768 This->PnpPowerDereferenceSelf();
1799 status =
This->m_DeviceQueryStop.Invoke(
This->m_Device->GetHandle());
1810 "EvtDeviceQueryStop failed, %!STATUS!",
status);
1815 "EvtDeviceQueryStop returned an invalid status " 1816 "STATUS_NOT_SUPPORTED");
1858 status =
This->PnpPowerReferenceDuringQueryPnp();
1875 "StopIdle on WDFDEVICE %p failed, %!STATUS!, failing query stop",
1940 if (
This->m_DeviceStopCount != 0) {
1943 "Failing QueryStopDevice because the driver " 1944 "has indicated that it cannot be stopped, count %d",
1945 This->m_DeviceStopCount);
1949 else if (
This->IsInSpecialUse()) {
1952 "Failing QueryStopDevice due to open special file counts (paging %d," 1953 " hiber %d, dump %d, boot %d)",
1966 completeQuery =
FALSE;
1969 if (completeQuery) {
2077 This->PnpPowerDereferenceSelf();
2108 This->ChildListNotifyRemove(&
This->m_PendingChildCount);
2144 return This->PnpEventPdoRemovedOverload();
2165 if (
This->m_DeviceRemoveProcessed !=
NULL) {
2166 This->m_SetDeviceRemoveProcessed =
TRUE;
2193 This->m_DeviceSurpriseRemoval.Invoke(
This->m_Device->GetHandle());
2199 This->PnpEventSurpriseRemovePendingOverload();
2204 This->PnpFinishProcessingIrp();
2327 "EvtDeviceReleaseHardware %p failed, %!STATUS!",
2336 This->PnpPowerPolicyRemove();
2365 This->m_Device->FxLogDeviceStartTelemetryEvent();
2368 This->PnpFinishProcessingIrp();
2435 This->PnpPowerPolicyStop();
2462 This->PnpPowerPolicyStart();
2495 if (matched ==
FALSE) {
2542 This->NotifyResourceobjectsToReleaseResources();
2548 "EvtDeviceReleaseHardware failed - %!STATUS!",
2552 This->SetInternalFailure();
2560 This->PnpFinishProcessingIrp();
2583 if (
This->PnpSendStartDeviceDownTheStackOverload() ==
FALSE) {
2620 This->PnpPowerPolicyStop();
2621 This->PnpPowerDereferenceSelf();
2648 This->m_DeviceSurpriseRemoval.Invoke(
This->m_Device->GetHandle());
2653 This->PnpEventSurpriseRemovePendingOverload();
2725 return This->PnpEventFdoRemovedOverload();
2748 This->PnpPowerDereferenceSelf();
2777 This->m_DeviceSurpriseRemoval.Invoke(
This->m_Device->GetHandle());
2782 This->PnpEventSurpriseRemovePendingOverload();
2818 This->PnpPowerPolicyStop();
2842 This->PnpPowerPolicySurpriseRemove();
2898 This->PnpPowerPolicyRemove();
2936 This->PnpCheckAndIncrementRestartCount()) {
2941 This->AskParentToRemoveAndReenumerate();
2951 This->m_Device->GetPhysicalDevice()
2959 This->m_Device->GetDeviceObject()
2992 This->m_DeviceSurpriseRemoval.Invoke(
This->m_Device->GetHandle());
2997 This->PnpEventSurpriseRemovePendingOverload();
3036 This->PnpFinishProcessingIrp();
3062 This->ReleasePowerThread();
3067 This->ReleaseReenumerationInterface();
3069 This->PnpFinishProcessingIrp();
3094 This->m_Device->EarlyDispose();
3101 This->m_Device->DestroyChildren();
3127 This->PnpPowerPolicyStop();
3155 "EvtDeviceReleaseHardware failed with %!STATUS!",
status);
3159 This->SetInternalFailure();
3165 if (
This->PnpSendStartDeviceDownTheStackOverload() ==
FALSE) {
3204 if (matched ==
FALSE) {
3221 This->PnpPowerPolicyStart();
3259 This->m_PowerThreadInterfaceReferenceCount = 1;
3268 This->m_PendingChildCount = 1;
3276 This->m_Device->m_PkgIo->ResetStateForRestart();
3278 if (
This->IsPowerPolicyOwner()) {
3279 This->m_PowerPolicyMachine.m_Owner->m_PowerIdleMachine.Reset();
3292 This->m_WakeInterruptsKeepConnected =
FALSE;
3321 return This->PnpGetPostRemoveState();
3354 if (
This->m_DeviceRemoveProcessed ==
NULL) {
3356 This->m_Device->GetRemoveLock(),
3375 if (
This->m_Device->m_ParentWaitingOnChild) {
3380 if (
This->m_DeviceRemoveProcessed ==
NULL) {
3391 This->m_Device->GetRemoveLock(),
3398 This->m_PnpMachine.SetDelayedDeletion();
3404 This->m_SetDeviceRemoveProcessed =
TRUE;
3450 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE) 3478 FxPkgPnp::PnpPrepareHardware(
3497 *ResourcesMatched =
FALSE;
3523 *ResourcesMatched =
FALSE;
3529 #if (FX_CORE_MODE == FX_CORE_USER_MODE) 3563 *ResourcesMatched =
TRUE;
3579 "EvtDevicePrepareHardware failed %!STATUS!",
status);
3584 "EvtDevicePrepareHardware returned an invalid status " 3585 "STATUS_NOT_SUPPORTED");
3609 "PrepareHardware failed %!STATUS!",
status);
3653 "EvtDeviceReleaseHardware returned an invalid status " 3654 "STATUS_NOT_SUPPORTED");
3661 #if (FX_CORE_MODE == FX_CORE_USER_MODE) 3918 "Entering PnpMatchResources");
3939 "Could not allocate raw resource list for WDFDEVICE 0x%p, %!STATUS!",
3948 "Could not allocate translated resource list for WDFDEVICE 0x%p, %!STATUS!",
3973 curTrans != endTrans;
3974 curTrans = curTrans->
Next(), curRaw = curRaw->
Next()) {
3991 "Not enough interrupt objects created by WDFDEVICE 0x%p",
3999 messageCount = resCmRaw->m_Descriptor.u.MessageInterrupt.Raw.MessageCount;
4003 (messageCount > 1)) {
4040 #if FX_IS_KERNEL_MODE 4067 ULONG characteristics;
4087 #endif // FX_IS_KERNEL_MODE 4091 "Exiting PnpMatchResources %!STATUS!",
status);
4163 for (pleFwd =
ple->Flink;
4165 pleFwd = pleFwd->
Flink) {
4186 for (pleFwd =
ple->Flink;
4188 pleFwd = pleFwd->
Flink) {
4267 if (&
res->m_DescriptorClone == *CmResource) {
4279 "The translated PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p is not valid, " 4280 "WDFDEVICE 0x%p, %!STATUS!",
4293 "The raw PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p is not valid, " 4294 "WDFDEVICE 0x%p, %!STATUS!",
4303 if (
sizeof(
res->m_Descriptor) !=
4306 sizeof(
res->m_Descriptor))) {
4310 "The translated PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p is not valid, " 4311 "driver cannot change the assigned PnP resources, WDFDEVICE 0x%p, " 4325 "The raw PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p is not valid, " 4326 "driver cannot change the assigned PnP resources, WDFDEVICE 0x%p, " 4337 *CmResource = &
res->m_Descriptor;
4376 cmIntResourceRaw = CmIntResourceRaw;
4377 cmIntResource = CmIntResource;
4395 "The raw PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p is not an " 4396 "interrupt resource, WDFDEVICE 0x%p, %!STATUS!",
4406 "The translated PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p is not an " 4407 "interrupt resource, WDFDEVICE 0x%p, %!STATUS!",
4433 if (messageCount != 0) {
4437 "Multi-message MSI 2.2 interrupts must be created " 4438 "sequentially, WDFDEVICE 0x%p, %!STATUS!",
4451 "The PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p was already used " 4452 "to create a wakable interrupt 0x%p, WDFDEVICE 0x%p and " 4453 "any functional interrupt being shared with wakable interrupt " 4454 "can not use passive level handling",
4465 "The PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p was already used " 4466 "to create a passive level interrupt 0x%p, WDFDEVICE 0x%p and " 4467 "is now being used to create a wakable interrupt. A functional " 4468 "passive level interrupt can not be shared with wakable interrupt",
4483 "The PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p was already used " 4484 "to create interrupt 0x%p, WDFDEVICE 0x%p",
4500 "All the MSI 2.2 interrupts for " 4501 "PCM_PARTIAL_RESOURCE_DESCRIPTOR 0x%p are already created, " 4502 "WDFDEVICE 0x%p, %!STATUS!",
4515 #define RESTART_START_ACHIEVED_NAME L"StartAchieved" 4516 #define RESTART_START_TIME_NAME L"StartTime" 4517 #define RESTART_COUNT_NAME L"Count" 4590 BOOLEAN started, writeTick, writeCount, writeStarted;
4600 writeStarted =
FALSE;
4609 writeStarted =
TRUE;
4617 if (CreatedNewKey) {
4634 &valueNameStartTime,
4646 status = FxRegKey::_QueryULong(RestartKey,
4703 if (started ==
FALSE) {
4707 &valueNameStartAchieved,
4716 started =
value != 0;
4735 writeStarted =
TRUE;
4754 status2 = FxRegKey::_SetValue(RestartKey,
4758 sizeof(currentTickCount.
QuadPart));
4768 status = FxRegKey::_SetValue(RestartKey,
4778 status2 = FxRegKey::_SetValue(RestartKey,
VOID SaveState(__in BOOLEAN UseCanSaveState)
static __inline NTSTATUS MxAcquireRemoveLock(__in MdRemoveLock RemoveLock, __in_opt PVOID Tag)
enum _WDF_DEVICE_PNP_STATE WDF_DEVICE_PNP_STATE
BOOLEAN IsSharedSpinLock(VOID)
static WDF_DEVICE_PNP_STATE PnpEventQueriedRemoving(__inout FxPkgPnp *This)
FxPnpMachineStateHistory m_States
FxPnpDeviceReleaseHardware m_DeviceReleaseHardware
static WDF_DEVICE_PNP_STATE PnpEventQueryRemovePending(__inout FxPkgPnp *This)
VOID NotifyResourceobjectsToReleaseResources(VOID)
return STATUS_NOT_SUPPORTED
VOID PnpPowerPolicySurpriseRemove(VOID)
#define _Must_inspect_result_
PCM_PARTIAL_RESOURCE_DESCRIPTOR GetResources(VOID)
static FxChildList * _FromEntry(__in FxTransactionedEntry *Entry)
static WDF_DEVICE_PNP_STATE PnpEventFailed(__inout FxPkgPnp *This)
static const PNP_EVENT_TARGET_STATE m_PnpRestartHardwareAvailableOtherStates[]
_Must_inspect_result_ FxCollectionEntry * Start(VOID)
static WDF_DEVICE_PNP_STATE PnpEventInitQueryRemoveCanceled(__inout FxPkgPnp *This)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
static const PNP_EVENT_TARGET_STATE m_PnpStartedStoppingOtherStates[]
static FxDeviceInterface * _FromEntry(__in PSINGLE_LIST_ENTRY Entry)
VOID AssignResources(__in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescRaw, __in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescTrans)
static WDF_DEVICE_PNP_STATE PnpEventRestart(__inout FxPkgPnp *This)
MdDeviceObject __inline GetDeviceObject(VOID)
VOID SetStatus(__in NTSTATUS Status)
static WDF_DEVICE_PNP_STATE PnpEventQueriedSurpriseRemove(__inout FxPkgPnp *This)
BOOLEAN SharesLock(FxInterrupt *Interrupt)
VOID PnpProcessEvent(__in FxPnpEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
static __inline VOID MxQueryTickCount(__out PLARGE_INTEGER TickCount)
VOID PnpFinishProcessingIrp(__in BOOLEAN IrpMustBePresent=TRUE)
VOID DeletePortResourceTable(VOID)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG Configuration
static WDF_DEVICE_PNP_STATE PnpEventQueryRemoveEnsureDeviceAwake(__inout FxPkgPnp *This)
VOID NotifyDeviceSurpriseRemove(VOID)
#define UNREFERENCED_PARAMETER(P)
WDFDEVICE __inline GetHandle(VOID)
#define STATUS_INVALID_PARAMETER
struct _LIST_ENTRY * Blink
WDFCASSERT(sizeof(WDF_DRIVER_CONFIG_V1_0)==sizeof(WDF_DRIVER_CONFIG_V1_1))
GLuint GLuint GLsizei count
BYTE m_SetDeviceRemoveProcessed
FxDeviceInterface * pDeviceInterface
VOID PnpCheckAssumptions(VOID)
static WDF_DEVICE_PNP_STATE PnpEventInitQueryRemove(__inout FxPkgPnp *This)
FxPnpDevicePrepareHardware m_DevicePrepareHardware
#define RESTART_COUNT_NAME
_In_ ULONG _In_ ULONG State
static const PNP_EVENT_TARGET_STATE m_PnpInitOtherStates[]
LIST_ENTRY m_InterruptListHead
VOID SetInternalFailure(VOID)
static WDF_DEVICE_PNP_STATE PnpEventRestarting(__inout FxPkgPnp *This)
VOID Invoke(__in WDF_DEVICE_PNP_STATE State, __in WDF_STATE_NOTIFICATION_TYPE Type, __in WDFDEVICE Device, __in PCWDF_DEVICE_PNP_NOTIFICATION_DATA NotificationData)
VOID PnpEnterNewState(__in WDF_DEVICE_PNP_STATE State)
virtual VOID PnpEventSurpriseRemovePendingOverload(VOID)
UCHAR IncrementHistoryIndex(VOID)
#define TRACE_LEVEL_INFORMATION
static const PNP_EVENT_TARGET_STATE m_PnpStartedRemovingOtherStates[]
UNICODE_STRING m_SymbolicLinkName
VOID WmiPkgDeregister(VOID)
#define TRACINGPNPPOWERSTATES
PCM_RESOURCE_LIST GetParameterAllocatedResources()
static WDF_DEVICE_PNP_STATE PnpEventStartingFromStopped(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventStopped(__inout FxPkgPnp *This)
static const PNP_EVENT_TARGET_STATE m_PnpStoppedWaitForStartCompletionOtherStates[]
static WDF_DEVICE_PNP_STATE PnpEventFailedPowerPolicyRemoved(__inout FxPkgPnp *This)
_Must_inspect_result_ NTSTATUS PnpEnableInterfacesAndRegisterWmi(VOID)
VOID InvalidateDeviceState(__in MdDeviceObject Fdo)
VOID PnpDisableInterfaces(VOID)
NTSTATUS BuildPortResourceTable(VOID)
#define STATUS_INVALID_DEVICE_STATE
VOID PnpPowerPolicyStop(VOID)
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
VOID UnlockFromEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID DeleteRegisterResourceTable(VOID)
static const PNP_EVENT_TARGET_STATE m_PnpHardwareAvailableOtherStates[]
BOOLEAN EarlyDispose(VOID)
CM_PARTIAL_RESOURCE_DESCRIPTOR m_Descriptor
static const PNP_EVENT_TARGET_STATE m_PnpFailedWaitForRemoveOtherStates[]
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@385 u
FxEnumerationInfo * m_EnumInfo
FxWaitLockTransactionedList m_ChildListList
#define RESTART_START_ACHIEVED_NAME
FORCEINLINE LONGLONG WDF_ABS_TIMEOUT_IN_SEC(_In_ ULONGLONG Time)
BOOLEAN IsPresentPendingPnpIrp(VOID)
FxCmResList * m_Resources
VOID OnPostReleaseHardware(VOID)
#define TRACE_LEVEL_VERBOSE
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDFCMRESLIST ResourcesRaw, __in WDFCMRESLIST ResourcesTranslated)
NTSTATUS WmiPkgRegister(VOID)
CM_PARTIAL_RESOURCE_DESCRIPTOR m_DescriptorClone
_Must_inspect_result_ NTSTATUS ValidateCmResource(__inout PCM_PARTIAL_RESOURCE_DESCRIPTOR *CmResourceRaw, __inout PCM_PARTIAL_RESOURCE_DESCRIPTOR *CmResource)
#define VALIDATE_PNP_STATE(_CurrentState, _NewState)
static WDF_DEVICE_PNP_STATE PnpEventQueryRemoveAskDriver(__inout FxPkgPnp *This)
__inline VOID SetCallbackFlags(__in BYTE Flags)
#define FILE_REMOVABLE_MEDIA
PCM_RESOURCE_LIST GetParameterAllocatedResourcesTranslated()
static WDF_DEVICE_PNP_STATE PnpEventSurpriseRemoved(__inout FxPkgPnp *This)
GLenum GLuint GLenum GLsizei length
static const PNP_EVENT_TARGET_STATE m_PnpFailedPowerDownOtherStates[]
virtual VOID DeleteSymbolicLinkOverload(BOOLEAN GracefulRemove)=0
_In_ PVOID _In_ ULONG Event
static const PWCHAR m_RestartCountName
_Must_inspect_result_ NTSTATUS PnpPrepareHardwareInternal(VOID)
static WDF_DEVICE_PNP_STATE PnpEventQueryStopAskDriver(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventStartedCancelRemove(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventFailedPowerDown(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventRemovedPdoWait(__inout FxPkgPnp *This)
_Must_inspect_result_ FxCollectionEntry * End(VOID)
MdDeviceObject __inline GetAttachedDevice(VOID)
_Must_inspect_result_ NTSTATUS PnpMatchResources(VOID)
static const PNP_EVENT_TARGET_STATE m_PnpQueriedRemovingOtherStates[]
static const PNP_EVENT_TARGET_STATE m_PnpRestartingOtherStates[]
static WDF_DEVICE_PNP_STATE PnpEventFailedInit(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventQueryCanceled(__inout FxPkgPnp *This)
VOID PnpPowerPolicyStart(VOID)
VOID ValidateResourceUnmap(VOID)
static WDF_DEVICE_PNP_STATE PnpEventQueryStopPending(__inout FxPkgPnp *This)
static const PNP_EVENT_TARGET_STATE m_PnpStartedOtherStates[]
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@385::@389 MessageInterrupt
VOID LockForEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
#define RESTART_START_TIME_NAME
static WDF_DEVICE_PNP_STATE PnpEventEnableInterfaces(__inout FxPkgPnp *This)
VOID SetSyncIrql(KIRQL SyncIrql)
VOID PnpCleanupForRemove(__in BOOLEAN GracefulRemove)
static const ULONG m_RestartCountMaximum
BOOLEAN IsSyncIrqlSet(VOID)
FxDisposeList * m_DisposeList
static WDF_DEVICE_PNP_STATE PnpEventSurpriseRemoveIoStarted(__inout FxPkgPnp *This)
VOID SetState(__in BOOLEAN State)
struct _LIST_ENTRY * Flink
NTSTATUS BuildRegisterResourceTable(VOID)
#define NT_SUCCESS(StatCode)
#define STATUS_NO_SUCH_DEVICE
static WDF_DEVICE_PNP_STATE PnpEventRestartHardwareAvailable(__inout FxPkgPnp *This)
FxPnpEvent m_Queue[PnpEventQueueDepth]
__inline BOOLEAN IsFilter()
static WDF_DEVICE_PNP_STATE PnpEventRestartReleaseHardware(__inout FxPkgPnp *This)
VOID PnpEventRemovedCommonCode(VOID)
#define DECLARE_CONST_UNICODE_STRING(_variablename, _string)
static WDF_DEVICE_PNP_STATE PnpEventStartedCancelStop(__inout FxPkgPnp *This)
#define IRP_MN_START_DEVICE
static WDF_DEVICE_PNP_STATE PnpEventFailedStarted(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventStartedRemoving(__inout FxPkgPnp *This)
static __inline VOID MxReleaseRemoveLockAndWait(__in MdRemoveLock RemoveLock, __in PVOID Tag)
FxWaitLockInternal m_DeviceInterfaceLock
_Must_inspect_result_ FxTransactionedEntry * GetNextEntry(__in_opt FxTransactionedEntry *Entry)
VOID PowerPolicyProcessEvent(__in FxPowerPolicyEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
_Must_inspect_result_ NTSTATUS BuildFromWdmList(__in PCM_RESOURCE_LIST ResourceList, __in UCHAR AccessFlags)
_Must_inspect_result_ NTSTATUS ValidateInterruptResourceCm(__in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmIntResourceRaw, __in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmIntResource, __in PWDF_INTERRUPT_CONFIG Configuration)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static WDF_DEVICE_PNP_STATE PnpEventPdoInitFailed(__inout FxPkgPnp *This)
BOOLEAN ShouldProcessPnpEventOnDifferentThread(__in KIRQL CurrentIrql, __in BOOLEAN CallerSpecifiedProcessingOnDifferentThread)
#define STATUS_UNSUCCESSFUL
static const PNP_EVENT_TARGET_STATE m_PnpQueryStopPendingOtherStates[]
struct _SINGLE_LIST_ENTRY * Next
__inline WDF_DEVICE_PNP_STATE GetDevicePnpState()
#define InterlockedDecrement
MdIrp GetPendingPnpIrp(VOID)
SINGLE_LIST_ENTRY m_DeviceInterfaceHead
static WDF_DEVICE_PNP_STATE PnpEventFailedSurpriseRemoved(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventFdoRemoved(__inout FxPkgPnp *This)
BOOLEAN PowerIndicateWaitWakeStatus(__in NTSTATUS WaitWakeStatus)
static WDF_DEVICE_PNP_STATE PnpEventFinal(__inout FxPkgPnp *This)
static const ULONG m_RestartTimePeriodMaximum
GLsizei const GLfloat * value
__inline BOOLEAN IsWakeCapable(VOID)
MdIrp ClearPendingPnpIrp(VOID)
static const PWCHAR m_RestartStartTimeName
BOOLEAN IsClosedLocked(VOID)
VOID __inline DestroyChildren(VOID)
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_WARNING
VOID GetFinishedState(__inout FxPostProcessInfo *Info)
FxPnpStateAndCaps m_PnpStateAndCaps
static WDF_DEVICE_PNP_STATE PnpEventQueryStopStaticCheck(__inout FxPkgPnp *This)
static const PNP_EVENT_TARGET_STATE m_PnpEjectFailedOtherStates[]
static const PNP_EVENT_TARGET_STATE m_PnpInitStartingOtherStates[]
static WDF_DEVICE_PNP_STATE PnpEventFailedOwnHardware(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventQueryStopEnsureDeviceAwake(__inout FxPkgPnp *This)
USHORT History[PnpEventQueueDepth]
__inline BOOLEAN IsPassiveHandling(VOID)
BOOLEAN PnpIncrementRestartCountLogic(_In_ HANDLE RestartKey, _In_ BOOLEAN CreatedNewKey)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
_Must_inspect_result_ NTSTATUS CheckForConnectionResources(VOID)
#define STATUS_OBJECT_NAME_NOT_FOUND
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
PFX_DRIVER_GLOBALS fxDriverGlobals
static const PNP_EVENT_TARGET_STATE m_PnpStartedStoppingFailedOtherStates[]
WDFCMRESLIST GetHandle(VOID)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
__inline VOID ClearCallbackFlags(__in BYTE Flags)
static WDF_DEVICE_PNP_STATE PnpEventInitSurpriseRemoved(__inout FxPkgPnp *This)
KIRQL GetResourceIrql(VOID)
#define CmResourceTypeInterrupt
static WDF_DEVICE_PNP_STATE PnpEventHardwareAvailablePowerPolicyFailed(__inout FxPkgPnp *This)
WDFINTERRUPT GetHandle(VOID)
VOID PnpPowerPolicyRemove(VOID)
static const PNP_EVENT_TARGET_STATE m_PnpStoppedOtherStates[]
static const PWCHAR m_RestartStartAchievedName
static WDF_DEVICE_PNP_STATE PnpEventQueryRemoveStaticCheck(__inout FxPkgPnp *This)
static const PNP_STATE_TABLE m_WdfPnpStates[]
static WDF_DEVICE_PNP_STATE PnpEventStoppedWaitForStartCompletion(__inout FxPkgPnp *This)
FxPnpStateCallback * m_PnpStateCallbacks
SharedPowerData m_SharedPower
static WDF_DEVICE_PNP_STATE PnpEventHardwareAvailable(__inout FxPkgPnp *This)
VOID SetPendingPnpIrpStatus(__in NTSTATUS Status)
static const PNP_EVENT_TARGET_STATE m_PnpRemovedPdoWaitOtherStates[]
UCHAR GetMinorFunction(VOID)
__inline VOID SetDevicePnpState(__in WDF_DEVICE_PNP_STATE DeviceState)
FxCmResList * m_ResourcesRaw
#define RtlZeroMemory(Destination, Length)
static WDF_DEVICE_PNP_STATE PnpEventRemoved(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventRemovedChildrenRemoved(__inout FxPkgPnp *This)
static const PNP_EVENT_TARGET_STATE m_PnpFailedIoStartingOtherStates[]
BOOLEAN m_DeviceInterfacesCanBeEnabled
static WDF_DEVICE_PNP_STATE PnpEventFailedIoStarting(__inout FxPkgPnp *This)
static VOID _PnpProcessEventInner(__inout FxPkgPnp *This, __inout FxPostProcessInfo *Info, __in PVOID WorkerContext)
static WDF_DEVICE_PNP_STATE PnpEventInitStarting(__inout FxPkgPnp *This)
__drv_when(!NT_SUCCESS(return), __drv_arg(ResourcesMatched, _Must_inspect_result_)) NTSTATUS FxPkgPnp
GLuint GLuint GLsizei GLenum type
#define STATUS_DEVICE_POWER_FAILURE
static __inline ULONG MxQueryTimeIncrement()
static WDF_DEVICE_PNP_STATE PnpEventStartedStopping(__inout FxPkgPnp *This)
_Must_inspect_result_ NTSTATUS PnpReleaseHardware(VOID)
VOID PnpProcessEventInner(__inout FxPostProcessInfo *Info)
FxSelfManagedIoMachine * m_SelfManagedIoMachine
static WDF_DEVICE_PNP_STATE PnpEventRemovingDisableInterfaces(__inout FxPkgPnp *This)
static CPPNP_STATE_TABLE GetPnpTableEntry(__in WDF_DEVICE_PNP_STATE State)
static BOOLEAN _IsMessageInterrupt(__in USHORT ResourceFlags)
static SERVICE_STATUS status
FxCollectionEntry * Next(VOID)
static WDF_DEVICE_PNP_STATE PnpEventCheckForDevicePresence(__inout FxPkgPnp *This)
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDFCMRESLIST ResourcesTranslated)
static WDF_DEVICE_PNP_STATE PnpEventPdoRestart(__inout FxPkgPnp *This)
static const PNP_EVENT_TARGET_STATE m_PnpInitQueryRemoveOtherStates[]
_Must_inspect_result_ NTSTATUS StopProcessingForPower(__in FxIoStopProcessingForPowerAction Action)
FxWaitLockInternal m_StateMachineLock
static const PNP_EVENT_TARGET_STATE m_PnpRestartOtherStates[]
#define RtlCompareMemory(s1, s2, l)
FxVerifierDbgBreakPoint(pFxDriverGlobals)
VOID SetFilterIoType(VOID)
static const PNP_EVENT_TARGET_STATE m_PnpQueryRemovePendingOtherStates[]
#define __drv_arg(expr, annotes)
VOID PnpAssignInterruptsSyncIrql(VOID)
static const PNP_EVENT_TARGET_STATE m_PnpRestartReleaseHardware[]
#define STATUS_DEVICE_NOT_READY
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
static WDF_DEVICE_PNP_STATE PnpEventPdoRemoved(__inout FxPkgPnp *This)
FxPnpMachine m_PnpMachine
static WDF_DEVICE_PNP_STATE PnpEventRemovedPdoSurpriseRemoved(__inout FxPkgPnp *This)
static WDF_DEVICE_PNP_STATE PnpEventStarted(__inout FxPkgPnp *This)