ReactOS 0.4.15-dev-7674-gc0b4db1
FxPkgFdo Class Reference

#include <fxpkgfdo.hpp>

Inheritance diagram for FxPkgFdo:
Collaboration diagram for FxPkgFdo:

Public Member Functions

_Must_inspect_result_ NTSTATUS RegisterCallbacks (__in PWDF_FDO_EVENT_CALLBACKS DispatchTable)
 
_Must_inspect_result_ NTSTATUS CreateDefaultDeviceList (__in PWDF_CHILD_LIST_CONFIG ListConfig, __in PWDF_OBJECT_ATTRIBUTES ListAttributes)
 
virtual _Must_inspect_result_ NTSTATUS Initialize (__in PWDFDEVICE_INIT DeviceInit)
 
_Must_inspect_result_ NTSTATUS PostCreateDeviceInitialize (VOID)
 
_Must_inspect_result_ NTSTATUS SetFilter (__in BOOLEAN Value)
 
BOOLEAN IsFilter (VOID)
 
- Public Member Functions inherited from FxPkgPnp
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)
 

Static Public Member Functions

static _Must_inspect_result_ NTSTATUS _Create (__in PFX_DRIVER_GLOBALS pGlobals, __in CfxDevice *Device, __deref_out FxPkgFdo **PkgFdo)
 
- 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)
 

Public Attributes

FxChildListm_DefaultDeviceList
 
FxChildListm_StaticDeviceList
 
FxIoTargetm_DefaultTarget
 
FxIoTargetSelfm_SelfTarget
 
- Public Attributes inherited from FxPkgPnp
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
 

Static Public Attributes

static MdCompletionRoutineType RaiseDevicePowerCompletion
 

Protected Member Functions

 ~FxPkgFdo ()
 
