ReactOS  0.4.15-dev-2700-g4b4ffa9
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)
 
_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)
 
__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)
 
_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)
 
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 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 NTSTATUS PowerCheckParentOverload (BOOLEAN *ParentOn)=0
 
virtual NTSTATUS PowerEnableWakeAtBusOverload (VOID)
 
virtual VOID PowerDisableWakeAtBusOverload (VOID)
 
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 
121 Routine Description:
122 
123  This is the constructor for the FxPkgFdo. Don't do any initialization
124  that might fail here.
125 
126 Arguments:
127 
128  none
129 
130 Returns:
131 
132  none
133 
134 --*/
135 
136 {
139 
141  m_SelfTarget = NULL;
142 
143  m_BusEnumRetries = 0;
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 }
#define TRUE
Definition: types.h:120
PNP_BUS_INFORMATION m_BusInformation
Definition: fxpkgpnp.hpp:4232
BOOLEAN m_Filter
Definition: fxpkgfdo.hpp:69
REENUMERATE_SELF_INTERFACE_STANDARD m_SurpriseRemoveAndReenumerateSelfInterface
Definition: fxpkgfdo.hpp:57
FxChildList * m_DefaultDeviceList
Definition: fxpkgfdo.hpp:40
#define FALSE
Definition: types.h:117
UCHAR m_BusEnumRetries
Definition: fxpkgpnp.hpp:4237
FxIoTargetSelf * m_SelfTarget
Definition: fxpkgfdo.hpp:53
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
FxChildList * m_StaticDeviceList
Definition: fxpkgfdo.hpp:42
#define NULL
Definition: types.h:112
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
BOOLEAN m_DeviceInterfacesCanBeEnabled
Definition: fxpkgpnp.hpp:4128
FxIoTarget * m_DefaultTarget
Definition: fxpkgfdo.hpp:47
FxPkgPnp(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device, __in WDFTYPE Type)
Definition: fxpkgpnp.cpp:48

Referenced by _Create().

◆ ~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 }
FxChildList * m_DefaultDeviceList
Definition: fxpkgfdo.hpp:40
FxIoTargetSelf * m_SelfTarget
Definition: fxpkgfdo.hpp:53
FxChildList * m_StaticDeviceList
Definition: fxpkgfdo.hpp:42
#define NULL
Definition: types.h:112
FxIoTarget * m_DefaultTarget
Definition: fxpkgfdo.hpp:47

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 
238 exit:
239  if (!NT_SUCCESS(status)) {
240  fxPkgFdo->DeleteFromFailedCreate();
241  }
242 
243  return status;
244 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
FxPowerPolicyMachine m_PowerPolicyMachine
Definition: fxpkgpnp.hpp:4153
DriverGlobals
_Must_inspect_result_ NTSTATUS Initialize(__in PFX_DRIVER_GLOBALS DriverGlobals)
Definition: eventqueue.cpp:55
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
FxPkgFdo(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device)
Definition: fxpkgfdo.cpp:114
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
FxPowerMachine m_PowerMachine
Definition: fxpkgpnp.hpp:4152
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
#define TRACINGIO
Definition: dbgtrace.h:66
void exit(int exitcode)
Definition: _exit.c:33
static SERVICE_STATUS status
Definition: service.c:31
FxPnpMachine m_PnpMachine
Definition: fxpkgpnp.hpp:4151
Definition: ps.c:97

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) {
149  }
150  else {
152  }
153 }
_Must_inspect_result_ NTSTATUS DispatchSystemQueryPower(__in FxIrp *Irp)
Definition: fdopower.cpp:414
_Must_inspect_result_ NTSTATUS DispatchDeviceQueryPower(__in FxIrp *Irp)
Definition: fdopower.cpp:443
_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 }
_Must_inspect_result_ NTSTATUS DispatchDeviceSetPower(__in FxIrp *Irp)
Definition: fdopower.cpp:297
_In_ PIRP Irp
Definition: csq.h:116
_Must_inspect_result_ NTSTATUS DispatchSystemSetPower(__in FxIrp *Irp)
Definition: fdopower.cpp:234
_In_ SYSTEM_POWER_STATE SystemPowerState
Definition: iotypes.h:7519

◆ _PnpFilteredStartDeviceCompletionRoutine()

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

Definition at line 1437 of file fxpkgfdo.cpp.

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

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 }
_In_ PIRP Irp
Definition: csq.h:116

◆ _PnpPassDown()

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

Definition at line 307 of file fxpkgfdo.cpp.

