ReactOS 0.4.15-dev-8408-g466a198
FxWmiInstance Class Referenceabstract

#include <fxwmiinstance.hpp>

Inheritance diagram for FxWmiInstance:
Collaboration diagram for FxWmiInstance:

Public Member Functions

 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)
 

Public Attributes

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
 

Protected Attributes

LIST_ENTRY m_ListEntry
 
FxWmiProviderm_Provider
 
- Protected Attributes inherited from FxObject
union {
   CfxDeviceBase *   m_DeviceBase
 
   CfxDevice *   m_Device
 
}; 
 

Private Attributes

friend FxWmiProvider
 
friend FxWmiIrpHandler
 

Additional Inherited Members

- 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 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)
 
- Static Protected Member Functions inherited from FxObject
static PVOID _GetBase (__in FxObject *Object)
 

Detailed Description

Definition at line 31 of file fxwmiinstance.hpp.

Constructor & Destructor Documentation

◆ FxWmiInstance()

FxWmiInstance::FxWmiInstance ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in USHORT  ObjectSize,
__in FxWmiProvider Provider 
)

Definition at line 28 of file fxwmiinstance.cpp.

32 :
33 FxNonPagedObject(FX_TYPE_WMI_INSTANCE, ObjectSize, FxDriverGlobals)
34{
37 m_Provider->ADDREF(this);
39}
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
Definition: fxobject.hpp:1101
LIST_ENTRY m_ListEntry
FxWmiProvider * m_Provider
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
@ ObjectDoNotLock
Definition: fxobject.hpp:128
@ FX_TYPE_WMI_INSTANCE
Definition: fxtypes.h:87

◆ ~FxWmiInstance()

FxWmiInstance::~FxWmiInstance ( )

Definition at line 41 of file fxwmiinstance.cpp.

42{
44}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define ASSERT(a)
Definition: mode.c:44

Member Function Documentation

◆ __drv_maxIRQL() [1/4]

◆ __drv_maxIRQL() [2/4]

◆ __drv_maxIRQL() [3/4]

◆ __drv_maxIRQL() [4/4]

◆ __drv_when()

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

◆ __in_bcount() [1/2]

◆ __in_bcount() [2/2]

◆ __inout_bcount()

virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG FxWmiInstance::__inout_bcount ( OutBufferSize  )

◆ __out_bcount_part()

virtual _Must_inspect_result_ __drv_sameIRQL FxWmiInstance::__out_bcount_part ( OutBufferSize  ,
BufferUsed 
)

◆ Dispose()

BOOLEAN FxWmiInstance::Dispose ( VOID  )
virtual

Reimplemented from FxObject.

Definition at line 47 of file fxwmiinstance.cpp.

50{
52 m_Provider->RELEASE(this);
53
54 //
55 // Object is being deleted, remove this object from the provider's list
56 // of instances. If we don't do this, the provider will have a list which
57 // contains entries which have been freed.
58 //
59 return FxNonPagedObject::Dispose(); // __super call
60}
virtual BOOLEAN Dispose(VOID)
VOID RemoveInstance(__in FxWmiInstance *Instance)

◆ FireEvent()

_Must_inspect_result_ NTSTATUS FxWmiInstance::FireEvent ( __in_bcount_opt(EventBufferSize) PVOID  EventBuffer,
__inout ULONG  EventBufferSize 
)

Definition at line 64 of file fxwmiinstance.cpp.