- Protected Member Functions inherited from FxPkgPnp
 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 STDCALL _PnpFilteredStartDeviceCompletionRoutine (__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
 
static _Must_inspect_result_ NTSTATUS STDCALL _PnpStartDeviceCompletionRoutine (__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
 
- Static Protected Member Functions inherited from FxPkgPnp
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)
 

Static Protected Attributes

static MdCompletionRoutineType _SystemPowerS0Completion
 
static MdCompletionRoutineType _SystemPowerSxCompletion
 
- Static Protected Attributes inherited from FxPkgPnp
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

 FxPkgFdo (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device)
 
virtual _Must_inspect_result_ NTSTATUS SendIrpSynchronously (__inout FxIrp *Irp)
 
virtual _Must_inspect_result_ NTSTATUS FireAndForgetIrp (__inout FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS PnpQueryDeviceRelations (__inout FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS PnpQueryCapabilities (__inout FxIrp *Irp)
 
VOID HandleQueryCapabilities (__inout FxIrp *Irp)
 
VOID HandleQueryCapabilitiesCompletion (__inout FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS PnpFilterResourceRequirements (__inout FxIrp *Irp)
 
VOID HandleQueryPnpDeviceStateCompletion (__inout FxIrp *Irp)
 
virtual BOOLEAN PnpSendStartDeviceDownTheStackOverload (VOID)
 
virtual WDF_DEVICE_PNP_STATE PnpEventEjectHardwareOverload (VOID)
 
virtual WDF_DEVICE_PNP_STATE PnpEventCheckForDevicePresenceOverload (VOID)
 
virtual WDF_DEVICE_PNP_STATE PnpEventPdoRemovedOverload (VOID)
 
virtual WDF_DEVICE_PNP_STATE PnpGetPostRemoveState (VOID)
 
virtual WDF_DEVICE_PNP_STATE PnpEventFdoRemovedOverload (VOID)
 
virtual _Must_inspect_result_ NTSTATUS PowerCheckParentOverload (__out BOOLEAN *ParentOn)
 
virtual WDF_DEVICE_POWER_STATE PowerCheckDeviceTypeOverload (VOID)
 
virtual WDF_DEVICE_POWER_STATE PowerCheckDeviceTypeNPOverload (VOID)
 
virtual VOID PowerParentPowerDereference (VOID)
 
_Must_inspect_result_ NTSTATUS DispatchSystemSetPower (__in FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS DispatchDeviceSetPower (__in FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS DispatchSystemQueryPower (__in FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS DispatchDeviceQueryPower (__in FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS RaiseDevicePower (__in FxIrp *Irp)
 
_Must_inspect_result_ NTSTATUS LowerDevicePower (__in FxIrp *Irp)
 
virtual VOID PowerReleasePendingDeviceIrp (__in BOOLEAN IrpMustBePresent=TRUE)
 
virtual _Must_inspect_result_ NTSTATUS ProcessRemoveDeviceOverload (__inout FxIrp *Irp)
 
virtual VOID DeleteSymbolicLinkOverload (__in BOOLEAN GracefulRemove)
 
virtual VOID QueryForReenumerationInterface (VOID)
 
virtual VOID ReleaseReenumerationInterface (VOID)
 
virtual _Must_inspect_result_ NTSTATUS AskParentToRemoveAndReenumerate (VOID)
 
virtual _Must_inspect_result_ NTSTATUS QueryForPowerThread (VOID)
 
virtual const PFN_PNP_POWER_CALLBACKGetDispatchPnp (VOID)
 
virtual const PFN_PNP_POWER_CALLBACKGetDispatchPower (VOID)
 
_Must_inspect_result_ NTSTATUS QueryForDsfInterface (VOID)
 

Static Private Member Functions

static _Must_inspect_result_ NTSTATUS _PnpPassDown (__in FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpSurpriseRemoval (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpQueryDeviceRelations (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpQueryInterface (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpQueryCapabilities (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpQueryCapabilitiesCompletionRoutine (__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
 
static _Must_inspect_result_ NTSTATUS _PnpFilterResourceRequirements (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpQueryPnpDeviceState (__inout FxPkgPnp *This, __inout FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _PnpQueryPnpDeviceStateCompletionRoutine (__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
 
static _Must_inspect_result_ NTSTATUS _PowerPassDown (__inout FxPkgPnp *This, __in FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _DispatchSetPower (__inout FxPkgPnp *This, __in FxIrp *Irp)
 
static _Must_inspect_result_ NTSTATUS _DispatchQueryPower (__inout FxPkgPnp *This, __in FxIrp *Irp)
 

Private Attributes

REENUMERATE_SELF_INTERFACE_STANDARD m_SurpriseRemoveAndReenumerateSelfInterface
 
FxPnpDeviceFilterResourceRequirements m_DeviceFilterAddResourceRequirements
 
FxPnpDeviceFilterResourceRequirements m_DeviceFilterRemoveResourceRequirements
 
FxPnpDeviceRemoveAddedResources m_DeviceRemoveAddedResources
 
BOOLEAN m_Filter
 

Static Private Attributes

static const PFN_PNP_POWER_CALLBACK m_FdoPnpFunctionTable [IRP_MN_SURPRISE_REMOVAL+1]
 
static const PFN_PNP_POWER_CALLBACK m_FdoPowerFunctionTable [IRP_MN_QUERY_POWER+1]
 

Additional Inherited Members

- Protected Attributes inherited from FxPkgPnp
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
 
}; 
 

Detailed Description

Definition at line 34 of file fxpkgfdo.hpp.

Constructor & Destructor Documentation

◆ FxPkgFdo()

FxPkgFdo::FxPkgFdo ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in CfxDevice Device 
)
private

Definition at line 114 of file fxpkgfdo.cpp.

117 :
118 FxPkgPnp(FxDriverGlobals, Device, FX_TYPE_PACKAGE_FDO)
119/*++
120
121Routine Description:
122
123 This is the constructor for the FxPkgFdo. Don't do any initialization
124 that might fail here.
125
126Arguments:
127
128 none
129
130Returns:
131
132 none
133
134--*/
135
136{
139
142
144
145 //
146 // Since we will always have a valid PDO when we are the FDO, we can do
147 // any device interface related activity at any time
148 //
150
151 m_Filter = FALSE;
152
154
157}
FxIoTargetSelf * m_SelfTarget
Definition: fxpkgfdo.hpp:53
REENUMERATE_SELF_INTERFACE_STANDARD m_SurpriseRemoveAndReenumerateSelfInterface
Definition: fxpkgfdo.hpp:57
BOOLEAN m_Filter
Definition: fxpkgfdo.hpp:69
FxChildList * m_DefaultDeviceList
Definition: fxpkgfdo.hpp:40
FxChildList * m_StaticDeviceList
Definition: fxpkgfdo.hpp:42
FxIoTarget * m_DefaultTarget
Definition: fxpkgfdo.hpp:47
UCHAR m_BusEnumRetries
Definition: fxpkgpnp.hpp:4237
PNP_BUS_INFORMATION m_BusInformation
Definition: fxpkgpnp.hpp:4232
BOOLEAN m_DeviceInterfacesCanBeEnabled
Definition: fxpkgpnp.hpp:4128
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
@ FX_TYPE_PACKAGE_FDO
Definition: fxtypes.h:93
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474

◆ ~FxPkgFdo()

FxPkgFdo::~FxPkgFdo ( )
protected

Definition at line 159 of file fxpkgfdo.cpp.

178{
179 if (m_DefaultDeviceList != NULL) {
180 m_DefaultDeviceList->RELEASE(this);
181 }
182 if (m_StaticDeviceList != NULL) {
183 m_StaticDeviceList->RELEASE(this);
184 }
185 if (m_SelfTarget != NULL) {
186 m_SelfTarget->RELEASE(this);
187 }
188 if (m_DefaultTarget != NULL) {
189 m_DefaultTarget->RELEASE(this);
190 }
191}

Member Function Documentation

◆ _Create()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_Create ( __in PFX_DRIVER_GLOBALS  pGlobals,
__in CfxDevice Device,
__deref_out FxPkgFdo **  PkgFdo 
)
static

Definition at line 195 of file fxpkgfdo.cpp.

200{
202 FxPkgFdo * fxPkgFdo;
203 FxEventQueue *eventQueue;
204
205 fxPkgFdo = new(DriverGlobals) FxPkgFdo(DriverGlobals, Device);
206
207 if (NULL == fxPkgFdo) {
210 "Memory allocation failed: %!STATUS!", status);
211 return status;
212 }
213
214 //
215 // Initialize the event queues in the PnP, power and power policy state
216 // machines
217 //
218 eventQueue = static_cast<FxEventQueue*> (&(fxPkgFdo->m_PnpMachine));
219 status = eventQueue->Initialize(DriverGlobals);
220 if (!NT_SUCCESS(status)) {
221 goto exit;
222 }
223
224 eventQueue = static_cast<FxEventQueue*> (&(fxPkgFdo->m_PowerMachine));
225 status = eventQueue->Initialize(DriverGlobals);
226 if (!NT_SUCCESS(status)) {
227 goto exit;
228 }
229
230 eventQueue = static_cast<FxEventQueue*> (&(fxPkgFdo->m_PowerPolicyMachine));
231 status = eventQueue->Initialize(DriverGlobals);
232 if (!NT_SUCCESS(status)) {
233 goto exit;
234 }
235
236 *PkgFdo = fxPkgFdo;
237
238exit:
239 if (!NT_SUCCESS(status)) {
240 fxPkgFdo->DeleteFromFailedCreate();
241 }
242
243 return status;
244}
LONG NTSTATUS
Definition: precomp.h:26
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
FxPowerMachine m_PowerMachine
Definition: fxpkgpnp.hpp:4152
FxPnpMachine m_PnpMachine
Definition: fxpkgpnp.hpp:4151
FxPowerPolicyMachine m_PowerPolicyMachine
Definition: fxpkgpnp.hpp:4153
#define TRACINGIO
Definition: dbgtrace.h:66
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
DriverGlobals
#define exit(n)
Definition: config.h:202
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
_Must_inspect_result_ NTSTATUS Initialize(__in PFX_DRIVER_GLOBALS DriverGlobals)
Definition: eventqueue.cpp:55
Definition: ps.c:97
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

Referenced by FxDevice::FdoInitialize().

◆ _DispatchQueryPower()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_DispatchQueryPower ( __inout FxPkgPnp This,
__in FxIrp Irp 
)
staticprivate

Definition at line 123 of file fdopower.cpp.

146{
147 if (Irp->GetParameterPowerType() == SystemPowerState) {
148 return ((FxPkgFdo*) This)->DispatchSystemQueryPower(Irp);
149 }
150 else {
151 return ((FxPkgFdo*) This)->DispatchDeviceQueryPower(Irp);
152 }
153}
_In_ PIRP Irp
Definition: csq.h:116
_In_ SYSTEM_POWER_STATE SystemPowerState
Definition: iotypes.h:7519

◆ _DispatchSetPower()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_DispatchSetPower ( __inout FxPkgPnp This,
__in FxIrp Irp 
)
staticprivate

Definition at line 90 of file fdopower.cpp.

112{
113 if (Irp->GetParameterPowerType() == SystemPowerState) {
114 return ((FxPkgFdo*) This)->DispatchSystemSetPower(Irp);
115 }
116 else {
117 return ((FxPkgFdo*) This)->DispatchDeviceSetPower(Irp);
118 }
119}

◆ _PnpFilteredStartDeviceCompletionRoutine()

_Must_inspect_result_ NTSTATUS STDCALL FxPkgFdo::_PnpFilteredStartDeviceCompletionRoutine ( __in MdDeviceObject  DeviceObject,
__inout MdIrp  Irp,
__inout PVOID  Context 
)
staticprotected

Definition at line 1438 of file fxpkgfdo.cpp.

1443{
1444 FxFilteredStartContext *pContext;
1446
1447 pContext = (FxFilteredStartContext*) Context;
1448
1449 //
1450 // Save off the package so we can use it after we free the context
1451 //
1452 pPkgFdo = pContext->PkgFdo;
1453
1454 delete pContext;
1455
1457}
static _Must_inspect_result_ NTSTATUS STDCALL _PnpStartDeviceCompletionRoutine(__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
Definition: fxpkgfdo.cpp:1462
FxPkgFdo * pPkgFdo
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

Referenced by PnpSendStartDeviceDownTheStackOverload().

◆ _PnpFilterResourceRequirements()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpFilterResourceRequirements ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprivate

Definition at line 748 of file fxpkgfdo.cpp.

752{
753 return ((FxPkgFdo*) This)->PnpFilterResourceRequirements(Irp);
754}

◆ _PnpPassDown()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpPassDown ( __in FxPkgPnp This,
__inout FxIrp Irp 
)
staticprivate

Definition at line 307 of file fxpkgfdo.cpp.

324{
327 MdIrp pIrp;
328
329 device = ((FxPkgFdo*)This)->m_Device;
330 pIrp = Irp->GetIrp();
331
332 Irp->CopyCurrentIrpStackLocationToNext();
333 status = Irp->CallDriver(
335
336 Mx::MxReleaseRemoveLock(device->GetRemoveLock(),
337 pIrp
338 );
339
340 return status;
341}
MdDeviceObject __inline GetAttachedDevice(VOID)
Definition: fxdevice.hpp:210
MdIrp GetIrp(VOID)
Definition: fxirpum.cpp:15
CfxDevice * m_Device
Definition: fxobject.hpp:329
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:278
FxIrp * pIrp
IWudfIrp * MdIrp
Definition: mxum.h:103
Definition: devices.h:37

Referenced by _PnpQueryInterface(), FireAndForgetIrp(), and PnpQueryDeviceRelations().

◆ _PnpQueryCapabilities()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpQueryCapabilities ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprivate

Definition at line 551 of file fxpkgfdo.cpp.

555{
556
557
558
559
560
561
562
563
564
565
566
567
568 return ((FxPkgFdo*) This)->PnpQueryCapabilities(Irp);
569}

◆ _PnpQueryCapabilitiesCompletionRoutine()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpQueryCapabilitiesCompletionRoutine ( __in MdDeviceObject  DeviceObject,
__inout MdIrp  Irp,
__inout PVOID  Context 
)
staticprivate

Definition at line 227 of file fxpkgfdokm.cpp.

232{
236
237 ASSERTMSG("Not implemented for KMDF\n", FALSE);
238
240}
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239

◆ _PnpQueryDeviceRelations()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpQueryDeviceRelations ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprivate

Definition at line 372 of file fxpkgfdo.cpp.

393{
394 return ((FxPkgFdo*) This)->PnpQueryDeviceRelations(Irp);
395}

◆ _PnpQueryInterface()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpQueryInterface ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprivate

Definition at line 490 of file fxpkgfdo.cpp.

511{
512 FxPkgFdo* pThis;
514 BOOLEAN completeIrp;
515
516 pThis = (FxPkgFdo*) This;
517
519 "Entering QueryInterface handler");
520
521 status = pThis->HandleQueryInterface(Irp, &completeIrp);
522
524 "Exiting QueryInterface handler, %!STATUS!",
525 status);
526 //
527 // If we understand the irp, we'll complete it. Otherwise we
528 // pass it down.
529 //
530 if (completeIrp == FALSE) {
531 status = _PnpPassDown(pThis, Irp);
532 }
533 else {
534 Irp->SetInformation(NULL);
536 }
537
538 //
539 // Remlock is released in _PnpPassDown and CompletePnpRequest. If this
540 // irp is racing with remove on another thread, it's possible for the device
541 // to get deleted right after the lock is released and before anything
542 // after this point is executed. So make sure to not touch any memory in
543 // the return path.
544 //
545
546 return status;
547}
unsigned char BOOLEAN
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
static _Must_inspect_result_ NTSTATUS _PnpPassDown(__in FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:307
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5752
_Must_inspect_result_ NTSTATUS HandleQueryInterface(__inout FxIrp *Irp, __out PBOOLEAN CompleteRequest)
Definition: fxpkgpnp.cpp:1493
#define TRACINGPNP
Definition: dbgtrace.h:67
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30

◆ _PnpQueryPnpDeviceState()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpQueryPnpDeviceState ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprivate

Definition at line 305 of file fxpkgfdokm.cpp.

326{
327 FxPkgFdo* pThis;
329
330 pThis = (FxPkgFdo*) This;
331
333
335 //
336 // Morph into a successful code so that we process the request
337 //
339 Irp->SetStatus(status);
340 }
341
342 if (NT_SUCCESS(status)) {
344 }
345 else {
347 This->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
348 "Lower stack returned error for query pnp device state, %!STATUS!",
349 status);
350 }
351
352 //
353 // Since we already sent the request down the stack, we must complete it
354 // now.
355 //
356 return pThis->CompletePnpRequest(Irp, status);
357}
VOID HandleQueryPnpDeviceStateCompletion(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:763
virtual _Must_inspect_result_ NTSTATUS SendIrpSynchronously(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:248
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ _PnpQueryPnpDeviceStateCompletionRoutine()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpQueryPnpDeviceStateCompletionRoutine ( __in MdDeviceObject  DeviceObject,
__inout MdIrp  Irp,
__inout PVOID  Context 
)
staticprivate

Definition at line 288 of file fxpkgfdokm.cpp.

293{
297
298 ASSERTMSG("Not implemented for KMDF\n", FALSE);
299
301}

◆ _PnpStartDeviceCompletionRoutine()

_Must_inspect_result_ NTSTATUS STDCALL FxPkgFdo::_PnpStartDeviceCompletionRoutine ( __in MdDeviceObject  DeviceObject,
__inout MdIrp  Irp,
__inout PVOID  Context 
)
staticprotected

Definition at line 1462 of file fxpkgfdo.cpp.

1467{
1468 FxPkgFdo* pThis;
1469 FxIrp irp(Irp);
1470
1472
1473 pThis = (FxPkgFdo*) Context;
1474
1475 if (NT_SUCCESS(irp.GetStatus())) {
1476 pThis->SetPendingPnpIrp(&irp);
1477
1478 //
1479 // Only raise irql if we are the power policy owner. Only the p.p.o.
1480 // does this so that we only have one driver in the device stack moving
1481 // to another thread.
1482 //
1483 if (pThis->IsPowerPolicyOwner()) {
1484 KIRQL irql;
1485
1486 //
1487 // By raising to dispatch level we are forcing the pnp state machine
1488 // to move to another thread. On NT 6.0 PnP supports asynchronous
1489 // starts, so this will other starts to proceed while WDF processes
1490 // this device starting.
1491 //
1492 Mx::MxRaiseIrql(DISPATCH_LEVEL, &irql);
1494 Mx::MxLowerIrql(irql);
1495 }
1496 else {
1498 }
1499 }
1500 else {
1501 //
1502 // Just complete the request, the current pnp state can handle the remove
1503 // which will be sent b/c of the failed start.
1504 //
1507 "PNP start failed with %!STATUS!", irp.GetStatus());
1508
1509 //
1510 // Process the event *before* completing the irp so that this even is in
1511 // the queue before the device remove event which will be be processed
1512 // right after the start irp has been completed.
1513 //
1515
1516 pThis->CompletePnpRequest(&irp, irp.GetStatus());
1517 }
1518
1520}
Definition: fxirp.hpp:28
NTSTATUS GetStatus()
Definition: fxirpum.cpp:466
BOOLEAN IsPowerPolicyOwner(VOID)
Definition: fxpkgpnp.hpp:3612
VOID PnpProcessEvent(__in FxPnpEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
VOID SetPendingPnpIrp(__inout FxIrp *Irp, __in BOOLEAN MarkIrpPending=TRUE)
Definition: fxpkgpnp.cpp:4883
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
@ PnpEventStartDeviceComplete
@ PnpEventStartDeviceFailed
FxIrp * irp
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68

Referenced by _PnpFilteredStartDeviceCompletionRoutine(), and PnpSendStartDeviceDownTheStackOverload().

◆ _PnpSurpriseRemoval()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PnpSurpriseRemoval ( __inout FxPkgPnp This,
__inout FxIrp Irp 
)
staticprivate

Definition at line 345 of file fxpkgfdo.cpp.

366{
367 return ((FxPkgFdo*) This)->PnpSurpriseRemoval(Irp);
368}

◆ _PowerPassDown()

_Must_inspect_result_ NTSTATUS FxPkgFdo::_PowerPassDown ( __inout FxPkgPnp This,
__in FxIrp Irp 
)
staticprivate

Definition at line 43 of file fdopower.cpp.

66{
67 FxPkgFdo* pThis;
69 MdIrp pIrp;
70
71 pIrp = Irp->GetIrp();
72 pThis = (FxPkgFdo*) This;
73
74 //
75 // FDOs don't handle this IRP, so simply pass it down.
76 //
77 Irp->StartNextPowerIrp();
78 Irp->CopyCurrentIrpStackLocationToNext();
79
80 status = Irp->PoCallDriver(pThis->m_Device->GetAttachedDevice());
81
83 pIrp);
84
85 return status;
86}
MdRemoveLock GetRemoveLock(VOID)
Definition: fxdevicekm.hpp:47

Referenced by DispatchDeviceQueryPower(), DispatchSystemQueryPower(), DispatchSystemSetPower(), FireAndForgetIrp(), and PowerReleasePendingDeviceIrp().

◆ AskParentToRemoveAndReenumerate()

_Must_inspect_result_ NTSTATUS FxPkgFdo::AskParentToRemoveAndReenumerate ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 567 of file fxpkgfdokm.cpp.

585{
587
589
590 if (pInterface->SurpriseRemoveAndReenumerateSelf != NULL) {
591 pInterface->SurpriseRemoveAndReenumerateSelf(pInterface->Context);
592
593 return STATUS_SUCCESS;
594 }
595
597}
PINTERFACE pInterface
PVOID Context
Definition: miniport.h:123

◆ CreateDefaultDeviceList()

_Must_inspect_result_ NTSTATUS FxPkgFdo::CreateDefaultDeviceList ( __in PWDF_CHILD_LIST_CONFIG  ListConfig,
__in PWDF_OBJECT_ATTRIBUTES  ListAttributes 
)

Definition at line 816 of file fxpkgfdo.cpp.

836{
838 WDFCHILDLIST hList;
839 size_t totalDescriptionSize = 0;
841
843
845
846 //
847 // This should not fail, we already validated the total size when we
848 // validated the config (we just had no place to store the total size, so
849 // we recompute it again).
850 //
853 ListConfig,
855 );
856 if (!NT_SUCCESS(status)) {
857 return status;
858 }
859
862 ListAttributes,
864 m_Device,
865 ListConfig);
866 if (!NT_SUCCESS(status)) {
867 return status;
868 }
869
870 status = m_DefaultDeviceList->Commit(ListAttributes,
871 (WDFOBJECT*)&hList,
872 m_Device);
873
874 if (!NT_SUCCESS(status)) {
876 "Could not convert object to handle");
879 return status;
880 }
881
882 //
883 // This will be released in the destructor
884 //
885 m_DefaultDeviceList->ADDREF(this);
886
887 return status;
888}
static _Must_inspect_result_ NTSTATUS _CreateAndInit(__out FxChildList **ChildList, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES ListAttributes, __in size_t TotalDescriptionSize, __in CfxDevice *Device, __in PWDF_CHILD_LIST_CONFIG ListConfig, __in BOOLEAN Static=FALSE)
static _Must_inspect_result_ NTSTATUS _ComputeTotalDescriptionSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_CHILD_LIST_CONFIG Config, __in size_t *TotalDescriptionSize)
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
Definition: fxobject.cpp:904
FxEnumerationInfo * m_EnumInfo
Definition: fxpkgpnp.hpp:4215
size_t totalDescriptionSize
PFX_DRIVER_GLOBALS pFxDriverGlobals
HWND hList
Definition: livecd.c:10
#define ASSERT(a)
Definition: mode.c:44

Referenced by FxDevice::FdoInitialize().

◆ DeleteSymbolicLinkOverload()

VOID FxPkgFdo::DeleteSymbolicLinkOverload ( __in BOOLEAN  GracefulRemove)
privatevirtual

Definition at line 1280 of file fxpkgfdo.cpp.

1296{
1297 UNREFERENCED_PARAMETER(GracefulRemove);
1298
1299 //
1300 // We always remove the symbolic link for an FDO since there is no presence
1301 // state to check.
1302 //
1304}
VOID DeleteSymbolicLink(VOID)

◆ DispatchDeviceQueryPower()

_Must_inspect_result_ NTSTATUS FxPkgFdo::DispatchDeviceQueryPower ( __in FxIrp Irp)
private

Definition at line 446 of file fdopower.cpp.

449{
450 //
451 // Either the framework is the power policy owner and we wouldn't be sending
452 // a device query power or we are a subordinate will do what the power
453 // policy owner wants 100% of the time.
454 //
455 Irp->SetStatus(STATUS_SUCCESS);
456
457 //
458 // This will release the remove lock
459 //
460 return _PowerPassDown(this, Irp);
461}
static _Must_inspect_result_ NTSTATUS _PowerPassDown(__inout FxPkgPnp *This, __in FxIrp *Irp)
Definition: fdopower.cpp:43

◆ DispatchDeviceSetPower()

_Must_inspect_result_ NTSTATUS FxPkgFdo::DispatchDeviceSetPower ( __in FxIrp Irp)
private

Definition at line 299 of file fdopower.cpp.

303{
305
306 if (IsPowerPolicyOwner()) {
309 //
310 // A power irp arrived, but we did not request it. log and bugcheck
311 //
314 "Received set device power irp 0x%p on WDFDEVICE 0x%p !devobj 0x%p, "
315 "but the irp was not requested by the device (the power policy owner)",
316 Irp->GetIrp(), m_Device->GetHandle(),
318
320 WDF_POWER_MULTIPLE_PPO, // specific type
322 (ULONG_PTR)Irp->GetIrp()); // parm 3
323
324 /* NOTREACHED */
325 }
326
327 //
328 // We are no longer requesting a power irp because we received the one
329 // we requested.
330 //
333 } else {
335 }
336 }
337
338 //
339 // Determine if we are raising or lowering the device power state.
340 //
341 if (Irp->GetParameterPowerStateDeviceState() == PowerDeviceD0) {
343 }
344 else {
346 }
347
348 return status;
349}
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
_Must_inspect_result_ NTSTATUS RaiseDevicePower(__in FxIrp *Irp)
Definition: fdopower.cpp:353
_Must_inspect_result_ NTSTATUS LowerDevicePower(__in FxIrp *Irp)
Definition: fdopower.cpp:401
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
@ PowerDeviceD0
Definition: ntpoapi.h:49
FxPowerPolicyOwnerSettings * m_Owner
uint32_t ULONG_PTR
Definition: typedefs.h:65
@ WDF_POWER_MULTIPLE_PPO
Definition: wdfbugcodes.h:70
_In_ PWDFDEVICE_INIT _In_ BOOLEAN IsPowerPolicyOwner
Definition: wdfdevice.h:2966

◆ DispatchSystemQueryPower()

_Must_inspect_result_ NTSTATUS FxPkgFdo::DispatchSystemQueryPower ( __in FxIrp Irp)
private

Definition at line 417 of file fdopower.cpp.

420{
423
425 Irp->GetParameterPowerStateSystemState()
426 );
427
428 Irp->SetStatus(status);
429
430 if (!NT_SUCCESS(status)) {
432 }
433 }
434
435 //
436 // Passing down the irp because one of the following
437 // a) We don't care b/c we don't control the power policy
438 // b) we are not enabled for arming for wake from Sx
439 // c) we can wake from the queried S state
440 //
441 return _PowerPassDown(this, Irp);
442}
_Must_inspect_result_ NTSTATUS PowerPolicyHandleSystemQueryPower(__in SYSTEM_POWER_STATE QueryState)
Definition: fxpkgpnp.cpp:3582
BOOLEAN PowerPolicyIsWakeEnabled(VOID)
Definition: fxpkgpnp.cpp:5769
NTSTATUS CompletePowerRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5404

◆ DispatchSystemSetPower()

_Must_inspect_result_ NTSTATUS FxPkgFdo::DispatchSystemSetPower ( __in FxIrp Irp)
private

Definition at line 236 of file fdopower.cpp.

239{
242
243 m_SystemPowerState = (BYTE) Irp->GetParameterPowerStateSystemState();
245 Irp->GetParameterPowerState());
246
247 if (IsPowerPolicyOwner()) {
248 //
249 // If we are going to S0, we just notify the power policy state machine
250 // and then let the request go (per the fast resume spec). Otherwise,
251 // send the request down and on the way up, send the Dx request.
252 //
254 //
255 // Post the event into the state machine when the irp is going up
256 // the stack. See the comment in _SystemPowerS0Completion for more
257 // detail as to why.
258 //
259 Irp->CopyCurrentIrpStackLocationToNext();
260 Irp->SetCompletionRoutineEx(deviceObject.GetObject(),
262 this);
263
264 return Irp->PoCallDriver(m_Device->GetAttachedDevice());
265 }
266 else {
267 //
268 // Stash away the irp for the power policy state machine. We will
269 // post the event to the power policy state machine when the S irp
270 // completes back to this driver.
271 //
273
274 Irp->CopyCurrentIrpStackLocationToNext();
275 Irp->SetCompletionRoutineEx(deviceObject.GetObject(),
277 this);
278
279 Irp->PoCallDriver(m_Device->GetAttachedDevice());
280
282 }
283 }
284 else {
285 //
286 // We don't do anything with S irps if we are not the power policy
287 // owner.
288 //
289 // This will release the remove lock as well.
290 //
291 status = _PowerPassDown(this, Irp);
292 }
293
294 return status;
295}
static MdCompletionRoutineType _SystemPowerS0Completion
Definition: fxpkgfdo.hpp:461
static MdCompletionRoutineType _SystemPowerSxCompletion
Definition: fxpkgfdo.hpp:465
BYTE m_SystemPowerState
Definition: fxpkgpnp.hpp:4102
VOID SetPendingSystemPowerIrp(__inout FxIrp *Irp)
Definition: fxpkgpnp.hpp:3082
POWER_STATE SetPowerState(__in POWER_STATE_TYPE Type, __in POWER_STATE State)
__inline MdDeviceObject GetObject(VOID)
MxDeviceObject deviceObject
@ PowerSystemWorking
Definition: ntpoapi.h:36
#define STATUS_PENDING
Definition: ntstatus.h:82
unsigned char BYTE
Definition: xxhash.c:193

◆ FireAndForgetIrp()

_Must_inspect_result_ NTSTATUS FxPkgFdo::FireAndForgetIrp ( __inout FxIrp Irp)
privatevirtual

Definition at line 276 of file fxpkgfdo.cpp.

296{
297 if (Irp->GetMajorFunction() == IRP_MJ_POWER) {
298 return _PowerPassDown(this, Irp);
299 }
300 else {
301 return _PnpPassDown(this, Irp);
302 }
303}
#define IRP_MJ_POWER

◆ GetDispatchPnp()

virtual const PFN_PNP_POWER_CALLBACK * FxPkgFdo::GetDispatchPnp ( VOID  )
inlineprivatevirtual

Implements FxPkgPnp.

Definition at line 428 of file fxpkgfdo.hpp.

431 {
433 }
static const PFN_PNP_POWER_CALLBACK m_FdoPnpFunctionTable[IRP_MN_SURPRISE_REMOVAL+1]
Definition: fxpkgfdo.hpp:74

◆ GetDispatchPower()

virtual const PFN_PNP_POWER_CALLBACK * FxPkgFdo::GetDispatchPower ( VOID  )
inlineprivatevirtual

Implements FxPkgPnp.

Definition at line 437 of file fxpkgfdo.hpp.

440 {
442 }
static const PFN_PNP_POWER_CALLBACK m_FdoPowerFunctionTable[IRP_MN_QUERY_POWER+1]
Definition: fxpkgfdo.hpp:79

◆ HandleQueryCapabilities()

VOID FxPkgFdo::HandleQueryCapabilities ( __inout FxIrp Irp)
private

Definition at line 572 of file fxpkgfdo.cpp.

575{
577 LONG pnpCaps;
578
580 "Entering QueryCapabilities handler");
581
582 pCaps = Irp->GetParameterDeviceCapabilities();
583
584 pnpCaps = GetPnpCapsInternal();
585
586 //
587 // Add Capabilities. These need to be done as the IRP goes down, since
588 // lower drivers need to see them.
589 //
590 if ((pCaps->Size >= sizeof(DEVICE_CAPABILITIES)) && (pCaps->Version == 1)) {
591 SET_PNP_CAP_IF_TRUE(pnpCaps, pCaps, LockSupported);
592 SET_PNP_CAP_IF_TRUE(pnpCaps, pCaps, EjectSupported);
593 SET_PNP_CAP_IF_TRUE(pnpCaps, pCaps, Removable);
594 SET_PNP_CAP_IF_TRUE(pnpCaps, pCaps, DockDevice);
595 SET_PNP_CAP_IF_TRUE(pnpCaps, pCaps, SurpriseRemovalOK);
596 SET_PNP_CAP_IF_TRUE(pnpCaps, pCaps, NoDisplayInUI);
597 //
598 // If the driver has declared a wake capable interrupt,
599 // we need to set this bit in the capabilities so that
600 // ACPI will relinquish control of wake responsiblity
601 //
602 if (SupportsWakeInterrupt()) {
603 pCaps->WakeFromInterrupt = TRUE;
604 }
605 }
606
608 "Exiting QueryCapabilities handler");
609 return;
610}
LONG GetPnpCapsInternal(VOID)
Definition: fxpkgpnp.cpp:5466
BOOLEAN SupportsWakeInterrupt(VOID)
Definition: fxpkgpnp.hpp:3620
long LONG
Definition: pedump.c:60
#define SET_PNP_CAP_IF_TRUE(caps, pCaps, FieldName)
Definition: pnppriv.hpp:265
@ Removable
Definition: arc.h:81
DEVICE_CAPABILITIES
Definition: iotypes.h:965
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965

Referenced by PnpQueryCapabilities().

◆ HandleQueryCapabilitiesCompletion()

VOID FxPkgFdo::HandleQueryCapabilitiesCompletion ( __inout FxIrp Irp)
private

Definition at line 613 of file fxpkgfdo.cpp.

616{
618 LONG pnpCaps;
619 ULONG i;
620
622 "Entering QueryCapabilities completion handler");
623
624 pCaps = Irp->GetParameterDeviceCapabilities();
625
626 pnpCaps = GetPnpCapsInternal();
627
628 //
629 // Confirm this is a valid DeviceCapabilities structure.
630 //
631 ASSERT(pCaps->Size >= sizeof(DEVICE_CAPABILITIES));
632 ASSERT(pCaps->Version >= 1);
633
634 if ((pCaps->Size >= sizeof(DEVICE_CAPABILITIES)) &&
635 (pCaps->Version == 1)) {
636 ULONG states;
637
638 //
639 // Remove Capabilities
640 //
641
642 //
643 // Re-add SOME capibilties that the bus driver may have accidentally
644 // stomped.
645
646
647
648
649
650 SET_PNP_CAP_IF_FALSE(pnpCaps, pCaps, LockSupported);
651 SET_PNP_CAP_IF_FALSE(pnpCaps, pCaps, EjectSupported);
652 SET_PNP_CAP_IF_FALSE(pnpCaps, pCaps, DockDevice);
653
654 SET_PNP_CAP(pnpCaps, pCaps, Removable);
655 SET_PNP_CAP(pnpCaps, pCaps, SurpriseRemovalOK);
656
657 //
658 // The DeviceState array contains a table of D states that correspond
659 // to a given S state. If the driver writer initialized entries of the
660 // array, and if the new value is a deeper sleep state than the
661 // original, we will use the new driver supplied value.
662 //
663 states = m_PowerCaps.States;
664
667
668 //
669 // PowerDeviceMaximum indicates to use the default value
670 //
671 // We are only allowed to deepen the D states, not lighten them,
672 // hence the > compare.
673 //
674 state = _GetPowerCapState(i, states);
675
676 if (state != PowerDeviceMaximum && state > pCaps->DeviceState[i]) {
677 pCaps->DeviceState[i] = state;
678 }
679 }
680
681 //
682 // If the driver supplied SystemWake value is lighter than the current
683 // value, then use the driver supplied value.
684 //
685 // PowerSystemMaximum indicates to use the default value
686 //
687 // We are only allowed to lighten the S state, not deepen it, hence
688 // the < compare.
689 //
691 m_PowerCaps.SystemWake < pCaps->SystemWake) {
692 pCaps->SystemWake = (SYSTEM_POWER_STATE) m_PowerCaps.SystemWake;
693 }
694
695 //
696 // Same for DeviceWake
697 //
699 m_PowerCaps.DeviceWake < pCaps->DeviceWake) {
700 pCaps->DeviceWake = (DEVICE_POWER_STATE) m_PowerCaps.DeviceWake;
701 }
702
703 //
704 // Set the Device wake up latencies. A value of -1 indicates to
705 // use the default values provided by the lower stack.
706 //
707 if (m_PowerCaps.D1Latency != (ULONG) -1 &&
708 m_PowerCaps.D1Latency > pCaps->D1Latency) {
709 pCaps->D1Latency = m_PowerCaps.D1Latency;
710 }
711
712 if (m_PowerCaps.D2Latency != (ULONG) -1 &&
713 m_PowerCaps.D2Latency > pCaps->D2Latency) {
714 pCaps->D2Latency = m_PowerCaps.D2Latency;
715 }
716
717 if (m_PowerCaps.D3Latency != (ULONG) -1 &&
718 m_PowerCaps.D3Latency > pCaps->D3Latency) {
719 pCaps->D3Latency = m_PowerCaps.D3Latency;
720 }
721
722 //
723 // Set the Address and the UI number values. A value of -1 indicates
724 // to use the default values provided by the lower stack.
725 //
726 if (m_PnpCapsAddress != (ULONG) -1) {
727 pCaps->Address = m_PnpCapsAddress;
728 }
729
730 if (m_PnpCapsUINumber != (ULONG) -1) {
731 pCaps->UINumber= m_PnpCapsUINumber;
732 }
733 }
734
735 //
736 // CompletePnpRequest is called after return from this function
737 // so it is safe to log here
738 //
739
741 "Exiting QueryCapabilities completion handler");
742
743 return;
744}
static int state
Definition: maze.c:121
ULONG m_PnpCapsUINumber
Definition: fxpkgpnp.hpp:4091
FxPowerCaps m_PowerCaps
Definition: fxpkgpnp.hpp:4093
ULONG m_PnpCapsAddress
Definition: fxpkgpnp.hpp:4090
static DEVICE_POWER_STATE _GetPowerCapState(__in ULONG Index, __in ULONG State)
Definition: fxpkgpnp.cpp:5657
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
@ PowerDeviceMaximum
Definition: ntpoapi.h:53
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
#define SET_PNP_CAP_IF_FALSE(caps, pCaps, FieldName)
Definition: pnppriv.hpp:272
#define SET_PNP_CAP(caps, pCaps, FieldName)
Definition: pnppriv.hpp:279
ULONG D3Latency
Definition: fxpkgpnp.hpp:425
BYTE SystemWake
Definition: fxpkgpnp.hpp:413
ULONG D2Latency
Definition: fxpkgpnp.hpp:424
ULONG D1Latency
Definition: fxpkgpnp.hpp:423
BYTE DeviceWake
Definition: fxpkgpnp.hpp:412
ULONG States
Definition: fxpkgpnp.hpp:418
uint32_t ULONG
Definition: typedefs.h:59