324 {
326  FxDevice* device;
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 }
CfxDevice * m_Device
Definition: fxobject.hpp:329
LONG NTSTATUS
Definition: precomp.h:26
FxIrp * pIrp
FxDevice * device
_In_ PIRP Irp
Definition: csq.h:116
Definition: devices.h:37
MdDeviceObject __inline GetAttachedDevice(VOID)
Definition: fxdevice.hpp:210
IWudfIrp * MdIrp
Definition: mxum.h:103
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:278
MdIrp GetIrp(VOID)
Definition: fxirpum.cpp:15
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

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 }
_In_ PIRP Irp
Definition: csq.h:116

◆ _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 
239  return STATUS_NOT_IMPLEMENTED;
240 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
return STATUS_NOT_IMPLEMENTED
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431

◆ _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 }
_In_ PIRP Irp
Definition: csq.h:116

◆ _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);
535  pThis->CompletePnpRequest(Irp, status);
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 }
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ NTSTATUS HandleQueryInterface(__inout FxIrp *Irp, __out PBOOLEAN CompleteRequest)
Definition: fxpkgpnp.cpp:1493
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
unsigned char BOOLEAN
#define TRACINGPNP
Definition: dbgtrace.h:67
static _Must_inspect_result_ NTSTATUS _PnpPassDown(__in FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:307
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5752
Definition: ps.c:97

◆ _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 
332  status = pThis->SendIrpSynchronously(Irp);
333 
334  if (status == STATUS_NOT_SUPPORTED) {
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 }
return STATUS_NOT_SUPPORTED
LONG NTSTATUS
Definition: precomp.h:26
VOID HandleQueryPnpDeviceStateCompletion(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:763
_In_ PIRP Irp
Definition: csq.h:116
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACINGPNP
Definition: dbgtrace.h:67
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define STATUS_SUCCESS
Definition: shellext.h:65
virtual _Must_inspect_result_ NTSTATUS SendIrpSynchronously(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:248
static SERVICE_STATUS status
Definition: service.c:31
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5752
Definition: ps.c:97

◆ _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 
300  return STATUS_NOT_IMPLEMENTED;
301 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
return STATUS_NOT_IMPLEMENTED
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431

◆ _PnpStartDeviceCompletionRoutine()

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

Definition at line 1460 of file fxpkgfdo.cpp.

1465 {
1466  FxPkgFdo* pThis;
1467  FxIrp irp(Irp);
1468 
1470 
1471  pThis = (FxPkgFdo*) Context;
1472 
1473  if (NT_SUCCESS(irp.GetStatus())) {
1474  pThis->SetPendingPnpIrp(&irp);
1475 
1476  //
1477  // Only raise irql if we are the power policy owner. Only the p.p.o.
1478  // does this so that we only have one driver in the device stack moving
1479  // to another thread.
1480  //
1481  if (pThis->IsPowerPolicyOwner()) {
1482  KIRQL irql;
1483 
1484  //
1485  // By raising to dispatch level we are forcing the pnp state machine
1486  // to move to another thread. On NT 6.0 PnP supports asynchronous
1487  // starts, so this will other starts to proceed while WDF processes
1488  // this device starting.
1489  //
1490  Mx::MxRaiseIrql(DISPATCH_LEVEL, &irql);
1492  Mx::MxLowerIrql(irql);
1493  }
1494  else {
1496  }
1497  }
1498  else {
1499  //
1500  // Just complete the request, the current pnp state can handle the remove
1501  // which will be sent b/c of the failed start.
1502  //
1505  "PNP start failed with %!STATUS!", irp.GetStatus());
1506 
1507  //
1508  // Process the event *before* completing the irp so that this even is in
1509  // the queue before the device remove event which will be be processed
1510  // right after the start irp has been completed.
1511  //
1513 
1514  pThis->CompletePnpRequest(&irp, irp.GetStatus());
1515  }
1516 
1518 }
VOID PnpProcessEvent(__in FxPnpEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
Definition: fxirp.hpp:28
KIRQL irql
Definition: wave.h:1
VOID SetPendingPnpIrp(__inout FxIrp *Irp, __in BOOLEAN MarkIrpPending=TRUE)
Definition: fxpkgpnp.cpp:4883
UCHAR KIRQL
Definition: env_spec_w32.h:591
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ PIRP Irp
Definition: csq.h:116
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOLEAN IsPowerPolicyOwner(VOID)
Definition: fxpkgpnp.hpp:3612
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxIrp * irp
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5752
NTSTATUS GetStatus()
Definition: fxirpum.cpp:466

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 }
_In_ PIRP Irp
Definition: csq.h:116

◆ _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 }
CfxDevice * m_Device
Definition: fxobject.hpp:329
MdRemoveLock GetRemoveLock(VOID)
Definition: fxdevicekm.hpp:47
LONG NTSTATUS
Definition: precomp.h:26
FxIrp * pIrp
_In_ PIRP Irp
Definition: csq.h:116
MdDeviceObject __inline GetAttachedDevice(VOID)
Definition: fxdevice.hpp:210
IWudfIrp * MdIrp
Definition: mxum.h:103
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:278
MdIrp GetIrp(VOID)
Definition: fxirpum.cpp:15
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

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 
596  return STATUS_NOT_SUPPORTED;
597 }
return STATUS_NOT_SUPPORTED
REENUMERATE_SELF_INTERFACE_STANDARD m_SurpriseRemoveAndReenumerateSelfInterface
Definition: fxpkgfdo.hpp:57
PINTERFACE pInterface
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
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 
844  ASSERT(m_EnumInfo != NULL);
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 }
CfxDevice * m_Device
Definition: fxobject.hpp:329
_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
LONG NTSTATUS
Definition: precomp.h:26
FxChildList * m_DefaultDeviceList
Definition: fxpkgfdo.hpp:40
FxEnumerationInfo * m_EnumInfo
Definition: fxpkgpnp.hpp:4215
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
HWND hList
Definition: livecd.c:10
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
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)
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
static _Must_inspect_result_ NTSTATUS _ComputeTotalDescriptionSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_CHILD_LIST_CONFIG Config, __in size_t *TotalDescriptionSize)
static SERVICE_STATUS status
Definition: service.c:31
size_t totalDescriptionSize
Definition: ps.c:97

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 }
CfxDevice * m_Device
Definition: fxobject.hpp:329
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
VOID DeleteSymbolicLink(VOID)

