ReactOS 0.4.16-dev-106-g10b08aa
baseobj.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#define GDIOBJ_POOL_TAG(type) ('00hG' + (((type) & 0x1f) << 24))
5
6#define BASEOBJECT CBASEOBJECT
7
8class BASEOBJECT : private _BASEOBJECT
9{
10public:
11
12 enum OWNER
13 {
17 };
18
19protected:
20
22 _In_ GDILOOBJTYPE loobjtype)
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 }
35
36 static
39 HGDIOBJ hobj,
40 GDIOBJTYPE objtype);
41
42 static
45 HGDIOBJ hobj,
46 GDILOOBJTYPE loobjtype);
47
48 static
51 HGDIOBJ hobj,
52 GDILOOBJTYPE loobjtype,
53 OWNER owner)
54 {
56 return reinterpret_cast<CBASEOBJECT*>(GDIOBJ_ShareLockObj(hobj, loobjtype));
57 }
58
59 VOID
61 _In_opt_ PVOID pvUserAttr)
62 {
63 GDIOBJ_vSetObjectAttr((POBJ)this, pvUserAttr);
64 }
65
66
67public:
68
69 static
70 inline
71 PVOID
73 _In_ GDIOBJTYPE objtype,
75 {
77 }
78
79 VOID
81 VOID)
82 {
83 if (this->cExclusiveLock > 0)
84 {
86 }
87 else
88 {
90 }
91 }
92
93 inline
96 VOID)
97 {
98 return _BASEOBJECT::hHmgr;
99 }
100
101 HGDIOBJ
103 OWNER owner)
104 {
105 return GDIOBJ_hInsertObject(this, owner);
106 }
107
108};
109
110
#define GDIOBJ_POOL_TAG(type)
Definition: baseobj.hpp:4
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
VOID vUnlock(VOID)
Definition: baseobj.hpp:80
VOID vSetObjectAttr(_In_opt_ PVOID pvUserAttr)
Definition: baseobj.hpp:60
HGDIOBJ hInsertObject(OWNER owner)
Definition: baseobj.hpp:102
BASEOBJECT(_In_ GDILOOBJTYPE loobjtype)
Definition: baseobj.hpp:21
static BASEOBJECT * LockExclusive(HGDIOBJ hobj, GDIOBJTYPE objtype)
static BASEOBJECT * LockShared(HGDIOBJ hobj, GDILOOBJTYPE loobjtype, OWNER owner)
Definition: baseobj.hpp:50
static PVOID pvAllocate(_In_ GDIOBJTYPE objtype, _In_ SIZE_T cjSize)
Definition: baseobj.hpp:72
static BASEOBJECT * LockExclusive(HGDIOBJ hobj, GDILOOBJTYPE loobjtype)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
enum GDILoObjType GDILOOBJTYPE
#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
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#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
enum GDIObjType GDIOBJTYPE
HGDIOBJ hHmgr
Definition: gdiobj.h:40
USHORT BaseFlags
Definition: gdiobj.h:46
USHORT cExclusiveLock
Definition: gdiobj.h:45
ULONG ulShareCount
Definition: gdiobj.h:42
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG_PTR
Definition: typedefs.h:65
VOID NTAPI GDIOBJ_vDereferenceObject(POBJ pobj)
Definition: gdiobj.c:631
HGDIOBJ NTAPI GDIOBJ_hInsertObject(POBJ pobj, ULONG ulOwner)
Definition: gdiobj.c:912
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
Definition: gdiobj.c:1096
PGDIOBJ NTAPI GDIOBJ_ShareLockObj(HGDIOBJ hObj, DWORD ExpectedType)
Definition: gdiobj.c:1443
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:880
_In_ ULONG cjSize
Definition: winddi.h:3634
void * HGDIOBJ
Definition: windef.h:252