4#include "../pnppriv.hpp"
10#if defined(EVENT_TRACING)
11#include "FxPkgPnpUM.tmh"
63 IWudfDeviceStack* devStack;
64 WmiIdleWakeInstanceUpdate updateType;
71 updateType = ForS0Idle ? AddS0IdleInstance : AddSxWakeInstance;
73 updateType = ForS0Idle ? RemoveS0IdleInstance : RemoveSxWakeInstance;
76 hr = devStack->UpdateIdleWakeWmiInstance(updateType);
81 PUMDF_VERSION_DATA driverVersion = devStack->GetMinDriverVersion();
83 devStack->ShouldPreserveIrpCompletionStatusCompatibility();
85 status = CHostFxUtil::NtStatusFromHr(
hr,
86 driverVersion->MajorNumber,
87 driverVersion->MinorNumber,
95 "failed to send ioctl to update %s WMI instance "
97 ForS0Idle ?
"S0Idle" :
"SxWake",
115 IWudfDeviceStack* devStack;
134 "RegOpenKeyEx returned error %d",
150 "failed to read registry, "
151 "RegQueryValueEx returned error %d",
160 if (
NULL != pwrPolKey) {
168 PUMDF_VERSION_DATA driverVersion = devStack->GetMinDriverVersion();
169 BOOL preserveCompat =
170 devStack->ShouldPreserveIrpCompletionStatusCompatibility();
173 driverVersion->MajorNumber,
174 driverVersion->MinorNumber,
191 IWudfDeviceStack* devStack;
192 UMINT::WDF_PROPERTY_STORE_ROOT propertyStore;
202 propertyStore.LengthCb =
sizeof(UMINT::WDF_PROPERTY_STORE_ROOT);
203 propertyStore.RootClass = UMINT::WdfPropertyStoreRootClassHardwareKey;
206 hr = devStack->CreateRegistryEntry(&propertyStore,
207 UMINT::WdfPropertyStoreCreateIfMissing,
230 "Failed to set Registry value "
231 "for S0Idle/SxWake error %d",
#define RegCloseKey(hKey)
IWudfDeviceStack * GetDeviceStack(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
VOID RevokeDmaEnablerResources(__in FxDmaEnabler *Enabler)
NTSTATUS UpdateWmiInstance(_In_ FxWmiInstanceAction Action, _In_ BOOLEAN ForS0Idle)
VOID ReadRegistrySxWake(__in PCUNICODE_STRING ValueName, __out BOOLEAN *Enabled)
NTSTATUS FilterResourceRequirements(__in IO_RESOURCE_REQUIREMENTS_LIST **IoList)
VOID RemoveDmaEnabler(__in FxDmaEnabler *Enabler)
NTSTATUS ReadStateFromRegistry(_In_ PCUNICODE_STRING ValueName, _Out_ PULONG Value)
VOID ReadRegistryS0Idle(__in PCUNICODE_STRING ValueName, __out BOOLEAN *Enabled)
_Must_inspect_result_ NTSTATUS AllocateDmaEnablerList(VOID)
NTSTATUS UpdateWmiInstanceForSxWake(__in FxWmiInstanceAction Action)
NTSTATUS UpdateWmiInstanceForS0Idle(__in FxWmiInstanceAction Action)
VOID AddDmaEnabler(__in FxDmaEnabler *Enabler)
VOID WriteStateToRegistry(__in HANDLE RegKey, __in PUNICODE_STRING ValueName, __in ULONG Value)
#define STATUS_NOT_IMPLEMENTED
#define WUDF_POWER_POLICY_SETTINGS
#define NT_SUCCESS(StatCode)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
VOID PnpPassThroughQIWorker(__in MxDeviceObject *Device, __inout FxIrp *Irp, __inout FxIrp *ForwardIrp)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define _Must_inspect_result_
#define ASSERTMSG(msg, exp)
#define UNREFERENCED_PARAMETER(P)
#define TRACE_LEVEL_ERROR
_Must_inspect_result_ _In_ WDFDEVICE Device
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define HRESULT_FROM_WIN32(x)