◆ DispatchDeviceQueryPower()

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

Definition at line 443 of file fdopower.cpp.

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

Referenced by _DispatchQueryPower().

◆ DispatchDeviceSetPower()

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

Definition at line 297 of file fdopower.cpp.

301 {
303 
304  if (IsPowerPolicyOwner()) {
307  //
308  // A power irp arrived, but we did not request it. log and bugcheck
309  //
312  "Received set device power irp 0x%p on WDFDEVICE 0x%p !devobj 0x%p, "
313  "but the irp was not requested by the device (the power policy owner)",
314  Irp->GetIrp(), m_Device->GetHandle(),
316 
318  WDF_POWER_MULTIPLE_PPO, // specific type
319  (ULONG_PTR)m_Device->GetDeviceObject(), //parm 2
320  (ULONG_PTR)Irp->GetIrp()); // parm 3
321 
322  /* NOTREACHED */
323  }
324 
325  //
326  // We are no longer requesting a power irp because we received the one
327  // we requested.
328  //
331  } else {
333  }
334  }
335 
336  //
337  // Determine if we are raising or lowering the device power state.
338  //
339  if (Irp->GetParameterPowerStateDeviceState() == PowerDeviceD0) {
341  }
342  else {
344  }
345 
346  return status;
347 }
CfxDevice * m_Device
Definition: fxobject.hpp:329
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
LONG NTSTATUS
Definition: precomp.h:26
FxPowerPolicyMachine m_PowerPolicyMachine
Definition: fxpkgpnp.hpp:4153
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
FxPowerPolicyOwnerSettings * m_Owner
BOOLEAN IsPowerPolicyOwner(VOID)
Definition: fxpkgpnp.hpp:3612
_Must_inspect_result_ NTSTATUS LowerDevicePower(__in FxIrp *Irp)
Definition: fdopower.cpp:398
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
_Must_inspect_result_ NTSTATUS RaiseDevicePower(__in FxIrp *Irp)
Definition: fdopower.cpp:351
#define ULONG_PTR
Definition: config.h:101
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by _DispatchSetPower().

◆ DispatchSystemQueryPower()

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

Definition at line 414 of file fdopower.cpp.