Referenced by PnpQueryCapabilities().

◆ HandleQueryPnpDeviceStateCompletion()

VOID FxPkgFdo::HandleQueryPnpDeviceStateCompletion ( __inout FxIrp Irp)
private

Definition at line 763 of file fxpkgfdo.cpp.

766{
767 PNP_DEVICE_STATE pnpDeviceState;
768
771 "Entering QueryPnpDeviceState completion handler");
772
773 pnpDeviceState = HandleQueryPnpDeviceState(
774 (PNP_DEVICE_STATE) Irp->GetInformation()
775 );
776
777 Irp->SetInformation((ULONG_PTR) pnpDeviceState);
778
781 "WDFDEVICE 0x%p !devobj 0x%p returning PNP_DEVICE_STATE 0x%d IRP 0x%p",
784 pnpDeviceState,
785 Irp->GetIrp());
786
789 "Exiting QueryPnpDeviceState completion handler");
790
791 return;
792}
PNP_DEVICE_STATE HandleQueryPnpDeviceState(__in PNP_DEVICE_STATE PnpDeviceState)
Definition: fxpkgpnp.cpp:662
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
ULONG PNP_DEVICE_STATE
Definition: iotypes.h:997

Referenced by _PnpQueryPnpDeviceState().

◆ Initialize()

