ReactOS 0.4.15-dev-7907-g95bf896
gdiobj.h
Go to the documentation of this file.
1/*
2 * GDI object common header definition
3 *
4 */
5
6#pragma once
7
8#define GDI_OBJECT_STACK_LEVELS 20
9
10/* The first 10 entries are never used in windows, they are empty */
11static const unsigned RESERVE_ENTRIES_COUNT = 10;
12
13typedef struct _GDI_HANDLE_TABLE
14{
15/* The table must be located at the beginning of this structure so it can be
16 * properly mapped!
17 */
20 DEVCAPS DevCaps; // Device Capabilities.
21 FLONG flDeviceUniq; // Device settings uniqueness.
22 PVOID pvLangPack; // Language Pack.
23 CFONT cfPublic[GDI_CFONT_MAX]; // Public Fonts.
25
26
28
30
31typedef PVOID PGDIOBJ;
32
33typedef VOID (NTAPI *GDICLEANUPPROC)(PVOID ObjectBody);
34typedef VOID (NTAPI *GDIOBJDELETEPROC)(PVOID ObjectBody);
35
36/* Every GDI Object must have this standard type of header.
37 * It's for thread locking. */
38typedef struct _BASEOBJECT
39{
41 union {
42 ULONG ulShareCount; /* For objects without a handle */
43 DWORD dwThreadId; /* Exclusive lock owner */
44 };
48#if DBG_ENABLE_GDIOBJ_BACKTRACES
49 PVOID apvBackTrace[GDI_OBJECT_STACK_LEVELS];
50#endif
51#if DBG_ENABLE_EVENT_LOGGING
52 SLIST_HEADER slhLog;
53#endif
55
57{
59
60 /* ReactOS specific: */
62};
63
64typedef struct _CLIENTOBJ
65{
68
70{
74};
75
76CODE_SEG("INIT")
80
81BOOL
84 HGDIOBJ hobj);
85
86BOOL
89 HGDIOBJ hObject);
90
94 HGDIOBJ hobj);
95
96BOOL
99 HGDIOBJ hobj,
100 ULONG ulOwner);
101
102BOOL
103NTAPI
105 HGDIOBJ hobj,
106 ULONG ulOwner,
107 ULONG Flags);
108
109INT
110NTAPI
112 IN HGDIOBJ hobj,
113 IN INT cbCount,
114 OUT PVOID pvBuffer);
115
116POBJ
117NTAPI
119 UCHAR objt,
121 FLONG fl);
122
123VOID
124NTAPI
126 POBJ pobj);
127
128POBJ
129NTAPI
131 HGDIOBJ hobj,
132 UCHAR objt);
133
134VOID
135NTAPI
137 POBJ pobj);
138
139VOID
140NTAPI
142 POBJ pobj);
143
145NTAPI
147 HGDIOBJ hobj,
148 UCHAR objt);
149
151NTAPI
153 HGDIOBJ hobj,
154 UCHAR objt);
155
156VOID
157NTAPI
159 POBJ pobj);
160
161VOID
162NTAPI
164 POBJ pobj,
165 ULONG ulOwner);
166
167BOOL
168NTAPI
170 ULONG ulCount,
171 HGDIOBJ* ahObj,
172 PGDIOBJ* apObj,
173 UCHAR objt);
174
176NTAPI
178 POBJ pobj,
179 ULONG ulOwner);
180
181VOID
182NTAPI
184 POBJ pobj);
185
186VOID
187NTAPI
189 POBJ pobj,
190 PVOID pvObjAttr);
191
192PVOID
193NTAPI
195 POBJ pobj);
196
#define CODE_SEG(...)
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
#define GDI_HANDLE_COUNT
Definition: gdi.h:12
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
Definition: gdiobj.c:1255
struct _CLIENTOBJ * PCLIENTOBJ
struct _GDI_HANDLE_TABLE * PGDI_HANDLE_TABLE
POBJ NTAPI GDIOBJ_ReferenceObjectByHandle(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:691
VOID NTAPI GDIOBJ_vDereferenceObject(POBJ pobj)
Definition: gdiobj.c:631
struct _CLIENTOBJ CLIENTOBJ
BASEFLAGS
Definition: gdiobj.h:57
@ BASEFLAG_READY_TO_DIE
Definition: gdiobj.h:61
@ BASEFLAG_LOOKASIDE
Definition: gdiobj.h:58
PVOID NTAPI GDIOBJ_pvGetObjectAttr(POBJ pobj)
Definition: gdiobj.c:1088
BOOL NTAPI GreSetObjectOwnerEx(HGDIOBJ hobj, ULONG ulOwner, ULONG Flags)
Definition: gdiobj.c:1222
struct _BASEOBJECT * POBJ
BOOL NTAPI GDIOBJ_ConvertFromStockObj(HGDIOBJ *phObj)
Definition: gdiobj.c:1489
_GDIOBJLAGS
Definition: gdiobj.h:70
@ GDIOBJFLAG_DEFAULT
Definition: gdiobj.h:71
@ GDIOBJFLAG_IGNOREPID
Definition: gdiobj.h:72
@ GDIOBJFLAG_IGNORELOCK
Definition: gdiobj.h:73
PVOID NTAPI GDI_MapHandleTable(PEPROCESS Process)
Definition: gdiobj.c:1552
VOID(NTAPI * GDICLEANUPPROC)(PVOID ObjectBody)
Definition: gdiobj.h:33
VOID NTAPI GDIOBJ_vFreeObject(POBJ pobj)
Definition: gdiobj.c:596
HGDIOBJ NTAPI GDIOBJ_hInsertObject(POBJ pobj, ULONG ulOwner)
Definition: gdiobj.c:912
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
Definition: gdiobj.c:1096
#define GDI_OBJECT_STACK_LEVELS
Definition: gdiobj.h:8
BOOL NTAPI GreDeleteObject(HGDIOBJ hObject)
Definition: gdiobj.c:1158
PGDIOBJ NTAPI GDIOBJ_LockObject(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:826
ULONG NTAPI GreGetObjectOwner(HGDIOBJ hobj)
Definition: gdiobj.c:1192
static const unsigned RESERVE_ENTRIES_COUNT
Definition: gdiobj.h:11
PVOID PGDIOBJ
Definition: gdiobj.h:31
BOOL NTAPI GDIOBJ_bLockMultipleObjects(ULONG ulCount, HGDIOBJ *ahObj, PGDIOBJ *apObj, UCHAR objt)
VOID(NTAPI * GDIOBJDELETEPROC)(PVOID ObjectBody)
Definition: gdiobj.h:34
struct _BASEOBJECT BASEOBJECT
POBJ NTAPI GDIOBJ_AllocateObject(UCHAR objt, ULONG cjSize, FLONG fl)
Definition: gdiobj.c:562
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1146
struct _GDI_HANDLE_TABLE GDI_HANDLE_TABLE
POBJ NTAPI GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
Definition: gdiobj.c:1522
BOOL NTAPI GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj)
Definition: gdiobj.c:1455
INT NTAPI GreGetObject(IN HGDIOBJ hobj, IN INT cbCount, OUT PVOID pvBuffer)
Definition: gdiobj.c:1264
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:880
PGDI_HANDLE_TABLE GdiHandleTable
Definition: gdihv.c:26
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1111
VOID NTAPI GDIOBJ_vSetObjectOwner(POBJ pobj, ULONG ulOwner)
Definition: gdiobj.c:965
PGDIOBJ NTAPI GDIOBJ_ShareLockObj(HGDIOBJ hObj, DWORD ObjectType)
Definition: gdiobj.c:1443
PGDIOBJ NTAPI GDIOBJ_TryLockObject(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:757
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:734
ObjectType
Definition: metafile.c:81
static int cbCount
Definition: fiber.c:42
unsigned long FLONG
Definition: ntbasedef.h:366
#define GDI_CFONT_MAX
Definition: ntgdihdl.h:20
unsigned short USHORT
Definition: pedump.c:61
HGDIOBJ hHmgr
Definition: gdiobj.h:40
USHORT BaseFlags
Definition: gdiobj.h:46
USHORT cExclusiveLock
Definition: gdiobj.h:45
DWORD dwThreadId
Definition: gdiobj.h:43
ULONG ulShareCount
Definition: gdiobj.h:42
EX_PUSH_LOCK pushlock
Definition: gdiobj.h:47
BASEOBJECT BaseObject
Definition: gdiobj.h:66
CFONT cfPublic[GDI_CFONT_MAX]
Definition: gdiobj.h:23
DWORD dwCFCount
Definition: gdiobj.h:24
FLONG flDeviceUniq
Definition: gdiobj.h:21
DEVCAPS DevCaps
Definition: gdiobj.h:20
PVOID pvLangPack
Definition: gdiobj.h:22
GDI_TABLE_ENTRY Entries[GDI_HANDLE_COUNT]
Definition: gdiobj.h:19
Definition: gdi.h:2
#define NTAPI
Definition: typedefs.h:36
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
NTSTATUS NTAPI InitGdiHandleTable(void)
Definition: gdiobj.c:259
_In_ FLONG fl
Definition: winddi.h:1279
_In_ ULONG cjSize
Definition: winddi.h:3634
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
unsigned char UCHAR
Definition: xmlstorage.h:181