68{
69 ULONG sizeNeeded;
72
73 if (EventBuffer == NULL) {
74 EventBufferSize = 0;
75 }
76
77 sizeNeeded = sizeof(WNODE_SINGLE_INSTANCE) + EventBufferSize;
78
79 //
80 // IoWMIWriteEvent will free the memory by calling ExFreePool. This means
81 // we cannot use a framework allocate function.
82 //
85
86 if (pNode != NULL) {
87 RtlCopyMemory(&pNode->WnodeHeader.Guid,
89 sizeof(GUID));
90
93 pNode->WnodeHeader.BufferSize = sizeNeeded;
97 KeQuerySystemTime(&pNode->WnodeHeader.TimeStamp);
98
100 pNode->SizeDataBlock = EventBufferSize;
101 pNode->DataBlockOffset = sizeof(WNODE_SINGLE_INSTANCE);
102
103 if (EventBuffer != NULL) {
104 RtlCopyMemory(&pNode->VariableData, EventBuffer, EventBufferSize);
105 }
106
107 //
108 // Upon success, IoWMIWriteEvent will free pNode.
109 //
110 status = IoWMIWriteEvent(pNode);
111
112 if (!NT_SUCCESS(status)) {
113 ExFreePool(pNode);
114 }
115 }
116 else {
118
121 "WDFWMIINSTANCE %p insufficient resources to fire event,%!STATUS!",
122 GetHandle(), status);
123 }
124
125 return status;
126}
LONG NTSTATUS
Definition: precomp.h:26
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
GUID * GetGUID(VOID)
ULONG GetInstanceIndex(__in FxWmiInstance *Instance)
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
return pList GetDevice()
return pDevice GetDeviceObject()
NTSTATUS NTAPI IoWMIWriteEvent(_Inout_ PVOID WnodeEventItem)
Definition: wmi.c:109
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
struct _WNODE_HEADER WnodeHeader
Definition: wmistr.h:58
#define GetHandle(h)
Definition: treelist.c:116
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define WNODE_FLAG_STATIC_INSTANCE_NAMES
Definition: wmistr.h:35
#define WNODE_FLAG_EVENT_ITEM
Definition: wmistr.h:31
struct tagWNODE_SINGLE_INSTANCE WNODE_SINGLE_INSTANCE
struct tagWNODE_SINGLE_INSTANCE * PWNODE_SINGLE_INSTANCE
#define WNODE_FLAG_SINGLE_INSTANCE
Definition: wmistr.h:29
#define IoWMIDeviceObjectToProviderId(DeviceObject)

Referenced by __in_bcount_opt().

◆ GetDevice()

CfxDevice * FxWmiInstance::GetDevice ( VOID  )
inline

Definition at line 46 of file fxwmiinstance.hpp.

49 {
50 return m_Provider->GetDevice();
51 }
CfxDevice * GetDevice(VOID)

◆ GetHandle()

WDFWMIINSTANCE FxWmiInstance::GetHandle ( VOID  )
inline

Definition at line 77 of file fxwmiinstance.hpp.

80 {
81 return (WDFWMIINSTANCE) GetObjectHandle();
82 }
return pObject GetObjectHandle()

Referenced by FxWmiIrpHandler::_QueryAllData().

◆ GetProvider()

FxWmiProvider * FxWmiInstance::GetProvider ( VOID  )
inline

Definition at line 54 of file fxwmiinstance.hpp.

57 {
58 return m_Provider;
59 }

◆ IsEnabled()

BOOLEAN FxWmiInstance::IsEnabled ( __in WDF_WMI_PROVIDER_CONTROL  Control)
inline

Definition at line 69 of file fxwmiinstance.hpp.

72 {
74 }
BOOLEAN IsEnabled(__in WDF_WMI_PROVIDER_CONTROL Control)
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166

◆ IsExecuteMethodSupported()

virtual BOOLEAN FxWmiInstance::IsExecuteMethodSupported ( VOID  )
pure virtual

◆ IsQueryInstanceSupported()

virtual BOOLEAN FxWmiInstance::IsQueryInstanceSupported ( VOID  )
pure virtual

◆ IsSetInstanceSupported()

virtual BOOLEAN FxWmiInstance::IsSetInstanceSupported ( VOID  )
pure virtual

◆ IsSetItemSupported()

virtual BOOLEAN FxWmiInstance::IsSetItemSupported ( VOID  )
pure virtual

Member Data Documentation

◆ BufferUsed [1/2]

virtual _Must_inspect_result_ __drv_sameIRQL __out PULONG FxWmiInstance::BufferUsed =0

Definition at line 98 of file fxwmiinstance.hpp.

◆ BufferUsed [2/2]

virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG __out PULONG FxWmiInstance::BufferUsed =0

Definition at line 152 of file fxwmiinstance.hpp.

◆ FxWmiIrpHandler

friend FxWmiInstance::FxWmiIrpHandler
private

Definition at line 34 of file fxwmiinstance.hpp.

◆ FxWmiProvider

friend FxWmiInstance::FxWmiProvider
private

Definition at line 33 of file fxwmiinstance.hpp.

◆ InBufferSize

_Must_inspect_result_ __drv_sameIRQL __in ULONG FxWmiInstance::InBufferSize

Definition at line 130 of file fxwmiinstance.hpp.

◆ m_ListEntry

LIST_ENTRY FxWmiInstance::m_ListEntry
protected

Definition at line 167 of file fxwmiinstance.hpp.

Referenced by FxWmiInstance(), and ~FxWmiInstance().

◆ m_Provider

FxWmiProvider* FxWmiInstance::m_Provider
protected

◆ OutBufferSize

virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG FxWmiInstance::OutBufferSize

Definition at line 148 of file fxwmiinstance.hpp.


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