_Must_inspect_result_ NTSTATUS FxPkgFdo::Initialize ( __in PWDFDEVICE_INIT  DeviceInit)
virtual

Reimplemented from FxPkgPnp.

Definition at line 361 of file fxpkgfdokm.cpp.

392{
395 size_t totalDescriptionSize = 0;
396 WDFCHILDLIST hList;
398
400
402 if (!NT_SUCCESS(status)) {
403 return status;
404 }
405
407 if (!NT_SUCCESS(status)) {
408 return status;
409 }
410
411 #pragma prefast(suppress: __WARNING_PASSING_FUNCTION_UNEXPECTED_NULL, "Static child lists do not use the EvtChildListCreateDevice callback")
414 NULL);
415
417 &config,
419 if (!NT_SUCCESS(status)) {
420 return status;
421 }
422
424 pGlobals,
427 m_Device,
428 &config,
429 TRUE);
430 if (!NT_SUCCESS(status)) {
431 return status;
432 }
433
435 (WDFOBJECT*) &hList,
436 m_Device);
437
438 if (!NT_SUCCESS(status)) {
441
442 return status;
443 }
444
445 //
446 // This will be released in the destructor
447 //
448 m_StaticDeviceList->ADDREF(this);
449
450 return status;
451}
_Must_inspect_result_ NTSTATUS AllocateEnumInfo(VOID)
Definition: fxpkgpnp.cpp:4920
virtual _Must_inspect_result_ NTSTATUS Initialize(__in PWDFDEVICE_INIT DeviceInit)
Definition: fxpkgpnp.cpp:349
struct config_s config
PFX_DRIVER_GLOBALS pGlobals
FORCEINLINE VOID WDF_CHILD_LIST_CONFIG_INIT(_Out_ PWDF_CHILD_LIST_CONFIG Config, _In_ ULONG IdentificationDescriptionSize, _In_ PFN_WDF_CHILD_LIST_CREATE_DEVICE EvtChildListCreateDevice)
Definition: wdfchildlist.h:415
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
#define WDF_NO_OBJECT_ATTRIBUTES
Definition: wdftypes.h:105