417 {
418  if (PowerPolicyIsWakeEnabled()) {
420 
422  Irp->GetParameterPowerStateSystemState()
423  );
424 
425  Irp->SetStatus(status);
426 
427  if (!NT_SUCCESS(status)) {
429  }
430  }
431 
432  //
433  // Passing down the irp because one of the following
434  // a) We don't care b/c we don't control the power policy
435  // b) we are not enabled for arming for wake from Sx
436  // c) we can wake from the queried S state
437  //
438  return _PowerPassDown(this, Irp);
439 }
_Must_inspect_result_ NTSTATUS PowerPolicyHandleSystemQueryPower(__in SYSTEM_POWER_STATE QueryState)
Definition: fxpkgpnp.cpp:3582
BOOLEAN PowerPolicyIsWakeEnabled(VOID)
Definition: fxpkgpnp.cpp:5769
LONG NTSTATUS
Definition: precomp.h:26
static _Must_inspect_result_ NTSTATUS _PowerPassDown(__inout FxPkgPnp *This, __in FxIrp *Irp)
Definition: fdopower.cpp:43
_In_ PIRP Irp
Definition: csq.h:116
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS CompletePowerRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5404
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by _DispatchQueryPower().

◆ DispatchSystemSetPower()

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

Definition at line 234 of file fdopower.cpp.

237 {
240 
241  m_SystemPowerState = (BYTE) Irp->GetParameterPowerStateSystemState();
243  Irp->GetParameterPowerState());
244 
245  if (IsPowerPolicyOwner()) {
246  //
247  // If we are going to S0, we just notify the power policy state machine
248  // and then let the request go (per the fast resume spec). Otherwise,
249  // send the request down and on the way up, send the Dx request.
250  //
252  //
253  // Post the event into the state machine when the irp is going up
254  // the stack. See the comment in _SystemPowerS0Completion for more
255  // detail as to why.
256  //
257  Irp->CopyCurrentIrpStackLocationToNext();
258  Irp->SetCompletionRoutineEx(deviceObject.GetObject(),
260  this);
261 
262  return Irp->PoCallDriver(m_Device->GetAttachedDevice());
263  }
264  else {
265  //
266  // Stash away the irp for the power policy state machine. We will
267  // post the event to the power policy state machine when the S irp
268  // completes back to this driver.
269  //
271 
272  Irp->CopyCurrentIrpStackLocationToNext();
273  Irp->SetCompletionRoutineEx(deviceObject.GetObject(),
275  this);
276 
277  Irp->PoCallDriver(m_Device->GetAttachedDevice());
278 
280  }
281  }
282  else {
283  //
284  // We don't do anything with S irps if we are not the power policy
285  // owner.
286  //
287  // This will release the remove lock as well.
288  //
289  status = _PowerPassDown(this, Irp);
290  }
291 
292  return status;
293 }
POWER_STATE SetPowerState(__in POWER_STATE_TYPE Type, __in POWER_STATE State)
CfxDevice * m_Device
Definition: fxobject.hpp:329
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
LONG NTSTATUS
Definition: precomp.h:26
static MdCompletionRoutineType _SystemPowerSxCompletion
Definition: fxpkgfdo.hpp:465
static _Must_inspect_result_ NTSTATUS _PowerPassDown(__inout FxPkgPnp *This, __in FxIrp *Irp)
Definition: fdopower.cpp:43
_In_ PIRP Irp
Definition: csq.h:116
MdDeviceObject __inline GetAttachedDevice(VOID)
Definition: fxdevice.hpp:210
#define STATUS_PENDING
Definition: ntstatus.h:82
BOOLEAN IsPowerPolicyOwner(VOID)
Definition: fxpkgpnp.hpp:3612
static MdCompletionRoutineType _SystemPowerS0Completion
Definition: fxpkgfdo.hpp:461
unsigned char BYTE
Definition: xxhash.c:193
MxDeviceObject deviceObject
__inline MdDeviceObject GetObject(VOID)
VOID SetPendingSystemPowerIrp(__inout FxIrp *Irp)
Definition: fxpkgpnp.hpp:3082
BYTE m_SystemPowerState
Definition: fxpkgpnp.hpp:4102
_In_ SYSTEM_POWER_STATE SystemPowerState
Definition: iotypes.h:7519
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by _DispatchSetPower().

