ReactOS 0.4.16-dev-336-gb667d82
FxPkgPnp Class Referenceabstract

#include <fxpkgpnp.hpp>

Inheritance diagram for FxPkgPnp:
Collaboration diagram for FxPkgPnp:

Public Member Functions

VOID PnpProcessEvent (__in FxPnpEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
 
VOID PowerProcessEvent (__in FxPowerEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
 
VOID PowerPolicyProcessEvent (__in FxPowerPolicyEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
 
BOOLEAN ShouldProcessPnpEventOnDifferentThread (__in KIRQL CurrentIrql, __in BOOLEAN CallerSpecifiedProcessingOnDifferentThread)
 
BOOLEAN ShouldProcessPowerPolicyEventOnDifferentThread (__in KIRQL CurrentIrql, __in BOOLEAN CallerSpecifiedProcessingOnDifferentThread)
 
VOID CleanupStateMachines (__in BOOLEAN ClenaupPnp)
 
VOID CleanupDeviceFromFailedCreate (__in MxEvent *WaitEvent)
 
virtual _Must_inspect_result_ NTSTATUS Initialize (__in PWDFDEVICE_INIT DeviceInit)
 
_Must_inspect_result_ NTSTATUS PostCreateDeviceInitialize (VOID)
 
virtual VOID FinishInitialize (__inout PWDFDEVICE_INIT DeviceInit)
 
VOID SetSpecialFileSupport (__in WDF_SPECIAL_FILE_TYPE FileType, __in BOOLEAN Supported)
 
_Must_inspect_result_ NTSTATUS RegisterCallbacks (__in PWDF_PNPPOWER_EVENT_CALLBACKS DispatchTable)
 
VOID RegisterPowerPolicyCallbacks (__in PWDF_POWER_POLICY_EVENT_CALLBACKS Callbacks)
 
NTSTATUS RegisterPowerPolicyWmiInstance (__in const GUID *Guid, __in FxWmiInstanceInternalCallbacks *Callbacks, __out FxWmiInstanceInternal **Instance)
 
NTSTATUS PowerPolicySetS0IdleSettings (__in PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings)
 
NTSTATUS AssignPowerFrameworkSettings (__in PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings)
 
NTSTATUS PowerPolicySetSxWakeSettings (__in PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings, __in BOOLEAN ArmForWakeIfChildrenAreArmedForWake, __in BOOLEAN IndicateChildWakeOnParentWake)
 
BOOLEAN PowerIndicateWaitWakeStatus (__in NTSTATUS WaitWakeStatus)
 
BOOLEAN PowerPolicyIsWakeEnabled (VOID)
 
ULONG PowerPolicyGetCurrentWakeReason (VOID)
 
BOOLEAN __inline PowerPolicyShouldPropagateWakeStatusToChildren (VOID)
 
VOID ChildRemoved (VOID)
 
VOID PowerPolicySetS0IdleState (__in BOOLEAN State)
 
VOID PowerPolicySetSxWakeState (__in BOOLEAN State)
 
VOID SetPowerCaps (__in PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities)
 
VOID SetPnpCaps (__in PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities)
 
VOID GetPnpState (__out PWDF_DEVICE_STATE State)
 
VOID SetPnpState (__in PWDF_DEVICE_STATE State)
 
VOID SetDeviceFailed (__in WDF_DEVICE_FAILED_ACTION FailedAction)
 
VOID SetChildBusInformation (__in PPNP_BUS_INFORMATION BusInformation)
 
_Must_inspect_result_ NTSTATUS HandleQueryBusInformation (__inout FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS __inline PowerReference (__in BOOLEAN WaitForD0, __in_opt PVOID Tag=NULL, __in_opt LONG Line=0, __in_opt PSTR File=NULL)
 
VOID __inline PowerDereference (__in_opt PVOID Tag=NULL, __in_opt LONG Line=0, __in_opt PSTR File=NULL)
 
BOOLEAN HasPowerThread (VOID)
 
VOID QueueToPowerThread (__in PWORK_QUEUE_ITEM WorkItem)
 
_Must_inspect_result_ NTSTATUS AddUsageDevice (__in MdDeviceObject DependentDevice)
 
VOID RemoveUsageDevice (__in MdDeviceObject DependentDevice)
 
_Must_inspect_result_ NTSTATUS AddRemovalDevice (__in MdDeviceObject DependentDevice)
 
VOID RemoveRemovalDevice (__in MdDeviceObject DependentDevice)
 
VOID ClearRemovalDevicesList (VOID)
 
_Must_inspect_result_ NTSTATUS AllocateEnumInfo (VOID)
 
VOID AddChildList (__in FxChildList *List)
 
VOID RemoveChildList (__in FxChildList *List)
 
VOID ChildListNotifyRemove (__inout PLONG PendingCount)
 
_Must_inspect_result_ NTSTATUS AllocateDmaEnablerList (VOID)
 
VOID AddDmaEnabler (__in FxDmaEnabler *Enabler)
 
VOID RemoveDmaEnabler (__in FxDmaEnabler *Enabler)
 
VOID RevokeDmaEnablerResources (__in FxDmaEnabler *Enabler)
 
VOID AddQueryInterface (__in FxQueryInterface *QI, __in BOOLEAN Lock)
 
VOID QueryForD3ColdInterface (VOID)
 
VOID DropD3ColdInterface (VOID)
 
BOOLEAN IsPowerPolicyOwner (VOID)
 
BOOLEAN SupportsWakeInterrupt (VOID)
 
BOOLEAN IsS0IdleWakeFromS0Enabled (VOID)
 
BOOLEAN IsS0IdleSystemManaged (VOID)
 
BOOLEAN IsS0IdleUsbSSEnabled (VOID)
 
BOOLEAN IsSxWakeEnabled (VOID)
 
_Must_inspect_result_ NTSTATUS PowerPolicyCanChildPowerUp (__out PBOOLEAN PowerUp)
 
VOID PowerPolicyChildPoweredDown (VOID)
 
POWER_ACTION GetSystemPowerAction (VOID)
 
VOID ProcessDelayedDeletion (VOID)
 
VOID SignalDeviceRemovedEvent (VOID)
 
virtual NTSTATUS FireAndForgetIrp (FxIrp *Irp)=0
 
FxCmResListGetTranslatedResourceList (VOID)
 
FxCmResListGetRawResourceList (VOID)
 
ULONG GetInterruptObjectCount (VOID)
 
VOID AckPendingWakeInterruptOperation (__in BOOLEAN ProcessPowerEventOnDifferentThread)
 
VOID SendEventToAllWakeInterrupts (__in enum FxWakeInterruptEvents WakeInterruptEvent)
 
_Must_inspect_result_ NTSTATUS ValidateCmResource (__inout PCM_PARTIAL_RESOURCE_DESCRIPTOR *CmResourceRaw, __inout PCM_PARTIAL_RESOURCE_DESCRIPTOR *CmResource)
 
_Must_inspect_result_ NTSTATUS ValidateInterruptResourceCm (__in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmIntResourceRaw, __in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmIntResource, __in PWDF_INTERRUPT_CONFIG Configuration)
 
BOOLEAN IsDefaultReleaseHardwareOrder (VOID)
 
BOOLEAN HasMultipleInterrupts (VOID)
 
VOID WakeInterruptCreated (VOID)
 
- Public Member Functions inherited from FxPackage
 FxPackage (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device, __in WDFTYPE Type)
 
virtual NTSTATUS Dispatch (__in MdIrp Irp)=0
 
__inline CfxDeviceGetDevice (VOID)
 
 DECLARE_INTERNAL_NEW_OPERATOR ()
 
- Public Member Functions inherited from FxNonPagedObject
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
virtual ~FxNonPagedObject (VOID)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) VOID Lock(__out __drv_deref(__drv_savesIRQL) PKIRQL PreviousIrql)
 
 _Releases_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID Unlock(__in __drv_restoresIRQL KIRQL PreviousIrql)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) VOID LockAtDispatch(VOID)
 
 _Requires_lock_held_ (this->m_NPLock.m_Lock) _Releases_lock_(this -> m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID UnlockFromDispatch(VOID)
 
- Public Member Functions inherited from FxObject
PVOID GetCOMWrapper ()
 
void SetCOMWrapper (__drv_aliasesMem PVOID Wrapper)
 
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxObject (VOID)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType Type)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize=0)
 
VOID operator delete (__in PVOID Memory)
 
VOID SetNoContextHeader (VOID)
 
PVOID __inline GetObjectHandle (VOID)
 
__inline FxContextHeaderGetContextHeader (VOID)
 
__inline PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)
 
WDFTYPE GetType (VOID)
 
USHORT GetObjectSize (VOID)
 
LONG GetRefCnt (VOID)
 
FxTagTrackerGetTagTracker (VOID)
 
CfxDeviceGetDevice (VOID)
 
CfxDeviceBaseGetDeviceBase (VOID)
 
VOID SetDeviceBase (__in CfxDeviceBase *DeviceBase)
 
__inline VOID CallCleanup (VOID)
 