Referenced by FxDevice::FdoInitialize().

◆ IsFilter()

BOOLEAN FxPkgFdo::IsFilter ( VOID  )
inline

Definition at line 130 of file fxpkgfdo.hpp.

133 {
134 return m_Filter;
135 }

◆ LowerDevicePower()

_Must_inspect_result_ NTSTATUS FxPkgFdo::LowerDevicePower ( __in FxIrp Irp)
private

Definition at line 401 of file fdopower.cpp.

404{
406
407 //
408 // Kick off the power state machine.
409 //
411
412 return STATUS_PENDING;
413}
VOID SetPendingDevicePowerIrp(__inout FxIrp *Irp)
Definition: fxpkgpnp.hpp:3050
VOID PowerProcessEvent(__in FxPowerEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)

Referenced by DispatchDeviceSetPower().

◆ PnpEventCheckForDevicePresenceOverload()

WDF_DEVICE_PNP_STATE FxPkgFdo::PnpEventCheckForDevicePresenceOverload ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 1133 of file fxpkgfdo.cpp.

1156{
1157 ASSERT(!"This should only be implemented for PDOs.");
1158
1159 //
1160 // Do something safe. Act like the device is not
1161 // present.
1162 //
1163 return WdfDevStatePnpFinal;
1164}
@ WdfDevStatePnpFinal
Definition: wdfdevice.h:117

◆ PnpEventEjectHardwareOverload()

WDF_DEVICE_PNP_STATE FxPkgFdo::PnpEventEjectHardwareOverload ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 1099 of file fxpkgfdo.cpp.

1122{
1123 ASSERT(!"This should only be reachable for PDOs.");
1124
1125 //
1126 // Do something safe. Act like the device got
1127 // ejected.
1128 //
1130}
@ WdfDevStatePnpEjectedWaitingForRemove
Definition: wdfdevice.h:68

◆ PnpEventFdoRemovedOverload()

WDF_DEVICE_PNP_STATE FxPkgFdo::PnpEventFdoRemovedOverload ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 1224 of file fxpkgfdo.cpp.

