ReactOS  0.4.15-dev-3175-g222acf5
fxwmiprovider.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxWmiDataBlock.hpp
8 
9 Abstract:
10 
11  This module implements the WMI data block object
12 
13 Author:
14 
15 
16 
17 
18 Environment:
19 
20  Both kernel and user mode
21 
22 Revision History:
23 
24 
25 --*/
26 
27 #ifndef _FXWMIPROVIDER_H_
28 #define _FXWMIPROVIDER_H_
29 
30 
32 
34 
36  PFX_DRIVER_GLOBALS FxDriverGlobals
37  ) :
38  FxCallback(FxDriverGlobals),
39  m_Method(NULL)
40  {
41  }
42 
44  {
45  }
46 
48  NTSTATUS
50  __in WDFDEVICE Device,
51  __in WDFWMIPROVIDER WmiProvider,
54  )
55  {
57 
59 
60  if (m_Method != NULL) {
61  CallbackStart();
63  CallbackEnd();
64  }
65  else {
67  }
68 
69  return status;
70  }
71 };
72 
74 
76 
77 public:
79  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
82  );
83 
85 
86  static
88  NTSTATUS
89  _Create(
90  __in PFX_DRIVER_GLOBALS CallersGlobals,
91  __in WDFDEVICE Device,
94  __out WDFWMIPROVIDER* WmiProvider,
96  );
97 
98  CfxDevice*
100  VOID
101  )
102  {
103  return m_Parent->GetDevice();
104  }
105 
106  GUID*
108  VOID
109  )
110  {
111  return &m_Guid;
112  }
113 
114  ULONG
116  VOID
117  )
118  {
119  return m_Flags;
120  }
121 
122  ULONG
124  VOID
125  )
126  {
128  }
129 
130  ULONG
132  VOID
133  );
134 
135  BOOLEAN
137  VOID
138  )
139  {
141  }
142 
143  BOOLEAN
146  )
147  {
148  switch (Control) {
151  default: ASSERT(FALSE); return FALSE;
152  }
153  }
154 
155  ULONGLONG
157  VOID
158  )
159  {
160  return m_TracingHandle;
161  }
162 
163  VOID
165  __in ULONGLONG TracingHandle
166  )
167  {
168  m_TracingHandle = TracingHandle;
169  }
170 
171  WDFWMIPROVIDER
173  VOID
174  )
175  {
176  return (WDFWMIPROVIDER) GetObjectHandle();
177  }
178 
179  BOOLEAN
181  VOID
182  )
183  {
184  return m_FunctionControl.m_Method != NULL;
185  }
186 
188  NTSTATUS
192  );
193 
195  NTSTATUS
196  AddInstance(
198  __in BOOLEAN NoErrorIfPresent = FALSE
199  );
200 
201  VOID
204  );
205 
206  ULONG
209  );
210 
214  __in ULONG Index,
215  __in PVOID Tag
216  );
217 
221  __in ULONG Index,
222  __in PVOID Tag
223  );
224 
225  // begin FxObject overrides
226  virtual
227  BOOLEAN
228  Dispose(
229  VOID
230  );
231  // end FxObject overrides
232 
233 protected:
237  };
238 
240  NTSTATUS
243  __in BOOLEAN NoErrorIfPresent,
246  );
247 
248 protected:
249  //
250  // List entry used by FxWmiIrpHandler to hold the list of WMI providers
251  //
253 
255 
257 
259 
261 
262 
263 
264 
265 
267 
269 
270  union {
271  //
272  // Set with values from WDF_WMI_PROVIDER_FLAGS
273  //
275 
276  //
277  // Not used by the code, but by the debug extension
278  //
279  struct {
283  } m_FlagsByName;
284  };
285 
287 
289 
291 
293 };
294 
295 #endif // _FXWMIPROVIDER_H_
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG WmiProviderConfig
Definition: wdfwmi.h:356
ULONG GetMinInstanceBufferSize(VOID)
#define FLAG_TO_BOOL(_Flags, _FlagMask)
Definition: fxobject.hpp:125
__inline CfxDevice * GetDevice(VOID)
Definition: fxpackage.hpp:46
FxWmiProviderFunctionControlCallback(PFX_DRIVER_GLOBALS FxDriverGlobals)
#define __in_opt
Definition: dbghelp.h:38
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
WDF_EXTERN_C_START enum _WDF_WMI_PROVIDER_CONTROL WDF_WMI_PROVIDER_CONTROL
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
ULONG GetRegistrationFlagsLocked(VOID)
EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL * PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL
Definition: wdfwmi.h:171
FxWmiProviderFunctionControlCallback m_FunctionControl
VOID SetTracingHandle(__in ULONGLONG TracingHandle)
BOOLEAN m_DataBlockControlEnabled
GUID * GetGUID(VOID)
PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL m_Method
#define FALSE
Definition: types.h:117
CfxDevice * GetDevice(VOID)
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603
#define __out
Definition: dbghelp.h:62
_Must_inspect_result_ FxWmiInstance * GetInstanceReferenced(__in ULONG Index, __in PVOID Tag)
_Must_inspect_result_ NTSTATUS AddInstanceLocked(__in FxWmiInstance *Instance, __in BOOLEAN NoErrorIfPresent, __out PBOOLEAN Update, __in AddInstanceAction Action=AddInstanceToTail)
BOOLEAN IsFunctionControlSupported(VOID)
unsigned char BOOLEAN
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166
ULONG GetInstanceIndex(__in FxWmiInstance *Instance)
ULONG m_MinInstanceBufferSize
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWMIPROVIDER * WmiProvider
Definition: wdfwmi.h:356
VOID RemoveInstance(__in FxWmiInstance *Instance)
LIST_ENTRY m_InstanceListHead
friend FxWmiIrpHandler
#define ASSERT(a)
Definition: mode.c:44
_In_ WDFCOLLECTION _In_ ULONG Index
uint64_t ULONGLONG
Definition: typedefs.h:67
BOOLEAN m_EventControlEnabled
BOOLEAN m_RemoveGuid
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES ProviderAttributes
Definition: wdfwmi.h:356
struct FxWmiProvider::@4578::@4580 m_FlagsByName
_Must_inspect_result_ FxWmiInstance * GetInstanceReferencedLocked(__in ULONG Index, __in PVOID Tag)
char * PBOOLEAN
Definition: retypes.h:11
virtual BOOLEAN Dispose(VOID)
BOOLEAN IsEnabled(__in WDF_WMI_PROVIDER_CONTROL Control)
BOOLEAN IsEventOnly(VOID)
Definition: typedefs.h:119
FxWmiProvider(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_WMI_PROVIDER_CONFIG Config, __in CfxDevice *Device)
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
ULONGLONG GetTracingHandle(VOID)
_Must_inspect_result_ NTSTATUS FunctionControl(__in WDF_WMI_PROVIDER_CONTROL Control, __in BOOLEAN Enable)
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:506
ULONG GetFlags(VOID)
#define NULL
Definition: types.h:112
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDFWMIPROVIDER WmiProvider, __in WDF_WMI_PROVIDER_CONTROL Control, __in BOOLEAN Enable)
LIST_ENTRY m_ListEntry
FxWmiIrpHandler * m_Parent
unsigned int ULONG
Definition: retypes.h:1
void __inline CallbackStart(VOID)
Definition: fxcallback.hpp:64
#define STATUS_SUCCESS
Definition: shellext.h:65
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 GetHandle(VOID)
_Must_inspect_result_ NTSTATUS AddInstance(__in FxWmiInstance *Instance, __in BOOLEAN NoErrorIfPresent=FALSE)
#define __in
Definition: dbghelp.h:35
static SERVICE_STATUS status
Definition: service.c:31
ULONGLONG m_TracingHandle
void __inline CallbackEnd(VOID)
Definition: fxcallback.hpp:74
IN PVOID Instance
Definition: pci.h:361
Definition: ps.c:97