◆ 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 }
static _Must_inspect_result_ NTSTATUS _PowerPassDown(__inout FxPkgPnp *This, __in FxIrp *Irp)
Definition: fdopower.cpp:43
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MJ_POWER
static _Must_inspect_result_ NTSTATUS _PnpPassDown(__in FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:307

◆ GetDispatchPnp()

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

Implements FxPkgPnp.

Definition at line 428 of file fxpkgfdo.hpp.

431  {
432  return m_FdoPnpFunctionTable;
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 {
576  PDEVICE_CAPABILITIES pCaps;
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 }
#define TRUE
Definition: types.h:120
LONG GetPnpCapsInternal(VOID)
Definition: fxpkgpnp.cpp:5466
DEVICE_CAPABILITIES
Definition: iotypes.h:965
BOOLEAN SupportsWakeInterrupt(VOID)
Definition: fxpkgpnp.hpp:3620
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
long LONG
Definition: pedump.c:60
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define SET_PNP_CAP_IF_TRUE(caps, pCaps, FieldName)
Definition: pnppriv.hpp:265
Definition: arc.h:81

Referenced by PnpQueryCapabilities().

◆ HandleQueryCapabilitiesCompletion()

VOID FxPkgFdo::HandleQueryCapabilitiesCompletion ( __inout FxIrp Irp)
private

Definition at line 613 of file fxpkgfdo.cpp.

616 {
617  PDEVICE_CAPABILITIES pCaps;
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 
665  for (i = PowerSystemWorking; i < PowerSystemMaximum; i++) {
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 }
BYTE SystemWake
Definition: fxpkgpnp.hpp:413
ULONG D1Latency
Definition: fxpkgpnp.hpp:423
#define SET_PNP_CAP(caps, pCaps, FieldName)
Definition: pnppriv.hpp:279
ULONG D3Latency
Definition: fxpkgpnp.hpp:425
LONG GetPnpCapsInternal(VOID)
Definition: fxpkgpnp.cpp:5466
DEVICE_CAPABILITIES
Definition: iotypes.h:965
#define SET_PNP_CAP_IF_FALSE(caps, pCaps, FieldName)
Definition: pnppriv.hpp:272
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
ULONG m_PnpCapsAddress
Definition: fxpkgpnp.hpp:4090
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
long LONG
Definition: pedump.c:60
ULONG States
Definition: fxpkgpnp.hpp:418
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
#define ASSERT(a)
Definition: mode.c:44
BYTE DeviceWake
Definition: fxpkgpnp.hpp:412
static int state
Definition: maze.c:121
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
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
ULONG m_PnpCapsUINumber
Definition: fxpkgpnp.hpp:4091
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxPowerCaps m_PowerCaps
Definition: fxpkgpnp.hpp:4093
unsigned int ULONG
Definition: retypes.h:1
static DEVICE_POWER_STATE _GetPowerCapState(__in ULONG Index, __in ULONG State)
Definition: fxpkgpnp.cpp:5657
Definition: arc.h:81
ULONG D2Latency
Definition: fxpkgpnp.hpp:424

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",
782  m_Device->GetHandle(),
784  pnpDeviceState,
785  Irp->GetIrp());
786 
789  "Exiting QueryPnpDeviceState completion handler");
790 
791  return;
792 }
CfxDevice * m_Device
Definition: fxobject.hpp:329
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
ULONG PNP_DEVICE_STATE
Definition: iotypes.h:997
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
PNP_DEVICE_STATE HandleQueryPnpDeviceState(__in PNP_DEVICE_STATE PnpDeviceState)
Definition: fxpkgpnp.cpp:662
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)

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")
413  sizeof(FxStaticChildDescription),
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 }
CfxDevice * m_Device
Definition: fxobject.hpp:329
struct config_s config
_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
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
virtual _Must_inspect_result_ NTSTATUS Initialize(__in PWDFDEVICE_INIT DeviceInit)
Definition: fxpkgpnp.cpp:349
_Must_inspect_result_ NTSTATUS AllocateEnumInfo(VOID)
Definition: fxpkgpnp.cpp:4920
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PFX_DRIVER_GLOBALS pGlobals
HWND hList
Definition: livecd.c:10
FxChildList * m_StaticDeviceList
Definition: fxpkgfdo.hpp:42
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
#define NULL
Definition: types.h:112
#define WDF_NO_OBJECT_ATTRIBUTES
Definition: wdftypes.h:105
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)
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
static _Must_inspect_result_ NTSTATUS _ComputeTotalDescriptionSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_CHILD_LIST_CONFIG Config, __in size_t *TotalDescriptionSize)
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
static SERVICE_STATUS status
Definition: service.c:31
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
size_t totalDescriptionSize
Definition: ps.c:97

Referenced by FxDevice::FdoInitialize().

◆ IsFilter()

BOOLEAN FxPkgFdo::IsFilter ( VOID  )
inline

Definition at line 130 of file fxpkgfdo.hpp.