1239{
1240 //
1241 // Do that which all device stacks need to do upon removal.
1242 //
1244
1245 return WdfDevStatePnpFinal;
1246}
VOID PnpEventRemovedCommonCode(VOID)

◆ PnpEventPdoRemovedOverload()

WDF_DEVICE_PNP_STATE FxPkgFdo::PnpEventPdoRemovedOverload ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 1167 of file fxpkgfdo.cpp.

1190{
1191 ASSERT(!"This should only be implemented for PDOs.");
1192
1193 return WdfDevStatePnpFinal;
1194}

◆ PnpFilterResourceRequirements()

_Must_inspect_result_ NTSTATUS FxPkgFdo::PnpFilterResourceRequirements ( __inout FxIrp Irp)
private

Definition at line 43 of file fxpkgfdokm.cpp.

65{
66 PIO_RESOURCE_REQUIREMENTS_LIST pWdmRequirementsList;
70 WDFIORESREQLIST reqlist;
71
73 "Entering FilterResourceRequirements handler");
74
76
77 pWdmRequirementsList = (PIO_RESOURCE_REQUIREMENTS_LIST) Irp->GetInformation();
78
80
82 pWdmRequirementsList,
84
85 if (pIoResReqList != NULL) {
87
88 // Commit should never fail because we own all object state
91
94
96 pNewWdmList = pIoResReqList->CreateWdmList();
97
98 if (pNewWdmList != NULL) {
99 //
100 // List could be missing previously
101 //
102 if (pWdmRequirementsList != NULL) {
103 //
104 // Propagate BusNumber to our new list.
105 //
106 pNewWdmList->BusNumber = pWdmRequirementsList->BusNumber;
107
108 MxMemory::MxFreePool(pWdmRequirementsList);
109 }
110
111 Irp->SetInformation((ULONG_PTR) pNewWdmList);
112 }
113 else {
115 }
116 }
117
118 //
119 // No matter what, free the resource requirements list object. If
120 // we need another one when adding resources, another one will be
121 // allocated.
122 //
125 }
126 }
127 else {
128 //
129 // No filtering on the way down, set status to STATUS_SUCCESS so we
130 // send the irp down the stack.
131 //
133 }
134
135 if (NT_SUCCESS(status)) {
137 }
138
139 //
140 // If we do not handle the IRP on the way down and the PDO does not handle
141 // the IRP, we can have a status of STATUS_NOT_SUPPORTED. We still want to
142 // process the irp in this state.
143 //
145 NTSTATUS filterStatus;
146
147 //
148 // Give the Framework objects a pass at the list.
149 //
151 (PIO_RESOURCE_REQUIREMENTS_LIST*)(&Irp->GetIrp()->IoStatus.Information)
152 );
153
154 if (!NT_SUCCESS(filterStatus)) {
155 status = filterStatus;
156 }
158 //
159 // Now give the driver a shot at it.
160 //
161 pWdmRequirementsList = (PIO_RESOURCE_REQUIREMENTS_LIST)
162 Irp->GetInformation();
163
165 GetDriverGlobals(), pWdmRequirementsList, FxResourceAllAccessAllowed);
166
167 if (pIoResReqList != NULL) {
168 status = pIoResReqList->Commit(NULL, (PWDFOBJECT) &reqlist);
170
171 //
172 // Since we absolutely control the lifetime of pIoResReqList, this
173 // should never fail
174 //
176
178 m_Device->GetHandle(), reqlist);
179
180 //
181 // It is possible the child driver modified the resource list,
182 // and if so we need to update the requirements list.
183 //
185 pNewWdmList = pIoResReqList->CreateWdmList();
186
187 if (pNewWdmList != NULL) {
188 //
189 // List could be missing previously
190 //
191 if (pWdmRequirementsList != NULL) {
192 //
193 // Propagate BusNumber to our new list.
194 //
195 pNewWdmList->BusNumber = pWdmRequirementsList->BusNumber;
196
197 ExFreePool(pWdmRequirementsList);
198 }
199
200 Irp->SetInformation((ULONG_PTR) pNewWdmList);
201 }
202 else {
204 }
205 }
206
209 }
210 else {
212 }
213 }
214 }
215
217
219 "Exiting FilterResourceRequirements handler, %!STATUS!",
220 status);
221
222 return status;
223}
struct _IO_RESOURCE_REQUIREMENTS_LIST * PIO_RESOURCE_REQUIREMENTS_LIST
_Must_inspect_result_ PIO_RESOURCE_REQUIREMENTS_LIST CreateWdmList(VOID)
static _Must_inspect_result_ FxIoResReqList * _CreateFromWdmList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PIO_RESOURCE_REQUIREMENTS_LIST WdmRequirementsList, __in UCHAR AccessFlags)
WDFIORESREQLIST GetHandle(VOID)
Definition: fxresource.hpp:691
virtual VOID DeleteObject(VOID)
FxPnpDeviceFilterResourceRequirements m_DeviceFilterRemoveResourceRequirements
Definition: fxpkgfdo.hpp:65
FxPnpDeviceFilterResourceRequirements m_DeviceFilterAddResourceRequirements
Definition: fxpkgfdo.hpp:63
NTSTATUS FilterResourceRequirements(__in IO_RESOURCE_REQUIREMENTS_LIST **IoList)
Definition: fxpkgpnpkm.cpp:16
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDFIORESREQLIST Collection)
PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS m_Method
BOOLEAN IsChanged(VOID)
Definition: fxresource.hpp:335
static __inline VOID MxFreePool(__in PVOID Ptr)
Definition: mxmemorykm.h:41
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
@ FxResourceAllAccessAllowed
Definition: fxresource.hpp:277
FxIoResReqList * pIoResReqList

◆ PnpGetPostRemoveState()

WDF_DEVICE_PNP_STATE FxPkgFdo::PnpGetPostRemoveState ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 1197 of file fxpkgfdo.cpp.

1219{
1221}
@ WdfDevStatePnpFdoRemoved
Definition: wdfdevice.h:100

◆ PnpQueryCapabilities()

_Must_inspect_result_ NTSTATUS FxPkgFdo::PnpQueryCapabilities ( __inout FxIrp Irp)
private

Definition at line 244 of file fxpkgfdokm.cpp.

266{
268
270
272
273 //
274 // Now that the IRP has returned to us, we modify what the bus driver
275 // set up.
276 //
277 if (NT_SUCCESS(status)) {
279 }
280
282
283 return status;
284}
VOID HandleQueryCapabilitiesCompletion(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:613
VOID HandleQueryCapabilities(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:572

◆ PnpQueryDeviceRelations()

_Must_inspect_result_ NTSTATUS FxPkgFdo::PnpQueryDeviceRelations ( __inout FxIrp Irp)
private

Definition at line 399 of file fxpkgfdo.cpp.

421{
424
425 type = Irp->GetParameterQDRType();
426
428 "Entering QueryDeviceRelations handler, "
429 "type %!DEVICE_RELATION_TYPE!",
430 type);
431
433
434
435 //
436 // Set up the type of relations.
437 //
438 switch (type) {
439 case BusRelations:
441
442 //
443 // STATUS_NOT_SUPPORTED is a special value. It means that
444 // HandleQueryBusRelations did not modify the irp at all and it should
445 // be sent off as is.
446 //
448 //
449 // We set status to STATUS_SUCCESS so that we send the requqest down
450 // the stack in the comparison below.
451 //
453 }
454 break;
455
456 case RemovalRelations:
458
459 //
460 // STATUS_NOT_SUPPORTED is a special value. It means that
461 // HandleQueryDeviceRelations did not modify the irp at all and it should
462 // be sent off as is.
463 //
465 //
466 // We set status to STATUS_SUCCESS so that we send the requqest down
467 // the stack in the comparison below.
468 //
470 }
471 break;
472 }
473
474 if (NT_SUCCESS(status)) {
475 status = _PnpPassDown(this, Irp);
476 }
477 else {
479 }
480
482 "Exiting QueryDeviceRelations handler, status %!STATUS!",
483 status);
484
485 return status;
486}
_Must_inspect_result_ NTSTATUS HandleQueryDeviceRelations(__inout FxIrp *Irp, __inout FxRelatedDeviceList *List)
Definition: fxpkgpnp.cpp:996
_Must_inspect_result_ NTSTATUS HandleQueryBusRelations(__inout FxIrp *Irp)
Definition: fxpkgpnp.cpp:758
FxRelatedDeviceList * m_RemovalDeviceList
Definition: fxpkgpnp.hpp:4115
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
@ RemovalRelations
Definition: iotypes.h:2155
@ BusRelations
Definition: iotypes.h:2152
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE

◆ PnpSendStartDeviceDownTheStackOverload()

BOOLEAN FxPkgFdo::PnpSendStartDeviceDownTheStackOverload ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 919 of file fxpkgfdo.cpp.

