ReactOS 0.4.15-dev-7788-g1ad9096
fxwmiapi.cpp File Reference
#include "fxwmipch.hpp"
#include "fxwmiapi.tmh"
Include dependency graph for fxwmiapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (DISPATCH_LEVEL) NTSTATUS WDFEXPORT(WdfWmiProviderCreate)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice)
 
 FxPointerNotNull (GetFxDriverGlobals(DriverGlobals), WmiProviderConfig)
 
 FxPointerNotNull (GetFxDriverGlobals(DriverGlobals), WmiProvider)
 
 if (pDevice->m_PkgPnp->IsPowerPolicyOwner())
 
 FxPointerNotNull (pFxDriverGlobals, InstanceConfig)
 
 if (InstanceConfig->Size !=sizeof(WDF_WMI_INSTANCE_CONFIG))
 
 if (InstanceConfig->Provider==NULL &&InstanceConfig->ProviderConfig==NULL)
 
else if (InstanceConfig->Provider !=NULL &&InstanceConfig->ProviderConfig !=NULL)
 
 if (!NT_SUCCESS(status))
 
 if (NT_SUCCESS(status) &&InstanceConfig->Register)
 
 if (NT_SUCCESS(status))
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), WmiProvider, FX_TYPE_WMI_PROVIDER,(PVOID *) &pProvider)
 
return pProvider GetDevice () -> GetHandle()
 
return pProvider IsEnabled (ProviderControl)
 
return pProvider GetTracingHandle ()
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), WmiInstance, FX_TYPE_WMI_INSTANCE,(PVOID *) &pInstance)
 
return pProvider AddInstance (pInstance)
 
pProvider RemoveInstance (pInstance)
 
return pInstance GetProvider () -> GetHandle()
 
_Must_inspect_result_ __drv_maxIRQL (APC_LEVEL) NTSTATUS WDFEXPORT(WdfWmiInstanceFireEvent)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
_Must_inspect_result_ __in WDFWMIINSTANCE __in_opt ULONG __in_bcount_opt (EventDataSize) PVOID EventData)
 

Variables

_Must_inspect_result_ __in WDFDEVICE Device
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_WMI_PROVIDER_CONFIG WmiProviderConfig
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_WMI_PROVIDER_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES ProviderAttributes
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_WMI_PROVIDER_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFWMIPROVIDER * WmiProvider
 
FxPowerPolicyOwnerSettingsownerSettings
 
FxWmiProviderpProvider = pInstance->GetProvider()
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_WMI_INSTANCE_CONFIG InstanceConfig
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_WMI_INSTANCE_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES InstanceAttributes
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_WMI_INSTANCE_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES __out_opt WDFWMIINSTANCE * Instance
 
FxWmiInstanceExternalpInstance = NULL
 
WDFWMIINSTANCE hInstance
 
NTSTATUS status
 
 pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
 else
 
WDFWMIPROVIDER hProvider = NULL
 
__in WDFWMIPROVIDER __in WDF_WMI_PROVIDER_CONTROL ProviderControl
 
_Must_inspect_result_ __in WDFWMIINSTANCE WmiInstance
 
_Must_inspect_result_ __in WDFWMIINSTANCE __in_opt ULONG EventDataSize
 

Function Documentation

◆ __drv_maxIRQL() [1/2]

_Must_inspect_result_ __drv_maxIRQL ( APC_LEVEL  )

◆ __drv_maxIRQL() [2/2]

◆ __in_bcount_opt()

_Must_inspect_result_ __in WDFWMIINSTANCE __in_opt ULONG __in_bcount_opt ( EventDataSize  )

Definition at line 405 of file fxwmiapi.cpp.

