- God is a second-hand imitation of Gé. Fix for bug 1213.
[reactos.git] / reactos / subsys / win32k / include / gdiobj.h
1 /*
2 * GDI object common header definition
3 *
4 */
5
6 #ifndef __WIN32K_GDIOBJ_H
7 #define __WIN32K_GDIOBJ_H
8
9 /* Public GDI Object/Handle definitions */
10 #include <win32k/ntgdihdl.h>
11
12 typedef PVOID PGDIOBJ;
13
14 typedef BOOL (INTERNAL_CALL *GDICLEANUPPROC)(PVOID ObjectBody);
15
16 /*!
17 * GDI object header. This is a part of any GDI object
18 */
19 typedef struct _GDIOBJHDR
20 {
21 PETHREAD LockingThread; /* only assigned if a thread is holding the lock! */
22 ULONG Locks;
23 #ifdef GDI_DEBUG
24 const char* createdfile;
25 int createdline;
26 const char* lockfile;
27 int lockline;
28 #endif
29 } GDIOBJHDR, *PGDIOBJHDR;
30
31 BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle);
32 void INTERNAL_CALL GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS Owner);
33 void INTERNAL_CALL GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo);
34 BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj);
35 VOID INTERNAL_CALL GDIOBJ_UnlockObjByPtr(PGDIOBJ Object);
36
37 #define GDIOBJ_GetObjectType(Handle) \
38 GDI_HANDLE_GET_TYPE(Handle)
39
40 #ifdef GDI_DEBUG
41
42 /* a couple macros for debugging GDIOBJ locking */
43 #define GDIOBJ_AllocObj(ty) GDIOBJ_AllocObjDbg(__FILE__,__LINE__,ty)
44 #define GDIOBJ_FreeObj(obj,ty) GDIOBJ_FreeObjDbg(__FILE__,__LINE__,obj,ty)
45 #define GDIOBJ_LockObj(obj,ty) GDIOBJ_LockObjDbg(__FILE__,__LINE__,obj,ty)
46 #define GDIOBJ_ShareLockObj(obj,ty) GDIOBJ_ShareLockObjDbg(__FILE__,__LINE__,obj,ty)
47
48 HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObjDbg(const char* file, int line, ULONG ObjectType);
49 BOOL INTERNAL_CALL GDIOBJ_FreeObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType);
50 PGDIOBJ INTERNAL_CALL GDIOBJ_LockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType);
51 PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType);
52
53 #else /* !GDI_DEBUG */
54
55 HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObj(ULONG ObjectType);
56 BOOL INTERNAL_CALL GDIOBJ_FreeObj (HGDIOBJ hObj, DWORD ObjectType);
57 PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType);
58 PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType);
59
60 #endif /* GDI_DEBUG */
61
62 PVOID INTERNAL_CALL GDI_MapHandleTable(PEPROCESS Process);
63
64 #define GDIOBJFLAG_DEFAULT (0x0)
65 #define GDIOBJFLAG_IGNOREPID (0x1)
66 #define GDIOBJFLAG_IGNORELOCK (0x2)
67
68 #endif