934{
935 //
936 // We will re-set the pending pnp irp when the start irp returns
937 //
939 PCM_RESOURCE_LIST pWdmRaw, pWdmTranslated;
941 BOOLEAN setFilteredCompletion = FALSE;
942 FxFilteredStartContext* pContext = NULL;
943
946
947 //
948 // Always setup the irp to be sent down the stack. In case of an error,
949 // this does no harm and it keeps everything simple.
950 //
952
953 //
954 // If the driver registered for a callback to remove its added resources
955 // and there are resources to remove, call the driver and set the next
956 // stack location to the filtered resources lists
957 //
959 pWdmRaw != NULL && pWdmTranslated != NULL) {
960
961 //
962 // Since we reuse these 2 fields for both the removal and the normal
963 // reporting (and can then be subsequently reused on a restart), we
964 // set the changed status back to FALSE.
965 //
968
971
972 if (NT_SUCCESS(status)) {
973 status = m_Resources->BuildFromWdmList(pWdmTranslated,
975 }
976
977 if (NT_SUCCESS(status)) {
982 );
983 }
984
985 if (NT_SUCCESS(status) &&
987
988 pContext = new(GetDriverGlobals()) FxFilteredStartContext();
989
990 if (pContext != NULL) {
991 pContext->PkgFdo = this;
992
993 //
994 // Allocate the raw and translated resources. Upon failure for
995 // either, fail the start irp. We allocate from NonPagedPool
996 // because we are going to free the list in a completion routine
997 // which maybe running at an IRQL > PASSIVE_LEVEL.
998 //
999 if (m_ResourcesRaw->Count() > 0) {
1000 pContext->ResourcesRaw =
1002
1003 if (pContext->ResourcesRaw == NULL) {
1005 }
1006 }
1007
1008 if (NT_SUCCESS(status) && m_Resources->Count() > 0) {
1009 pContext->ResourcesTranslated =
1011
1012 if (pContext->ResourcesTranslated == NULL) {
1014 }
1015 }
1016
1017 if (NT_SUCCESS(status)) {
1018 //
1019 // We copied to the next stack location at the start
1020 //
1022 pContext->ResourcesRaw);
1024 pContext->ResourcesTranslated);
1025
1026 //
1027 // Completion routine will free the resource list
1028 // allocations.
1029 //
1030 setFilteredCompletion = TRUE;
1031 }
1032 else {
1033 //
1034 // Allocation failure. The destructor will free any
1035 // outstanding allocations.
1036 //
1037 delete pContext;
1038 }
1039 }
1040 }
1041 }
1042 else {
1044 }
1045
1046 if (NT_SUCCESS(status)) {
1047 //
1048 // The completion of the start irp will move the state machine into a new
1049 // state.
1050 //
1051 // After calling IoSetCompletionRoutineEx the driver must call
1052 // IoCallDriver, otherwise a memory leak would occur. So call this API
1053 // as close to IoCallDriver as possible to avoid failure paths.
1054 //
1055 if (setFilteredCompletion) {
1056 ASSERT(pContext != NULL);
1060 pContext);
1061 }
1062 else {
1066 this);
1067 }
1068
1070 }
1071 else {
1073 "PNP start preprocessing failed with %!STATUS!",
1074 status);
1075
1076 //
1077 // Move the state machine to the failed state.
1078 //
1079 // Process the event *before* completing the irp so that this even is in
1080 // the queue before the device remove event which will be be processed
1081 // right after the start irp has been completed.
1082 //
1084
1085 //
1086 // All states which handle the PnpEventStartDeviceFailed event
1087 // transition do not expect a pended start irp.
1088 //
1090 }
1091
1092 //
1093 // Indicate to the caller that the transition is asynchronous.
1094 //
1095 return FALSE;
1096}
_Must_inspect_result_ PCM_RESOURCE_LIST CreateWdmList(__in __drv_strictTypeMatch(__drv_typeExpr) POOL_TYPE PoolType=PagedPool)
WDFCMRESLIST GetHandle(VOID)
Definition: fxresource.hpp:449
_Must_inspect_result_ NTSTATUS BuildFromWdmList(__in PCM_RESOURCE_LIST ResourceList, __in UCHAR AccessFlags)
PCM_RESOURCE_LIST GetParameterAllocatedResources()
Definition: fxirpum.cpp:843
VOID SetCompletionRoutineEx(__in MdDeviceObject DeviceObject, __in MdCompletionRoutine CompletionRoutine, __in PVOID Context, __in BOOLEAN InvokeOnSuccess=TRUE, __in BOOLEAN InvokeOnError=TRUE, __in BOOLEAN InvokeOnCancel=TRUE)
Definition: fxirpum.cpp:104
PCM_RESOURCE_LIST GetParameterAllocatedResourcesTranslated()
Definition: fxirpum.cpp:877
VOID SetParameterAllocatedResourcesTranslated(__in PCM_RESOURCE_LIST AllocatedResourcesTranslated)
Definition: fxirpum.cpp:897
VOID CopyCurrentIrpStackLocationToNext(VOID)
Definition: fxirpum.cpp:209
VOID SetParameterAllocatedResources(__in PCM_RESOURCE_LIST AllocatedResources)
Definition: fxirpum.cpp:869
NTSTATUS CallDriver(__in MdDeviceObject DeviceObject)
Definition: fxirpum.cpp:36
static _Must_inspect_result_ NTSTATUS STDCALL _PnpFilteredStartDeviceCompletionRoutine(__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
Definition: fxpkgfdo.cpp:1438
FxPnpDeviceRemoveAddedResources m_DeviceRemoveAddedResources
Definition: fxpkgfdo.hpp:67
FxCmResList * m_Resources
Definition: fxpkgpnp.hpp:4220
FxCmResList * m_ResourcesRaw
Definition: fxpkgpnp.hpp:4225
MdIrp ClearPendingPnpIrp(VOID)
Definition: fxpkgpnp.hpp:3029
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDFCMRESLIST ResourcesRaw, __in WDFCMRESLIST ResourcesTranslated)
PFN_WDF_DEVICE_REMOVE_ADDED_RESOURCES m_Method
#define NonPagedPool
Definition: env_spec_w32.h:307
PCM_RESOURCE_LIST ResourcesRaw
Definition: fxpkgfdo.cpp:65
PCM_RESOURCE_LIST ResourcesTranslated
Definition: fxpkgfdo.cpp:67

◆ PostCreateDeviceInitialize()

_Must_inspect_result_ NTSTATUS FxPkgFdo::PostCreateDeviceInitialize ( VOID  )

Definition at line 1524 of file fxpkgfdo.cpp.

1527{
1529
1530 status = FxPkgPnp::PostCreateDeviceInitialize(); // __super call
1531 if (!NT_SUCCESS(status)) {
1532 return status;
1533 }
1534
1535#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
1536 //
1537 // Allow device simulation framework to hook interrupt routines.
1538 //
1539 if (GetDriverGlobals()->FxDsfOn) {
1541 if (!NT_SUCCESS(status)) {
1542 return status;
1543 }
1544 }
1545
1546#endif
1547
1549 FALSE /*SelfTarget=FALSE*/);
1550 if (NT_SUCCESS(status)) {
1551 //
1552 // This will be released in the destructor
1553 //
1554 m_DefaultTarget->ADDREF(this);
1555 }
1556
1559 TRUE /*SelfTarget*/);
1560 if (NT_SUCCESS(status)) {
1561 //
1562 // This will be released in the destructor
1563 //
1564 m_SelfTarget->ADDREF(this);
1565 }
1566 }
1567
1568
1569 return status;
1570}
_Must_inspect_result_ NTSTATUS AllocateTarget(_Out_ FxIoTarget **Target, _In_ BOOLEAN SelfTarget)
BOOLEAN m_SelfIoTargetNeeded
Definition: fxdevice.hpp:611
_Must_inspect_result_ NTSTATUS QueryForDsfInterface(VOID)
Definition: fxpkgfdokm.cpp:455
_Must_inspect_result_ NTSTATUS PostCreateDeviceInitialize(VOID)
Definition: fxpkgpnp.cpp:1187

Referenced by FxDevice::FdoInitialize().

◆ PowerCheckDeviceTypeNPOverload()

WDF_DEVICE_POWER_STATE FxPkgFdo::PowerCheckDeviceTypeNPOverload ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 520 of file fdopower.cpp.

537{
539}
@ WdfDevStatePowerWakingNP
Definition: wdfdevice.h:182

◆ PowerCheckDeviceTypeOverload()

WDF_DEVICE_POWER_STATE FxPkgFdo::PowerCheckDeviceTypeOverload ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 498 of file fdopower.cpp.

515{
517}
@ WdfDevStatePowerWaking
Definition: wdfdevice.h:181

◆ PowerCheckParentOverload()

_Must_inspect_result_ NTSTATUS FxPkgFdo::PowerCheckParentOverload ( __out BOOLEAN ParentOn)
privatevirtual

Definition at line 543 of file fdopower.cpp.

562{
563 ASSERT(!"This state shouldn't be reachable for an FDO.");
564 *ParentOn = TRUE;
565 return STATUS_SUCCESS;
566}

◆ PowerParentPowerDereference()

VOID FxPkgFdo::PowerParentPowerDereference ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 569 of file fdopower.cpp.

584{
585 DO_NOTHING();
586}
#define DO_NOTHING()
Definition: mxgeneral.h:32

◆ PowerReleasePendingDeviceIrp()

VOID FxPkgFdo::PowerReleasePendingDeviceIrp ( __in BOOLEAN  IrpMustBePresent = TRUE)
privatevirtual

Definition at line 464 of file fdopower.cpp.

467{
468 MdIrp pIrp;
469
471
472 UNREFERENCED_PARAMETER(IrpMustBePresent);
473 ASSERT(IrpMustBePresent == FALSE || pIrp != NULL);
474
475 if (pIrp != NULL) {
476 FxIrp irp(pIrp);
477
479 //
480 // We catch D0 irps on the way up, so complete it
481 //
483 }
484 else {
486
487 //
488 // We catch Dx irps on the way down, so send it on its way
489 //
490 // This will also release the remove lock
491 //
492 (void) _PowerPassDown(this, &irp);
493 }
494 }
495}
VOID SetStatus(__in NTSTATUS Status)
Definition: fxirpum.cpp:457
DEVICE_POWER_STATE GetParameterPowerStateDeviceState()
Definition: fxirpum.cpp:695
MdIrp ClearPendingDevicePowerIrp(VOID)
Definition: fxpkgpnp.hpp:3069