422{
425
429 (PVOID*) &pInstance);
430
432 if (!NT_SUCCESS(status)) {
433 return status;
434 }
435
436 return pInstance->FireEvent(EventData, EventDataSize);
437}
LONG NTSTATUS
Definition: precomp.h:26
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
_Must_inspect_result_ NTSTATUS FireEvent(__in_bcount_opt(EventBufferSize) PVOID EventBuffer, __inout ULONG EventBufferSize)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define APC_LEVEL
Definition: env_spec_w32.h:695
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
@ FX_TYPE_WMI_INSTANCE
Definition: fxtypes.h:87
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
NTSTATUS status
Definition: fxwmiapi.cpp:115
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice)
FxWmiInstanceExternal * pInstance
Definition: fxwmiapi.cpp:113
Definition: ps.c:97
_Must_inspect_result_ _In_ WDFWMIINSTANCE WmiInstance
Definition: wdfwmi.h:514
_Must_inspect_result_ _In_ WDFWMIINSTANCE _In_opt_ ULONG EventDataSize
Definition: wdfwmi.h:617

◆ AddInstance()

return pProvider AddInstance ( pInstance  )

◆ FxObjectHandleGetPtr() [1/3]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Device  ,
FX_TYPE_DEVICE  ,
(PVOID *) &  pDevice 
)

Referenced by __in_bcount_opt().

◆ FxObjectHandleGetPtr() [2/3]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
WmiInstance  ,
FX_TYPE_WMI_INSTANCE  ,
(PVOID *) &  pInstance 
)

◆ FxObjectHandleGetPtr() [3/3]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
WmiProvider  ,
FX_TYPE_WMI_PROVIDER  ,
(PVOID *) &  pProvider 
)

◆ FxPointerNotNull() [1/3]

FxPointerNotNull ( GetFxDriverGlobals(DriverGlobals ,
WmiProvider   
)

◆ FxPointerNotNull() [2/3]

FxPointerNotNull ( GetFxDriverGlobals(DriverGlobals ,
WmiProviderConfig   
)

◆ FxPointerNotNull() [3/3]

FxPointerNotNull ( pFxDriverGlobals  ,
InstanceConfig   
)

◆ GetDevice()

return pProvider GetDevice ( ) -> GetHandle()

◆ GetProvider()

return pInstance GetProvider ( ) -> GetHandle()

Referenced by Chkdsk(), and FormatEx().

◆ GetTracingHandle()

return pProvider GetTracingHandle ( )

◆ if() [1/7]

if ( NT_SUCCESSstatus)

Definition at line 204 of file fxwmiapi.cpp.

204 {
205 return status;
206 }

◆ if() [2/7]

if ( InstanceConfig->Provider = NULL && InstanceConfig->ProviderConfig != NULL)

Definition at line 142 of file fxwmiapi.cpp.

143 {
145
148 "InstanceConfig %p Provider %p and ProviderConfig %p are both not "
149 "NULL, only one can be, %!STATUS!", InstanceConfig,
150 InstanceConfig->Provider, InstanceConfig->ProviderConfig, status);
151
152 return status;
153 }
#define TRACINGDEVICE
Definition: dbgtrace.h:58
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
pFxDriverGlobals
Definition: fxwmiapi.cpp:117
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG InstanceConfig
Definition: wdfwmi.h:476

◆ if() [3/7]

if ( InstanceConfig->  Provider = NULL && InstanceConfig->ProviderConfig == NULL)

Definition at line 131 of file fxwmiapi.cpp.

132 {
134
137 "InstanceConfig %p Provider and ProviderConfig are both NULL, only "
138 "one can be, %!STATUS!", InstanceConfig, status);
139
140 return status;
141 }

◆ if() [4/7]

Definition at line 122 of file fxwmiapi.cpp.

122 {
125 "Expected InstanceConfig Size %d, got %d, %!STATUS!",
126 InstanceConfig->Size, sizeof(*InstanceConfig),
127 status);
128 return status;
129 }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133

◆ if() [5/7]

if ( NT_SUCCESS(status) &&InstanceConfig->  Register)

