ReactOS 0.4.16-dev-91-g764881a
FxWmiInstanceExternal Class Reference

#include <fxwmiinstance.hpp>

Inheritance diagram for FxWmiInstanceExternal:
Collaboration diagram for FxWmiInstanceExternal:

Public Member Functions

 FxWmiInstanceExternal (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_WMI_INSTANCE_CONFIG Config, __in FxWmiProvider *Provider)
 
VOID SetContextForQueryLength (__in ULONG ContextSize)
 
- Public Member Functions inherited from FxWmiInstance
 FxWmiInstance (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ObjectSize, __in FxWmiProvider *Provider)
 
 ~FxWmiInstance ()
 
CfxDeviceGetDevice (VOID)
 
FxWmiProviderGetProvider (VOID)
 
_Must_inspect_result_ NTSTATUS FireEvent (__in_bcount_opt(EventBufferSize) PVOID EventBuffer, __inout ULONG EventBufferSize)
 
BOOLEAN IsEnabled (__in WDF_WMI_PROVIDER_CONTROL Control)
 
WDFWMIINSTANCE GetHandle (VOID)
 
virtual BOOLEAN IsQueryInstanceSupported (VOID)=0
 
virtual _Must_inspect_result_ __drv_sameIRQL __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS QueryInstance(__in ULONG OutBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __out_bcount_part (OutBufferSize, *BufferUsed) PVOID OutBuffer
 
virtual BOOLEAN IsSetInstanceSupported (VOID)=0
 
virtual _Must_inspect_result_ __drv_sameIRQL __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS SetInstance(__in ULONG InBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __in_bcount (InBufferSize) PVOID InBuffer)=0
 
virtual BOOLEAN IsSetItemSupported (VOID)=0
 
virtual _Must_inspect_result_ __drv_sameIRQL __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS SetItem(__in ULONG DataItemId
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __in_bcount (InBufferSize) PVOID InBuffer)=0
 
virtual BOOLEAN IsExecuteMethodSupported (VOID)=0
 
virtual _Must_inspect_result_ __drv_sameIRQL __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS ExecuteMethod(__in ULONG MethodId
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG __drv_when (InBufferSize >=OutBufferSize, __inout_bcount(InBufferSize)) __drv_when(InBufferSize< OutBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG __inout_bcount (OutBufferSize)) PVOID Buffer
 
virtual BOOLEAN Dispose (VOID)
 
- Public Member Functions inherited from FxNonPagedObject
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
virtual ~FxNonPagedObject (VOID)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) VOID Lock(__out __drv_deref(__drv_savesIRQL) PKIRQL PreviousIrql)
 
 _Releases_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID Unlock(__in __drv_restoresIRQL KIRQL PreviousIrql)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) VOID LockAtDispatch(VOID)
 
 _Requires_lock_held_ (this->m_NPLock.m_Lock) _Releases_lock_(this -> m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID UnlockFromDispatch(VOID)
 
- Public Member Functions inherited from FxObject
PVOID GetCOMWrapper ()
 
void SetCOMWrapper (__drv_aliasesMem PVOID Wrapper)
 
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxObject (VOID)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType Type)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize=0)
 
VOID operator delete (__in PVOID Memory)
 
VOID SetNoContextHeader (VOID)
 
PVOID __inline GetObjectHandle (VOID)
 
__inline FxContextHeaderGetContextHeader (VOID)
 
__inline PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)
 
WDFTYPE GetType (VOID)
 
USHORT GetObjectSize (VOID)
 
LONG GetRefCnt (VOID)
 
FxTagTrackerGetTagTracker (VOID)
 
CfxDeviceGetDevice (VOID)
 
CfxDeviceBaseGetDeviceBase (VOID)
 
VOID SetDeviceBase (__in CfxDeviceBase *DeviceBase)
 
__inline VOID CallCleanup (VOID)
 
