73 if (EventBuffer ==
NULL) {
103 if (EventBuffer !=
NULL) {
121 "WDFWMIINSTANCE %p insufficient resources to fire event,%!STATUS!",
134 m_QueryInstanceCallback(FxDriverGlobals),
135 m_SetInstanceCallback(FxDriverGlobals),
136 m_SetItemCallback(FxDriverGlobals),
137 m_ExecuteMethodCallback(FxDriverGlobals)
177 (WmiInstanceConfig->UseContextForQuery ||
178 WmiInstanceConfig->EvtWmiInstanceQueryInstance !=
NULL ||
179 WmiInstanceConfig->EvtWmiInstanceSetInstance !=
NULL ||
180 WmiInstanceConfig->EvtWmiInstanceSetItem !=
NULL ||
181 WmiInstanceConfig->EvtWmiInstanceExecuteMethod !=
NULL)) {
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);
206 if (WmiInstanceConfig->UseContextForQuery) {
211 if (WmiInstanceConfig->EvtWmiInstanceSetInstance !=
NULL ||
212 WmiInstanceConfig->EvtWmiInstanceSetItem !=
NULL) {
217 "UseContextForQuery set, i.e. a read only instance, but "
218 "EvtWmiInstanceSetInstance %p or EvtWmiInstanceSetItem %p is "
220 WmiInstanceConfig->EvtWmiInstanceSetInstance,
221 WmiInstanceConfig->EvtWmiInstanceSetItem,
status);
235 "UseContextForQuery set, but InstanceAttributes %p is null or "
236 "there is no associated type, %!STATUS!",
245 status = RtlSizeTAdd(contextSize,
251 "Overlfow adding contextSize %I64d with size override %I64d, "
252 "%!STATUS!", contextSize,
269 "context size %I64d can be %d large, %!STATUS!",
278 if (contextSize < Provider->GetMinInstanceBufferSize()) {
283 "context size %I64d is less then the WDFWMIPROVIDER %p min size "
300 "could not allocate memory for WDFWMIINSTANCE, %!STATUS!",
306 if (contextSize > 0) {
364FxWmiInstanceExternal::QueryInstance(
385 "WDFWMIINSTANCE %p query instance using context for query, "
386 "query buffer length %d, context length %d, %!STATUS!",
417 "WDFWMIINSTANCE %p was queried and returned %!STATUS!, which is "
433 "WDFWMIINSTANCE %p was queried with buffer size %d, "
434 " but returned %d bytes and %!STATUS!, should return "
435 "!NT_SUCCESS in this case",
455 "WDFWMIINSTANCE %p returned %!STATUS!, but it specified "
456 "a minimum instance size %d in its WDFWMIPROVIDER %p",
461 "This is a break in the contract. Minimum instance size "
462 "should only be used for fixed sized instances");
473 "WDFWMIINSTANCE %p was queried with no query callback and supports "
474 "execute method (%p), zero bytes returned",
GetHandle(),
496FxWmiInstanceExternal::SetInstance(
521FxWmiInstanceExternal::SetItem(
548FxWmiInstanceExternal::ExecuteMethod(
593FxWmiInstanceInternal::QueryInstance(
618FxWmiInstanceInternal::SetInstance(
641FxWmiInstanceInternal::SetItem(
667FxWmiInstanceInternal::ExecuteMethod(
const struct winhelp_callbacks Callbacks
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
virtual BOOLEAN Dispose(VOID)
VOID DeleteFromFailedCreate(VOID)
__inline FxContextHeader * GetContextHeader(VOID)
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
_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 SetContextForQueryLength(__in ULONG ContextSize)
virtual _Must_inspect_result_ __drv_sameIRQL __in ULONG __inout ULONG OutBufferSize
virtual BOOLEAN IsSetInstanceSupported(VOID)
virtual BOOLEAN IsQueryInstanceSupported(VOID)
FxWmiInstanceSetItemCallback m_SetItemCallback
BOOLEAN m_UseContextForQuery
FxWmiInstanceQueryInstanceCallback m_QueryInstanceCallback
FxWmiInstanceSetInstanceCallback m_SetInstanceCallback
virtual BOOLEAN IsSetItemSupported(VOID)
FxWmiInstanceExternal(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_WMI_INSTANCE_CONFIG Config, __in FxWmiProvider *Provider)
virtual _Must_inspect_result_ __drv_sameIRQL __out PULONG BufferUsed
virtual BOOLEAN IsExecuteMethodSupported(VOID)
FxWmiInstanceExecuteMethodCallback m_ExecuteMethodCallback
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)
virtual BOOLEAN IsSetInstanceSupported(VOID)
PFN_FX_WMI_INSTANCE_EXECUTE_METHOD m_ExecuteMethod
virtual BOOLEAN IsQueryInstanceSupported(VOID)
PFN_FX_WMI_INSTANCE_SET_ITEM m_SetItem
FxWmiInstanceInternal(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxWmiInstanceInternalCallbacks *Callbacks, __in FxWmiProvider *m_Provider)
virtual BOOLEAN IsSetItemSupported(VOID)
PFN_FX_WMI_INSTANCE_QUERY_INSTANCE m_QueryInstance
virtual BOOLEAN IsExecuteMethodSupported(VOID)
PFN_FX_WMI_INSTANCE_SET_INSTANCE m_SetInstance
virtual BOOLEAN Dispose(VOID)
FxWmiProvider * m_Provider
_Must_inspect_result_ NTSTATUS FireEvent(__in_bcount_opt(EventBufferSize) PVOID EventBuffer, __inout ULONG EventBufferSize)
FxWmiInstance(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ObjectSize, __in FxWmiProvider *Provider)
ULONG GetInstanceIndex(__in FxWmiInstance *Instance)
WDFWMIPROVIDER GetHandle(VOID)
VOID RemoveInstance(__in FxWmiInstance *Instance)
ULONG GetMinInstanceBufferSize(VOID)
#define __inout_bcount(x)
#define __in_bcount_opt(x)
#define NT_SUCCESS(StatCode)
#define __drv_when(cond, annotes)
#define __drv_maxIRQL(irql)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeQuerySystemTime(t)
#define InitializeListHead(ListHead)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
return pDevice GetDeviceObject()
FxVerifierDbgBreakPoint(pFxDriverGlobals)
@ 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
_Must_inspect_result_ __drv_sameIRQL __in FxWmiInstanceInternal * Instance
HRESULT SetItem(REFGUID guidKey, REFPROPVARIANT Value)
#define _Must_inspect_result_
NTSTATUS NTAPI IoWMIWriteEvent(_Inout_ PVOID WnodeEventItem)
#define STATUS_INTEGER_OVERFLOW
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
#define STATUS_BUFFER_TOO_SMALL
#define TRACE_LEVEL_ERROR
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
struct _WNODE_HEADER WnodeHeader
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
_In_ ULONG _Out_ PULONG BufferUsed
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES InstanceAttributes
_Must_inspect_result_ _In_ WDFWMIINSTANCE WmiInstance
#define WNODE_FLAG_STATIC_INSTANCE_NAMES
#define WNODE_FLAG_EVENT_ITEM
struct tagWNODE_SINGLE_INSTANCE WNODE_SINGLE_INSTANCE
struct tagWNODE_SINGLE_INSTANCE * PWNODE_SINGLE_INSTANCE
#define WNODE_FLAG_SINGLE_INSTANCE
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define IoWMIDeviceObjectToProviderId(DeviceObject)