Definition at line 221 of file fxwmiapi.cpp.

221 {
223 }
_Must_inspect_result_ NTSTATUS AddInstance(__in FxWmiInstance *Instance, __in BOOLEAN NoErrorIfPresent=FALSE)
FxWmiProvider * pProvider
Definition: fxwmiapi.cpp:54

◆ if() [6/7]

if ( NT_SUCCESS(status )

Definition at line 225 of file fxwmiapi.cpp.

225 {
226 if (Instance != NULL) {
228 }
229 }
#define NULL
Definition: types.h:112
WDFWMIINSTANCE hInstance
Definition: fxwmiapi.cpp:114
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481

◆ if() [7/7]

if ( pDevice->m_PkgPnp->  IsPowerPolicyOwner() = FALSE)

Definition at line 69 of file fxwmiapi.cpp.

69 {
71
73 &GUID_POWER_DEVICE_ENABLE) &&
75
77 &GUID_POWER_DEVICE_WAKE_ENABLE) &&
79
81 TRACINGDEVICE, "WMI Guid already registered by "
82 "framework");
84 }
85 }
FxPkgPnp * m_PkgPnp
Definition: fxdevice.hpp:670
FxPowerPolicyMachine m_PowerPolicyMachine
Definition: fxpkgpnp.hpp:4153
FxDevice * pDevice
_Must_inspect_result_ BOOLEAN __inline FxIsEqualGuid(__in CONST GUID *Lhs, __in CONST GUID *Rhs)
Definition: fxglobals.h:977
FxPowerPolicyOwnerSettings * ownerSettings
Definition: fxwmiapi.cpp:53
#define STATUS_WMI_GUID_DISCONNECTED
Definition: ntstatus.h:877
FxPowerPolicyOwnerSettings * m_Owner
FxWmiInstanceInternal * WmiInstance
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG WmiProviderConfig
Definition: wdfwmi.h:358

◆ IsEnabled()

◆ RemoveInstance()

pProvider RemoveInstance ( pInstance  )

Variable Documentation

◆ Device

Definition at line 43 of file fxwmiapi.cpp.

◆ else

else
Initial value:

Definition at line 162 of file fxwmiapi.cpp.

◆ EventDataSize

Definition at line 404 of file fxwmiapi.cpp.

◆ hInstance

WDFWMIINSTANCE hInstance

Definition at line 114 of file fxwmiapi.cpp.

Referenced by if().

◆ hProvider

hProvider = NULL

◆ Instance

◆ InstanceAttributes

◆ InstanceConfig

◆ ownerSettings

FxPowerPolicyOwnerSettings * ownerSettings

Definition at line 53 of file fxwmiapi.cpp.

Referenced by if().

◆ pFxDriverGlobals

pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)

Definition at line 117 of file fxwmiapi.cpp.

Referenced by if().

◆ pInstance

◆ pProvider

◆ ProviderAttributes

◆ ProviderControl

Initial value:

Definition at line 280 of file fxwmiapi.cpp.

◆ status

Initial value:
InstanceConfig->ProviderConfig,
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS CallersGlobals, __in WDFDEVICE Device, __in_opt PWDF_OBJECT_ATTRIBUTES ProviderAttributes, __in PWDF_WMI_PROVIDER_CONFIG WmiProviderConfig, __out WDFWMIPROVIDER *WmiProvider, __out FxWmiProvider **Provider)
WDFWMIPROVIDER hProvider
Definition: fxwmiapi.cpp:165
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474

Definition at line 115 of file fxwmiapi.cpp.

Referenced by __in_bcount_opt(), and if().

◆ WmiInstance

Initial value:

Definition at line 319 of file fxwmiapi.cpp.

◆ WmiProvider

__in WDFWMIPROVIDER WmiProvider
Initial value:

Definition at line 49 of file fxwmiapi.cpp.

◆ WmiProviderConfig