2 #define _WIN32_WINNT 0x0501
5 typedef struct _GDI_TABLE_ENTRY
7 PVOID KernelData
; /* Points to the kernel mode structure */
8 HANDLE ProcessId
; /* process id that created the object, 0 for stock objects */
9 LONG Type
; /* the first 16 bit is the object type including the stock obj flag, the last 16 bits is just the object type */
10 PVOID UserData
; /* Points to the user mode structure, usually NULL though */
11 } GDI_TABLE_ENTRY
, *PGDI_TABLE_ENTRY
;
13 typedef PGDI_TABLE_ENTRY (CALLBACK
* GDIQUERYPROC
) (void);
15 /* GDI handle table can hold 0x4000 handles */
16 #define GDI_HANDLE_COUNT 0x10000
17 #define GDI_GLOBAL_PROCESS (0x0)
19 /* Handle Masks and shifts */
20 #define GDI_HANDLE_INDEX_MASK (GDI_HANDLE_COUNT - 1)
21 #define GDI_HANDLE_TYPE_MASK 0x007f0000
22 #define GDI_HANDLE_STOCK_MASK 0x00800000
23 #define GDI_HANDLE_REUSE_MASK 0xff000000
24 #define GDI_HANDLE_REUSECNT_SHIFT 24
25 #define GDI_HANDLE_UPPER_MASK 0xffff0000
28 #define GDI_HANDLE_CREATE(i, t) \
29 ((HANDLE)(((i) & GDI_HANDLE_INDEX_MASK) | ((t) << 16)))
31 #define GDI_HANDLE_GET_INDEX(h) \
32 (((ULONG_PTR)(h)) & GDI_HANDLE_INDEX_MASK)
34 #define GDI_HANDLE_GET_TYPE(h) \
35 (((ULONG_PTR)(h)) & GDI_HANDLE_TYPE_MASK)
37 #define GDI_HANDLE_IS_TYPE(h, t) \
38 ((t) == (((ULONG_PTR)(h)) & GDI_HANDLE_TYPE_MASK))
40 #define GDI_HANDLE_IS_STOCKOBJ(h) \
41 (0 != (((ULONG_PTR)(h)) & GDI_HANDLE_STOCK_MASK))
43 #define GDI_HANDLE_SET_STOCKOBJ(h) \
44 ((h) = (HANDLE)(((ULONG_PTR)(h)) | GDI_HANDLE_STOCK_MASK))
46 #define GDI_HANDLE_GET_UPPER(h) \
47 (((ULONG_PTR)(h)) & GDI_HANDLE_UPPER_MASK)
49 #define GDI_OBJECT_TYPE_DC 0x00010000
50 #define GDI_OBJECT_TYPE_REGION 0x00040000
51 #define GDI_OBJECT_TYPE_BITMAP 0x00050000
52 #define GDI_OBJECT_TYPE_PALETTE 0x00080000
53 #define GDI_OBJECT_TYPE_FONT 0x000a0000
54 #define GDI_OBJECT_TYPE_BRUSH 0x00100000
55 #define GDI_OBJECT_TYPE_EMF 0x00210000
56 #define GDI_OBJECT_TYPE_PEN 0x00300000
57 #define GDI_OBJECT_TYPE_EXTPEN 0x00500000
58 #define GDI_OBJECT_TYPE_COLORSPACE 0x00090000
59 #define GDI_OBJECT_TYPE_METADC 0x00660000
60 #define GDI_OBJECT_TYPE_METAFILE 0x00260000
61 #define GDI_OBJECT_TYPE_ENHMETAFILE 0x00460000
62 /* Following object types made up for ROS */
63 #define GDI_OBJECT_TYPE_ENHMETADC 0x00740000
64 #define GDI_OBJECT_TYPE_MEMDC 0x00750000
65 #define GDI_OBJECT_TYPE_DCE 0x00770000
66 #define GDI_OBJECT_TYPE_DONTCARE 0x007f0000
67 /** Not really an object type. Forces GDI_FreeObj to be silent. */
68 #define GDI_OBJECT_TYPE_SILENT 0x80000000
72 /* Number Representation */
76 typedef struct _EFLOAT_S
82 /* XFORM Structures */
83 typedef struct _MATRIX_S
96 /* GDI object structures */
98 typedef struct _RGNATTR
105 // Local DC structure (_DC_ATTR) PVOID pvLDC;
111 PVOID pvEmfDC
; /* Pointer to ENHMETAFILE structure */
112 ABORTPROC pAbortProc
; /* AbortProc for Printing */
113 HANDLE hPrinter
; /* Local or Remote Printer driver */
114 INT iInitPage
; /* Start/Stop */
125 COLORREF crBackgroundClr
; // 010
126 ULONG ulBackgroundClr
;
127 COLORREF crForegroundClr
;
128 ULONG ulForegroundClr
;
130 #if (_WIN32_WINNT >= 0x0500)
131 COLORREF crBrushClr
; // 020
142 BYTE jStretchBltMode
;
144 POINT ptlCurrent
; // 03C
145 POINTFX ptfxCurrent
; // 044
148 long lFillMode
; // 050
149 long lStretchBltMode
;
151 #if (_WIN32_WINNT >= 0x0500)
152 long flFontMapper
; // 058
154 unsigned hcmXform
; // 060
155 HCOLORSPACE hColorSpace
;
157 unsigned IcmBrushColor
;
158 unsigned IcmPenColor
; // 070
162 long flTextAlign
; // 078
164 long lTextExtra
; // 080
169 HFONT hlfntNew
; // 090
170 MATRIX mxWorldToDevice
; // 094
171 MATRIX mxDeviceToWorld
; // 0D0
172 MATRIX mxWorldToPage
; // 10C
181 #if (_WIN32_WINNT >= 0x0500)
182 DWORD dwLayout
; // 16c
183 long lWindowOrgx
; // 170
185 POINT ptlWindowOrg
; // 174
186 SIZE szlWindowExt
; // 17c
187 POINT ptlViewportOrg
; // 184
188 SIZE szlViewportExt
; // 18c
191 SIZE szlVirtualDevicePixel
; // 198
192 SIZE szlVirtualDeviceMm
; // 1a0
193 POINT ptlBrushOrigin
; // 1a8
195 unsigned unk1b0_00000000
[2]; // 1b0
196 RGNATTR VisRectRegion
;
198 // unsigned unk1b0_00000000[2]; // 1b0
199 // unsigned RectRegionFlag; // 1b4
200 // RECT VisRectRegion; // 1b8
201 } DC_ATTR
, *PDC_ATTR
;
203 HDC WINAPI
GdiConvertBitmap(HDC hdc
);
204 HBRUSH WINAPI
GdiConvertBrush(HBRUSH hbr
);
205 HDC WINAPI
GdiConvertDC(HDC hdc
);
206 HFONT WINAPI
GdiConvertFont(HFONT hfont
);
207 HPALETTE WINAPI
GdiConvertPalette(HPALETTE hpal
);
208 HRGN WINAPI
GdiConvertRegion(HRGN hregion
);
209 HBRUSH WINAPI
GdiGetLocalBrush(HBRUSH hbr
);
210 HDC WINAPI
GdiGetLocalDC(HDC hdc
);