133  {
134  return m_Filter;
135  }
BOOLEAN m_Filter
Definition: fxpkgfdo.hpp:69

◆ LowerDevicePower()

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

Definition at line 398 of file fdopower.cpp.

401 {
403 
404  //
405  // Kick off the power state machine.
406  //
408 
409  return STATUS_PENDING;
410 }
_In_ PIRP Irp
Definition: csq.h:116
VOID PowerProcessEvent(__in FxPowerEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
#define STATUS_PENDING
Definition: ntstatus.h:82
VOID SetPendingDevicePowerIrp(__inout FxIrp *Irp)
Definition: fxpkgpnp.hpp:3050

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 }
#define ASSERT(a)
Definition: mode.c:44

◆ 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 }
#define ASSERT(a)
Definition: mode.c:44

◆ 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 }
#define ASSERT(a)
Definition: mode.c:44

◆ 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) {
86  status = pIoResReqList->Commit(NULL, (PWDFOBJECT) &reqlist);
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 }
CfxDevice * m_Device
Definition: fxobject.hpp:329
virtual VOID DeleteObject(VOID)
return STATUS_NOT_SUPPORTED
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_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
NTSTATUS FilterResourceRequirements(__in IO_RESOURCE_REQUIREMENTS_LIST **IoList)
Definition: fxpkgpnpkm.cpp:16
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
LONG NTSTATUS
Definition: precomp.h:26
struct _IO_RESOURCE_REQUIREMENTS_LIST * PIO_RESOURCE_REQUIREMENTS_LIST
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDFIORESREQLIST Collection)
FxIoResReqList * pIoResReqList
uint32_t ULONG_PTR
Definition: typedefs.h:65
static __inline VOID MxFreePool(__in PVOID Ptr)
Definition: mxmemorykm.h:41
PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS m_Method
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
BOOLEAN IsChanged(VOID)
Definition: fxresource.hpp:335
FxPnpDeviceFilterResourceRequirements m_DeviceFilterRemoveResourceRequirements
Definition: fxpkgfdo.hpp:65
_Must_inspect_result_ PIO_RESOURCE_REQUIREMENTS_LIST CreateWdmList(VOID)
FxPnpDeviceFilterResourceRequirements m_DeviceFilterAddResourceRequirements
Definition: fxpkgfdo.hpp:63
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
WDFIORESREQLIST GetHandle(VOID)
Definition: fxresource.hpp:691
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
virtual _Must_inspect_result_ NTSTATUS SendIrpSynchronously(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:248
static _Must_inspect_result_ FxIoResReqList * _CreateFromWdmList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PIO_RESOURCE_REQUIREMENTS_LIST WdmRequirementsList, __in UCHAR AccessFlags)
static SERVICE_STATUS status
Definition: service.c:31
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5752
Definition: ps.c:97

◆ PnpGetPostRemoveState()

WDF_DEVICE_PNP_STATE FxPkgFdo::PnpGetPostRemoveState ( VOID  )
privatevirtual

Implements FxPkgPnp.

Definition at line 1197 of file fxpkgfdo.cpp.

1219 {
1220  return WdfDevStatePnpFdoRemoved;
1221 }

◆ 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
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID HandleQueryCapabilities(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:572
virtual _Must_inspect_result_ NTSTATUS SendIrpSynchronously(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:248
static SERVICE_STATUS status
Definition: service.c:31
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5752
Definition: ps.c:97

◆ 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  //
447  if (status == STATUS_NOT_SUPPORTED) {
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  //
464  if (status == STATUS_NOT_SUPPORTED) {
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 }
return STATUS_NOT_SUPPORTED
_Must_inspect_result_ NTSTATUS HandleQueryBusRelations(__inout FxIrp *Irp)
Definition: fxpkgpnp.cpp:758
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define TRACINGPNP
Definition: dbgtrace.h:67
static _Must_inspect_result_ NTSTATUS _PnpPassDown(__in FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:307
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxRelatedDeviceList * m_RemovalDeviceList
Definition: fxpkgpnp.hpp:4115
#define STATUS_SUCCESS
Definition: shellext.h:65
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static SERVICE_STATUS status
Definition: service.c:31
_Must_inspect_result_ NTSTATUS HandleQueryDeviceRelations(__inout FxIrp *Irp, __inout FxRelatedDeviceList *List)
Definition: fxpkgpnp.cpp:996
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
Definition: fxpkgpnp.cpp:5752
Definition: ps.c:97

◆ 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)) {
979  m_Device->GetHandle(),
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->