◆ ProcessRemoveDeviceOverload()

_Must_inspect_result_ NTSTATUS FxPkgFdo::ProcessRemoveDeviceOverload ( __inout FxIrp Irp)
privatevirtual

Definition at line 1250 of file fxpkgfdo.cpp.

1253{
1255
1256 //
1257 // After this is called, any irp dispatched to FxDevice::DispatchWithLock
1258 // will fail with STATUS_INVALID_DEVICE_REQUEST.
1259 //
1261 Irp->GetIrp());
1262
1263 //
1264 // Cleanup the state machines and release the power thread.
1265 //
1267
1268 Irp->CopyCurrentIrpStackLocationToNext();
1269 status = Irp->CallDriver(m_Device->GetAttachedDevice());
1270
1271 //
1272 // Detach and delete the device object.
1273 //
1274 DeleteDevice();
1275
1276 return status;
1277}
VOID CleanupStateMachines(__in BOOLEAN ClenaupPnp)
Definition: fxpkgpnp.cpp:2066
VOID DeleteDevice(VOID)
Definition: fxpkgpnp.cpp:2249
static __inline VOID MxReleaseRemoveLockAndWait(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:288

◆ QueryForDsfInterface()

_Must_inspect_result_ NTSTATUS FxPkgFdo::QueryForDsfInterface ( VOID  )
private

Definition at line 455 of file fxpkgfdokm.cpp.

458{
459// __REACTOS__ : not supported
460// WDF_DSF_INTERFACE dsfInterface;
461// NTSTATUS status;
462// BOOLEAN derefQI = FALSE;
463
464// RtlZeroMemory(&dsfInterface, sizeof(dsfInterface));
465
466// //
467// // Since there are some stacks that are not PnP re-entrant (like USBHUB,
468// // xpsp2), we specify that the QI goes only to our attached device and
469// // not to the top of the stack as a normal QI irp would.
470// //
471// // We also do this a preventative measure for other stacks we don't know
472// // about internally and do not have access to when testing.
473// //
474// status = m_Device->QueryForInterface(&GUID_WDF_DSF_INTERFACE,
475// (PINTERFACE) &dsfInterface,
476// sizeof(dsfInterface),
477// WDM_DSF_INTERFACE_V1_0,
478// NULL,
479// m_Device->GetAttachedDevice()
480// );
481
482// if (status == STATUS_NOT_SUPPORTED) {
483// DoTraceLevelMessage(
484// GetDriverGlobals(), TRACE_LEVEL_WARNING, TRACINGPNP,
485// "Lower stack does not have a DSF interface");
486// status = STATUS_SUCCESS;
487// goto Done;
488// }
489
490// if (!NT_SUCCESS(status)) {
491// DoTraceLevelMessage(
492// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
493// "Lower stack returned an error for query DSF interface, %!STATUS!",
494// status);
495// goto Done;
496// }
497
498// derefQI = TRUE;
499
500// //
501// // Basic run time checks.
502// //
503// if (dsfInterface.Interface.Version != WDM_DSF_INTERFACE_V1_0) {
504// status = STATUS_REVISION_MISMATCH;
505// DoTraceLevelMessage(
506// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
507// "Lower DSF stack supports v(%x), requested v(%x), %!STATUS!",
508// dsfInterface.Interface.Version,
509// WDM_DSF_INTERFACE_V1_0,
510// status);
511// goto Done;
512// }
513
514// //
515// // Ex functions should be both set or cleared.
516// // Active/Inactive functions should be both set or cleared.
517// // Ex function must be present.
518// // Note: !!(ptr) expression below converts ptr value to true/false value.
519// // I.e., ptr==NULL to false and ptr!=NULL to true.
520// //
521// if (!((!!(dsfInterface.IoConnectInterruptEx) ==
522// !!(dsfInterface.IoDisconnectInterruptEx)) &&
523// (!!(dsfInterface.IoReportInterruptActive) ==
524// !!(dsfInterface.IoReportInterruptInactive)) &&
525// (dsfInterface.IoConnectInterruptEx != NULL)
526// )) {
527// status = STATUS_DATA_ERROR;
528// DoTraceLevelMessage(
529// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
530// "Function mismatch detected in DSF interface, %!STATUS!",
531// status);
532// goto Done;
533// }
534
535// //
536// // Info is correct.
537// //
538// m_IoConnectInterruptEx = dsfInterface.IoConnectInterruptEx;
539// m_IoDisconnectInterruptEx = dsfInterface.IoDisconnectInterruptEx;
540
541// //
542// // If DSF interface provides active/inactive functions then use them
543// //
544// if (dsfInterface.IoReportInterruptActive != NULL)
545// {
546// m_IoReportInterruptActive = dsfInterface.IoReportInterruptActive;
547// m_IoReportInterruptInactive = dsfInterface.IoReportInterruptInactive;
548// }
549
550// Done:
551
552// //
553// // The contract with the DSF layer is to release the interface right away;
554// // the embedded interrupt function ptrs will be valid until this driver is
555// // unloaded.
556// //
557// if (derefQI) {
558// dsfInterface.Interface.InterfaceDereference(dsfInterface.Interface.Context);
559// }
560
561// return status;
563}

Referenced by PostCreateDeviceInitialize().

◆ QueryForPowerThread()

_Must_inspect_result_ NTSTATUS FxPkgFdo::QueryForPowerThread ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 1387 of file fxpkgfdo.cpp.

1403{
1405
1406 //
1407 // Query down the stack to see if a lower device already created a thread.
1408 // Do NOT send this to the top of the stack, it is sent to the attached
1409 // device b/c we need the thread from a device below us b/c its lifetime
1410 // will outlast this device's.
1411 //
1414 sizeof(m_PowerThreadInterface),
1415 1,
1416 NULL,
1418
1419 if (NT_SUCCESS(status)) {
1420 //
1421 // A lower thread exists, use it
1422 //
1424 }
1425 else {
1426 //
1427 // No thread exists yet, attempt to create our own
1428 //
1430 }
1431
1432 return status;
1433}
_Must_inspect_result_ NTSTATUS QueryForInterface(__in const GUID *InterfaceType, __out PINTERFACE Interface, __in USHORT Size, __in USHORT Version, __in PVOID InterfaceSpecificData, __in_opt MdDeviceObject TargetDevice=NULL)
_Must_inspect_result_ NTSTATUS CreatePowerThread(VOID)
Definition: fxpkgpnp.cpp:5125
POWER_THREAD_INTERFACE m_PowerThreadInterface
Definition: fxpkgpnp.hpp:4213
static const GUID GUID_POWER_THREAD_INTERFACE
Definition: fxpkgpnp.hpp:4282
BOOLEAN m_HasPowerThread
Definition: fxpkgpnp.hpp:4256

◆ QueryForReenumerationInterface()

VOID FxPkgFdo::QueryForReenumerationInterface ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 1307 of file fxpkgfdo.cpp.

1310{
1313
1315
1316 if (pInterface->SurpriseRemoveAndReenumerateSelf != NULL) {
1317 //
1318 // Already got it, just return. This function can be called again during
1319 // stop -> start, so we must check.
1320 //
1321 return;
1322 }
1323
1325 pInterface->Size = sizeof(*pInterface);
1326 pInterface->Version = 1;
1327
1328 //
1329 // Since there are some stacks that are not PnP re-entrant
1330
1331 // we specify that the QI goes only to our attached device and
1332 // not to the top of the stack as a normal QI irp would. For the
1333 // reenumerate self interface, having someone on top of us filter the
1334 // IRP makes no sense anyways.
1335 //
1336 // We also do this as a preventative measure for other stacks we don't know
1337 // about internally and do not have access to when testing.
1338 //
1339 status = m_Device->QueryForInterface(&GUID_REENUMERATE_SELF_INTERFACE_STANDARD,
1341 sizeof(*pInterface),
1342 1,
1343 NULL,
1345 );
1346
1347 //
1348 // Failure to get this interface is not fatal.
1349 // Note that an implicit reference has been taken on the interface. We
1350 // must release the reference when we are done with the interface.
1351 //
1352 UNREFERENCED_PARAMETER(status); // for analyis tools.
1353}
USHORT Version
Definition: miniport.h:122
USHORT Size
Definition: miniport.h:121

◆ RaiseDevicePower()

_Must_inspect_result_ NTSTATUS FxPkgFdo::RaiseDevicePower ( __in FxIrp Irp)
private

Definition at line 353 of file fdopower.cpp.

356{
357 Irp->MarkIrpPending();
358 Irp->CopyCurrentIrpStackLocationToNext();
359 Irp->SetCompletionRoutineEx(m_Device->GetDeviceObject(),
361 this);
362
363 Irp->PoCallDriver(m_Device->GetAttachedDevice());
364
365 return STATUS_PENDING;
366}
static MdCompletionRoutineType RaiseDevicePowerCompletion
Definition: fxpkgfdo.hpp:454

Referenced by DispatchDeviceSetPower().

◆ RegisterCallbacks()

_Must_inspect_result_ NTSTATUS FxPkgFdo::RegisterCallbacks ( __in PWDF_FDO_EVENT_CALLBACKS  DispatchTable)