ULONG __inline AddRef (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG Release (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG AddRefOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG ReleaseOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual _Must_inspect_result_ NTSTATUS QueryInterface (__in FxQueryInterfaceParams *Params)
 
VOID MarkTraceState (VOID)
 
BOOLEAN __inline IsTraceState (VOID)
 
VOID __inline TraceDroppedEvent (__in FxObjectDroppedEvent Event)
 
VOID MarkPassiveDispose (__in FxObjectLockState State=ObjectLock)
 
VOID MarkPassiveCallbacks (__in FxObjectLockState State=ObjectLock)
 
VOID MarkForceDisposeThread (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsPassiveCallbacks (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsPassiveDispose (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsForceDisposeThread (__in BOOLEAN AcquireLock=TRUE)
 
VOID MarkCommitted (VOID)
 
BOOLEAN IsCommitted (VOID)
 
VOID MarkDisposeOverride (__in FxObjectLockState State=ObjectLock)
 
VOID MarkNoDeleteDDI (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsNoDeleteDDI (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)
 
VOID DeleteFromFailedCreate (VOID)
 
VOID ClearEvtCallbacks (VOID)
 
BOOLEAN EarlyDispose (VOID)
 
virtual VOID DeleteObject (VOID)
 
virtual BOOLEAN Dispose (VOID)
 
_Must_inspect_result_ NTSTATUS AssignParentObject (__in FxObject *ParentObject)
 
_Must_inspect_result_ NTSTATUS AddContext (__in FxContextHeader *Header, __in PVOID *Context, __in PWDF_OBJECT_ATTRIBUTES Attributes)
 
_Must_inspect_result_ NTSTATUS RemoveParentAssignment (VOID)
 
_Must_inspect_result_ FxObjectGetParentObjectReferenced (__in PVOID Tag)
 
BOOLEAN IsDisposed (VOID)
 

Public Attributes

FxPnpStateAndCaps m_PnpStateAndCaps
 
ULONG m_PnpCapsAddress
 
ULONG m_PnpCapsUINumber
 
FxPowerCaps m_PowerCaps
 
BOOLEAN m_Failed
 
BYTE m_SystemPowerState
 
BYTE m_DevicePowerState
 
BYTE m_DevicePowerStateOld
 
FxRelatedDeviceListm_UsageDependentDeviceList
 
FxRelatedDeviceListm_RemovalDeviceList
 
FxWaitLockInternal m_QueryInterfaceLock
 
SINGLE_LIST_ENTRY m_QueryInterfaceHead
 
FxWaitLockInternal m_DeviceInterfaceLock
 
SINGLE_LIST_ENTRY m_DeviceInterfaceHead
 
BOOLEAN m_DeviceInterfacesCanBeEnabled
 
BOOLEAN m_SpecialSupport [WdfSpecialFileMax-1]
 
LONG m_SpecialFileCount [WdfSpecialFileMax-1]
 
ULONG m_DeviceStopCount
 
FxPnpMachine m_PnpMachine
 
FxPowerMachine m_PowerMachine
 
FxPowerPolicyMachine m_PowerPolicyMachine
 
FxSelfManagedIoMachinem_SelfManagedIoMachine
 
SharedPowerData m_SharedPower
 
D3COLD_SUPPORT_INTERFACE m_D3ColdInterface
 
FxPnpDeviceUsageNotification m_DeviceUsageNotification
 
FxPnpDeviceUsageNotificationEx m_DeviceUsageNotificationEx
 
FxPnpDeviceRelationsQuery m_DeviceRelationsQuery
 
FxPnpDeviceD0Entry m_DeviceD0Entry
 
FxPnpDeviceD0EntryPostInterruptsEnabled m_DeviceD0EntryPostInterruptsEnabled
 
FxPnpDeviceD0ExitPreInterruptsDisabled m_DeviceD0ExitPreInterruptsDisabled
 
FxPnpDeviceD0Exit m_DeviceD0Exit
 
FxPnpDevicePrepareHardware m_DevicePrepareHardware
 
FxPnpDeviceReleaseHardware m_DeviceReleaseHardware
 
FxPnpDeviceQueryStop m_DeviceQueryStop
 
FxPnpDeviceQueryRemove m_DeviceQueryRemove
 
FxPnpDeviceSurpriseRemoval m_DeviceSurpriseRemoval
 

Protected Member Functions

 FxPkgPnp (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device, __in WDFTYPE Type)
 
 ~FxPkgPnp ()
 
virtual BOOLEAN Dispose (VOID)
 
virtual _Must_inspect_result_ NTSTATUS Dispatch (__in MdIrp Irp)
 
virtual const PFN_PNP_POWER_CALLBACKGetDispatchPnp (VOID)=0
 
virtual const PFN_PNP_POWER_CALLBACKGetDispatchPower (VOID)=0
 
VOID DeleteDevice (VOID)
 
VOID SetInternalFailure (VOID)
 
NTSTATUS CompletePowerRequest (__inout FxIrp *Irp, __in NTSTATUS Status)
 
NTSTATUS CompletePnpRequest (__inout FxIrp *Irp, __in NTSTATUS Status)
 
PNP_DEVICE_STATE HandleQueryPnpDeviceState (__in PNP_DEVICE_STATE PnpDeviceState)
 
_Must_inspect_result_ NTSTATUS HandleQueryBusRelations (__inout FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS HandleQueryDeviceRelations (__inout FxIrp *Irp, __inout FxRelatedDeviceList *List)
 
_Must_inspect_result_ NTSTATUS HandleQueryInterface (__inout FxIrp *Irp, __out PBOOLEAN CompleteRequest)
 
_Must_inspect_result_ NTSTATUS QueryForCapabilities (VOID)
 
VOID PnpAssignInterruptsSyncIrql (VOID)
 
_Must_inspect_result_ NTSTATUS PnpMatchResources (VOID)
 
 __drv_when (!NT_SUCCESS(return), __drv_arg(ResourcesMatched, _Must_inspect_result_)) NTSTATUS PnpPrepareHardware(__out PBOOLEAN ResourcesMatched)
 
_Must_inspect_result_ NTSTATUS PnpPrepareHardwareInternal (VOID)
 
_Must_inspect_result_ NTSTATUS PnpReleaseHardware (VOID)
 
_Must_inspect_result_ NTSTATUS PnpEnableInterfacesAndRegisterWmi (VOID)
 
_Must_inspect_result_ NTSTATUS PnpSurpriseRemoval (__inout FxIrp *Irp)
 
NTSTATUS FilterResourceRequirements (__in IO_RESOURCE_REQUIREMENTS_LIST **IoList)
 
virtual VOID PowerReleasePendingDeviceIrp (BOOLEAN IrpMustBePresent=TRUE)=0
 
VOID AddInterruptObject (__in FxInterrupt *Interrupt)
 
VOID RemoveInterruptObject (__in FxInterrupt *Interrupt)
 
VOID PnpProcessEventInner (__inout FxPostProcessInfo *Info)
 
VOID PowerProcessEventInner (__inout FxPostProcessInfo *Info)
 
VOID PowerPolicyProcessEventInner (__inout FxPostProcessInfo *Info)
 
VOID PnpEnterNewState (__in WDF_DEVICE_PNP_STATE State)
 
VOID PowerEnterNewState (__in WDF_DEVICE_POWER_STATE State)
 
VOID PowerPolicyEnterNewState (__in WDF_DEVICE_POWER_POLICY_STATE State)
 
VOID NotPowerPolicyOwnerEnterNewState (__in WDF_DEVICE_POWER_POLICY_STATE NewState)
 
_Must_inspect_result_ NTSTATUS DispatchWaitWake (__inout FxIrp *Irp)
 
VOID SaveState (__in BOOLEAN UseCanSaveState)
 
_Must_inspect_result_ NTSTATUS PnpDeviceUsageNotification (__inout FxIrp *Irp)
 
LONG GetPnpStateInternal (VOID)
 
LONG GetPnpCapsInternal (VOID)
 
virtual BOOLEAN PnpSendStartDeviceDownTheStackOverload (VOID)=0
 
virtual WDF_DEVICE_PNP_STATE PnpEventCheckForDevicePresenceOverload (VOID)=0
 
virtual WDF_DEVICE_PNP_STATE PnpEventEjectHardwareOverload (VOID)=0
 
virtual WDF_DEVICE_PNP_STATE PnpGetPostRemoveState (VOID)=0
 
virtual WDF_DEVICE_PNP_STATE PnpEventPdoRemovedOverload (VOID)=0
 
virtual WDF_DEVICE_PNP_STATE PnpEventFdoRemovedOverload (VOID)=0
 
virtual VOID PnpEventSurpriseRemovePendingOverload (VOID)
 
VOID PnpEventRemovedCommonCode (VOID)
 
VOID PnpPowerPolicyStart (VOID)
 
VOID PnpPowerPolicyStop (VOID)
 
VOID PnpPowerPolicySurpriseRemove (VOID)
 
VOID PnpPowerPolicyRemove (VOID)
 
VOID PnpFinishProcessingIrp (__in BOOLEAN IrpMustBePresent=TRUE)
 
VOID PnpDisableInterfaces (VOID)
 
virtual NTSTATUS SendIrpSynchronously (FxIrp *Irp)=0
 
virtual WDF_DEVICE_POWER_STATE PowerCheckDeviceTypeOverload (VOID)=0
 
virtual WDF_DEVICE_POWER_STATE PowerCheckDeviceTypeNPOverload (VOID)=0
 
virtual NTSTATUS PowerCheckParentOverload (BOOLEAN *ParentOn)=0
 
virtual NTSTATUS PowerEnableWakeAtBusOverload (VOID)
 
virtual VOID PowerDisableWakeAtBusOverload (VOID)
 
virtual VOID PowerParentPowerDereference (VOID)=0
 
VOID PowerGotoDx (VOID)
 
BOOLEAN PowerGotoDxIoStopped (VOID)
 
BOOLEAN PowerGotoDxIoStoppedNP (VOID)
 
BOOLEAN PowerDmaEnableAndScan (__in BOOLEAN ImplicitPowerUp)
 
VOID PowerCompletePendedWakeIrp (VOID)
 
VOID PowerCompleteWakeRequestFromWithinMachine (__in NTSTATUS Status)
 
BOOLEAN PowerMakeWakeRequestNonCancelable (__in NTSTATUS Status)
 
BOOLEAN PowerIsWakeRequestPresent (VOID)
 
VOID PowerSendIdlePowerEvent (__in FxPowerIdleEvents Event)
 
VOID PowerSendPowerDownEvents (__in FxPowerDownType Type)
 
VOID PowerSendPowerUpEvents (VOID)
 
VOID PowerSendPowerDownFailureEvent (__in FxPowerDownType Type)
 
VOID PowerSendPowerUpFailureEvent (VOID)
 
VOID PowerSetDevicePowerState (__in WDF_POWER_DEVICE_STATE State)
 
_Must_inspect_result_ BOOLEAN PowerDmaPowerUp (VOID)
 
BOOLEAN PowerDmaPowerDown (VOID)
 
VOID PowerConnectInterruptFailed (VOID)
 
VOID PowerPolicyUpdateSystemWakeSource (__in FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS PowerPolicySendDevicePowerRequest (__in DEVICE_POWER_STATE DeviceState, __in SendDeviceRequestAction Action)
 
_Must_inspect_result_ NTSTATUS PowerPolicySendWaitWakeRequest (__in SYSTEM_POWER_STATE SystemState)
 
VOID PowerPolicyCompleteSystemPowerIrp (VOID)
 
BOOLEAN PowerPolicyCancelWaitWake (VOID)
 
VOID PowerPolicySubmitUsbIdleNotification (VOID)
 
BOOLEAN PowerPolicyCancelUsbSSIfCapable (VOID)
 
VOID PowerPolicyCancelUsbSS (VOID)
 
SYSTEM_POWER_STATE PowerPolicyGetPendingSystemState (VOID)
 
_Must_inspect_result_ NTSTATUS PowerPolicyHandleSystemQueryPower (__in SYSTEM_POWER_STATE QueryState)
 
BOOLEAN PowerPolicyCanWakeFromSystemState (__in SYSTEM_POWER_STATE SystemState)
 
SYSTEM_POWER_STATE PowerPolicyGetDeviceDeepestSystemWakeState (VOID)
 
DEVICE_POWER_STATE PowerPolicyGetDeviceDeepestDeviceWakeState (__in SYSTEM_POWER_STATE SystemState)
 
BOOLEAN IsPresentPendingPnpIrp (VOID)
 
VOID SetPendingPnpIrp (__inout FxIrp *Irp, __in BOOLEAN MarkIrpPending=TRUE)
 
VOID SetPendingPnpIrpStatus (__in NTSTATUS Status)
 
MdIrp ClearPendingPnpIrp (VOID)
 
MdIrp GetPendingPnpIrp (VOID)
 
VOID SetPendingDevicePowerIrp (__inout FxIrp *Irp)
 
MdIrp ClearPendingDevicePowerIrp (VOID)
 
VOID SetPendingSystemPowerIrp (__inout FxIrp *Irp)
 
MdIrp ClearPendingSystemPowerIrp (VOID)
 
MdIrp GetPendingSystemPowerIrp (VOID)
 
BOOLEAN IsDevicePowerUpIrpPending (VOID)
 
BOOLEAN IsUsageSupported (__in DEVICE_USAGE_NOTIFICATION_TYPE Usage)
 
VOID SetUsageSupport (__in DEVICE_USAGE_NOTIFICATION_TYPE Usage, __in BOOLEAN Supported)
 
LONG AdjustUsageCount (__in DEVICE_USAGE_NOTIFICATION_TYPE Usage, __in BOOLEAN Add)
 
LONG GetUsageCount (__in __range(1, 4) ULONG Usage)
 
BOOLEAN IsInSpecialUse (VOID)
 
ULONG SetUsageNotificationFlags (__in DEVICE_USAGE_NOTIFICATION_TYPE Type, __in BOOLEAN InPath)
 
VOID RevertUsageNotificationFlags (__in DEVICE_USAGE_NOTIFICATION_TYPE Type, __in BOOLEAN InPath, __in ULONG OldFlags)
 
VOID CommitUsageNotification (__in DEVICE_USAGE_NOTIFICATION_TYPE Type, __in ULONG OldFlags)
 
_Must_inspect_result_ NTSTATUS CreatePowerThread (VOID)
 
- Protected Member Functions inherited from FxObject
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
FxObjectDebugExtensionGetDebugExtension (VOID)
 
BOOLEAN IsDebug (VOID)
 
VOID AllocateTagTracker (__in WDFTYPE Type)
 
virtual VOID SelfDestruct (VOID)
 
PVOID __inline GetObjectHandleUnchecked (VOID)
 
VOID __inline DestroyChildren (VOID)
 
VOID DeleteEarlyDisposedObject (VOID)
 

Static Protected Member Functions

static _Must_inspect_result_ NTSTATUS _PnpStartDevice (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpQueryStopDevice (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpCancelStopDevice (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpStopDevice (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpQueryRemoveDevice (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpCancelRemoveDevice (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpRemoveDevice (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static VOID _PnpProcessEventInner (__inout FxPkgPnp *This, __inout FxPostProcessInfo *Info, __in PVOID WorkerContext)
 
static VOID _PowerProcessEventInner (__in FxPkgPnp *This, __in FxPostProcessInfo *Info, __in PVOID WorkerContext)
 
static VOID _PowerPolicyProcessEventInner (__inout FxPkgPnp *This, __inout FxPostProcessInfo *Info, __in PVOID WorkerContext)
 
static _Must_inspect_result_ NTSTATUS _DispatchWaitWake (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpDeviceUsageNotification (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static VOID _SetPowerCapState (__in ULONG Index, __in DEVICE_POWER_STATE State, __out PULONG Result)
 
static DEVICE_POWER_STATE _GetPowerCapState (__in ULONG Index, __in ULONG State)
 
static WDF_DEVICE_PNP_STATE PnpEventCheckForDevicePresence (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventEjectHardware (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventInitStarting (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventInitSurpriseRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventHardwareAvailable (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventEnableInterfaces (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventHardwareAvailablePowerPolicyFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryRemoveAskDriver (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryRemoveEnsureDeviceAwake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryRemovePending (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryRemoveStaticCheck (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueriedRemoving (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryStopAskDriver (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryStopEnsureDeviceAwake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryStopPending (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryStopStaticCheck (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueryCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventPdoRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRemovedPdoWait (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRemovedPdoSurpriseRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRemovingDisableInterfaces (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRestarting (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventStarted (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventStartedCancelStop (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventStartedCancelRemove (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventStartedRemoving (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventStartingFromStopped (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventStopped (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventStoppedWaitForStartCompletion (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventStartedStopping (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventSurpriseRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventInitQueryRemove (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventInitQueryRemoveCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFdoRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventQueriedSurpriseRemove (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventSurpriseRemoveIoStarted (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFailedPowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFailedIoStarting (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFailedOwnHardware (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFailedPowerPolicyRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFailedSurpriseRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFailedStarted (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFailedInit (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventPdoInitFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRestart (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRestartReleaseHardware (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRestartHardwareAvailable (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventPdoRestart (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventRemovedChildrenRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_PNP_STATE PnpEventFinal (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerCheckDeviceType (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerCheckDeviceTypeNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerEnablingWakeAtBus (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerEnablingWakeAtBusNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerCheckParentState (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerCheckParentStateNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDZero (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0NP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0BusWakeOwner (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0BusWakeOwnerNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0ArmedForWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0ArmedForWakeNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoImplicitD3DisarmWakeAtBus (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0DisarmingWakeAtBus (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0DisarmingWakeAtBusNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0Starting (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0StartingConnectInterrupt (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0StartingDmaEnable (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0StartingStartSelfManagedIo (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDecideD0State (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoD3Stopped (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerStartingCheckDeviceType (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerStartingChild (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxDisablingWakeAtBus (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxDisablingWakeAtBusNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDNotZero (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDNotZeroNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDNotZeroIoStopped (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDNotZeroIoStoppedNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxNPFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxArmedForWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxArmedForWakeNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDNotZeroNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxIoStoppedArmedForWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxIoStoppedArmedForWakeNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerCheckParentStateArmedForWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerCheckParentStateArmedForWakeNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerStartSelfManagedIo (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerStartSelfManagedIoNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerStartSelfManagedIoFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerStartSelfManagedIoFailedNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakePending (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakePendingNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWaking (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingConnectInterrupt (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingConnectInterruptNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingConnectInterruptFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingConnectInterruptFailedNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingDmaEnable (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingDmaEnableNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingDmaEnableFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerWakingDmaEnableFailedNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerReportPowerUpFailedDerefParent (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerReportPowerUpFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerPowerFailedPowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerReportPowerDownFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerInitialConnectInterruptFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerInitialDmaEnableFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerInitialSelfManagedIoFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerInitialPowerUpFailedDerefParent (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerInitialPowerUpFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxSurpriseRemovedPowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxSurpriseRemovedPowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxStoppedDisarmWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxStoppedDisarmWakeNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxStoppedDisableInterruptNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxStopped (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoStopped (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerStoppedCompleteDx (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxStoppedDecideDxState (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxStoppedArmForWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerDxStoppedArmForWakeNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerFinalPowerDownFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerD0SurpriseRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerSurpriseRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerUpFailedDerefParent (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerUpFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerGotoDxStoppedDisableInterrupt (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerUpFailedDerefParentNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerUpFailedNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerNotifyingD0ExitToWakeInterrupts (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerNotifyingD0EntryToWakeInterrupts (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerNotifyingD0ExitToWakeInterruptsNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_STATE PowerNotifyingD0EntryToWakeInterruptsNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStarting (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartingPoweredUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartingPoweredUpFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartingSucceeded (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartingFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartingDecideS0Wake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartedIdleCapable (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolIdleCapableDeviceIdle (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolDeviceIdleReturnToActive (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolDeviceIdleSleeping (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolDeviceIdleStopping (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredNoWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredNoWakeCompletePowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWaitingUnarmedQueryIdle (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolS0NoWakePowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolS0NoWakeCompletePowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemSleepFromDeviceWaitingUnarmed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemSleepNeedWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemSleepNeedWakeCompletePowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemSleepPowerRequestFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolCheckPowerPageable (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingWakeWakeArrived (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingWakeRevertArmWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemAsleepWakeArmed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeEnabled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeEnabledWakeCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeDisarm (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeTriggeredS0 (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWokeDisarm (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingWakeWakeArrivedNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingWakeRevertArmWakeNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingWakePowerDownFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingWakePowerDownFailedWakeCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemAsleepWakeArmedNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeEnabledNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeEnabledWakeCanceledNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeDisarmNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeTriggeredS0NP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWokeDisarmNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeCompletePowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleeping (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingNoWakePowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingNoWakeCompletePowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingNoWakeDxRequestFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingWakePowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingSendWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemAsleepNoWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeDisabled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceToD0 (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceToD0CompletePowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeQueryIdle (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartedWakeCapable (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWakeCapableDeviceIdle (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWakeCapableUsbSSCompleted (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredDecideUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapablePowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableSendWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableWakeArrived (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableCancelWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableWakeCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableCleanup (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableDxAllocFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableUndoPowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCompletedPowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCompletedPowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCompletedHardwareStarted (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWaitingArmedUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWaitingArmedQueryIdle (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolIoPresentArmed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolIoPresentArmedWakeCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolS0WakeDisarm (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolS0WakeCompletePowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeSucceeded (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCompletedDisarm (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWakeFailedUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapablePowerDownFailedCancelWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapablePowerDownFailedWakeCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapablePowerDownFailedUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolCancelingWakeForSystemSleep (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolCancelingWakeForSystemSleepWakeCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolDisarmingWakeForSystemSleepCompletePowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolPowerUpForSystemSleepFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWokeFromS0UsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWokeFromS0 (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWokeFromS0NotifyDriver (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingResetDevice (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingResetDeviceCompletePowerUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingResetDeviceFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingD0 (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingD0Failed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingDisarmWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingDisarmWakeCancelWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingDisarmWakeWakeCanceled (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStopping (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingSucceeded (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingSendStatus (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppedRemoving (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolRemoved (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolRestarting (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolRestartingFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingCancelTimer (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingCancelUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingCancelWake (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolCancelUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStarted (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartedCancelTimer (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartedWakeCapableCancelTimerForSleep (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartedWakeCapableSleepingUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStartedIdleCapableCancelTimerForSleep (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolDeviceD0PowerRequestFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolDevicePowerRequestFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSleepingPowerDownNotProcessed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapablePowerDownNotProcessed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredNoWakePowerDownNotProcessed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredNoWakeUndoPowerDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredNoWakeReturnToActive (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredNoWakePoweredDownDisableIdleTimer (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolPowerUpForSystemSleepNotSeen (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWaitingArmedStoppingCancelUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWaitingArmedWakeFailedCancelUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWaitingArmedIoPresentCancelUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWaitingArmedWakeSucceededCancelUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolCancelingUsbSSForSystemSleep (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolStoppingD0CancelUsbSS (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolWaitingArmedWakeInterruptFired (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeInterruptFired (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolSystemWakeDeviceWakeInterruptFiredNP (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE PowerPolTimerExpiredWakeCapableWakeInterruptArrived (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerStarting (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerStarted (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerGotoDx (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerGotoDxInDx (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerGotoD0 (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerGotoD0InD0 (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerStopping (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerStoppingSendStatus (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerStartingFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerStoppingFailed (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerStoppingPoweringUp (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerStoppingPoweringDown (__inout FxPkgPnp *This)
 
static WDF_DEVICE_POWER_POLICY_STATE NotPowerPolOwnerRemoved (__inout FxPkgPnp *This)
 
static VOID _PowerSetSystemWakeSource (__in FxIrp *Irp)
 
static CPPNP_STATE_TABLE GetPnpTableEntry (__in WDF_DEVICE_PNP_STATE State)
 
static CPPOWER_STATE_TABLE GetPowerTableEntry (__in WDF_DEVICE_POWER_STATE State)
 
static CPPOWER_POLICY_STATE_TABLE GetPowerPolicyTableEntry (__in WDF_DEVICE_POWER_POLICY_STATE State)
 
static _Must_inspect_result_ CPNOT_POWER_POLICY_OWNER_STATE_TABLE GetNotPowerPolicyOwnerTableEntry (__in WDF_DEVICE_POWER_POLICY_STATE State)
 
static NTSTATUS _S0IdleQueryInstance (__in CfxDevice *Device, __in FxWmiInstanceInternal *Instance, __in ULONG OutBufferSize, __out PVOID OutBuffer, __out PULONG BufferUsed)
 
static NTSTATUS _S0IdleSetInstance (__in CfxDevice *Device, __in FxWmiInstanceInternal *Instance, __in ULONG InBufferSize, __in PVOID InBuffer)
 
static NTSTATUS _S0IdleSetItem (__in CfxDevice *Device, __in FxWmiInstanceInternal *Instance, __in ULONG DataItemId, __in ULONG InBufferSize, __in PVOID InBuffer)
 
static NTSTATUS _SxWakeQueryInstance (__in CfxDevice *Device, __in FxWmiInstanceInternal *Instaace, __in ULONG OutBufferSize, __out PVOID OutBuffer, __out PULONG BufferUsed)
 
static NTSTATUS _SxWakeSetInstance (__in CfxDevice *Device, __in FxWmiInstanceInternal *Instance, __in ULONG InBufferSize, __in PVOID InBuffer)
 
static NTSTATUS _SxWakeSetItem (__in CfxDevice *Device, __in FxWmiInstanceInternal *Instance, __in ULONG DataItemId, __in ULONG InBufferSize, __in PVOID InBuffer)
 
static DEVICE_USAGE_NOTIFICATION_TYPE _SpecialTypeToUsage (__in WDF_SPECIAL_FILE_TYPE Type)
 
static WDF_SPECIAL_FILE_TYPE _UsageToSpecialType (__in DEVICE_USAGE_NOTIFICATION_TYPE Type)
 
- Static Protected Member Functions inherited from FxObject
static PVOID _GetBase (__in FxObject *Object)
 

Protected Attributes

MxEventm_DeviceRemoveProcessed
 
LONG m_PendingChildCount
 
BYTE m_DeviceWake [DeviceWakeStates]
 
BYTE m_SystemWake
 
BYTE m_FailedAction
 
BYTE m_SetDeviceRemoveProcessed
 
POWER_THREAD_INTERFACE m_PowerThreadInterface
 
FxEnumerationInfom_EnumInfo
 
FxCmResListm_Resources
 
FxCmResListm_ResourcesRaw
 
FxSpinLockTransactionedListm_DmaEnablerList
 
PNP_BUS_INFORMATION m_BusInformation
 
UCHAR m_BusEnumRetries
 
UCHAR m_SystemPowerAction
 
BOOLEAN m_CapsQueried
 
BOOLEAN m_InternalFailure
 
BOOLEAN m_HasPowerThread
 
BOOLEAN m_ReleaseHardwareAfterDescendantsOnFailure
 
PFN_IO_CONNECT_INTERRUPT_EX m_IoConnectInterruptEx
 
PFN_IO_DISCONNECT_INTERRUPT_EX m_IoDisconnectInterruptEx
 
PFN_IO_REPORT_INTERRUPT_ACTIVE m_IoReportInterruptActive
 
PFN_IO_REPORT_INTERRUPT_INACTIVE m_IoReportInterruptInactive
 
- Protected Attributes inherited from FxObject
union {
   CfxDeviceBase *   m_DeviceBase
 
   CfxDevice *   m_Device
 
}; 
 

Static Protected Attributes

static MdCancelRoutineType _PowerWaitWakeCancelRoutine
 
static MdRequestPowerCompleteType _PowerPolDeviceWaitWakeComplete
 
static MdRequestPowerCompleteType _PowerPolDevicePowerDownComplete
 
static MdRequestPowerCompleteType _PowerPolDevicePowerUpComplete
 
static MdCompletionRoutineType _PowerPolicyWaitWakeCompletionRoutine
 
static MdCompletionRoutineType _PowerPolicyUsbSelectiveSuspendCompletionRoutine
 
static const GUID GUID_POWER_THREAD_INTERFACE
 

Private Member Functions

VOID DisconnectInterruptNP (VOID)
 
NTSTATUS UpdateWmiInstanceForS0Idle (__in FxWmiInstanceAction Action)
 
VOID ReadRegistryS0Idle (__in PCUNICODE_STRING ValueName, __out BOOLEAN *Enabled)
 
NTSTATUS UpdateWmiInstanceForSxWake (__in FxWmiInstanceAction Action)
 
VOID ReadRegistrySxWake (__in PCUNICODE_STRING ValueName, __out BOOLEAN *Enabled)
 
VOID WriteStateToRegistry (__in HANDLE RegKey, __in PUNICODE_STRING ValueName, __in ULONG Value)
 
NTSTATUS ReadStateFromRegistry (_In_ PCUNICODE_STRING ValueName, _Out_ PULONG Value)
 
NTSTATUS UpdateWmiInstance (_In_ FxWmiInstanceAction Action, _In_ BOOLEAN ForS0Idle)
 
VOID PowerPolicyCheckAssumptions (VOID)
 
VOID PowerCheckAssumptions (VOID)
 
VOID PnpCheckAssumptions (VOID)
 
VOID NotifyResourceobjectsToReleaseResources (VOID)
 
_Must_inspect_result_ NTSTATUS NotifyResourceObjectsD0 (__in ULONG NotifyFlags)
 
NTSTATUS NotifyResourceObjectsDx (__in ULONG NotifyFlags)
 
BOOLEAN PnpCheckAndIncrementRestartCount (VOID)
 
BOOLEAN PnpIncrementRestartCountLogic (_In_ HANDLE RestartKey, _In_ BOOLEAN CreatedNewKey)
 
VOID PnpCleanupForRemove (__in BOOLEAN GracefulRemove)
 
virtual NTSTATUS ProcessRemoveDeviceOverload (FxIrp *Irp)=0
 
virtual VOID DeleteSymbolicLinkOverload (BOOLEAN GracefulRemove)=0
 
virtual VOID QueryForReenumerationInterface (VOID)=0
 
virtual VOID ReleaseReenumerationInterface (VOID)=0
 
virtual NTSTATUS AskParentToRemoveAndReenumerate (VOID)=0
 
_Must_inspect_result_ NTSTATUS CreatePowerThreadIfNeeded (VOID)
 
virtual NTSTATUS QueryForPowerThread (VOID)=0
 
VOID ReleasePowerThread (VOID)
 
_Must_inspect_result_ NTSTATUS HandleQueryInterfaceForPowerThread (__inout FxIrp *Irp, __out PBOOLEAN CompleteRequest)
 
_Must_inspect_result_ NTSTATUS PnpPowerReferenceSelf (VOID)
 
VOID PnpPowerDereferenceSelf (VOID)
 
BOOLEAN PowerPolicyCanIdlePowerDown (__in DEVICE_POWER_STATE DxState)
 
VOID PowerPolicyPostParentToD0ToChildren (VOID)
 
VOID PowerPolicyChildrenCanPowerUp (VOID)
 
VOID __inline PowerPolicyDisarmWakeFromSx (VOID)
 
_Must_inspect_result_ NTSTATUS PowerPolicyPowerDownForSx (__in DEVICE_POWER_STATE DxState, __in SendDeviceRequestAction Action)
 
VOID PowerPolicyBlockChildrenPowerUp (VOID)
 
_Must_inspect_result_ NTSTATUS PnpPowerReferenceDuringQueryPnp (VOID)
 

Static Private Member Functions

static VOID _PowerThreadEnqueue (__in PVOID Context, __in PWORK_QUEUE_ITEM WorkItem)
 
static VOID STDCALL _PowerThreadInterfaceReference (__inout PVOID Context)
 
static VOID STDCALL _PowerThreadInterfaceDereference (__inout PVOID Context)
 

Private Attributes

friend FxPnpMachine
 
friend FxPowerMachine
 
friend FxPowerPolicyMachine
 
friend FxPowerPolicyOwnerSettings
 
friend FxInterrupt
 
FxCREvent m_CleanupEventUm
 
MxEvent m_RemoveEventUm
 
ULONG m_InterruptObjectCount
 
LIST_ENTRY m_InterruptListHead
 
ULONG m_WakeInterruptCount
 
ULONG m_WakeInterruptPendingAckCount
 
BOOLEAN m_SystemWokenByWakeInterrupt
 
BOOLEAN m_WakeInterruptsKeepConnected
 
BOOLEAN m_AchievedStart
 
FxSystemThreadm_PowerThread
 
LONG m_PowerThreadInterfaceReferenceCount
 
FxCREventm_PowerThreadEvent
 
MdIrp m_PendingPnPIrp
 
MdIrp m_PendingSystemPowerIrp
 
MdIrp m_PendingDevicePowerIrp
 
FxPnpStateCallbackm_PnpStateCallbacks
 
FxPowerStateCallbackm_PowerStateCallbacks
 
FxPowerPolicyStateCallbackm_PowerPolicyStateCallbacks
 

Static Private Attributes

static const PNP_STATE_TABLE m_WdfPnpStates []
 
static const POWER_STATE_TABLE m_WdfPowerStates []
 
static const POWER_POLICY_STATE_TABLE m_WdfPowerPolicyStates []
 
static const NOT_POWER_POLICY_OWNER_STATE_TABLE m_WdfNotPowerPolicyOwnerStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpInitOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpInitStartingOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpHardwareAvailableOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpQueryStopPendingOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpRemovedPdoWaitOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpRestartingOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpStartedOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpQueryRemovePendingOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpQueriedRemovingOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpInitQueryRemoveOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpStoppedOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpStoppedWaitForStartCompletionOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpStartedStoppingOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpStartedStoppingFailedOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpEjectFailedOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpStartedRemovingOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpFailedPowerDownOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpFailedIoStartingOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpFailedWaitForRemoveOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpRestartOtherStates []
 
static const PNP_EVENT_TARGET_STATE m_PnpRestartReleaseHardware []
 
static const PNP_EVENT_TARGET_STATE m_PnpRestartHardwareAvailableOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerD0OtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerD0NPOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerD0BusWakeOwnerOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerD0BusWakeOwnerNPOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerD0ArmedForWakeOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerD0ArmedForWakeNPOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerDNotZeroOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerDNotZeroNPOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_DxArmedForWakeOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_DxArmedForWakeNPOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_WakePendingOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_WakePendingNPOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_DxSurpriseRemovedOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerStoppedOtherStates []
 
static const POWER_EVENT_TARGET_STATE m_PowerDxStoppedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolObjectCreatedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStartingOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStartedIdleCapableOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolIdleCapableDeviceIdleOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredNoWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredNoWakeCompletePowerDownOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolWaitingUnarmedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolS0NoWakePowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolS0NoWakeCompletePowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemSleepNeedWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemSleepNeedWakeCompletePowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemAsleepWakeArmedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemAsleepWakeArmedNPOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceToD0OtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceToD0CompletePowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStartedWakeCapableOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolWakeCapableDeviceIdleOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapablePowerDownOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapableSendWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapableUsbSSOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolWaitingArmedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolDisarmingWakeForSystemSleepCompletePowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolCancelingWakeForSystemSleepWakeCanceledOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolWokeFromS0OtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStoppingResetDeviceOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStoppingResetDeviceCompletePowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStoppingD0OtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStoppingDisarmWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStoppingDisarmWakeCancelWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolIoPresentArmedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolIoPresentArmedWakeCanceledOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolS0WakeCompletePowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapableWakeSucceededOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapableWakeFailedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapablePowerDownFailedCancelWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolCancelingWakeForSystemSleepOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapableWakeArrivedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapableCancelWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCompletedPowerDownOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCompletedPowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeEnabledOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeEnabledNPOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeEnabledWakeCanceledOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeEnabledWakeCanceledNPOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingWakeWakeArrivedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeTriggeredS0OtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeTriggeredS0NPOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeCompletePowerUpOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingNoWakePowerDownOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingNoWakeCompletePowerDownOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingWakePowerDownOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingSendWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingWakeWakeArrivedNPOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingWakePowerDownFailedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStartedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStartedWaitForIdleTimeoutOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolDevicePowerRequestFailedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStoppingOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStoppedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolRestartingOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolStoppingCancelWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolCancelUsbSSOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingWakeRevertArmWakeOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSleepingWakeRevertArmWakeNPOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolRemovedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapableWakeInterruptArrivedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolTimerExpiredWakeCapablePowerDownFailedWakeInterruptArrivedOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolWaitingArmedWakeInterruptFiredDuringPowerDownOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerObjectCreatedStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerStartingStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerStartingSucceededStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerStartingFailedStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerGotoDxStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerGotoDxInDxStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerDxStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerGotoD0States []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerGotoD0InD0States []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerStoppedStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerStoppingWaitForImplicitPowerDownStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerStoppingPoweringUpStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerStoppingPoweringDownStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_NotPowerPolOwnerRemovedStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolWaitingArmedWakeInterruptFiredOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeInterruptFiredOtherStates []
 
static const POWER_POLICY_EVENT_TARGET_STATE m_PowerPolSystemWakeDeviceWakeInterruptFiredNPOtherStates []
 
static const PWCHAR m_RestartStartAchievedName = RESTART_START_ACHIEVED_NAME
 
static const PWCHAR m_RestartStartTimeName = RESTART_START_TIME_NAME
 
static const PWCHAR m_RestartCountName = RESTART_COUNT_NAME
 
static const ULONG m_RestartTimePeriodMaximum = 60
 
static const ULONG m_RestartCountMaximum = 5
 

Additional Inherited Members

- Static Public Member Functions inherited from FxObject
static FxObject_FromDisposeEntry (__in PSINGLE_LIST_ENTRY Entry)
 
static FxObject_GetObjectFromHandle (__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
 
static PVOID __inline _ToHandle (__in FxObject *Object)
 
static VOID __inline _ReferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static VOID __inline _DereferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static PVOID _GetDebugBase (__in FxObject *Object)
 
static PFX_POOL_HEADER _CleanupPointer (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Object)
 
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)
 
static _Must_inspect_result_ NTSTATUS _ObjectQuery (_In_ FxObject *Object, _In_ CONST GUID *Guid, _In_ ULONG QueryBufferLength, _Out_writes_bytes_(QueryBufferLength) PVOID QueryBuffer)
 

Detailed Description

Definition at line 488 of file fxpkgpnp.hpp.

Constructor & Destructor Documentation

◆ FxPkgPnp()

FxPkgPnp::FxPkgPnp ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in CfxDevice Device,
__in WDFTYPE  Type 
)
protected

Definition at line 48 of file fxpkgpnp.cpp.

52 :
53 FxPackage(FxDriverGlobals, Device, Type)
54{
55 ULONG i;
56
60
61 //
62 // Initialize the structures to the default state and then override the
63 // non WDF std default values to the unsupported / off values.
64 //
72
82 ;
83
86
95 ;
96
99
103
105 for (i = 0; i < PowerSystemMaximum; i++) {
107 }
108
112
123
128
129 //
130 // We only set the pending child count to 1 once we know we have successfully
131 // created an FxDevice and initialized it fully. If we delete an FxDevice
132 // which is half baked, it cannot have any FxChildLists which have any
133 // pending children on them.
134 //
136
138
141
142 m_Failed = FALSE;
144
148
153
157
159
161
164
172
176
178
179#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
180 //
181 // Interrupt APIs for Vista and forward
182 //
185
186 //
187 // Interrupt APIs for Windows 8 and forward
188 //
191
192#endif
193
195
197}
Type
Definition: Type.h:7
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
Definition: fxobject.hpp:1101
MdIrp m_PendingPnPIrp
Definition: fxpkgpnp.hpp:4360
FxPnpStateCallback * m_PnpStateCallbacks
Definition: fxpkgpnp.hpp:4374
ULONG m_PnpCapsUINumber
Definition: fxpkgpnp.hpp:4091
FxCmResList * m_Resources
Definition: fxpkgpnp.hpp:4220
PFN_IO_REPORT_INTERRUPT_INACTIVE m_IoReportInterruptInactive
Definition: fxpkgpnp.hpp:4294
FxSystemThread * m_PowerThread
Definition: fxpkgpnp.hpp:4350
static VOID STDCALL _PowerThreadInterfaceDereference(__inout PVOID Context)
Definition: fxpkgpnp.cpp:5292
ULONG m_InterruptObjectCount
Definition: fxpkgpnp.hpp:4308
SINGLE_LIST_ENTRY m_DeviceInterfaceHead
Definition: fxpkgpnp.hpp:4126
FxSelfManagedIoMachine * m_SelfManagedIoMachine
Definition: fxpkgpnp.hpp:4155
LONG m_SpecialFileCount[WdfSpecialFileMax-1]
Definition: fxpkgpnp.hpp:4139
FxCmResList * m_ResourcesRaw
Definition: fxpkgpnp.hpp:4225
FxRelatedDeviceList * m_UsageDependentDeviceList
Definition: fxpkgpnp.hpp:4113
PFN_IO_DISCONNECT_INTERRUPT_EX m_IoDisconnectInterruptEx
Definition: fxpkgpnp.hpp:4289
FxPowerStateCallback * m_PowerStateCallbacks
Definition: fxpkgpnp.hpp:4376
BOOLEAN m_ReleaseHardwareAfterDescendantsOnFailure
Definition: fxpkgpnp.hpp:4277
static VOID STDCALL _PowerThreadInterfaceReference(__inout PVOID Context)
Definition: fxpkgpnp.cpp:5262
LONG m_PendingChildCount
Definition: fxpkgpnp.hpp:4178
LONG m_PowerThreadInterfaceReferenceCount
Definition: fxpkgpnp.hpp:4352
UCHAR m_SystemPowerAction
Definition: fxpkgpnp.hpp:4242
BYTE m_SetDeviceRemoveProcessed
Definition: fxpkgpnp.hpp:4198
BYTE m_FailedAction
Definition: fxpkgpnp.hpp:4191
FxEnumerationInfo * m_EnumInfo
Definition: fxpkgpnp.hpp:4215
BOOLEAN m_InternalFailure
Definition: fxpkgpnp.hpp:4249
static VOID _SetPowerCapState(__in ULONG Index, __in DEVICE_POWER_STATE State, __out PULONG Result)
Definition: fxpkgpnp.cpp:5616
BOOLEAN m_Failed
Definition: fxpkgpnp.hpp:4095
MxEvent * m_DeviceRemoveProcessed
Definition: fxpkgpnp.hpp:4172
POWER_THREAD_INTERFACE m_PowerThreadInterface
Definition: fxpkgpnp.hpp:4213
BYTE m_DevicePowerStateOld
Definition: fxpkgpnp.hpp:4108
PFN_IO_REPORT_INTERRUPT_ACTIVE m_IoReportInterruptActive
Definition: fxpkgpnp.hpp:4293
FxCREvent * m_PowerThreadEvent
Definition: fxpkgpnp.hpp:4354
FxPowerPolicyStateCallback * m_PowerPolicyStateCallbacks
Definition: fxpkgpnp.hpp:4378
SINGLE_LIST_ENTRY m_QueryInterfaceHead
Definition: fxpkgpnp.hpp:4122
FxSpinLockTransactionedList * m_DmaEnablerList
Definition: fxpkgpnp.hpp:4227
BOOLEAN m_AchievedStart
Definition: fxpkgpnp.hpp:4344
MdIrp m_PendingSystemPowerIrp
Definition: fxpkgpnp.hpp:4366
BOOLEAN m_SpecialSupport[WdfSpecialFileMax-1]
Definition: fxpkgpnp.hpp:4133
BOOLEAN m_CapsQueried
Definition: fxpkgpnp.hpp:4247
BYTE m_DevicePowerState
Definition: fxpkgpnp.hpp:4105
FxPowerCaps m_PowerCaps
Definition: fxpkgpnp.hpp:4093
ULONG m_PnpCapsAddress
Definition: fxpkgpnp.hpp:4090
static VOID _PowerThreadEnqueue(__in PVOID Context, __in PWORK_QUEUE_ITEM WorkItem)
Definition: fxpkgpnp.hpp:3944
BOOLEAN m_WakeInterruptsKeepConnected
Definition: fxpkgpnp.hpp:4339
SharedPowerData m_SharedPower
Definition: fxpkgpnp.hpp:4161
ULONG m_WakeInterruptCount
Definition: fxpkgpnp.hpp:4316
BYTE m_SystemPowerState
Definition: fxpkgpnp.hpp:4102
LIST_ENTRY m_InterruptListHead
Definition: fxpkgpnp.hpp:4310
ULONG m_DeviceStopCount
Definition: fxpkgpnp.hpp:4146
FxPnpStateAndCaps m_PnpStateAndCaps
Definition: fxpkgpnp.hpp:4088
FxRelatedDeviceList * m_RemovalDeviceList
Definition: fxpkgpnp.hpp:4115
BOOLEAN m_DeviceInterfacesCanBeEnabled
Definition: fxpkgpnp.hpp:4128
ULONG m_WakeInterruptPendingAckCount
Definition: fxpkgpnp.hpp:4323
BOOLEAN m_HasPowerThread
Definition: fxpkgpnp.hpp:4256
PFN_IO_CONNECT_INTERRUPT_EX m_IoConnectInterruptEx
Definition: fxpkgpnp.hpp:4288
MdIrp m_PendingDevicePowerIrp
Definition: fxpkgpnp.hpp:4372
D3COLD_SUPPORT_INTERFACE m_D3ColdInterface
Definition: fxpkgpnp.hpp:4166
BOOLEAN m_SystemWokenByWakeInterrupt
Definition: fxpkgpnp.hpp:4330
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
@ ObjectDoNotLock
Definition: fxobject.hpp:128
@ FxPnpCapSilentInstallUseDefault
Definition: fxpkgpnp.hpp:309
@ FxPnpStateResourcesChangedUseDefault
Definition: fxpkgpnp.hpp:277
@ FxPnpStateDisabledUseDefault
Definition: fxpkgpnp.hpp:252
@ FxPnpCapHardwareDisabledUseDefault
Definition: fxpkgpnp.hpp:319
@ FxPnpCapSurpriseRemovalOKUseDefault
Definition: fxpkgpnp.hpp:314
@ FxPnpCapUniqueIDUseDefault
Definition: fxpkgpnp.hpp:304
@ FxPnpCapEjectSupportedUseDefault
Definition: fxpkgpnp.hpp:289
@ FxPnpStateNotDisableableUseDefault
Definition: fxpkgpnp.hpp:267
@ FxPnpCapLockSupportedUseDefault
Definition: fxpkgpnp.hpp:284
@ FxPnpStateRemovedUseDefault
Definition: fxpkgpnp.hpp:272
@ FxPnpStateDontDisplayInUIUseDefault
Definition: fxpkgpnp.hpp:257
@ FxPnpStateFailedUseDefault
Definition: fxpkgpnp.hpp:262
@ FxPnpCapDockDeviceUseDefault
Definition: fxpkgpnp.hpp:299
@ FxPnpCapRemovableUseDefault
Definition: fxpkgpnp.hpp:294
@ FxPnpCapNoDisplayInUIUseDefault
Definition: fxpkgpnp.hpp:324
@ FxPowerCapWakeFromD0UseDefault
Definition: fxpkgpnp.hpp:383
@ FxPowerCapDeviceD2UseDefault
Definition: fxpkgpnp.hpp:378
@ FxPowerCapWakeFromD2UseDefault
Definition: fxpkgpnp.hpp:393
@ FxPowerCapDeviceD1UseDefault
Definition: fxpkgpnp.hpp:373
@ FxPowerCapWakeFromD1UseDefault
Definition: fxpkgpnp.hpp:388
@ FxPowerCapWakeFromD3UseDefault
Definition: fxpkgpnp.hpp:398
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
Definition: glfuncs.h:248
@ PowerSystemMaximum
Definition: ntpoapi.h:42
@ PowerSystemWorking
Definition: ntpoapi.h:36
@ PowerActionNone
Definition: ntpoapi.h:123
@ PowerDeviceMaximum
Definition: ntpoapi.h:53
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
PFN_IO_REPORT_INTERRUPT_INACTIVE IoReportInterruptInactive
Definition: fxglobals.h:764
PFN_IO_DISCONNECT_INTERRUPT_EX IoDisconnectInterruptEx
Definition: fxglobals.h:732
PFN_IO_CONNECT_INTERRUPT_EX IoConnectInterruptEx
Definition: fxglobals.h:730
PFN_IO_REPORT_INTERRUPT_ACTIVE IoReportInterruptActive
Definition: fxglobals.h:762
ULONG D3Latency
Definition: fxpkgpnp.hpp:425
BYTE SystemWake
Definition: fxpkgpnp.hpp:413
ULONG D2Latency
Definition: fxpkgpnp.hpp:424
ULONG D1Latency
Definition: fxpkgpnp.hpp:423
USHORT Caps
Definition: fxpkgpnp.hpp:406
BYTE DeviceWake
Definition: fxpkgpnp.hpp:412
ULONG States
Definition: fxpkgpnp.hpp:418
BOOLEAN m_ExtendWatchDogTimer
Definition: fxpkgpnp.hpp:196
BOOLEAN m_WaitWakeOwner
Definition: fxpkgpnp.hpp:186
MdIrp m_WaitWakeIrp
Definition: fxpkgpnp.hpp:180
PVOID Context
Definition: miniport.h:123
USHORT Version
Definition: miniport.h:122
USHORT Size
Definition: miniport.h:121
PINTERFACE_REFERENCE InterfaceReference
Definition: miniport.h:124
PINTERFACE_DEREFERENCE InterfaceDereference
Definition: miniport.h:125
PFN_POWER_THREAD_ENQUEUE PowerThreadEnqueue
Definition: fxpkgpnp.hpp:110
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:637
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
@ WdfPowerDeviceD3Final
Definition: wdfdevice.h:427
@ WdfDeviceFailedUndefined
Definition: wdfdevice.h:468
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ ~FxPkgPnp()

FxPkgPnp::~FxPkgPnp ( )
protected

Definition at line 199 of file fxpkgpnp.cpp.

200{
202
204
205 //
206 // We should either have zero pending children or we never made it out of
207 // the init state during a failed WDFDEVICE create or failed EvtDriverDeviceAdd
208 //
211
212
214 while (ple != NULL) {
216
218
219 //
220 // Advance to the next before deleting the current
221 //
222 ple = ple->Next;
223
224 //
225 // No longer in the list
226 //
227 pDI->m_Entry.Next = NULL;
228
229 delete pDI;
230 }
232
233 if (m_DmaEnablerList != NULL) {
234 delete m_DmaEnablerList;
236 }
237
238 if (m_RemovalDeviceList != NULL) {
239 delete m_RemovalDeviceList;
241 }
242
246 }
247
248 if (m_PnpStateCallbacks != NULL) {
249 delete m_PnpStateCallbacks;
250 }
251
254 }
255
258 }
259
263 }
264
265 if (m_EnumInfo != NULL) {
266 delete m_EnumInfo;
268 }
269
270 if (m_Resources != NULL) {
271 m_Resources->RELEASE(this);
273 }
274
275 if (m_ResourcesRaw != NULL) {
276 m_ResourcesRaw->RELEASE(this);
278 }
279
281}
static FxDeviceInterface * _FromEntry(__in PSINGLE_LIST_ENTRY Entry)
SINGLE_LIST_ENTRY m_Entry
__inline WDF_DEVICE_PNP_STATE GetDevicePnpState()
Definition: fxdevice.hpp:1149
CfxDevice * m_Device
Definition: fxobject.hpp:329
static __inline VOID MxAssert(__in BOOLEAN Condition)
Definition: mxgeneralkm.h:165
static __inline KIRQL MxGetCurrentIrql()
Definition: mxgeneralkm.h:86
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
PSINGLE_LIST_ENTRY ple
#define ASSERT(a)
Definition: mode.c:44
Definition: ntbasedef.h:636
@ WdfDevStatePnpInit
Definition: wdfdevice.h:69

Member Function Documentation

◆ __drv_when()

FxPkgPnp::__drv_when ( NT_SUCCESSreturn,
__drv_arg(ResourcesMatched, _Must_inspect_result_  
)
protected

◆ _DispatchWaitWake()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_DispatchWaitWake ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 2400 of file fxpkgpnp.cpp.

2425{
2426 return This->DispatchWaitWake(Irp);
2427}
_In_ PIRP Irp
Definition: csq.h:116

◆ _GetPowerCapState()

DEVICE_POWER_STATE FxPkgPnp::_GetPowerCapState ( __in ULONG  Index,
__in ULONG  State 
)
staticprotected

Definition at line 5657 of file fxpkgpnp.cpp.

5676{
5677 ASSERT(Index < 8);
5678 // isolate the value and normalize it
5679 return (DEVICE_POWER_STATE) ((State & (0xF << (Index * 4))) >> (Index * 4));
5680}
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by FxPkgPdo::HandleQueryCapabilities(), FxPkgFdo::HandleQueryCapabilitiesCompletion(), and PowerPolSleepingNoWakePowerDown().

◆ _PnpCancelRemoveDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_PnpCancelRemoveDevice ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 2026 of file fxpkgpnp.cpp.

2049{
2050 //
2051 // Seed the irp with success
2052 //
2053 Irp->SetStatus(STATUS_SUCCESS);
2054
2055 //
2056 // Pend it and transition the state machine
2057 //
2058
2059 This->SetPendingPnpIrp(Irp);
2060 This->PnpProcessEvent(PnpEventCancelRemove);
2061
2062 return STATUS_PENDING;
2063}
#define STATUS_PENDING
Definition: d3dkmdt.h:43
@ PnpEventCancelRemove
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ _PnpCancelStopDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_PnpCancelStopDevice ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 1901 of file fxpkgpnp.cpp.

1928{
1929 //
1930 // Seed the irp with success
1931 //
1932 Irp->SetStatus(STATUS_SUCCESS);
1933
1934 //
1935 // Pend it and transition the state machine
1936 //
1937 This->SetPendingPnpIrp(Irp);
1938 This->PnpProcessEvent(PnpEventCancelStop);
1939
1940 return STATUS_PENDING;
1941}
@ PnpEventCancelStop

◆ _PnpDeviceUsageNotification()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_PnpDeviceUsageNotification ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 3857 of file fxpkgpnp.cpp.

3861{
3862 return This->PnpDeviceUsageNotification(Irp);
3863}

◆ _PnpProcessEventInner()

VOID FxPkgPnp::_PnpProcessEventInner ( __inout FxPkgPnp This,
__inout FxPostProcessInfo Info,
__in PVOID  WorkerContext 
)
staticprotected

Definition at line 952 of file pnpstatemachine.cpp.

957{
958 UNREFERENCED_PARAMETER(WorkerContext);
959
960 //
961 // Take the state machine lock.
962 //
963 This->m_PnpMachine.m_StateMachineLock.AcquireLock(
964 This->GetDriverGlobals()
965 );
966
967 //
968 // Call the function that will actually run the state machine.
969 //
970 This->PnpProcessEventInner(Info);
971
972 //
973 // We are being called from the work item and m_WorkItemRunning is > 0, so
974 // we cannot be deleted yet.
975 //
976 ASSERT(Info->SomethingToDo() == FALSE);
977
978 //
979 // Now release the lock
980 //
981 This->m_PnpMachine.m_StateMachineLock.ReleaseLock(
982 This->GetDriverGlobals()
983 );
984}
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by PostCreateDeviceInitialize().

◆ _PnpQueryRemoveDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_PnpQueryRemoveDevice ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 1981 of file fxpkgpnp.cpp.

2005{
2006 //
2007 // By default we handle this state.
2008 //
2009 Irp->SetStatus(STATUS_SUCCESS);
2010
2011 //
2012 // Keep this IRP around, since we're going to deal with it later.
2013 //
2014 This->SetPendingPnpIrp(Irp);
2015
2016 //
2017 // Now run the state machine on this thread.
2018 //
2019 This->PnpProcessEvent(PnpEventQueryRemove);
2020
2021 return STATUS_PENDING;
2022}
@ PnpEventQueryRemove

◆ _PnpQueryStopDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_PnpQueryStopDevice ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 1850 of file fxpkgpnp.cpp.

1885{
1886 //
1887 // Keep this IRP around, since we're going to deal with it later.
1888 //
1889 This->SetPendingPnpIrp(Irp);
1890
1891 //
1892 // Now run the state machine on this thread.
1893 //
1894 This->PnpProcessEvent(PnpEventQueryStop);
1895
1896 return STATUS_PENDING;
1897}
@ PnpEventQueryStop

◆ _PnpRemoveDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_PnpRemoveDevice ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 2275 of file fxpkgpnp.cpp.

2298{
2299#if (FX_CORE_MODE==FX_CORE_USER_MODE)
2300 MxEvent * event = This->m_RemoveEventUm.GetSelfPointer();
2301#else
2302 MxEvent eventOnStack;
2303 eventOnStack.Initialize(SynchronizationEvent, FALSE);
2304 MxEvent * event = eventOnStack.GetSelfPointer();
2305#endif
2306
2308
2310 This->m_Device->GetRemoveLock(),
2311 Irp->GetIrp());
2312
2313#if DBG
2315#else
2317#endif
2318
2319 //
2320 // Keep this object around after m_Device has RELEASE'ed its reference to
2321 // this package.
2322 //
2323 This->ADDREF(Irp);
2324
2325 //
2326 // Removes are always success
2327 //
2328 Irp->SetStatus(STATUS_SUCCESS);
2329
2330 ASSERT(This->m_DeviceRemoveProcessed == NULL);
2331 This->m_DeviceRemoveProcessed = event;
2332
2333 //
2334 // Post the event and wait for the FxDevice to destroy itself or determine
2335 // it has not been reported missing yet (for PDOs and bus filters).
2336 //
2337 This->PnpProcessEvent(PnpEventRemove);
2338
2340 This->GetDriverGlobals(), TRACE_LEVEL_INFORMATION, TRACINGPNP,
2341 "WDFDEVICE %p, !devobj %p waiting for remove event to finish processing",
2342 This->m_Device->GetHandle(), This->m_Device->GetDeviceObject());
2343
2344 //
2345 // No need to wait in a critical region because we are in the context of a
2346 // pnp request which is in the system context.
2347 //
2348 event->WaitFor(Executive, KernelMode, FALSE, NULL);
2349
2350 This->m_DeviceRemoveProcessed = NULL;
2351
2352 status = This->ProcessRemoveDeviceOverload(Irp);
2353
2354 //
2355 // Release the reference added at the top. This is most likely going to be
2356 // the last reference on the package for KMDF. For UMDF, host manages the
2357 // lifetime of FxDevice so this may not be the last release for UMDF.
2358 //
2359 This->RELEASE(Irp);
2360
2361 return status;
2362}
LONG NTSTATUS
Definition: precomp.h:26
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in EVENT_TYPE Type, __in BOOLEAN InitialState)
Definition: mxeventkm.h:55
MxEvent * GetSelfPointer(VOID)
Definition: mxevent.h:110
static __inline NTSTATUS MxAcquireRemoveLock(__in MdRemoveLock RemoveLock, __in_opt PVOID Tag)
Definition: mxgeneralkm.h:268
#define TRACINGPNP
Definition: dbgtrace.h:67
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
@ PnpEventRemove
struct _cl_event * event
Definition: glext.h:7739
#define KernelMode
Definition: asm.h:34
@ SynchronizationEvent
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
Definition: ps.c:97
@ Executive
Definition: ketypes.h:415

◆ _PnpStartDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_PnpStartDevice ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 1823 of file fxpkgpnp.cpp.

1841{
1842 This->SetPendingPnpIrp(Irp);
1843 This->PnpProcessEvent(PnpEventStartDevice);
1844
1845 return STATUS_PENDING;
1846}
@ PnpEventStartDevice

◆ _PnpStopDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::_PnpStopDevice ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprotected

Definition at line 1945 of file fxpkgpnp.cpp.

1964{
1965 //
1966 // Seed the irp with success
1967 //
1968 Irp->SetStatus(STATUS_SUCCESS);
1969
1970 //
1971 // Pend and transition the state machine
1972 //
1973 This->SetPendingPnpIrp(Irp);
1974 This->PnpProcessEvent(PnpEventStop);
1975
1976 return STATUS_PENDING;
1977}
@ PnpEventStop

◆ _PowerPolicyProcessEventInner()

VOID FxPkgPnp::_PowerPolicyProcessEventInner ( __inout FxPkgPnp This,
__inout FxPostProcessInfo Info,
__in PVOID  WorkerContext 
)
staticprotected

Definition at line 3048 of file powerpolicystatemachine.cpp.

3053{
3054
3056
3057 //
3058 // Take the state machine lock.
3059 //
3060 This->m_PowerPolicyMachine.m_StateMachineLock.AcquireLock(
3061 This->GetDriverGlobals()
3062 );
3063
3064 //
3065 // Call the function that will actually run the state machine.
3066 //
3067 This->PowerPolicyProcessEventInner(Info);
3068
3069 //
3070 // We are being called from the work item and m_WorkItemRunning is > 0, so
3071 // we cannot be deleted yet.
3072 //
3073 ASSERT(Info->SomethingToDo() == FALSE);
3074
3075 //
3076 // Now release the lock
3077 //
3078 This->m_PowerPolicyMachine.m_StateMachineLock.ReleaseLock(
3079 This->GetDriverGlobals()
3080 );
3081}

Referenced by PostCreateDeviceInitialize().

◆ _PowerProcessEventInner()

VOID FxPkgPnp::_PowerProcessEventInner ( __in FxPkgPnp This,
__in FxPostProcessInfo Info,
__in PVOID  WorkerContext 
)
staticprotected

Definition at line 1309 of file powerstatemachine.cpp.

1314{
1315
1316 UNREFERENCED_PARAMETER(WorkerContext);
1317
1318 //
1319 // Take the state machine lock.
1320 //
1321 This->m_PowerMachine.m_StateMachineLock.AcquireLock(
1322 This->GetDriverGlobals()
1323 );
1324
1325 //
1326 // Call the function that will actually run the state machine.
1327 //
1328 This->PowerProcessEventInner(Info);
1329
1330 //
1331 // We are being called from the work item and m_WorkItemRunning is > 0, so
1332 // we cannot be deleted yet.
1333 //
1334 ASSERT(Info->SomethingToDo() == FALSE);
1335
1336 //
1337 // Now release the lock
1338 //
1339 This->m_PowerMachine.m_StateMachineLock.ReleaseLock(
1340 This->GetDriverGlobals()
1341 );
1342}

Referenced by PostCreateDeviceInitialize().

◆ _PowerSetSystemWakeSource()

VOID FxPkgPnp::_PowerSetSystemWakeSource ( __in FxIrp Irp)
staticprotected

Definition at line 133 of file powerstatemachinekm.cpp.

148{
149 PoSetSystemWake(Irp->GetIrp());
150}

Referenced by PowerMakeWakeRequestNonCancelable().

◆ _PowerThreadEnqueue()

static VOID FxPkgPnp::_PowerThreadEnqueue ( __in PVOID  Context,
__in PWORK_QUEUE_ITEM  WorkItem 
)
inlinestaticprivate

Definition at line 3944 of file fxpkgpnp.hpp.

3948 {
3950
3951 result = ((FxPkgPnp*) Context)->m_PowerThread->QueueWorkItem(WorkItem);
3952#if DBG
3953 ASSERT(result);
3954#else
3956#endif
3957 }
unsigned char BOOLEAN
GLuint64EXT * result
Definition: glext.h:11304
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:115

Referenced by FxPkgPnp().

◆ _PowerThreadInterfaceDereference()

VOID FxPkgPnp::_PowerThreadInterfaceDereference ( __inout PVOID  Context)
staticprivate

Definition at line 5292 of file fxpkgpnp.cpp.

5310{
5311 FxPkgPnp* pThis;
5312
5313 pThis = (FxPkgPnp*) Context;
5314
5316 pThis->m_PowerThreadEvent->Set();
5317 }
5318}
#define InterlockedDecrement
Definition: armddk.h:52
VOID Set(VOID)
Definition: fxwaitlock.hpp:144

Referenced by FxPkgPnp().

◆ _PowerThreadInterfaceReference()

VOID FxPkgPnp::_PowerThreadInterfaceReference ( __inout PVOID  Context)
staticprivate

Definition at line 5262 of file fxpkgpnp.cpp.

5277{
5278 LONG count;
5279
5282 );
5283
5284#if DBG
5285 ASSERT(count >= 2);
5286#else
5288#endif
5289}
#define InterlockedIncrement
Definition: armddk.h:53
GLuint GLuint GLsizei count
Definition: gl.h:1545
long LONG
Definition: pedump.c:60

Referenced by FxPkgPnp().

◆ _S0IdleQueryInstance()

NTSTATUS FxPkgPnp::_S0IdleQueryInstance ( __in CfxDevice Device,
__in FxWmiInstanceInternal Instance,
__in ULONG  OutBufferSize,
__out PVOID  OutBuffer,
__out PULONG  BufferUsed 
)
staticprotected

Definition at line 3455 of file fxpkgpnp.cpp.

3462{
3463 *((BOOLEAN*) OutBuffer) =
3465 *BufferUsed = sizeof(BOOLEAN);
3466
3467 return STATUS_SUCCESS;
3468}
FxPowerPolicyMachine m_PowerPolicyMachine
Definition: fxpkgpnp.hpp:4153
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
Definition: scsi.h:4071
FxPowerPolicyOwnerSettings * m_Owner
_In_ ULONG _Out_ PULONG BufferUsed
Definition: wdfwmi.h:92

◆ _S0IdleSetInstance()

NTSTATUS FxPkgPnp::_S0IdleSetInstance ( __in CfxDevice Device,
__in FxWmiInstanceInternal Instance,
__in ULONG  InBufferSize,
__in PVOID  InBuffer 
)
staticprotected

Definition at line 3471 of file fxpkgpnp.cpp.

3477{
3478 BOOLEAN value;
3479
3480
3481 //
3482 // FxWmiIrpHandler makes sure the buffer is at least one byte big, so we
3483 // don't check the buffer size.
3484 //
3485
3486 value = *(PBOOLEAN) InBuffer;
3487
3489
3490 return STATUS_SUCCESS;
3491}
VOID PowerPolicySetS0IdleState(__in BOOLEAN State)
Definition: fxpkgpnp.cpp:3710
unsigned char * PBOOLEAN
Definition: typedefs.h:53
Definition: pdh_main.c:94

◆ _S0IdleSetItem()

NTSTATUS FxPkgPnp::_S0IdleSetItem ( __in CfxDevice Device,
__in FxWmiInstanceInternal Instance,
__in ULONG  DataItemId,
__in ULONG  InBufferSize,
__in PVOID  InBuffer 
)
staticprotected

Definition at line 3494 of file fxpkgpnp.cpp.

3501{
3502 BOOLEAN value;
3503
3504 if (DataItemId != 0) {
3506 }
3507
3508 if (InBufferSize < sizeof(BOOLEAN)) {
3510 }
3511
3512 value = *(BOOLEAN*) InBuffer;
3514
3515 return STATUS_SUCCESS;
3516}
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_In_ ULONG InBufferSize
Definition: wdfwmi.h:106
_In_ ULONG DataItemId
Definition: wdfwmi.h:123

◆ _SetPowerCapState()

VOID FxPkgPnp::_SetPowerCapState ( __in ULONG  Index,
__in DEVICE_POWER_STATE  State,
__out PULONG  Result 
)
staticprotected

Definition at line 5616 of file fxpkgpnp.cpp.

5639{
5640 //
5641 // We store off state in 4 bits, starting at the lowest byte
5642 //
5643 ASSERT(Index < 8);
5644
5645 //
5646 // Erase the old value
5647 //
5648 *Result &= ~(0xF << (Index * 4));
5649
5650 //
5651 // Write in the new one
5652 //
5653 *Result |= (0xF & State) << (Index * 4);
5654}
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by FxPkgPnp(), FxPowerPolicyOwnerSettings::FxPowerPolicyOwnerSettings(), QueryForCapabilities(), and SetPowerCaps().

◆ _SpecialTypeToUsage()

static DEVICE_USAGE_NOTIFICATION_TYPE FxPkgPnp::_SpecialTypeToUsage ( __in WDF_SPECIAL_FILE_TYPE  Type)
inlinestaticprotected

Definition at line 3187 of file fxpkgpnp.hpp.

3190 {
3191 switch (Type) {
3196 default: ASSERT(FALSE);return DeviceUsageTypePaging;
3197 }
3198 }
@ WdfSpecialFileBoot
Definition: wdfdevice.h:445
@ WdfSpecialFileHibernation
Definition: wdfdevice.h:443
@ WdfSpecialFileDump
Definition: wdfdevice.h:444
@ WdfSpecialFilePaging
Definition: wdfdevice.h:442
@ DeviceUsageTypeHibernation
Definition: iotypes.h:1171
@ DeviceUsageTypeBoot
Definition: iotypes.h:1173
@ DeviceUsageTypeDumpFile
Definition: iotypes.h:1172
@ DeviceUsageTypePaging
Definition: iotypes.h:1170

Referenced by PnpDeviceUsageNotification(), and SetSpecialFileSupport().

◆ _SxWakeQueryInstance()

NTSTATUS FxPkgPnp::_SxWakeQueryInstance ( __in CfxDevice Device,
__in FxWmiInstanceInternal Instaace,
__in ULONG  OutBufferSize,
__out PVOID  OutBuffer,
__out PULONG  BufferUsed 
)
staticprotected

Definition at line 3519 of file fxpkgpnp.cpp.

3526{
3527 *((BOOLEAN*) OutBuffer) =
3529 *BufferUsed = sizeof(BOOLEAN);
3530
3531 return STATUS_SUCCESS;
3532}

◆ _SxWakeSetInstance()

NTSTATUS FxPkgPnp::_SxWakeSetInstance ( __in CfxDevice Device,
__in FxWmiInstanceInternal Instance,
__in ULONG  InBufferSize,
__in PVOID  InBuffer 
)
staticprotected

Definition at line 3535 of file fxpkgpnp.cpp.

3541{
3542 BOOLEAN value;
3543
3544 //
3545 // FxWmiIrpHandler makes sure that the buffer is at least one byte big, so
3546 // we don't check the buffer size
3547 //
3548 value = *(PBOOLEAN) InBuffer;
3549
3551
3552 return STATUS_SUCCESS;
3553}
VOID PowerPolicySetSxWakeState(__in BOOLEAN State)
Definition: fxpkgpnp.cpp:3720

◆ _SxWakeSetItem()

NTSTATUS FxPkgPnp::_SxWakeSetItem ( __in CfxDevice Device,
__in FxWmiInstanceInternal Instance,
__in ULONG  DataItemId,
__in ULONG  InBufferSize,
__in PVOID  InBuffer 
)
staticprotected

Definition at line 3556 of file fxpkgpnp.cpp.

3563{
3564 BOOLEAN value;
3565
3566 if (DataItemId != 0) {
3568 }
3569
3570 if (InBufferSize < sizeof(BOOLEAN)) {
3572 }
3573
3574 value = *(BOOLEAN*) InBuffer;
3576
3577 return STATUS_SUCCESS;
3578}

◆ _UsageToSpecialType()

static WDF_SPECIAL_FILE_TYPE FxPkgPnp::_UsageToSpecialType ( __in DEVICE_USAGE_NOTIFICATION_TYPE  Type)
inlinestaticprotected

Definition at line 3202 of file fxpkgpnp.hpp.

3205 {
3206 switch (Type) {
3211 default: ASSERT(FALSE); return WdfSpecialFilePaging;
3212 }
3213 }

Referenced by PnpDeviceUsageNotification().

◆ AckPendingWakeInterruptOperation()

VOID FxPkgPnp::AckPendingWakeInterruptOperation ( __in BOOLEAN  ProcessPowerEventOnDifferentThread)

Definition at line 6211 of file fxpkgpnp.cpp.

6232{
6236 ProcessPowerEventOnDifferentThread
6237 );
6238 }
6239}
VOID PowerProcessEvent(__in FxPowerEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
@ PowerWakeInterruptCompleteTransition

◆ AddChildList()

VOID FxPkgPnp::AddChildList ( __in FxChildList List)

Definition at line 4970 of file fxpkgpnp.cpp.

4973{
4975 "Adding FxChildList %p, WDFCHILDLIST %p", List,
4976 List->GetHandle());
4977
4979 &List->m_TransactionLink);
4980}
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
NTSTATUS Add(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxTransactionedEntry *Entry)
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
FxWaitLockTransactionedList m_ChildListList
Definition: fxpkgpnp.hpp:485
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by FxDevice::AddChildList().

◆ AddDmaEnabler()

VOID FxPkgPnp::AddDmaEnabler ( __in FxDmaEnabler Enabler)

Definition at line 277 of file fxpkgpnpkm.cpp.

280{
282 "Adding DmaEnabler %p, WDFDMAENABLER %p",
283 Enabler, Enabler->GetObjectHandle());
284
285 m_DmaEnablerList->Add(GetDriverGlobals(), &Enabler->m_TransactionLink);
286}

Referenced by FxDevice::AddDmaEnabler().

◆ AddInterruptObject()

VOID FxPkgPnp::AddInterruptObject ( __in FxInterrupt Interrupt)
protected

Definition at line 5928 of file fxpkgpnp.cpp.

5959{
5962}
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:379

Referenced by FxInterrupt::Initialize().

◆ AddQueryInterface()

VOID FxPkgPnp::AddQueryInterface ( __in FxQueryInterface QI,
__in BOOLEAN  Lock 
)

Definition at line 5017 of file fxpkgpnp.cpp.

5035{
5037
5038 if (Lock) {
5040 }
5041
5042 ASSERT(QI->m_Entry.Next == NULL);
5043
5044 //
5045 // Iterate until we find the end of the list and then append the new
5046 // structure. ppPrev is the pointer to the Next pointer value. When we
5047 // get to the end, ppPrev will be equal to the Next field which points to NULL.
5048 //
5051
5052 while (pCur != NULL) {
5053 ppPrev = &pCur->Next;
5054 pCur = pCur->Next;
5055 }
5056
5057 *ppPrev = &QI->m_Entry;
5058
5059 if (Lock) {
5061 }
5062}
FxWaitLockInternal m_QueryInterfaceLock
Definition: fxpkgpnp.hpp:4120
SINGLE_LIST_ENTRY * pCur
SINGLE_LIST_ENTRY ** ppPrev
#define QI(I)
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127

◆ AddRemovalDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::AddRemovalDevice ( __in MdDeviceObject  DependentDevice)

Definition at line 4753 of file fxpkgpnp.cpp.

4756{
4757 FxRelatedDevice* pRelated;
4759
4760 if (m_RemovalDeviceList == NULL) {
4761 KIRQL irql;
4762
4763 Lock(&irql);
4764 if (m_RemovalDeviceList == NULL) {
4766
4767 if (m_RemovalDeviceList != NULL) {
4769 }
4770 else {
4772
4775 "Could not allocate removal device list for WDFDEVICE %p, "
4776 "%!STATUS!", m_Device->GetHandle(), status);
4777 }
4778 }
4779 else {
4780 //
4781 // another thread allocated the list already
4782 //
4784 }
4785 Unlock(irql);
4786
4787 if (!NT_SUCCESS(status)) {
4788 return status;
4789 }
4790 }
4791
4792 pRelated = new(GetDriverGlobals())
4794 if (pRelated == NULL) {
4796 }
4797
4799
4800 if (NT_SUCCESS(status)) {
4801 //
4802 // RemovalRelations are queried automatically by PnP when the device is
4803 // going to be query removed. No need to tell pnp that the list changed
4804 // until it needs to query for it.
4805 //
4806 DO_NOTHING();
4807 }
4808 else {
4809 pRelated->DeleteFromFailedCreate();
4810 }
4811
4812 return status;
4813}
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
__drv_restoresIRQL KIRQL __in BOOLEAN Unlock
Definition: fxobject.hpp:1474
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
_Must_inspect_result_ NTSTATUS Add(__in PFX_DRIVER_GLOBALS Globals, __inout FxRelatedDevice *Entry)
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define DO_NOTHING()
Definition: mxgeneral.h:32
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE _In_ PDEVICE_OBJECT DependentDevice
Definition: wdfdevice.h:2263

◆ AddUsageDevice()

_Must_inspect_result_ NTSTATUS FxPkgPnp::AddUsageDevice ( __in MdDeviceObject  DependentDevice)

Definition at line 4685 of file fxpkgpnp.cpp.

4688{
4689 FxRelatedDevice* pRelated;
4691
4693 KIRQL irql;
4694
4695 Lock(&irql);
4698
4701 }
4702 else {
4704
4707 "Could not allocate usage device list for WDFDEVICE %p, "
4708 "%!STATUS!", m_Device->GetHandle(), status);
4709 }
4710
4711 }
4712 else {
4713 //
4714 // another thread allocated the list already
4715 //
4717 }
4718 Unlock(irql);
4719
4720 if (!NT_SUCCESS(status)) {
4721 return status;
4722 }
4723 }
4724
4725 pRelated = new(GetDriverGlobals())
4727
4728 if (pRelated == NULL) {
4730 }
4731
4733
4734 if (!NT_SUCCESS(status)) {
4735 pRelated->DeleteFromFailedCreate();
4736 }
4737
4738 return status;
4739}

◆ AdjustUsageCount()

LONG FxPkgPnp::AdjustUsageCount ( __in DEVICE_USAGE_NOTIFICATION_TYPE  Usage,
__in BOOLEAN  Add 
)
inlineprotected

Definition at line 3147 of file fxpkgpnp.hpp.

3151 {
3152 if (Add) {
3154 }
3155 else {
3157 }
3158 }
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:384

Referenced by RevertUsageNotificationFlags(), and SetUsageNotificationFlags().

◆ AllocateDmaEnablerList()

_Must_inspect_result_ NTSTATUS FxPkgPnp::AllocateDmaEnablerList ( VOID  )

Definition at line 241 of file fxpkgpnpkm.cpp.

244{
247 KIRQL irql;
248
249 if (m_DmaEnablerList != NULL) {
250 return STATUS_SUCCESS;
251 }
252
253 Lock(&irql);
254 if (m_DmaEnablerList == NULL) {
256
257 if (pList != NULL) {
260 }
261 else {
263 }
264 }
265 else {
266 //
267 // Already have a DMA list
268 //
270 }
271 Unlock(irql);
272
273 return status;
274}
FxChildList * pList

Referenced by FxDevice::AllocateDmaEnablerList().

◆ AllocateEnumInfo()

_Must_inspect_result_ NTSTATUS FxPkgPnp::AllocateEnumInfo ( VOID  )

Definition at line 4920 of file fxpkgpnp.cpp.

4923{
4924 KIRQL irql;
4926
4927 if (m_EnumInfo != NULL) {
4928 return STATUS_SUCCESS;
4929 }
4930
4931 Lock(&irql);
4932 if (m_EnumInfo == NULL) {
4934
4935 if (m_EnumInfo != NULL) {
4937
4938 if (!NT_SUCCESS(status)) {
4939 delete m_EnumInfo;
4940 m_EnumInfo = NULL;
4941
4943 TRACINGPNP,
4944 "Could not initialize enum info for "
4945 "WDFDEVICE %p, %!STATUS!",
4947 }
4948
4949 }
4950 else {
4952
4954 "Could not allocate enum info for WDFDEVICE %p, "
4955 "%!STATUS!", m_Device->GetHandle(), status);
4956 }
4957 }
4958 else {
4959 //
4960 // another thread allocated the list already
4961 //
4963 }
4964 Unlock(irql);
4965
4966 return status;
4967}
NTSTATUS Initialize(VOID)
Definition: fxpkgpnp.hpp:442

Referenced by FxDevice::AllocateEnumInfo(), and FxPkgFdo::Initialize().

◆ AskParentToRemoveAndReenumerate()

virtual NTSTATUS FxPkgPnp::AskParentToRemoveAndReenumerate ( VOID  )
privatepure virtual

Implemented in FxPkgFdo, and FxPkgPdo.

Referenced by SetDeviceFailed().

◆ AssignPowerFrameworkSettings()

NTSTATUS FxPkgPnp::AssignPowerFrameworkSettings ( __in PWDF_POWER_FRAMEWORK_SETTINGS  PowerFrameworkSettings)

Definition at line 6243 of file fxpkgpnp.cpp.

6246{
6247// NTSTATUS status;
6248// PPO_FX_COMPONENT_IDLE_STATE idleStates = NULL;
6249// ULONG idleStatesSize = 0;
6250// PPO_FX_COMPONENT component = NULL;
6251// ULONG componentSize = 0;
6252// PPOX_SETTINGS poxSettings = NULL;
6253// ULONG poxSettingsSize = 0;
6254// BYTE * buffer = NULL;
6255
6256// if (FALSE==(IdleTimeoutManagement::_SystemManagedIdleTimeoutAvailable())) {
6257// //
6258// // If system-managed idle timeout is not available on this OS, then
6259// // there is nothing to do.
6260// //
6261// DoTraceLevelMessage(
6262// GetDriverGlobals(), TRACE_LEVEL_INFORMATION, TRACINGPNP,
6263// "WDFDEVICE %p !devobj %p Power framework is not supported on the "
6264// "current OS. Therefore, the power framework settings will not take "
6265// "effect.",
6266// m_Device->GetHandle(),
6267// m_Device->GetDeviceObject()
6268// );
6269// return STATUS_SUCCESS;
6270// }
6271
6272// if (NULL != PowerFrameworkSettings->Component) {
6273// //
6274// // Caller should ensure that IdleStateCount is not zero
6275// //
6276// ASSERT(0 != PowerFrameworkSettings->Component->IdleStateCount);
6277
6278// //
6279// // Compute buffer size needed for storing F-states
6280// //
6281// status = RtlULongMult(
6282// PowerFrameworkSettings->Component->IdleStateCount,
6283// sizeof(*(PowerFrameworkSettings->Component->IdleStates)),
6284// &idleStatesSize
6285// );
6286// if (FALSE == NT_SUCCESS(status)) {
6287// DoTraceLevelMessage(
6288// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
6289// "WDFDEVICE %p !devobj %p Unable to compute length of buffer "
6290// "required to store F-states. RtlULongMult failed with "
6291// "%!STATUS!",
6292// m_Device->GetHandle(),
6293// m_Device->GetDeviceObject(),
6294// status
6295// );
6296// goto exit;
6297// }
6298
6299// //
6300// // Compute buffer size needed for storing component information
6301// // (including F-states)
6302// //
6303// status = RtlULongAdd(idleStatesSize,
6304// sizeof(*component),
6305// &componentSize);
6306// if (FALSE == NT_SUCCESS(status)) {
6307// DoTraceLevelMessage(
6308// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
6309// "WDFDEVICE %p !devobj %p Unable to compute length of buffer "
6310// "required to store driver's component information. RtlULongAdd "
6311// "failed with %!STATUS!",
6312// m_Device->GetHandle(),
6313// m_Device->GetDeviceObject(),
6314// status
6315// );
6316// goto exit;
6317// }
6318// }
6319
6320// //
6321// // Compute total buffer size needed for power framework settings
6322// //
6323// status = RtlULongAdd(componentSize,
6324// sizeof(*poxSettings),
6325// &poxSettingsSize);
6326// if (FALSE == NT_SUCCESS(status)) {
6327// DoTraceLevelMessage(
6328// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
6329// "WDFDEVICE %p !devobj %p Unable to compute length of buffer "
6330// "required to store driver's power framework settings. RtlULongAdd "
6331// "failed with %!STATUS!",
6332// m_Device->GetHandle(),
6333// m_Device->GetDeviceObject(),
6334// status
6335// );
6336// goto exit;
6337// }
6338
6339// //
6340// // Allocate memory to copy the settings
6341// //
6342// buffer = (BYTE *) MxMemory::MxAllocatePoolWithTag(NonPagedPool,
6343// poxSettingsSize,
6344// GetDriverGlobals()->Tag);
6345// if (NULL == buffer) {
6346// status = STATUS_INSUFFICIENT_RESOURCES;
6347// DoTraceLevelMessage(
6348// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
6349// "WDFDEVICE %p !devobj %p Unable to allocate buffer required to "
6350// "store F-states. %!STATUS!",
6351// m_Device->GetHandle(),
6352// m_Device->GetDeviceObject(),
6353// status
6354// );
6355// goto exit;
6356// }
6357
6358// //
6359// // Set our pointers to point to appropriate locations in the buffer.
6360// //
6361// // NOTES:
6362// // - The array of F-states comes first because it has ULONGLONG members
6363// // because of which it has the biggest alignment requirement.
6364// // - The logic below works even if the client driver did not specify any
6365// // component information. In that case idleStatesSize and componentSize
6366// // are both 0 and 'poxSettings' points to the beginning of the allocated
6367// // buffer
6368// //
6369// idleStates = (PPO_FX_COMPONENT_IDLE_STATE) buffer;
6370// component = (PPO_FX_COMPONENT) (buffer + idleStatesSize);
6371// poxSettings = (PPOX_SETTINGS) (buffer + componentSize);
6372
6373// //
6374// // Copy the relevant parts of the settings buffer
6375// //
6376// poxSettings->EvtDeviceWdmPostPoFxRegisterDevice =
6377// PowerFrameworkSettings->EvtDeviceWdmPostPoFxRegisterDevice;
6378// poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice =
6379// PowerFrameworkSettings->EvtDeviceWdmPrePoFxUnregisterDevice;
6380// poxSettings->Component = PowerFrameworkSettings->Component;
6381// poxSettings->ComponentActiveConditionCallback =
6382// PowerFrameworkSettings->ComponentActiveConditionCallback;
6383// poxSettings->ComponentIdleConditionCallback =
6384// PowerFrameworkSettings->ComponentIdleConditionCallback;
6385// poxSettings->ComponentIdleStateCallback =
6386// PowerFrameworkSettings->ComponentIdleStateCallback;
6387// poxSettings->PowerControlCallback =
6388// PowerFrameworkSettings->PowerControlCallback;
6389// poxSettings->PoFxDeviceContext = PowerFrameworkSettings->PoFxDeviceContext;
6390
6391// if (NULL != PowerFrameworkSettings->Component) {
6392// //
6393// // Copy the component information
6394// //
6395// poxSettings->Component = component;
6396// RtlCopyMemory(poxSettings->Component,
6397// PowerFrameworkSettings->Component,
6398// sizeof(*component));
6399
6400// //
6401// // Caller should ensure that IdleStates is not NULL
6402// //
6403// ASSERT(NULL != PowerFrameworkSettings->Component->IdleStates);
6404
6405// //
6406// // Copy the F-states
6407// //
6408// poxSettings->Component->IdleStates = idleStates;
6409// RtlCopyMemory(poxSettings->Component->IdleStates,
6410// PowerFrameworkSettings->Component->IdleStates,
6411// idleStatesSize);
6412// }
6413
6414// //
6415// // Commit these settings
6416// //
6417// status = m_PowerPolicyMachine.m_Owner->
6418// m_IdleSettings.m_TimeoutMgmt.CommitPowerFrameworkSettings(
6419// GetDriverGlobals(),
6420// poxSettings
6421// );
6422// if (FALSE == NT_SUCCESS(status)) {
6423// goto exit;
6424// }
6425
6426// status = STATUS_SUCCESS;
6427
6428// exit:
6429// if (FALSE == NT_SUCCESS(status)) {
6430// if (NULL != buffer) {
6431// MxMemory::MxFreePool(buffer);
6432// }
6433// }
6434// return status;
6436 return STATUS_SUCCESS;
6437}
#define ROSWDFNOTIMPLEMENTED
Definition: fxglobals.h:52

◆ ChildListNotifyRemove()

VOID FxPkgPnp::ChildListNotifyRemove ( __inout PLONG  PendingCount)

Definition at line 4999 of file fxpkgpnp.cpp.

5002{
5004
5005 ple = NULL;
5006
5007 if (m_EnumInfo != NULL) {
5011 }
5013 }
5014}
VOID NotifyDeviceRemove(__inout PLONG ChildCount)
static FxChildList * _FromEntry(__in FxTransactionedEntry *Entry)
_Must_inspect_result_ FxTransactionedEntry * GetNextEntry(__in_opt FxTransactionedEntry *Entry)
VOID UnlockFromEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID LockForEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)

◆ ChildRemoved()

VOID FxPkgPnp::ChildRemoved ( VOID  )
inline

Definition at line 3415 of file fxpkgpnp.hpp.

3418 {
3419 LONG c;
3420
3421 //
3422 // Called by a child that we are waiting on its removal
3423 //
3425 ASSERT(c >= 0);
3426
3427 if (c == 0) {
3429 }
3430 }
VOID PnpProcessEvent(__in FxPnpEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
@ PnpEventChildrenRemovalComplete
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80

Referenced by PnpEventFinal().

◆ CleanupDeviceFromFailedCreate()

VOID FxPkgPnp::CleanupDeviceFromFailedCreate ( __in MxEvent WaitEvent)

Definition at line 2190 of file fxpkgpnp.cpp.

2218{
2220
2221 //
2222 // Caller must initialize the event as Synchronization event and it should
2223 // be passed as non-signalled. But we Clear it just to be sure.
2224 //
2225 WaitEvent->Clear();
2226
2227 ADDREF(WaitEvent);
2228
2230 m_DeviceRemoveProcessed = WaitEvent;
2231
2232 //
2233 // Simulate a remove event coming to the device. After this call returns
2234 // m_Device is still valid and must be deleted.
2235 //
2237
2238 //
2239 // No need to wait in a critical region because we are in the context of a
2240 // pnp request which is in the system context.
2241 //
2242 WaitEvent->WaitFor(Executive, KernelMode, FALSE, NULL);
2244
2245 RELEASE(WaitEvent);
2246}
#define ADDREF(_tag)
Definition: fxobject.hpp:49
#define RELEASE(_tag)
Definition: fxobject.hpp:50

Referenced by FxDevice::DeleteDeviceFromFailedCreateNoDelete().

◆ CleanupStateMachines()

VOID FxPkgPnp::CleanupStateMachines ( __in BOOLEAN  ClenaupPnp)

Definition at line 2066 of file fxpkgpnp.cpp.

2069{
2070#if (FX_CORE_MODE==FX_CORE_USER_MODE)
2072#else
2073 FxCREvent eventOnStack;
2074 eventOnStack.Initialize();
2075 FxCREvent * event = eventOnStack.GetSelfPointer();
2076#endif
2077
2078 //
2079 // Order of shutdown is important here.
2080 // o Pnp initiates events to power policy.
2081 // o Power policy initiates events to power and device-power-requirement
2082 // o Power does not initiate any events
2083 // o Device-power-requirement does not initiate any events
2084 //
2085 // By shutting them down in the order in which they send events, we can
2086 // guarantee that no new events will be posted into the subsidiary state
2087 // machines.
2088 //
2089
2090 //
2091 // This will shut off the pnp state machine and synchronize any outstanding
2092 // threads of execution.
2093 //
2094 if (CleanupPnp && m_PnpMachine.SetFinished(
2095 event
2096 ) == FALSE) {
2099 "WDFDEVICE %p, !devobj %p waiting for pnp state machine to finish",
2101
2102 //
2103 // Process the event *before* completing the irp so that this event is in
2104 // the queue before the device remove event which will be processed
2105 // right after the start irp has been completed.
2106 //
2107 event->EnterCRAndWaitAndLeave();
2108 }
2109
2110 //
2111 // Even though event is a SynchronizationEvent, so we need to reset it for
2112 // the next wait because SetFinished will set it if even if the transition
2113 // to the finished state is immediate
2114 //
2115 event->Clear();
2116
2120 "WDFDEVICE %p, !devobj %p waiting for pwr pol state machine to finish",
2122
2123 event->EnterCRAndWaitAndLeave();
2124 }
2125
2126 //
2127 // See previous comment about why we Clear()
2128 //
2129 event->Clear();
2130
2134 "WDFDEVICE %p, !devobj %p waiting for pwr state machine to finish",
2136
2137 event->EnterCRAndWaitAndLeave();
2138 }
2139
2140 if (IsPowerPolicyOwner()) {
2141 //
2142 // See previous comment about why we Clear()
2143 //
2144 event->Clear();
2145
2147 m_DevicePowerRequirementMachine) {
2148
2150 m_DevicePowerRequirementMachine->SetFinished(event)) {
2151
2154 "WDFDEVICE %p, !devobj %p waiting for device power "
2155 "requirement state machine to finish",
2158
2159 event->EnterCRAndWaitAndLeave();
2160 }
2161 }
2162
2164 }
2165
2166 //
2167 // Release the power thread if we have one either through creation or query.
2168 // Since the power policy state machine is off, we should no longer need
2169 // a dedicated thread.
2170 //
2171 // *** NOTE ***
2172 // The power thread must be released *BEFORE* sending the irp down the stack
2173 // because this can happen
2174 // 1) this driver is not the power thread owner, but the last client
2175 // 2) we send the pnp irp first
2176 // 3) the power thread owner waits on this thread for all the clients to go
2177 // away, but this device still has a reference on it
2178 // 4) this device will not release the reference b/c the owner is waiting
2179 // in the same thread.
2180 //
2182
2183 //
2184 // Deref the reenumeration interface
2185 //
2187}
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
virtual VOID ReleaseReenumerationInterface(VOID)=0
FxPowerMachine m_PowerMachine
Definition: fxpkgpnp.hpp:4152
VOID ReleasePowerThread(VOID)
Definition: fxpkgpnp.cpp:5180
FxPnpMachine m_PnpMachine
Definition: fxpkgpnp.hpp:4151
FxCREvent m_CleanupEventUm
Definition: fxpkgpnp.hpp:4304
FxCREvent * GetSelfPointer(VOID)
Definition: fxwaitlock.hpp:180
CHECK_RETURN_IF_USER_MODE NTSTATUS Initialize(__in BOOLEAN InitialState=FALSE)
Definition: fxwaitlock.hpp:51
BOOLEAN SetFinished(__in FxCREvent *Event)
Definition: eventqueue.cpp:91
_In_ PWDFDEVICE_INIT _In_ BOOLEAN IsPowerPolicyOwner
Definition: wdfdevice.h:2966

Referenced by FxDevice::DeleteDeviceFromFailedCreateNoDelete(), ProcessDelayedDeletion(), FxPkgFdo::ProcessRemoveDeviceOverload(), and FxPkgPdo::ProcessRemoveDeviceOverload().

◆ ClearPendingDevicePowerIrp()

MdIrp FxPkgPnp::ClearPendingDevicePowerIrp ( VOID  )
inlineprotected

Definition at line 3069 of file fxpkgpnp.hpp.

3072 {
3073 MdIrp irp;
3074
3077
3078 return irp;
3079 }
FxIrp * irp
IWudfIrp * MdIrp
Definition: mxum.h:103

Referenced by FxPkgFdo::PowerReleasePendingDeviceIrp(), and FxPkgPdo::PowerReleasePendingDeviceIrp().

◆ ClearPendingPnpIrp()

MdIrp FxPkgPnp::ClearPendingPnpIrp ( VOID  )
inlineprotected

Definition at line 3029 of file fxpkgpnp.hpp.

3032 {
3033 MdIrp irp;
3034
3037
3038 return irp;
3039 }

Referenced by FxPkgPdo::_PnpEject(), PnpFinishProcessingIrp(), PnpProcessEventInner(), and FxPkgFdo::PnpSendStartDeviceDownTheStackOverload().

◆ ClearPendingSystemPowerIrp()

MdIrp FxPkgPnp::ClearPendingSystemPowerIrp ( VOID  )
inlineprotected

Definition at line 3092 of file fxpkgpnp.hpp.

3095 {
3096 MdIrp irp;
3097
3100
3101 return irp;
3102 }

◆ ClearRemovalDevicesList()

VOID FxPkgPnp::ClearRemovalDevicesList ( VOID  )

Definition at line 4832 of file fxpkgpnp.cpp.

4835{
4837
4838 if (m_RemovalDeviceList == NULL) {
4839 return;
4840 }
4841
4845 }
4847
4848 //
4849 // RemovalRelations are queried automatically by PnP when the device is
4850 // going to be query removed. No need to tell pnp that the list changed
4851 // until it needs to query for it.
4852 //
4853}
VOID UnlockFromEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID Remove(__in PFX_DRIVER_GLOBALS Globals, __in MdDeviceObject Device)
VOID LockForEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
_Must_inspect_result_ FxRelatedDevice * GetNextEntry(__in_opt FxRelatedDevice *Entry)
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484

◆ CommitUsageNotification()

VOID FxPkgPnp::CommitUsageNotification ( __in DEVICE_USAGE_NOTIFICATION_TYPE  Type,
__in ULONG  OldFlags 
)
protected

Definition at line 4614 of file fxpkgpnp.cpp.

4639{
4640 PFX_DRIVER_GLOBALS FxDriverGlobals = GetDriverGlobals();
4641 ULONG newFlags;
4642
4643 newFlags = m_Device->GetDeviceObjectFlags();
4644
4646 (newFlags & DO_POWER_PAGABLE) == 0) {
4647 //
4648 // We transitioned from a power pageable to a non power pageable
4649 // device. Move the power state machine to the appropriate
4650 // state.
4651 //
4653 }
4654
4655 if ((OldFlags & DO_POWER_PAGABLE) == 0 &&
4656 (newFlags & DO_POWER_PAGABLE) == DO_POWER_PAGABLE) {
4657 //
4658 // We transitioned from a non power pageable to a power pageable
4659 // device. Move the power state machine to the appropriate
4660 // state.
4661 //
4663 }
4664
4665 //
4666 // Notify PNP that it should no longer be able
4667 // to disable this device.
4668 //
4669 MxDeviceObject physicalDeviceObject(
4671 );
4672 physicalDeviceObject.InvalidateDeviceState(
4674 );
4675
4677 FxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP,
4678 "After: special count %d, flags 0x%x, device %p (WDFDEVICE %p)",
4679 GetUsageCount(Type), newFlags,
4681}
ULONG __inline GetDeviceObjectFlags(VOID)
Definition: fxdevice.hpp:192
MdDeviceObject __inline GetPhysicalDevice(VOID)
Definition: fxdevice.hpp:228
LONG GetUsageCount(__in __range(1, 4) ULONG Usage)
Definition: fxpkgpnp.hpp:3161
SHORT OldFlags
Definition: fxioqueue.cpp:1325
@ PowerMarkPageable
@ PowerMarkNonpageable
#define DO_POWER_PAGABLE

Referenced by PnpDeviceUsageNotification().

◆ CompletePnpRequest()

NTSTATUS FxPkgPnp::CompletePnpRequest ( __inout FxIrp Irp,
__in NTSTATUS  Status 
)
protected

Definition at line 5752 of file fxpkgpnp.cpp.

5756{
5757 MdIrp pIrp = Irp->GetIrp();
5758
5759 Irp->SetStatus(Status);
5760 Irp->CompleteRequest(IO_NO_INCREMENT);
5761
5763 pIrp);
5764
5765 return Status;
5766}
MdRemoveLock GetRemoveLock(VOID)
Definition: fxdevicekm.hpp:47
MdIrp GetIrp(VOID)
Definition: fxirpum.cpp:15
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:278
FxIrp * pIrp