37#if defined(EVENT_TRACING)
38#include "FxObject.hpp.tmh"
49#define ADDREF(_tag) AddRef(_tag, __LINE__, __FILE__)
50#define RELEASE(_tag) Release(_tag, __LINE__, __FILE__)
52#define ADDREF_OFFSET(_tag, offset) AddRefOverride(offset, _tag, __LINE__, __FILE__)
53#define RELEASE_OFFSET(_tag, offset) ReleaseOverride(offset, _tag, __LINE__, __FILE__)
125#define FLAG_TO_BOOL(_Flags, _FlagMask) (!!((_Flags) & (_FlagMask)))
190#define DECLARE_INTERNAL_NEW_OPERATOR() \
195 __in PFX_DRIVER_GLOBALS FxDriverGlobals \
198 return FxObjectHandleAlloc(FxDriverGlobals, \
202 WDF_NO_OBJECT_ATTRIBUTES,\
204 FxObjectTypeInternal); \
241#if FX_CORE_MODE==FX_CORE_USER_MODE
242#ifndef INLINE_WRAPPER_ALLOCATION
376 "Object %p, WDFOBJECT %p transitioning from %!FxObjectState! to "
490#ifdef INLINE_WRAPPER_ALLOCATION
492#if FX_CORE_MODE==FX_CORE_USER_MODE
517#if FX_CORE_MODE==FX_CORE_USER_MODE
591 #define GET_CONTEXT_HEADER() WDF_PTR_ADD_OFFSET_TYPE(this, m_ObjectSize, FxContextHeader*)
626 handle &= ~FxHandleFlagMask;
773 AllocationStart)->TagTracker;
844 if (pTagTracker !=
NULL) {
863 if (pTagTracker !=
NULL) {
937 "Object %p, WDFOBJECT %p, state %!FxObjectState! dropping event"
938 " %!FxObjectDroppedEvent!",
1288 if (FxDriverGlobals->IsPoolTrackingOn()) {
1403 if (PreviousIrql ==
NULL) {
1429 PerformEarlyDisposeWorkerAndUnlock(
1437 PerformDisposingDisposeChildrenLocked(
1445 DeleteWorkerAndUnlock(
1463 DisposeChildrenWorker(
1472 DeletedAndDisposedWorkerLocked(
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
#define InterlockedIncrement
#define InterlockedDecrement
const struct winhelp_callbacks Callbacks
FxObjectDebugExtension * GetDebugExtension(VOID)
VOID QueueDeferredDisposeLocked(__in FxObjectState NewDeferedState)
struct FxObject::@4761::@4765 m_ObjectFlagsByName
static FxObject * _GetObjectFromHandle(__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
PFX_DRIVER_GLOBALS m_Globals
_Must_inspect_result_ NTSTATUS AssignParentObject(__in FxObject *ParentObject)
PVOID __inline GetObjectHandle(VOID)
static FxObject * _FromDisposeEntry(__in PSINGLE_LIST_ENTRY Entry)
virtual ULONG AddRefOverride(__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
VOID MarkPassiveDispose(__in FxObjectLockState State=ObjectLock)
static PVOID _GetBase(__in FxObject *Object)
BOOLEAN MarkDeleteCalledLocked(VOID)
_Must_inspect_result_ NTSTATUS AddChildObjectInternal(__in FxObject *ChildObject)
_Must_inspect_result_ NTSTATUS RemoveParentAssignment(VOID)
VOID CallCleanupCallbacks(VOID)
VOID ParentDeleteEvent(VOID)
VOID SetNoContextHeader(VOID)
_Must_inspect_result_ NTSTATUS RemoveChildObjectInternal(__in FxObject *ChildObject)
VOID SetDeviceBase(__in CfxDeviceBase *DeviceBase)
BOOLEAN IsPassiveDispose(__in BOOLEAN AcquireLock=TRUE)
BOOLEAN IsNoDeleteDDI(VOID)
BOOLEAN IsPassiveDisposeLocked(VOID)
BOOLEAN IsForceDisposeThreadLocked(VOID)
LIST_ENTRY m_ChildListHead
_Must_inspect_result_ NTSTATUS AddContext(__in FxContextHeader *Header, __in PVOID *Context, __in PWDF_OBJECT_ATTRIBUTES Attributes)
PVOID __inline GetObjectHandleUnchecked(VOID)
_Must_inspect_result_ NTSTATUS RemoveParentAssociation(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
SINGLE_LIST_ENTRY m_DisposeSingleEntry
friend VOID GetTriageInfo(VOID)
VOID __inline Construct(__in BOOLEAN Embedded)
VOID __inline DestroyChildren(VOID)
VOID DeferredDisposeWorkItem(VOID)
VOID MarkTraceState(VOID)
VOID __inline TraceDroppedEvent(__in FxObjectDroppedEvent Event)
ULONG __inline AddRef(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
FxObject * m_ParentObject
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)
CfxDeviceBase * m_DeviceBase
static VOID __inline _ReferenceActual(__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
virtual ULONG ReleaseOverride(__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
VOID DeleteEarlyDisposedObject(VOID)
BOOLEAN IsForceDisposeThread(__in BOOLEAN AcquireLock=TRUE)
__drv_restoresIRQL KIRQL __in BOOLEAN Unlock
_Releases_lock_(this->m_SpinLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) BOOLEAN PerformEarlyDisposeWorkerAndUnlock(__in __drv_restoresIRQL KIRQL OldIrql
VOID MarkNoDeleteDDI(__in FxObjectLockState State=ObjectLock)
BOOLEAN ShouldDeferDisposeLocked(__out_opt PKIRQL PreviousIrql=NULL)
VOID ClearEvtCallbacks(VOID)
USHORT GetObjectSize(VOID)
CfxDeviceBase * GetDeviceBase(VOID)
BOOLEAN EarlyDispose(VOID)
VOID MarkForceDisposeThread(__in FxObjectLockState State=ObjectLock)
VOID ProcessDestroy(VOID)
CfxDevice * GetDevice(VOID)
BOOLEAN IsPassiveCallbacks(__in BOOLEAN AcquireLock=TRUE)
USHORT ForceDisposeThread
static PVOID _GetDebugBase(__in FxObject *Object)
virtual BOOLEAN Dispose(VOID)
FxTagTracker * GetTagTracker(VOID)
FX_DECLARE_VF_FUNCTION_P1(VOID, VerifyConstruct, _In_ BOOLEAN)
virtual ULONG Release(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
VOID DeleteFromFailedCreate(VOID)
static PVOID __inline _ToHandle(__in FxObject *Object)
static _Must_inspect_result_ NTSTATUS _ObjectQuery(_In_ FxObject *Object, _In_ CONST GUID *Guid, _In_ ULONG QueryBufferLength, _Out_writes_bytes_(QueryBufferLength) PVOID QueryBuffer)
__inline FxContextHeader * GetContextHeader(VOID)
VOID MarkPassiveCallbacks(__in FxObjectLockState State=ObjectLock)
BOOLEAN IsPassiveCallbacksLocked(VOID)
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
BOOLEAN __inline IsTraceState(VOID)
static PFX_POOL_HEADER _CleanupPointer(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Object)
_Must_inspect_result_ FxObject * GetParentObjectReferenced(__in PVOID Tag)
VOID __inline SetObjectStateLocked(__in FxObjectState NewState)
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
BOOLEAN IsCommitted(VOID)
VOID AllocateTagTracker(__in WDFTYPE Type)
void SetCOMWrapper(__drv_aliasesMem PVOID Wrapper)
BOOLEAN PerformEarlyDispose(VOID)
virtual VOID SelfDestruct(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)
__inline VOID CallCleanup(VOID)
static VOID __inline _DereferenceActual(__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
__in __drv_restoresIRQL KIRQL OldIrql
VOID UpdateTagHistory(__in PVOID Tag, __in LONG Line, __in_opt PSTR File, __in FxTagRefType RefType, __in ULONG RefCount)
static __inline KIRQL MxGetCurrentIrql()
#define _Releases_lock_(lock)
#define __drv_when(cond, annotes)
#define __drv_restoresIRQL
#define __drv_requiresIRQL(irql)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
pPkgPnp m_DeviceInterfaceLock AcquireLock(pFxDriverGlobals)
PVOID FxObjectHandleAlloc(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType, __in size_t Size, __in ULONG Tag, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize, __in FxObjectType ObjectType)
VOID _In_ BOOLEAN Embedded
@ FxObjectStateDeferedDeleting
@ FxObjectStateDisposingDisposeChildren
@ FxObjectStateWaitingForEarlyDispose
@ FxObjectStateDeletedDisposing
@ FxObjectStateWaitingForParentDeleteAndDisposed
@ FxObjectStateDeletedAndDisposed
@ FxObjectStateDisposingEarly
@ FxObjectStateDeferedDisposing
@ FxObjectStateDeferedDestroy
@ FXOBJECT_FLAGS_DELETECALLED
@ FXOBJECT_FLAGS_PASSIVE_CALLBACKS
@ FXOBJECT_FLAGS_FORCE_DISPOSE_THREAD
@ FXOBJECT_FLAGS_NODELETEDDI
@ FXOBJECT_FLAGS_DISPOSE_OVERRIDE
@ FXOBJECT_FLAGS_PASSIVE_DISPOSE
@ FXOBJECT_FLAGS_HAS_DEBUG
@ FXOBJECT_FLAGS_TRACE_STATE
@ FXOBJECT_FLAGS_HAS_CLEANUP
@ FXOBJECT_FLAGS_COMMITTED
@ FXOBJECT_FLAGS_EARLY_DISPOSED_EXT
FxObjectDebugExtensionValues
@ FxObjectDebugExtensionSignature
@ FxObjectDebugExtensionSize
#define FLAG_TO_BOOL(_Flags, _FlagMask)
@ FxObjectDroppedEventDeleteObject
@ FxObjectDroppedEventParentDeleteEvent
@ FxObjectDroppedEventAssignParentObject
@ FxObjectDroppedEventPerformEarlyDispose
@ FxObjectDroppedEventRemoveParentAssignment
@ FxObjectDroppedEventAddChildObjectInternal
@ FxObjectDroppedEventRemoveChildObjectInternal
USHORT * PWDFOBJECT_OFFSET
#define GET_CONTEXT_HEADER()
DECLSPEC_SELECTANY const ULONG_PTR FxHandleValueMask
FX_POOL_TRACKER * PFX_POOL_TRACKER
VOID __inline FxPoolRemoveNonPagedAllocateTracker(__in PFX_POOL_TRACKER Tracker)
FxContextHeader * pHeader
#define _Out_writes_bytes_(size)
#define _Must_inspect_result_
#define _When_(expr, annos)
#define DECLSPEC_ALIGN(x)
#define MEMORY_ALLOCATION_ALIGNMENT
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG Offset
#define DECLSPEC_SELECTANY
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_INFORMATION
base of all file and directory entries
FxVerifierLock * VerifierLock
DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) ULONG AllocationStart[1]
FxTagTracker * TagTracker
struct _SINGLE_LIST_ENTRY * Next
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID _In_ ULONG QueryBufferLength
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
#define WDF_NO_OBJECT_ATTRIBUTES