ULONG __inline AddRef (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG Release (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG AddRefOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG ReleaseOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual _Must_inspect_result_ NTSTATUS QueryInterface (__in FxQueryInterfaceParams *Params)
 
VOID MarkTraceState (VOID)
 
BOOLEAN __inline IsTraceState (VOID)
 
VOID __inline TraceDroppedEvent (__in FxObjectDroppedEvent Event)
 
VOID MarkPassiveDispose (__in FxObjectLockState State=ObjectLock)
 
VOID MarkPassiveCallbacks (__in FxObjectLockState State=ObjectLock)
 
VOID MarkForceDisposeThread (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsPassiveCallbacks (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsPassiveDispose (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsForceDisposeThread (__in BOOLEAN AcquireLock=TRUE)
 
VOID MarkCommitted (VOID)
 
BOOLEAN IsCommitted (VOID)
 
VOID MarkDisposeOverride (__in FxObjectLockState State=ObjectLock)
 
VOID MarkNoDeleteDDI (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsNoDeleteDDI (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)
 
VOID DeleteFromFailedCreate (VOID)
 
VOID ClearEvtCallbacks (VOID)
 
BOOLEAN EarlyDispose (VOID)
 
virtual VOID DeleteObject (VOID)
 
virtual BOOLEAN Dispose (VOID)
 
_Must_inspect_result_ NTSTATUS AssignParentObject (__in FxObject *ParentObject)
 
_Must_inspect_result_ NTSTATUS AddContext (__in FxContextHeader *Header, __in PVOID *Context, __in PWDF_OBJECT_ATTRIBUTES Attributes)
 
_Must_inspect_result_ NTSTATUS RemoveParentAssignment (VOID)
 
_Must_inspect_result_ FxObjectGetParentObjectReferenced (__in PVOID Tag)
 
BOOLEAN IsDisposed (VOID)
 

Static Public Member Functions

static _Must_inspect_result_ NTSTATUS _Create (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxWmiProvider *Provider, __in PWDF_WMI_INSTANCE_CONFIG WmiInstanceConfig, __in_opt PWDF_OBJECT_ATTRIBUTES InstanceAttributes, __out WDFWMIINSTANCE *WmiInstance, __out FxWmiInstanceExternal **Instance)
 
- Static Public Member Functions inherited from FxObject
static FxObject_FromDisposeEntry (__in PSINGLE_LIST_ENTRY Entry)
 
static FxObject_GetObjectFromHandle (__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
 
static PVOID __inline _ToHandle (__in FxObject *Object)
 
static VOID __inline _ReferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static VOID __inline _DereferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static PVOID _GetDebugBase (__in FxObject *Object)
 
static PFX_POOL_HEADER _CleanupPointer (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Object)
 
static _Must_inspect_result_ NTSTATUS _GetEffectiveLock (__in FxObject *Object, __in_opt IFxHasCallbacks *Callbacks, __in BOOLEAN AutomaticLocking, __in BOOLEAN PassiveCallbacks, __out FxCallbackLock **CallbackLock, __out_opt FxObject **CallbackLockObject)
 
static _Must_inspect_result_ NTSTATUS _ObjectQuery (_In_ FxObject *Object, _In_ CONST GUID *Guid, _In_ ULONG QueryBufferLength, _Out_writes_bytes_(QueryBufferLength) PVOID QueryBuffer)
 

Protected Member Functions

virtual BOOLEAN IsQueryInstanceSupported (VOID)
 
virtual _Must_inspect_result_ __drv_sameIRQL __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS QueryInstance(__inout ULONG OutBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __out_xcount (OutBuffer->size) PVOID OutBuffer
 
virtual BOOLEAN IsSetInstanceSupported (VOID)
 
virtual _Must_inspect_result_ __drv_sameIRQL __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS SetInstance(__in ULONG InBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __in_bcount (InBufferSize) PVOID InBuffer)
 
virtual BOOLEAN IsSetItemSupported (VOID)
 
virtual _Must_inspect_result_ __drv_sameIRQL __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS SetItem(__in ULONG DataItemId
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __in_bcount (InBufferSize) PVOID InBuffer)
 
virtual BOOLEAN IsExecuteMethodSupported (VOID)
 
virtual _Must_inspect_result_ __drv_sameIRQL __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS ExecuteMethod(__in ULONG MethodId
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG __drv_when (InBufferSize >=OutBufferSize, __inout_bcount(InBufferSize)) __drv_when(InBufferSize< OutBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG __inout_bcount (OutBufferSize)) PVOID Buffer
 
- Protected Member Functions inherited from FxObject
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
FxObjectDebugExtensionGetDebugExtension (VOID)
 
BOOLEAN IsDebug (VOID)
 
VOID AllocateTagTracker (__in WDFTYPE Type)
 
virtual VOID SelfDestruct (VOID)
 
PVOID __inline GetObjectHandleUnchecked (VOID)
 
VOID __inline DestroyChildren (VOID)
 
VOID DeleteEarlyDisposedObject (VOID)
 

Protected Attributes

virtual _Must_inspect_result_ __drv_sameIRQL __out PULONG BufferUsed
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG InBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG OutBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG __out PULONG BufferUsed
 
FxWmiInstanceQueryInstanceCallback m_QueryInstanceCallback
 
FxWmiInstanceSetInstanceCallback m_SetInstanceCallback
 
FxWmiInstanceSetItemCallback m_SetItemCallback
 
FxWmiInstanceExecuteMethodCallback m_ExecuteMethodCallback
 
ULONG m_ContextLength
 
BOOLEAN m_UseContextForQuery
 
- Protected Attributes inherited from FxWmiInstance
LIST_ENTRY m_ListEntry
 
FxWmiProviderm_Provider
 
- Protected Attributes inherited from FxObject
union {
   CfxDeviceBase *   m_DeviceBase
 
   CfxDevice *   m_Device
 
}; 
 

Additional Inherited Members

- Public Attributes inherited from FxWmiInstance
virtual _Must_inspect_result_ __drv_sameIRQL __out PULONG BufferUsed =0
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG InBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG OutBufferSize
 
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG __out PULONG BufferUsed =0
 
- Static Protected Member Functions inherited from FxObject
static PVOID _GetBase (__in FxObject *Object)
 

Detailed Description

Definition at line 370 of file fxwmiinstance.hpp.

Constructor & Destructor Documentation

◆ FxWmiInstanceExternal()

FxWmiInstanceExternal::FxWmiInstanceExternal ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in PWDF_WMI_INSTANCE_CONFIG  Config,
__in FxWmiProvider Provider 
)

Definition at line 128 of file fxwmiinstance.cpp.

132 :
133 FxWmiInstance(FxDriverGlobals, sizeof(FxWmiInstanceExternal), Provider),
134 m_QueryInstanceCallback(FxDriverGlobals),
135 m_SetInstanceCallback(FxDriverGlobals),
136 m_SetItemCallback(FxDriverGlobals),
137 m_ExecuteMethodCallback(FxDriverGlobals)
138{
139 m_ContextLength = 0;
140 m_UseContextForQuery = Config->UseContextForQuery;
141
143 m_QueryInstanceCallback.m_Method = Config->EvtWmiInstanceQueryInstance;
144 }
145 m_SetInstanceCallback.m_Method = Config->EvtWmiInstanceSetInstance;
146 m_SetItemCallback.m_Method = Config->EvtWmiInstanceSetItem;
147
148 m_ExecuteMethodCallback.m_Method = Config->EvtWmiInstanceExecuteMethod;
149}
FxWmiInstanceSetItemCallback m_SetItemCallback
FxWmiInstanceQueryInstanceCallback m_QueryInstanceCallback
FxWmiInstanceSetInstanceCallback m_SetInstanceCallback
FxWmiInstanceExecuteMethodCallback m_ExecuteMethodCallback
#define FALSE
Definition: types.h:117
PFN_WDF_WMI_INSTANCE_EXECUTE_METHOD m_Method
PFN_WDF_WMI_INSTANCE_QUERY_INSTANCE m_Method
PFN_WDF_WMI_INSTANCE_SET_INSTANCE m_Method
PFN_WDF_WMI_INSTANCE_SET_ITEM m_Method
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476

Member Function Documentation

◆ __drv_maxIRQL() [1/4]

virtual _Must_inspect_result_ __drv_sameIRQL FxWmiInstanceExternal::__drv_maxIRQL ( PASSIVE_LEVEL  )
protectedvirtual

Reimplemented from FxWmiInstance.

◆ __drv_maxIRQL() [2/4]

virtual _Must_inspect_result_ __drv_sameIRQL FxWmiInstanceExternal::__drv_maxIRQL ( PASSIVE_LEVEL  )
protectedvirtual

Reimplemented from FxWmiInstance.

◆ __drv_maxIRQL() [3/4]

virtual _Must_inspect_result_ __drv_sameIRQL FxWmiInstanceExternal::__drv_maxIRQL ( PASSIVE_LEVEL  )
protectedvirtual

Reimplemented from FxWmiInstance.

◆ __drv_maxIRQL() [4/4]

virtual _Must_inspect_result_ __drv_sameIRQL FxWmiInstanceExternal::__drv_maxIRQL ( PASSIVE_LEVEL  )
protectedvirtual

Reimplemented from FxWmiInstance.

◆ __drv_when()

virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG FxWmiInstanceExternal::__drv_when ( InBufferSize >=  OutBufferSize,
__inout_bcount(InBufferSize  
)
protected

◆ __in_bcount() [1/2]

virtual _Must_inspect_result_ __drv_sameIRQL FxWmiInstanceExternal::__in_bcount ( InBufferSize  )
protectedvirtual

Implements FxWmiInstance.

◆ __in_bcount() [2/2]

virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG FxWmiInstanceExternal::__in_bcount ( InBufferSize  )
protectedvirtual

Implements FxWmiInstance.

◆ __inout_bcount()

virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG FxWmiInstanceExternal::__inout_bcount ( OutBufferSize  )
protected

◆ __out_xcount()

virtual _Must_inspect_result_ __drv_sameIRQL FxWmiInstanceExternal::__out_xcount ( OutBuffer->  size)
protected

◆ _Create()

_Must_inspect_result_ NTSTATUS FxWmiInstanceExternal::_Create ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in FxWmiProvider Provider,
__in PWDF_WMI_INSTANCE_CONFIG  WmiInstanceConfig,
__in_opt PWDF_OBJECT_ATTRIBUTES  InstanceAttributes,
__out WDFWMIINSTANCE *  WmiInstance,
__out FxWmiInstanceExternal **  Instance 
)
static

Definition at line 153 of file fxwmiinstance.cpp.

161{
163 WDFWMIINSTANCE hInstance;
165 size_t contextSize;
166
167 contextSize = 0;
168 *Instance = 0;
169
170 *WmiInstance = NULL;
171
172 //
173 // For event only providers, you cannot specify any callbacks or context
174 // usage.
175 //
176 if (Provider->IsEventOnly() &&
177 (WmiInstanceConfig->UseContextForQuery ||
178 WmiInstanceConfig->EvtWmiInstanceQueryInstance != NULL ||
179 WmiInstanceConfig->EvtWmiInstanceSetInstance != NULL ||
180 WmiInstanceConfig->EvtWmiInstanceSetItem != NULL ||
181 WmiInstanceConfig->EvtWmiInstanceExecuteMethod != NULL)) {
182
184
186 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
187 "WDFWMIPROVIDER %p is event only and UseContextForQuery (%d) is TRUE,"
188 " or a callback (query instance %p, set instance %p, set item %p, "
189 "executue method %p) is not NULL, %!STATUS!",
190 Provider->GetHandle(), WmiInstanceConfig->UseContextForQuery,
191 WmiInstanceConfig->EvtWmiInstanceQueryInstance,
192 WmiInstanceConfig->EvtWmiInstanceSetInstance,
193 WmiInstanceConfig->EvtWmiInstanceSetItem,
194 WmiInstanceConfig->EvtWmiInstanceExecuteMethod, status);
195
196 return status;
197 }
198
199 status = FxValidateObjectAttributes(FxDriverGlobals,
202 if (!NT_SUCCESS(status)) {
203 return status;
204 }
205
206 if (WmiInstanceConfig->UseContextForQuery) {
207 //
208 // UseContextForQuery only supported for read only instances.
209 // ExecuteMethod has undefined side affects, so we allow it.
210 //
211 if (WmiInstanceConfig->EvtWmiInstanceSetInstance != NULL ||
212 WmiInstanceConfig->EvtWmiInstanceSetItem != NULL) {
214
216 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
217 "UseContextForQuery set, i.e. a read only instance, but "
218 "EvtWmiInstanceSetInstance %p or EvtWmiInstanceSetItem %p is "
219 "set, %!STATUS!",
220 WmiInstanceConfig->EvtWmiInstanceSetInstance,
221 WmiInstanceConfig->EvtWmiInstanceSetItem, status);
222
223 return status;
224 }
225
226 //
227 // We must have a context to use for the query
228 //
229 if (InstanceAttributes == NULL ||
230 InstanceAttributes->ContextTypeInfo == NULL) {
232
234 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
235 "UseContextForQuery set, but InstanceAttributes %p is null or "
236 "there is no associated type, %!STATUS!",
238
239 return status;
240 }
241
242 contextSize = InstanceAttributes->ContextTypeInfo->ContextSize;
243
244 if (InstanceAttributes->ContextSizeOverride != 0) {
245 status = RtlSizeTAdd(contextSize,
246 InstanceAttributes->ContextSizeOverride,
247 &contextSize);
248 if (!NT_SUCCESS(status)) {
250 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
251 "Overlfow adding contextSize %I64d with size override %I64d, "
252 "%!STATUS!", contextSize,
253 InstanceAttributes->ContextSizeOverride, status);
254
255 return status;
256 }
257 }
258
259 if (contextSize > ULONG_MAX) {
260 //
261 // Since we are casting to a ULONG below, detect loss of data here
262 // (only really applicable on 64 bit machines where sizeof(size_t) !=
263 // sizeof(ULONG)
264 //
266
268 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
269 "context size %I64d can be %d large, %!STATUS!",
270 contextSize, ULONG_MAX, status);
271
272 return status;
273 }
274
275 //
276 // Make sure the context is the minimum the buffer size.
277 //
278 if (contextSize < Provider->GetMinInstanceBufferSize()) {
280
282 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
283 "context size %I64d is less then the WDFWMIPROVIDER %p min size "
284 "of %d, %!STATUS!",
285 contextSize, Provider->GetHandle(),
286 Provider->GetMinInstanceBufferSize(), status);
287
288 return status;
289 }
290 }
291
292 pInstance = new(FxDriverGlobals, InstanceAttributes)
293 FxWmiInstanceExternal(FxDriverGlobals, WmiInstanceConfig, Provider);
294
295 if (pInstance == NULL) {
297
299 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
300 "could not allocate memory for WDFWMIINSTANCE, %!STATUS!",
301 status);
302
303 return status;
304 }
305
306 if (contextSize > 0) {
308 }
309
310 if (NT_SUCCESS(status)) {
313
314 if (NT_SUCCESS(status)) {
315 //
316 // Assign the handle back to the caller.
317 //
319 }
320 else {
321 //
322 // On failure, DeleteFromFailedCreate will delete the object and
323 // the Dispose callback will remove the instance from the provider's
324 // list.
325 //
326 DO_NOTHING();
327 }
328 }
329
330 if (NT_SUCCESS(status)) {
332 }
333 else {
335 }
336
337 return status;
338}
LONG NTSTATUS
Definition: precomp.h:26
HINSTANCE hInstance
Definition: charmap.c:19
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
Definition: fxobject.cpp:904
VOID SetContextForQueryLength(__in ULONG ContextSize)
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
@ FX_VALIDATE_OPTION_PARENT_NOT_ALLOWED
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
FxWmiInstanceExternal * pInstance
Definition: fxwmiapi.cpp:113
#define ULONG_MAX
Definition: limits.h:44
#define DO_NOTHING()
Definition: mxgeneral.h:32
#define STATUS_INTEGER_OVERFLOW
Definition: ntstatus.h:385
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES InstanceAttributes
Definition: wdfwmi.h:478
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
_Must_inspect_result_ _In_ WDFWMIINSTANCE WmiInstance
Definition: wdfwmi.h:514

◆ IsExecuteMethodSupported()

BOOLEAN FxWmiInstanceExternal::IsExecuteMethodSupported ( VOID  )
protectedvirtual

Implements FxWmiInstance.

Definition at line 537 of file fxwmiinstance.cpp.

540{
542}
#define TRUE
Definition: types.h:120

◆ IsQueryInstanceSupported()

BOOLEAN FxWmiInstanceExternal::IsQueryInstanceSupported ( VOID  )
protectedvirtual

Implements FxWmiInstance.

Definition at line 341 of file fxwmiinstance.cpp.

344{
345 //
346 // If we have a function pointer to call or we are using the context
347 // as the buffer, query instance is supported.
348 //
349 // Also, if neither of the first 2 are true, we need to support query
350 // instance if the device has an execute method callback b/c WMI will
351 // send a query instance to this instance which much succeed for the
352 // execute method irp to be sent.
353 //
354 return (m_UseContextForQuery ||
357 : FALSE;
358}

Referenced by FxWmiIrpHandler::_QueryAllData().

◆ IsSetInstanceSupported()

BOOLEAN FxWmiInstanceExternal::IsSetInstanceSupported ( VOID  )
protectedvirtual

Implements FxWmiInstance.

Definition at line 485 of file fxwmiinstance.cpp.

488{
490}

◆ IsSetItemSupported()

BOOLEAN FxWmiInstanceExternal::IsSetItemSupported ( VOID  )
protectedvirtual

Implements FxWmiInstance.

Definition at line 510 of file fxwmiinstance.cpp.

513{
515}

◆ SetContextForQueryLength()

VOID FxWmiInstanceExternal::SetContextForQueryLength ( __in ULONG  ContextSize)
inline

Definition at line 379 of file fxwmiinstance.hpp.

382 {
384 }
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
Definition: fltkernel.h:1444

Referenced by _Create().

Member Data Documentation

◆ BufferUsed [1/2]

virtual _Must_inspect_result_ __drv_sameIRQL __out PULONG FxWmiInstanceExternal::BufferUsed
protected

Definition at line 413 of file fxwmiinstance.hpp.

Referenced by __drv_maxIRQL().

◆ BufferUsed [2/2]

virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG __out PULONG FxWmiInstanceExternal::BufferUsed
protected

Definition at line 467 of file fxwmiinstance.hpp.

◆ InBufferSize

_Must_inspect_result_ __drv_sameIRQL __in ULONG FxWmiInstanceExternal::InBufferSize
protected

Definition at line 445 of file fxwmiinstance.hpp.

◆ m_ContextLength

ULONG FxWmiInstanceExternal::m_ContextLength
protected

◆ m_ExecuteMethodCallback

FxWmiInstanceExecuteMethodCallback FxWmiInstanceExternal::m_ExecuteMethodCallback
protected

◆ m_QueryInstanceCallback

FxWmiInstanceQueryInstanceCallback FxWmiInstanceExternal::m_QueryInstanceCallback
protected

◆ m_SetInstanceCallback

FxWmiInstanceSetInstanceCallback FxWmiInstanceExternal::m_SetInstanceCallback
protected

Definition at line 476 of file fxwmiinstance.hpp.

Referenced by FxWmiInstanceExternal(), and IsSetInstanceSupported().

◆ m_SetItemCallback

FxWmiInstanceSetItemCallback FxWmiInstanceExternal::m_SetItemCallback
protected

Definition at line 478 of file fxwmiinstance.hpp.

Referenced by FxWmiInstanceExternal(), and IsSetItemSupported().

◆ m_UseContextForQuery

BOOLEAN FxWmiInstanceExternal::m_UseContextForQuery
protected

◆ OutBufferSize

virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG FxWmiInstanceExternal::OutBufferSize
protected

Definition at line 463 of file fxwmiinstance.hpp.

Referenced by __drv_maxIRQL().


The documentation for this class was generated from the following files: