37#if defined(EVENT_TRACING)
40#include "fxpkgfdo.tmh"
73 _PnpQueryRemoveDevice,
75 _PnpCancelRemoveDevice,
80 _PnpQueryDeviceRelations,
82 _PnpQueryCapabilities,
86 _PnpFilterResourceRequirements,
95 _PnpQueryPnpDeviceState,
97 _PnpDeviceUsageNotification,
207 if (
NULL == fxPkgFdo) {
210 "Memory allocation failed: %!STATUS!",
status);
270 Irp->CopyCurrentIrpStackLocationToNext();
332 Irp->CopyCurrentIrpStackLocationToNext();
425 type =
Irp->GetParameterQDRType();
428 "Entering QueryDeviceRelations handler, "
429 "type %!DEVICE_RELATION_TYPE!",
482 "Exiting QueryDeviceRelations handler, status %!STATUS!",
519 "Entering QueryInterface handler");
524 "Exiting QueryInterface handler, %!STATUS!",
530 if (completeIrp ==
FALSE) {
580 "Entering QueryCapabilities handler");
582 pCaps =
Irp->GetParameterDeviceCapabilities();
603 pCaps->WakeFromInterrupt =
TRUE;
608 "Exiting QueryCapabilities handler");
622 "Entering QueryCapabilities completion handler");
624 pCaps =
Irp->GetParameterDeviceCapabilities();
632 ASSERT(pCaps->Version >= 1);
635 (pCaps->Version == 1)) {
677 pCaps->DeviceState[
i] =
state;
741 "Exiting QueryCapabilities completion handler");
771 "Entering QueryPnpDeviceState completion handler");
781 "WDFDEVICE 0x%p !devobj 0x%p returning PNP_DEVICE_STATE 0x%d IRP 0x%p",
789 "Exiting QueryPnpDeviceState completion handler");
876 "Could not convert object to handle");
959 pWdmRaw !=
NULL && pWdmTranslated !=
NULL) {
990 if (pContext !=
NULL) {
1030 setFilteredCompletion =
TRUE;
1055 if (setFilteredCompletion) {
1073 "PNP start preprocessing failed with %!STATUS!",
1123 ASSERT(!
"This should only be reachable for PDOs.");
1157 ASSERT(!
"This should only be implemented for PDOs.");
1191 ASSERT(!
"This should only be implemented for PDOs.");
1268 Irp->CopyCurrentIrpStackLocationToNext();
1494 Mx::MxLowerIrql(
irql);
1535#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
static _Must_inspect_result_ NTSTATUS _CreateAndInit(__out FxChildList **ChildList, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES ListAttributes, __in size_t TotalDescriptionSize, __in CfxDevice *Device, __in PWDF_CHILD_LIST_CONFIG ListConfig, __in BOOLEAN Static=FALSE)
static _Must_inspect_result_ NTSTATUS _ComputeTotalDescriptionSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_CHILD_LIST_CONFIG Config, __in size_t *TotalDescriptionSize)
_Must_inspect_result_ PCM_RESOURCE_LIST CreateWdmList(__in __drv_strictTypeMatch(__drv_typeExpr) POOL_TYPE PoolType=PagedPool)
WDFCMRESLIST GetHandle(VOID)
_Must_inspect_result_ NTSTATUS BuildFromWdmList(__in PCM_RESOURCE_LIST ResourceList, __in UCHAR AccessFlags)
_Must_inspect_result_ NTSTATUS QueryForInterface(__in const GUID *InterfaceType, __out PINTERFACE Interface, __in USHORT Size, __in USHORT Version, __in PVOID InterfaceSpecificData, __in_opt MdDeviceObject TargetDevice=NULL)
_Must_inspect_result_ NTSTATUS AllocateTarget(_Out_ FxIoTarget **Target, _In_ BOOLEAN SelfTarget)
WDFDEVICE __inline GetHandle(VOID)
MdDeviceObject __inline GetAttachedDevice(VOID)
MdDeviceObject __inline GetDeviceObject(VOID)
VOID DeleteSymbolicLink(VOID)
MdRemoveLock GetRemoveLock(VOID)
BOOLEAN m_SelfIoTargetNeeded
PCM_RESOURCE_LIST GetParameterAllocatedResources()
VOID SetCompletionRoutineEx(__in MdDeviceObject DeviceObject, __in MdCompletionRoutine CompletionRoutine, __in PVOID Context, __in BOOLEAN InvokeOnSuccess=TRUE, __in BOOLEAN InvokeOnError=TRUE, __in BOOLEAN InvokeOnCancel=TRUE)
PCM_RESOURCE_LIST GetParameterAllocatedResourcesTranslated()
VOID SetParameterAllocatedResourcesTranslated(__in PCM_RESOURCE_LIST AllocatedResourcesTranslated)
VOID CopyCurrentIrpStackLocationToNext(VOID)
VOID SetParameterAllocatedResources(__in PCM_RESOURCE_LIST AllocatedResources)
NTSTATUS CallDriver(__in MdDeviceObject DeviceObject)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
VOID DeleteFromFailedCreate(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)
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS pGlobals, __in CfxDevice *Device, __deref_out FxPkgFdo **PkgFdo)
FxIoTargetSelf * m_SelfTarget
REENUMERATE_SELF_INTERFACE_STANDARD m_SurpriseRemoveAndReenumerateSelfInterface
_Must_inspect_result_ NTSTATUS PnpQueryDeviceRelations(__inout FxIrp *Irp)
static _Must_inspect_result_ NTSTATUS _PnpQueryCapabilities(__inout FxPkgPnp *This, __inout FxIrp *Irp)
FxPnpDeviceFilterResourceRequirements m_DeviceFilterRemoveResourceRequirements
virtual VOID QueryForReenumerationInterface(VOID)
virtual _Must_inspect_result_ NTSTATUS FireAndForgetIrp(__inout FxIrp *Irp)
static const PFN_PNP_POWER_CALLBACK m_FdoPowerFunctionTable[IRP_MN_QUERY_POWER+1]
static _Must_inspect_result_ NTSTATUS _PnpQueryDeviceRelations(__inout FxPkgPnp *This, __inout FxIrp *Irp)
static _Must_inspect_result_ NTSTATUS STDCALL _PnpStartDeviceCompletionRoutine(__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
_Must_inspect_result_ NTSTATUS SetFilter(__in BOOLEAN Value)
VOID HandleQueryPnpDeviceStateCompletion(__inout FxIrp *Irp)
virtual WDF_DEVICE_PNP_STATE PnpEventCheckForDevicePresenceOverload(VOID)
static _Must_inspect_result_ NTSTATUS STDCALL _PnpFilteredStartDeviceCompletionRoutine(__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
virtual WDF_DEVICE_PNP_STATE PnpEventFdoRemovedOverload(VOID)
FxPnpDeviceFilterResourceRequirements m_DeviceFilterAddResourceRequirements
static _Must_inspect_result_ NTSTATUS _PnpFilterResourceRequirements(__inout FxPkgPnp *This, __inout FxIrp *Irp)
virtual _Must_inspect_result_ NTSTATUS QueryForPowerThread(VOID)
FxPnpDeviceRemoveAddedResources m_DeviceRemoveAddedResources
virtual WDF_DEVICE_PNP_STATE PnpEventEjectHardwareOverload(VOID)
FxChildList * m_DefaultDeviceList
VOID HandleQueryCapabilitiesCompletion(__inout FxIrp *Irp)
virtual VOID DeleteSymbolicLinkOverload(__in BOOLEAN GracefulRemove)
static _Must_inspect_result_ NTSTATUS _PowerPassDown(__inout FxPkgPnp *This, __in FxIrp *Irp)
virtual VOID ReleaseReenumerationInterface(VOID)
static const PFN_PNP_POWER_CALLBACK m_FdoPnpFunctionTable[IRP_MN_SURPRISE_REMOVAL+1]
_Must_inspect_result_ NTSTATUS CreateDefaultDeviceList(__in PWDF_CHILD_LIST_CONFIG ListConfig, __in PWDF_OBJECT_ATTRIBUTES ListAttributes)
virtual BOOLEAN PnpSendStartDeviceDownTheStackOverload(VOID)
virtual WDF_DEVICE_PNP_STATE PnpGetPostRemoveState(VOID)
_Must_inspect_result_ NTSTATUS RegisterCallbacks(__in PWDF_FDO_EVENT_CALLBACKS DispatchTable)
static _Must_inspect_result_ NTSTATUS _PnpSurpriseRemoval(__inout FxPkgPnp *This, __inout FxIrp *Irp)
virtual WDF_DEVICE_PNP_STATE PnpEventPdoRemovedOverload(VOID)
_Must_inspect_result_ NTSTATUS PostCreateDeviceInitialize(VOID)
FxChildList * m_StaticDeviceList
FxIoTarget * m_DefaultTarget
virtual _Must_inspect_result_ NTSTATUS ProcessRemoveDeviceOverload(__inout FxIrp *Irp)
static _Must_inspect_result_ NTSTATUS _PnpQueryInterface(__inout FxPkgPnp *This, __inout FxIrp *Irp)
static _Must_inspect_result_ NTSTATUS _PnpPassDown(__in FxPkgPnp *This, __inout FxIrp *Irp)
VOID HandleQueryCapabilities(__inout FxIrp *Irp)
_Must_inspect_result_ NTSTATUS QueryForDsfInterface(VOID)
FxPkgFdo(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device)
virtual _Must_inspect_result_ NTSTATUS SendIrpSynchronously(__inout FxIrp *Irp)
FxCmResList * m_Resources
_Must_inspect_result_ NTSTATUS CreatePowerThread(VOID)
FxCmResList * m_ResourcesRaw
PNP_BUS_INFORMATION m_BusInformation
FxPowerMachine m_PowerMachine
BOOLEAN IsPowerPolicyOwner(VOID)
FxEnumerationInfo * m_EnumInfo
_Must_inspect_result_ NTSTATUS HandleQueryDeviceRelations(__inout FxIrp *Irp, __inout FxRelatedDeviceList *List)
POWER_THREAD_INTERFACE m_PowerThreadInterface
_Must_inspect_result_ NTSTATUS PostCreateDeviceInitialize(VOID)
FxPnpMachine m_PnpMachine
MdIrp ClearPendingPnpIrp(VOID)
LONG GetPnpCapsInternal(VOID)
VOID CleanupStateMachines(__in BOOLEAN ClenaupPnp)
_Must_inspect_result_ NTSTATUS HandleQueryBusRelations(__inout FxIrp *Irp)
static const GUID GUID_POWER_THREAD_INTERFACE
BOOLEAN SupportsWakeInterrupt(VOID)
VOID PnpEventRemovedCommonCode(VOID)
VOID PnpProcessEvent(__in FxPnpEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
FxRelatedDeviceList * m_RemovalDeviceList
VOID SetPendingPnpIrp(__inout FxIrp *Irp, __in BOOLEAN MarkIrpPending=TRUE)
BOOLEAN m_DeviceInterfacesCanBeEnabled
FxPowerPolicyMachine m_PowerPolicyMachine
NTSTATUS CompletePnpRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
static DEVICE_POWER_STATE _GetPowerCapState(__in ULONG Index, __in ULONG State)
PNP_DEVICE_STATE HandleQueryPnpDeviceState(__in PNP_DEVICE_STATE PnpDeviceState)
_Must_inspect_result_ NTSTATUS HandleQueryInterface(__inout FxIrp *Irp, __out PBOOLEAN CompleteRequest)
PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS m_Method
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDFCMRESLIST ResourcesRaw, __in WDFCMRESLIST ResourcesTranslated)
PFN_WDF_DEVICE_REMOVE_ADDED_RESOURCES m_Method
static __inline VOID MxFreePool(__in PVOID Ptr)
static __inline VOID MxReleaseRemoveLockAndWait(__in MdRemoveLock RemoveLock, __in PVOID Tag)
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
#define STATUS_NOT_SUPPORTED
#define NT_SUCCESS(StatCode)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
size_t totalDescriptionSize
PFX_DRIVER_GLOBALS pFxDriverGlobals
_Must_inspect_result_ NTSTATUS(* PFN_PNP_POWER_CALLBACK)(__inout FxPkgPnp *This, __inout FxIrp *Irp)
@ PnpEventStartDeviceComplete
@ PnpEventStartDeviceFailed
@ FxResourceAllAccessAllowed
GLuint GLuint GLsizei GLenum type
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
#define _Must_inspect_result_
#define UNREFERENCED_PARAMETER(P)
#define IRP_MN_SURPRISE_REMOVAL
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
#define SET_PNP_CAP_IF_TRUE(caps, pCaps, FieldName)
#define SET_PNP_CAP_IF_FALSE(caps, pCaps, FieldName)
#define SET_PNP_CAP(caps, pCaps, FieldName)
#define STATUS_MORE_PROCESSING_REQUIRED
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_INFORMATION
_Must_inspect_result_ NTSTATUS Initialize(__in PFX_DRIVER_GLOBALS DriverGlobals)
FxFilteredStartContext(VOID)
PCM_RESOURCE_LIST ResourcesRaw
~FxFilteredStartContext()
PCM_RESOURCE_LIST ResourcesTranslated
PINTERFACE_DEREFERENCE InterfaceDereference
#define RtlZeroMemory(Destination, Length)
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE Device
_In_ PDEVICE_OBJECT DeviceObject
@ WdfDevStatePnpEjectedWaitingForRemove
@ WdfDevStatePnpFdoRemoved
_In_ WDFCMRESLIST _In_ WDFCMRESLIST ResourcesTranslated
_In_ WDFCMRESLIST ResourcesRaw
enum _WDF_DEVICE_PNP_STATE WDF_DEVICE_PNP_STATE
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
#define IRP_MN_QUERY_POWER