Go to the documentation of this file.
4 #define GDI_MAX_HANDLE_COUNT 0x4000
6 #define GDI_HANDLE_INDEX_SHIFT 0
7 #define GDI_HANDLE_INDEX_BITS 16
8 #define GDI_HANDLE_INDEX_MASK 0xffff
10 #define GDI_HANDLE_TYPE_SHIFT 16
11 #define GDI_HANDLE_TYPE_BITS 5
12 #define GDI_HANDLE_TYPE_MASK 0x1f
14 #define GDI_HANDLE_ALTTYPE_SHIFT 21
15 #define GDI_HANDLE_ALTTYPE_BITS 2
16 #define GDI_HANDLE_ALTTYPE_MASK 0x3
18 #define GDI_HANDLE_STOCK_SHIFT 23
19 #define GDI_HANDLE_STOCK_BITS 1
20 #define GDI_HANDLE_STOCK_MASK 0x1
22 #define GDI_HANDLE_UNIQUE_SHIFT 24
23 #define GDI_HANDLE_UNIQUE_BITS 8
24 #define GDI_HANDLE_UNIQUE_MASK 0xff
26 #define GDI_HANDLE_INDEX(Handle) ((ULONG)(Handle) & GDI_HANDLE_INDEX_MASK)
27 #define GDI_HANDLE_TYPE(Handle) (((ULONG)(Handle) >> GDI_HANDLE_TYPE_SHIFT) & GDI_HANDLE_TYPE_MASK)
28 #define GDI_HANDLE_ALTTYPE(Handle) (((ULONG)(Handle) >> GDI_HANDLE_ALTTYPE_SHIFT) & GDI_HANDLE_ALTTYPE_MASK)
29 #define GDI_HANDLE_STOCK(Handle) (((ULONG)(Handle) >> GDI_HANDLE_STOCK_SHIFT)) & GDI_HANDLE_STOCK_MASK)
31 #define GDI_MAKE_HANDLE(Index, Unique) ((ULONG)(((ULONG)(Unique) << GDI_HANDLE_INDEX_BITS) | (ULONG)(Index)))
35 #define GDI_DEF_TYPE 0 // invalid handle
37 #define GDI_DD_DIRECTDRAW_TYPE 2
38 #define GDI_DD_SURFACE_TYPE 3
39 #define GDI_RGN_TYPE 4
40 #define GDI_SURF_TYPE 5
41 #define GDI_CLIENTOBJ_TYPE 6
42 #define GDI_PATH_TYPE 7
43 #define GDI_PAL_TYPE 8
44 #define GDI_ICMLCS_TYPE 9
45 #define GDI_LFONT_TYPE 10
46 #define GDI_RFONT_TYPE 11
47 #define GDI_PFE_TYPE 12
48 #define GDI_PFT_TYPE 13
49 #define GDI_ICMCXF_TYPE 14
50 #define GDI_ICMDLL_TYPE 15
51 #define GDI_BRUSH_TYPE 16
52 #define GDI_PFF_TYPE 17 // unused
53 #define GDI_CACHE_TYPE 18 // unused
54 #define GDI_SPACE_TYPE 19
55 #define GDI_DBRUSH_TYPE 20 // unused
56 #define GDI_META_TYPE 21
57 #define GDI_EFSTATE_TYPE 22
58 #define GDI_BMFD_TYPE 23 // unused
59 #define GDI_VTFD_TYPE 24 // unused
60 #define GDI_TTFD_TYPE 25 // unused
61 #define GDI_RC_TYPE 26 // unused
62 #define GDI_TEMP_TYPE 27 // unused
63 #define GDI_DRVOBJ_TYPE 28
64 #define GDI_DCIOBJ_TYPE 29 // unused
65 #define GDI_SPOOL_TYPE 30
69 #define GDI_CLIENT_TYPE_FROM_HANDLE(Handle) ((ULONG)(Handle) & ((GDI_HANDLE_ALTTYPE_MASK << GDI_HANDLE_ALTTYPE_SHIFT) | \
70 (GDI_HANDLE_TYPE_MASK << GDI_HANDLE_TYPE_SHIFT)))
71 #define GDI_CLIENT_TYPE_FROM_UNIQUE(Unique) GDI_CLIENT_TYPE_FROM_HANDLE((ULONG)(Unique) << 16)
73 #define GDI_ALTTYPE_1 (1 << GDI_HANDLE_ALTTYPE_SHIFT)
74 #define GDI_ALTTYPE_2 (2 << GDI_HANDLE_ALTTYPE_SHIFT)
75 #define GDI_ALTTYPE_3 (3 << GDI_HANDLE_ALTTYPE_SHIFT)
77 #define GDI_CLIENT_BITMAP_TYPE (GDI_SURF_TYPE << GDI_HANDLE_TYPE_SHIFT)
78 #define GDI_CLIENT_BRUSH_TYPE (GDI_BRUSH_TYPE << GDI_HANDLE_TYPE_SHIFT)
79 #define GDI_CLIENT_CLIENTOBJ_TYPE (GDI_CLIENTOBJ_TYPE << GDI_HANDLE_TYPE_SHIFT)
80 #define GDI_CLIENT_DC_TYPE (GDI_DC_TYPE << GDI_HANDLE_TYPE_SHIFT)
81 #define GDI_CLIENT_FONT_TYPE (GDI_LFONT_TYPE << GDI_HANDLE_TYPE_SHIFT)
82 #define GDI_CLIENT_PALETTE_TYPE (GDI_PAL_TYPE << GDI_HANDLE_TYPE_SHIFT)
83 #define GDI_CLIENT_REGION_TYPE (GDI_RGN_TYPE << GDI_HANDLE_TYPE_SHIFT)
85 #define GDI_CLIENT_ALTDC_TYPE (GDI_CLIENT_DC_TYPE | GDI_ALTTYPE_1)
86 #define GDI_CLIENT_DIBSECTION_TYPE (GDI_CLIENT_BITMAP_TYPE | GDI_ALTTYPE_1)
87 #define GDI_CLIENT_EXTPEN_TYPE (GDI_CLIENT_BRUSH_TYPE | GDI_ALTTYPE_2)
88 #define GDI_CLIENT_METADC16_TYPE (GDI_CLIENT_CLIENTOBJ_TYPE | GDI_ALTTYPE_3)
89 #define GDI_CLIENT_METAFILE_TYPE (GDI_CLIENT_CLIENTOBJ_TYPE | GDI_ALTTYPE_2)
90 #define GDI_CLIENT_METAFILE16_TYPE (GDI_CLIENT_CLIENTOBJ_TYPE | GDI_ALTTYPE_1)
91 #define GDI_CLIENT_PEN_TYPE (GDI_CLIENT_BRUSH_TYPE | GDI_ALTTYPE_1)