18a978a17SVictor Perevertkin /*++ 28a978a17SVictor Perevertkin 38a978a17SVictor Perevertkin Copyright (c) Microsoft. All rights reserved. 48a978a17SVictor Perevertkin 58a978a17SVictor Perevertkin Module Name: 68a978a17SVictor Perevertkin 78a978a17SVictor Perevertkin FxPkgPdo.hpp 88a978a17SVictor Perevertkin 98a978a17SVictor Perevertkin Abstract: 108a978a17SVictor Perevertkin 118a978a17SVictor Perevertkin This module implements the pnp package for Pdo objects. 128a978a17SVictor Perevertkin 138a978a17SVictor Perevertkin Author: 148a978a17SVictor Perevertkin 158a978a17SVictor Perevertkin 168a978a17SVictor Perevertkin 178a978a17SVictor Perevertkin Environment: 188a978a17SVictor Perevertkin 198a978a17SVictor Perevertkin Both kernel and user mode 208a978a17SVictor Perevertkin 218a978a17SVictor Perevertkin Revision History: 228a978a17SVictor Perevertkin 238a978a17SVictor Perevertkin 248a978a17SVictor Perevertkin --*/ 258a978a17SVictor Perevertkin 268a978a17SVictor Perevertkin #ifndef _FXPKGPDO_H_ 278a978a17SVictor Perevertkin #define _FXPKGPDO_H_ 288a978a17SVictor Perevertkin 298a978a17SVictor Perevertkin typedef NTSTATUS (FxPkgPdo::*PFN_PDO_HANDLER)(FxIrp *Irp); 308a978a17SVictor Perevertkin 318a978a17SVictor Perevertkin class FxPkgPdo : public FxPkgPnp 328a978a17SVictor Perevertkin { 338a978a17SVictor Perevertkin public: 348a978a17SVictor Perevertkin // 358a978a17SVictor Perevertkin // Properties used in handling IRP_MN_QUERY_DEVICE_TEXT 368a978a17SVictor Perevertkin // 378a978a17SVictor Perevertkin SINGLE_LIST_ENTRY m_DeviceTextHead; 388a978a17SVictor Perevertkin LCID m_DefaultLocale; 398a978a17SVictor Perevertkin 408a978a17SVictor Perevertkin FxDeviceDescriptionEntry* m_Description; 418a978a17SVictor Perevertkin 428a978a17SVictor Perevertkin FxChildList* m_OwningChildList; 438a978a17SVictor Perevertkin 448a978a17SVictor Perevertkin // 458a978a17SVictor Perevertkin // The following structure contains the function pointer table 468a978a17SVictor Perevertkin // for the "events" this package can raise. 478a978a17SVictor Perevertkin // 488a978a17SVictor Perevertkin FxPnpDeviceResourcesQuery m_DeviceResourcesQuery; 498a978a17SVictor Perevertkin FxPnpDeviceResourceRequirementsQuery m_DeviceResourceRequirementsQuery; 508a978a17SVictor Perevertkin FxPnpDeviceEject m_DeviceEject; 518a978a17SVictor Perevertkin FxPnpDeviceSetLock m_DeviceSetLock; 528a978a17SVictor Perevertkin 538a978a17SVictor Perevertkin FxPowerDeviceEnableWakeAtBus m_DeviceEnableWakeAtBus; 548a978a17SVictor Perevertkin FxPowerDeviceDisableWakeAtBus m_DeviceDisableWakeAtBus; 558a978a17SVictor Perevertkin 568a978a17SVictor Perevertkin // added in 1.11 578a978a17SVictor Perevertkin FxPnpDeviceReportedMissing m_DeviceReportedMissing; 588a978a17SVictor Perevertkin 598a978a17SVictor Perevertkin BOOLEAN m_RawOK; 608a978a17SVictor Perevertkin 618a978a17SVictor Perevertkin BOOLEAN m_Static; 628a978a17SVictor Perevertkin 638a978a17SVictor Perevertkin BOOLEAN m_AddedToStaticList; 648a978a17SVictor Perevertkin 658a978a17SVictor Perevertkin // 668a978a17SVictor Perevertkin // This field is used to indicate that Requests on this PDO could be 678a978a17SVictor Perevertkin // forwarded to the parent. 688a978a17SVictor Perevertkin // 698a978a17SVictor Perevertkin BOOLEAN m_AllowForwardRequestToParent; 708a978a17SVictor Perevertkin 718a978a17SVictor Perevertkin protected: 728a978a17SVictor Perevertkin // 738a978a17SVictor Perevertkin // Pointer to a null terminated string which is the device ID. This is 748a978a17SVictor Perevertkin // not a pointer that can be freed. m_IDsAllocation is the beginning of 758a978a17SVictor Perevertkin // the allocation that can be freed. 768a978a17SVictor Perevertkin // 778a978a17SVictor Perevertkin PWSTR m_DeviceID; 788a978a17SVictor Perevertkin 798a978a17SVictor Perevertkin // 808a978a17SVictor Perevertkin // Pointer to a null terminated string which is the instance ID. This is 818a978a17SVictor Perevertkin // not a pointer that can be freed. m_IDsAllocation is the beginning of 828a978a17SVictor Perevertkin // the allocation that can be freed. 838a978a17SVictor Perevertkin // 848a978a17SVictor Perevertkin PWSTR m_InstanceID; 858a978a17SVictor Perevertkin 868a978a17SVictor Perevertkin // 878a978a17SVictor Perevertkin // Pointer to a multi sz which is the hardware IDs. This is 888a978a17SVictor Perevertkin // not a pointer that can be freed. m_IDsAllocation is the beginning of 898a978a17SVictor Perevertkin // the allocation that can be freed. 908a978a17SVictor Perevertkin // 918a978a17SVictor Perevertkin PWSTR m_HardwareIDs; 928a978a17SVictor Perevertkin 938a978a17SVictor Perevertkin // 948a978a17SVictor Perevertkin // Pointer to a multi sz which is the compatible IDs. This is 958a978a17SVictor Perevertkin // not a pointer that can be freed. m_IDsAllocation is the beginning of 968a978a17SVictor Perevertkin // the allocation that can be freed. 978a978a17SVictor Perevertkin // 988a978a17SVictor Perevertkin PWSTR m_CompatibleIDs; 998a978a17SVictor Perevertkin 1008a978a17SVictor Perevertkin // 1018a978a17SVictor Perevertkin // Pointer to a null terminated string which is the unique ID. This is 1028a978a17SVictor Perevertkin // not a pointer that can be freed. m_IDsAllocation is the beginning of 1038a978a17SVictor Perevertkin // the allocation that can be freed. 1048a978a17SVictor Perevertkin // 1058a978a17SVictor Perevertkin PWSTR m_ContainerID; 1068a978a17SVictor Perevertkin 1078a978a17SVictor Perevertkin // 1088a978a17SVictor Perevertkin // Single allocation for all static ID strings (device, instance, hw, compat) 1098a978a17SVictor Perevertkin // for the device 1108a978a17SVictor Perevertkin // 1118a978a17SVictor Perevertkin PWSTR m_IDsAllocation; 1128a978a17SVictor Perevertkin 1138a978a17SVictor Perevertkin FxRelatedDeviceList* m_EjectionDeviceList; 1148a978a17SVictor Perevertkin 1158a978a17SVictor Perevertkin // 1168a978a17SVictor Perevertkin // IRP_MN_EJECT needs to be handled synchronously because PnP manager does 1178a978a17SVictor Perevertkin // not serialize it with other state changing PnP irps if not handled 1188a978a17SVictor Perevertkin // synchronously. This event is used to signal the completion of 1198a978a17SVictor Perevertkin // IRP_MN_EJECT processing. 1208a978a17SVictor Perevertkin // 1218a978a17SVictor Perevertkin MxEvent* m_DeviceEjectProcessed; 1228a978a17SVictor Perevertkin 1238a978a17SVictor Perevertkin BOOLEAN m_CanBeDeleted; 1248a978a17SVictor Perevertkin 1258a978a17SVictor Perevertkin // 1268a978a17SVictor Perevertkin // Parameter to track whether the EvtDeviceEnableWakeAtBus callback was 1278a978a17SVictor Perevertkin // invoked and to determine whether the EvtDeviceDisableWakeAtBus callback 1288a978a17SVictor Perevertkin // should be invoked or not. The EnableWakeAtBus callback may not get 1298a978a17SVictor Perevertkin // invoked if an upper driver in the stack completed the wait wake irp 1308a978a17SVictor Perevertkin // instead of passing it down the stack and the power policy owner is 1318a978a17SVictor Perevertkin // a PDO. 1328a978a17SVictor Perevertkin // 1338a978a17SVictor Perevertkin // This parameter can be referenced by either the power state machine or 1348a978a17SVictor Perevertkin // the power policy state machine when a PDO is the power policy owner 1358a978a17SVictor Perevertkin // but there is no locking mechanism necessary to synchronize access to 1368a978a17SVictor Perevertkin // the field. This is because the arrival of a Dx irp will move the power 1378a978a17SVictor Perevertkin // state machine to a state where it can no longer affect the value of 1388a978a17SVictor Perevertkin // this field and hence provides an implicit guard that allows the power 1398a978a17SVictor Perevertkin // policy state machine to use this field while processing the Dx irp. 1408a978a17SVictor Perevertkin // 1418a978a17SVictor Perevertkin BOOLEAN m_EnableWakeAtBusInvoked; 1428a978a17SVictor Perevertkin 1438a978a17SVictor Perevertkin private: 1448a978a17SVictor Perevertkin // 1458a978a17SVictor Perevertkin // Table of internal methods to handle PnP minor function codes. 1468a978a17SVictor Perevertkin // 1478a978a17SVictor Perevertkin static const PFN_PNP_POWER_CALLBACK m_PdoPnpFunctionTable[IRP_MN_SURPRISE_REMOVAL + 1]; 1488a978a17SVictor Perevertkin 1498a978a17SVictor Perevertkin // 1508a978a17SVictor Perevertkin // Table of internal methods to handle power minor function codes. 1518a978a17SVictor Perevertkin // 1528a978a17SVictor Perevertkin static const PFN_PNP_POWER_CALLBACK m_PdoPowerFunctionTable[IRP_MN_QUERY_POWER + 1]; 1538a978a17SVictor Perevertkin 1548a978a17SVictor Perevertkin public: 1558a978a17SVictor Perevertkin 1568a978a17SVictor Perevertkin FxPkgPdo( 1578a978a17SVictor Perevertkin __in PFX_DRIVER_GLOBALS FxDriverGlobals, 1588a978a17SVictor Perevertkin __in CfxDevice *Device 1598a978a17SVictor Perevertkin ); 1608a978a17SVictor Perevertkin 1618a978a17SVictor Perevertkin ~FxPkgPdo(); 1628a978a17SVictor Perevertkin 1638a978a17SVictor Perevertkin _Must_inspect_result_ 1648a978a17SVictor Perevertkin virtual 1658a978a17SVictor Perevertkin NTSTATUS 1668a978a17SVictor Perevertkin Initialize( 1678a978a17SVictor Perevertkin __in PWDFDEVICE_INIT DeviceInit 1688a978a17SVictor Perevertkin ); 1698a978a17SVictor Perevertkin 1708a978a17SVictor Perevertkin virtual 1718a978a17SVictor Perevertkin VOID 1728a978a17SVictor Perevertkin FinishInitialize( 1738a978a17SVictor Perevertkin __in PWDFDEVICE_INIT DeviceInit 1748a978a17SVictor Perevertkin ); 1758a978a17SVictor Perevertkin 1768a978a17SVictor Perevertkin VOID 1778a978a17SVictor Perevertkin RegisterCallbacks( 1788a978a17SVictor Perevertkin __in PWDF_PDO_EVENT_CALLBACKS DispatchTable 1798a978a17SVictor Perevertkin ); 1808a978a17SVictor Perevertkin 1818a978a17SVictor Perevertkin _Must_inspect_result_ 1828a978a17SVictor Perevertkin NTSTATUS 1838a978a17SVictor Perevertkin AddEjectionDevice( 1848a978a17SVictor Perevertkin __in MdDeviceObject DependentDevice 1858a978a17SVictor Perevertkin ); 1868a978a17SVictor Perevertkin 1878a978a17SVictor Perevertkin VOID 1888a978a17SVictor Perevertkin RemoveEjectionDevice( 1898a978a17SVictor Perevertkin __in MdDeviceObject DependentDevice 1908a978a17SVictor Perevertkin ); 1918a978a17SVictor Perevertkin 1928a978a17SVictor Perevertkin VOID 1938a978a17SVictor Perevertkin ClearEjectionDevicesList( 1948a978a17SVictor Perevertkin VOID 1958a978a17SVictor Perevertkin ); 1968a978a17SVictor Perevertkin 1978a978a17SVictor Perevertkin _Must_inspect_result_ 1988a978a17SVictor Perevertkin NTSTATUS 1998a978a17SVictor Perevertkin HandleQueryInterfaceForReenumerate( 2008a978a17SVictor Perevertkin __in FxIrp* Irp, 2018a978a17SVictor Perevertkin __out PBOOLEAN CompleteRequest 2028a978a17SVictor Perevertkin ); 2038a978a17SVictor Perevertkin 2048a978a17SVictor Perevertkin __inline 2058a978a17SVictor Perevertkin BOOLEAN IsForwardRequestToParentEnabled(VOID)2068a978a17SVictor Perevertkin IsForwardRequestToParentEnabled( 2078a978a17SVictor Perevertkin VOID 2088a978a17SVictor Perevertkin ) 2098a978a17SVictor Perevertkin { 2108a978a17SVictor Perevertkin return m_AllowForwardRequestToParent; 2118a978a17SVictor Perevertkin } 2128a978a17SVictor Perevertkin 2138a978a17SVictor Perevertkin 2148a978a17SVictor Perevertkin private: 2158a978a17SVictor Perevertkin _Must_inspect_result_ 2168a978a17SVictor Perevertkin virtual 2178a978a17SVictor Perevertkin NTSTATUS 2188a978a17SVictor Perevertkin SendIrpSynchronously( 2198a978a17SVictor Perevertkin __in FxIrp* Irp 2208a978a17SVictor Perevertkin ); 2218a978a17SVictor Perevertkin 2228a978a17SVictor Perevertkin _Must_inspect_result_ 2238a978a17SVictor Perevertkin virtual 2248a978a17SVictor Perevertkin NTSTATUS 2258a978a17SVictor Perevertkin FireAndForgetIrp( 2268a978a17SVictor Perevertkin __inout FxIrp* Irp 2278a978a17SVictor Perevertkin ); 2288a978a17SVictor Perevertkin 2298a978a17SVictor Perevertkin // 2308a978a17SVictor Perevertkin // The following are static member function. The only reason 2318a978a17SVictor Perevertkin // I've defined them as member functions at all is so they can see 2328a978a17SVictor Perevertkin // the private data in this class. 2338a978a17SVictor Perevertkin // 2348a978a17SVictor Perevertkin 2358a978a17SVictor Perevertkin _Must_inspect_result_ 2368a978a17SVictor Perevertkin static 2378a978a17SVictor Perevertkin NTSTATUS 2388a978a17SVictor Perevertkin _PnpCompleteIrp( 2398a978a17SVictor Perevertkin __in FxPkgPnp* This, 2408a978a17SVictor Perevertkin __inout FxIrp *Irp 2418a978a17SVictor Perevertkin ); 2428a978a17SVictor Perevertkin 2438a978a17SVictor Perevertkin _Must_inspect_result_ 2448a978a17SVictor Perevertkin static 2458a978a17SVictor Perevertkin NTSTATUS 2468a978a17SVictor Perevertkin _PnpQueryDeviceRelations( 2478a978a17SVictor Perevertkin __in FxPkgPnp* This, 2488a978a17SVictor Perevertkin __inout FxIrp *Irp 2498a978a17SVictor Perevertkin ); 2508a978a17SVictor Perevertkin 2518a978a17SVictor Perevertkin _Must_inspect_result_ 2528a978a17SVictor Perevertkin NTSTATUS 2538a978a17SVictor Perevertkin PnpQueryDeviceRelations( 2548a978a17SVictor Perevertkin __inout FxIrp *Irp 2558a978a17SVictor Perevertkin ); 2568a978a17SVictor Perevertkin 2578a978a17SVictor Perevertkin _Must_inspect_result_ 2588a978a17SVictor Perevertkin static 2598a978a17SVictor Perevertkin NTSTATUS 2608a978a17SVictor Perevertkin _PnpQueryInterface( 2618a978a17SVictor Perevertkin IN FxPkgPnp* This, 2628a978a17SVictor Perevertkin IN FxIrp *Irp 2638a978a17SVictor Perevertkin ); 2648a978a17SVictor Perevertkin 2658a978a17SVictor Perevertkin _Must_inspect_result_ 2668a978a17SVictor Perevertkin static 2678a978a17SVictor Perevertkin NTSTATUS 2688a978a17SVictor Perevertkin _PnpQueryCapabilities( 2698a978a17SVictor Perevertkin __inout FxPkgPnp* This, 2708a978a17SVictor Perevertkin __inout FxIrp *Irp 2718a978a17SVictor Perevertkin ); 2728a978a17SVictor Perevertkin 2738a978a17SVictor Perevertkin _Must_inspect_result_ 2748a978a17SVictor Perevertkin NTSTATUS 2758a978a17SVictor Perevertkin PnpQueryCapabilities( 2768a978a17SVictor Perevertkin __inout FxIrp *Irp 2778a978a17SVictor Perevertkin ); 2788a978a17SVictor Perevertkin 2798a978a17SVictor Perevertkin VOID 2808a978a17SVictor Perevertkin HandleQueryCapabilities( 2818a978a17SVictor Perevertkin __inout PDEVICE_CAPABILITIES ReportedCaps, 2828a978a17SVictor Perevertkin __in PDEVICE_CAPABILITIES ParentCaps 2838a978a17SVictor Perevertkin ); 2848a978a17SVictor Perevertkin 2858a978a17SVictor Perevertkin static 2868a978a17SVictor Perevertkin VOID 287*1f377076SVictor Perevertkin STDCALL 2888a978a17SVictor Perevertkin _QueryCapsWorkItem( 2898a978a17SVictor Perevertkin __in MdDeviceObject DeviceObject, 2908a978a17SVictor Perevertkin __in PVOID Context 2918a978a17SVictor Perevertkin ); 2928a978a17SVictor Perevertkin 2938a978a17SVictor Perevertkin _Must_inspect_result_ 2948a978a17SVictor Perevertkin static 2958a978a17SVictor Perevertkin NTSTATUS 2968a978a17SVictor Perevertkin _PnpQueryResources( 2978a978a17SVictor Perevertkin __inout FxPkgPnp* This, 2988a978a17SVictor Perevertkin __inout FxIrp *Irp 2998a978a17SVictor Perevertkin ); 3008a978a17SVictor Perevertkin 3018a978a17SVictor Perevertkin _Must_inspect_result_ 3028a978a17SVictor Perevertkin NTSTATUS 3038a978a17SVictor Perevertkin PnpQueryResources( 3048a978a17SVictor Perevertkin __inout FxIrp *Irp 3058a978a17SVictor Perevertkin ); 3068a978a17SVictor Perevertkin 3078a978a17SVictor Perevertkin _Must_inspect_result_ 3088a978a17SVictor Perevertkin static 3098a978a17SVictor Perevertkin NTSTATUS 3108a978a17SVictor Perevertkin _PnpQueryResourceRequirements( 3118a978a17SVictor Perevertkin __inout FxPkgPnp* This, 3128a978a17SVictor Perevertkin __inout FxIrp *Irp 3138a978a17SVictor Perevertkin ); 3148a978a17SVictor Perevertkin 3158a978a17SVictor Perevertkin _Must_inspect_result_ 3168a978a17SVictor Perevertkin NTSTATUS 3178a978a17SVictor Perevertkin PnpQueryResourceRequirements( 3188a978a17SVictor Perevertkin __inout FxIrp *Irp 3198a978a17SVictor Perevertkin ); 3208a978a17SVictor Perevertkin 3218a978a17SVictor Perevertkin _Must_inspect_result_ 3228a978a17SVictor Perevertkin static 3238a978a17SVictor Perevertkin NTSTATUS 3248a978a17SVictor Perevertkin _PnpQueryDeviceText( 3258a978a17SVictor Perevertkin __inout FxPkgPnp* This, 3268a978a17SVictor Perevertkin __inout FxIrp *Irp 3278a978a17SVictor Perevertkin ); 3288a978a17SVictor Perevertkin 3298a978a17SVictor Perevertkin _Must_inspect_result_ 3308a978a17SVictor Perevertkin static 3318a978a17SVictor Perevertkin NTSTATUS 3328a978a17SVictor Perevertkin _PnpFilterResourceRequirements( 3338a978a17SVictor Perevertkin __inout FxPkgPnp* This, 3348a978a17SVictor Perevertkin __inout FxIrp *Irp 3358a978a17SVictor Perevertkin ); 3368a978a17SVictor Perevertkin 3378a978a17SVictor Perevertkin _Must_inspect_result_ 3388a978a17SVictor Perevertkin static 3398a978a17SVictor Perevertkin NTSTATUS 3408a978a17SVictor Perevertkin _PnpEject( 3418a978a17SVictor Perevertkin __inout FxPkgPnp* This, 3428a978a17SVictor Perevertkin __inout FxIrp *Irp 3438a978a17SVictor Perevertkin ); 3448a978a17SVictor Perevertkin 3458a978a17SVictor Perevertkin virtual 3468a978a17SVictor Perevertkin BOOLEAN 3478a978a17SVictor Perevertkin PnpSendStartDeviceDownTheStackOverload( 3488a978a17SVictor Perevertkin VOID 3498a978a17SVictor Perevertkin ); 3508a978a17SVictor Perevertkin 3518a978a17SVictor Perevertkin virtual 3528a978a17SVictor Perevertkin WDF_DEVICE_PNP_STATE 3538a978a17SVictor Perevertkin PnpEventEjectHardwareOverload( 3548a978a17SVictor Perevertkin VOID 3558a978a17SVictor Perevertkin ); 3568a978a17SVictor Perevertkin 3578a978a17SVictor Perevertkin virtual 3588a978a17SVictor Perevertkin WDF_DEVICE_PNP_STATE 3598a978a17SVictor Perevertkin PnpEventCheckForDevicePresenceOverload( 3608a978a17SVictor Perevertkin VOID 3618a978a17SVictor Perevertkin ); 3628a978a17SVictor Perevertkin 3638a978a17SVictor Perevertkin virtual 3648a978a17SVictor Perevertkin WDF_DEVICE_PNP_STATE 3658a978a17SVictor Perevertkin PnpEventPdoRemovedOverload( 3668a978a17SVictor Perevertkin VOID 3678a978a17SVictor Perevertkin ); 3688a978a17SVictor Perevertkin 3698a978a17SVictor Perevertkin virtual 3708a978a17SVictor Perevertkin WDF_DEVICE_PNP_STATE 3718a978a17SVictor Perevertkin PnpEventFdoRemovedOverload( 3728a978a17SVictor Perevertkin VOID 3738a978a17SVictor Perevertkin ); 3748a978a17SVictor Perevertkin 3758a978a17SVictor Perevertkin virtual 3768a978a17SVictor Perevertkin VOID 3778a978a17SVictor Perevertkin PnpEventSurpriseRemovePendingOverload( 3788a978a17SVictor Perevertkin VOID 3798a978a17SVictor Perevertkin ); 3808a978a17SVictor Perevertkin 3818a978a17SVictor Perevertkin virtual 3828a978a17SVictor Perevertkin WDF_DEVICE_PNP_STATE 3838a978a17SVictor Perevertkin PnpGetPostRemoveState( 3848a978a17SVictor Perevertkin VOID 3858a978a17SVictor Perevertkin ); 3868a978a17SVictor Perevertkin 3878a978a17SVictor Perevertkin _Must_inspect_result_ 3888a978a17SVictor Perevertkin static 3898a978a17SVictor Perevertkin NTSTATUS 3908a978a17SVictor Perevertkin _PnpSetLock( 3918a978a17SVictor Perevertkin __inout FxPkgPnp* This, 3928a978a17SVictor Perevertkin __inout FxIrp *Irp 3938a978a17SVictor Perevertkin ); 3948a978a17SVictor Perevertkin 3958a978a17SVictor Perevertkin _Must_inspect_result_ 3968a978a17SVictor Perevertkin static 3978a978a17SVictor Perevertkin NTSTATUS 3988a978a17SVictor Perevertkin _PnpQueryId( 3998a978a17SVictor Perevertkin __inout FxPkgPnp* This, 4008a978a17SVictor Perevertkin __inout FxIrp *Irp 4018a978a17SVictor Perevertkin ); 4028a978a17SVictor Perevertkin 4038a978a17SVictor Perevertkin _Must_inspect_result_ 4048a978a17SVictor Perevertkin static 4058a978a17SVictor Perevertkin NTSTATUS 4068a978a17SVictor Perevertkin _PnpQueryPnpDeviceState( 4078a978a17SVictor Perevertkin __inout FxPkgPnp* This, 4088a978a17SVictor Perevertkin __inout FxIrp *Irp 4098a978a17SVictor Perevertkin ); 4108a978a17SVictor Perevertkin 4118a978a17SVictor Perevertkin _Must_inspect_result_ 4128a978a17SVictor Perevertkin static 4138a978a17SVictor Perevertkin NTSTATUS 4148a978a17SVictor Perevertkin _PnpQueryBusInformation( 4158a978a17SVictor Perevertkin __inout FxPkgPnp* This, 4168a978a17SVictor Perevertkin __inout FxIrp *Irp 4178a978a17SVictor Perevertkin ); 4188a978a17SVictor Perevertkin 4198a978a17SVictor Perevertkin _Must_inspect_result_ 4208a978a17SVictor Perevertkin static 4218a978a17SVictor Perevertkin NTSTATUS 4228a978a17SVictor Perevertkin _PnpSurpriseRemoval( 4238a978a17SVictor Perevertkin __inout FxPkgPnp* This, 4248a978a17SVictor Perevertkin __inout FxIrp *Irp 4258a978a17SVictor Perevertkin ); 4268a978a17SVictor Perevertkin 4278a978a17SVictor Perevertkin static 4288a978a17SVictor Perevertkin _Must_inspect_result_ 4298a978a17SVictor Perevertkin NTSTATUS 4308a978a17SVictor Perevertkin _DispatchPowerSequence( 4318a978a17SVictor Perevertkin __inout FxPkgPnp* This, 4328a978a17SVictor Perevertkin __in FxIrp *Irp 4338a978a17SVictor Perevertkin ); 4348a978a17SVictor Perevertkin 4358a978a17SVictor Perevertkin static 4368a978a17SVictor Perevertkin _Must_inspect_result_ 4378a978a17SVictor Perevertkin NTSTATUS 4388a978a17SVictor Perevertkin _DispatchSetPower( 4398a978a17SVictor Perevertkin __inout FxPkgPnp* This, 4408a978a17SVictor Perevertkin __in FxIrp *Irp 4418a978a17SVictor Perevertkin ); 4428a978a17SVictor Perevertkin 4438a978a17SVictor Perevertkin _Must_inspect_result_ 4448a978a17SVictor Perevertkin NTSTATUS 4458a978a17SVictor Perevertkin DispatchSystemSetPower( 4468a978a17SVictor Perevertkin __in FxIrp *Irp 4478a978a17SVictor Perevertkin ); 4488a978a17SVictor Perevertkin 4498a978a17SVictor Perevertkin _Must_inspect_result_ 4508a978a17SVictor Perevertkin NTSTATUS 4518a978a17SVictor Perevertkin DispatchDeviceSetPower( 4528a978a17SVictor Perevertkin __in FxIrp *Irp 4538a978a17SVictor Perevertkin ); 4548a978a17SVictor Perevertkin 4558a978a17SVictor Perevertkin static 4568a978a17SVictor Perevertkin _Must_inspect_result_ 4578a978a17SVictor Perevertkin NTSTATUS 4588a978a17SVictor Perevertkin _DispatchQueryPower( 4598a978a17SVictor Perevertkin __inout FxPkgPnp* This, 4608a978a17SVictor Perevertkin __in FxIrp *Irp 4618a978a17SVictor Perevertkin ); 4628a978a17SVictor Perevertkin 4638a978a17SVictor Perevertkin virtual 4648a978a17SVictor Perevertkin _Must_inspect_result_ 4658a978a17SVictor Perevertkin NTSTATUS 4668a978a17SVictor Perevertkin PowerCheckParentOverload( 4678a978a17SVictor Perevertkin __in BOOLEAN* ParentOn 4688a978a17SVictor Perevertkin ); 4698a978a17SVictor Perevertkin 4708a978a17SVictor Perevertkin virtual 4718a978a17SVictor Perevertkin WDF_DEVICE_POWER_STATE 4728a978a17SVictor Perevertkin PowerCheckDeviceTypeOverload( 4738a978a17SVictor Perevertkin VOID 4748a978a17SVictor Perevertkin ); 4758a978a17SVictor Perevertkin 4768a978a17SVictor Perevertkin virtual 4778a978a17SVictor Perevertkin WDF_DEVICE_POWER_STATE 4788a978a17SVictor Perevertkin PowerCheckDeviceTypeNPOverload( 4798a978a17SVictor Perevertkin VOID 4808a978a17SVictor Perevertkin ); 4818a978a17SVictor Perevertkin 4828a978a17SVictor Perevertkin virtual 4838a978a17SVictor Perevertkin _Must_inspect_result_ 4848a978a17SVictor Perevertkin NTSTATUS 4858a978a17SVictor Perevertkin PowerEnableWakeAtBusOverload( 4868a978a17SVictor Perevertkin VOID 4878a978a17SVictor Perevertkin ); 4888a978a17SVictor Perevertkin 4898a978a17SVictor Perevertkin virtual 4908a978a17SVictor Perevertkin VOID 4918a978a17SVictor Perevertkin PowerDisableWakeAtBusOverload( 4928a978a17SVictor Perevertkin VOID 4938a978a17SVictor Perevertkin ); 4948a978a17SVictor Perevertkin 4958a978a17SVictor Perevertkin virtual 4968a978a17SVictor Perevertkin VOID 4978a978a17SVictor Perevertkin PowerParentPowerDereference( 4988a978a17SVictor Perevertkin VOID 4998a978a17SVictor Perevertkin ); 5008a978a17SVictor Perevertkin 5018a978a17SVictor Perevertkin virtual 5028a978a17SVictor Perevertkin VOID 5038a978a17SVictor Perevertkin PowerReleasePendingDeviceIrp( 5048a978a17SVictor Perevertkin __in BOOLEAN IrpMustBePresent = TRUE 5058a978a17SVictor Perevertkin ); 5068a978a17SVictor Perevertkin 5078a978a17SVictor Perevertkin _Must_inspect_result_ 5088a978a17SVictor Perevertkin virtual 5098a978a17SVictor Perevertkin NTSTATUS 5108a978a17SVictor Perevertkin ProcessRemoveDeviceOverload( 5118a978a17SVictor Perevertkin __inout FxIrp* Irp 5128a978a17SVictor Perevertkin ); 5138a978a17SVictor Perevertkin 5148a978a17SVictor Perevertkin virtual 5158a978a17SVictor Perevertkin VOID 5168a978a17SVictor Perevertkin DeleteSymbolicLinkOverload( 5178a978a17SVictor Perevertkin __in BOOLEAN GracefulRemove 5188a978a17SVictor Perevertkin ); 5198a978a17SVictor Perevertkin 5208a978a17SVictor Perevertkin virtual 5218a978a17SVictor Perevertkin VOID QueryForReenumerationInterface(VOID)5228a978a17SVictor Perevertkin QueryForReenumerationInterface( 5238a978a17SVictor Perevertkin VOID 5248a978a17SVictor Perevertkin ) 5258a978a17SVictor Perevertkin { 5268a978a17SVictor Perevertkin // 5278a978a17SVictor Perevertkin // As the PDO, we already have the interface built in 5288a978a17SVictor Perevertkin // 5298a978a17SVictor Perevertkin DO_NOTHING(); 5308a978a17SVictor Perevertkin } 5318a978a17SVictor Perevertkin 5328a978a17SVictor Perevertkin virtual 5338a978a17SVictor Perevertkin VOID ReleaseReenumerationInterface(VOID)5348a978a17SVictor Perevertkin ReleaseReenumerationInterface( 5358a978a17SVictor Perevertkin VOID 5368a978a17SVictor Perevertkin ) 5378a978a17SVictor Perevertkin { 5388a978a17SVictor Perevertkin // 5398a978a17SVictor Perevertkin // As the PDO, we already have the interface built in 5408a978a17SVictor Perevertkin // 5418a978a17SVictor Perevertkin DO_NOTHING(); 5428a978a17SVictor Perevertkin } 5438a978a17SVictor Perevertkin 5448a978a17SVictor Perevertkin _Must_inspect_result_ 5458a978a17SVictor Perevertkin virtual 5468a978a17SVictor Perevertkin NTSTATUS 5478a978a17SVictor Perevertkin AskParentToRemoveAndReenumerate( 5488a978a17SVictor Perevertkin VOID 5498a978a17SVictor Perevertkin ); 5508a978a17SVictor Perevertkin 5518a978a17SVictor Perevertkin _Must_inspect_result_ 5528a978a17SVictor Perevertkin virtual 5538a978a17SVictor Perevertkin NTSTATUS 5548a978a17SVictor Perevertkin QueryForPowerThread( 5558a978a17SVictor Perevertkin VOID 5568a978a17SVictor Perevertkin ); 5578a978a17SVictor Perevertkin 5588a978a17SVictor Perevertkin virtual 5598a978a17SVictor Perevertkin const PFN_PNP_POWER_CALLBACK* GetDispatchPnp(VOID)5608a978a17SVictor Perevertkin GetDispatchPnp( 5618a978a17SVictor Perevertkin VOID 5628a978a17SVictor Perevertkin ) 5638a978a17SVictor Perevertkin { 5648a978a17SVictor Perevertkin return m_PdoPnpFunctionTable; 5658a978a17SVictor Perevertkin } 5668a978a17SVictor Perevertkin 5678a978a17SVictor Perevertkin virtual 5688a978a17SVictor Perevertkin const PFN_PNP_POWER_CALLBACK* GetDispatchPower(VOID)5698a978a17SVictor Perevertkin GetDispatchPower( 5708a978a17SVictor Perevertkin VOID 5718a978a17SVictor Perevertkin ) 5728a978a17SVictor Perevertkin { 5738a978a17SVictor Perevertkin return m_PdoPowerFunctionTable; 5748a978a17SVictor Perevertkin } 5758a978a17SVictor Perevertkin 5768a978a17SVictor Perevertkin static 5778a978a17SVictor Perevertkin VOID 578*1f377076SVictor Perevertkin STDCALL 5798a978a17SVictor Perevertkin _RemoveAndReenumerateSelf( 5808a978a17SVictor Perevertkin __in PVOID Context 5818a978a17SVictor Perevertkin ); 5828a978a17SVictor Perevertkin 5838a978a17SVictor Perevertkin VOID 5848a978a17SVictor Perevertkin PowerNotifyParentChildWakeArmed( 5858a978a17SVictor Perevertkin VOID 5868a978a17SVictor Perevertkin ); 5878a978a17SVictor Perevertkin 5888a978a17SVictor Perevertkin VOID 5898a978a17SVictor Perevertkin PowerNotifyParentChildWakeDisarmed( 5908a978a17SVictor Perevertkin VOID 5918a978a17SVictor Perevertkin ); 5928a978a17SVictor Perevertkin }; 5938a978a17SVictor Perevertkin 5948a978a17SVictor Perevertkin #endif // _FXPKGPDO_H 595