ReactOS 0.4.16-dev-401-g45b008d
BASEOBJECT Class Reference

#include <baseobj.hpp>

Inheritance diagram for BASEOBJECT:
Collaboration diagram for BASEOBJECT:

Public Types

enum  OWNER { POWNED = GDI_OBJ_HMGR_POWNED , PUBLIC = GDI_OBJ_HMGR_PUBLIC , NONE = GDI_OBJ_HMGR_NONE }
 

Public Member Functions

VOID vUnlock (VOID)
 
HGDIOBJ hHmgr (VOID)
 
HGDIOBJ hInsertObject (OWNER owner)
 

Static Public Member Functions

static PVOID pvAllocate (_In_ GDIOBJTYPE objtype, _In_ SIZE_T cjSize)
 

Protected Member Functions

 BASEOBJECT (_In_ GDILOOBJTYPE loobjtype)
 
VOID vSetObjectAttr (_In_opt_ PVOID pvUserAttr)
 

Static Protected Member Functions

static BASEOBJECTLockExclusive (HGDIOBJ hobj, GDIOBJTYPE objtype)
 
static BASEOBJECTLockExclusive (HGDIOBJ hobj, GDILOOBJTYPE loobjtype)
 
static BASEOBJECTLockShared (HGDIOBJ hobj, GDILOOBJTYPE loobjtype, OWNER owner)
 

Additional Inherited Members

- Private Attributes inherited from _BASEOBJECT
HGDIOBJ hHmgr
 
union {
   ULONG   ulShareCount
 
   DWORD   dwThreadId
 
}; 
 
USHORT cExclusiveLock
 
USHORT BaseFlags
 
EX_PUSH_LOCK pushlock
 

Detailed Description

Definition at line 8 of file baseobj.hpp.

Member Enumeration Documentation

◆ OWNER

enum BASEOBJECT::OWNER
Enumerator
POWNED 
PUBLIC 
NONE 

Definition at line 12 of file baseobj.hpp.

13 {
17 };
#define NONE
Definition: ntddpar.h:94
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
#define GDI_OBJ_HMGR_NONE
Definition: ntgdihdl.h:118

Constructor & Destructor Documentation

◆ BASEOBJECT()

BASEOBJECT::BASEOBJECT ( _In_ GDILOOBJTYPE  loobjtype)
inlineprotected

Definition at line 21 of file baseobj.hpp.

23 {
24 /* Initialize the object */
26 this->cExclusiveLock = 0;
27 this->ulShareCount = 1;
28 this->BaseFlags = 0;//fl & 0xffff;
29 DBG_INITLOG(&this->slhLog);
30 DBG_LOGEVENT(&this->slhLog, EVENT_ALLOCATE, 0);
31 #if DBG_ENABLE_GDIOBJ_BACKTRACES
33 #endif /* GDI_DEBUG */
34 }
#define DBG_LOGEVENT(pslh, type, val)
Definition: gdidebug.h:109
#define DBG_INITLOG(pslh)
Definition: gdidebug.h:110
ULONG NTAPI DbgCaptureStackBackTace(_Out_writes_(cFramesToCapture) PVOID *ppvFrames, _In_ ULONG cFramesToSkip, _In_ ULONG cFramesToCapture)
#define GDI_OBJECT_STACK_LEVELS
Definition: gdiobj.h:8
HGDIOBJ hHmgr
Definition: gdiobj.h:40
USHORT BaseFlags
Definition: gdiobj.h:46
USHORT cExclusiveLock
Definition: gdiobj.h:45
ULONG ulShareCount
Definition: gdiobj.h:42
uint32_t ULONG_PTR
Definition: typedefs.h:65
void * HGDIOBJ
Definition: windef.h:252

Member Function Documentation

◆ hHmgr()

◆ hInsertObject()

HGDIOBJ BASEOBJECT::hInsertObject ( OWNER  owner)
inline

Definition at line 102 of file baseobj.hpp.

104 {
105 return GDIOBJ_hInsertObject(this, owner);
106 }
HGDIOBJ NTAPI GDIOBJ_hInsertObject(POBJ pobj, ULONG ulOwner)
Definition: gdiobj.c:912

◆ LockExclusive() [1/2]

static BASEOBJECT * BASEOBJECT::LockExclusive ( HGDIOBJ  hobj,
GDILOOBJTYPE  loobjtype 
)
staticprotected

◆ LockExclusive() [2/2]

static BASEOBJECT * BASEOBJECT::LockExclusive ( HGDIOBJ  hobj,
GDIOBJTYPE  objtype 
)
staticprotected

◆ LockShared()

static BASEOBJECT * BASEOBJECT::LockShared ( HGDIOBJ  hobj,
GDILOOBJTYPE  loobjtype,
OWNER  owner 
)
inlinestaticprotected

FIXME: should check owner!

Definition at line 50 of file baseobj.hpp.

54 {
56 return reinterpret_cast<CBASEOBJECT*>(GDIOBJ_ShareLockObj(hobj, loobjtype));
57 }
PGDIOBJ NTAPI GDIOBJ_ShareLockObj(HGDIOBJ hObj, DWORD ExpectedType)
Definition: gdiobj.c:1443

Referenced by BRUSH::_Ret_opt_bytecap_(), and BRUSH::_Ret_opt_bytecount_().

◆ pvAllocate()

static PVOID BASEOBJECT::pvAllocate ( _In_ GDIOBJTYPE  objtype,
_In_ SIZE_T  cjSize 
)
inlinestatic

Definition at line 72 of file baseobj.hpp.

75 {
77 }
#define GDIOBJ_POOL_TAG(type)
Definition: baseobj.hpp:4
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
_In_ ULONG cjSize
Definition: winddi.h:3634

◆ vSetObjectAttr()

VOID BASEOBJECT::vSetObjectAttr ( _In_opt_ PVOID  pvUserAttr)
inlineprotected

Definition at line 60 of file baseobj.hpp.

62 {
63 GDIOBJ_vSetObjectAttr((POBJ)this, pvUserAttr);
64 }
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
Definition: gdiobj.c:1096

Referenced by BRUSH::bAllocateBrushAttr().

◆ vUnlock()

VOID BASEOBJECT::vUnlock ( VOID  )
inline

Definition at line 80 of file baseobj.hpp.

82 {
83 if (this->cExclusiveLock > 0)
84 {
86 }
87 else
88 {
90 }
91 }
VOID NTAPI GDIOBJ_vDereferenceObject(POBJ pobj)
Definition: gdiobj.c:631
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:880

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