[PSDK]
[reactos.git] / reactos / include / psdk / winddi.h
1 /*
2 * winddi.h
3 *
4 * GDI device driver interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 * Annotations by Timo Kreuzer <timo.kreuzer@reactos.org>
11 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 */
23
24 #ifndef _WINDDI_
25 #define _WINDDI_
26 #pragma once
27
28 #ifdef __VIDEO_H__
29 #error video.h cannot be included with winddi.h
30 #else
31
32 //#include <winapifamily.h>
33 #include <ddrawint.h>
34 #include <d3dnthal.h>
35 #include <specstrings.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #ifndef DECLSPEC_IMPORT
42 #define DECLSPEC_IMPORT __attribute__((dllimport))
43 #endif
44
45 #if defined(_ENGINE_EXPORT_)
46 #define ENGAPI
47 #else
48 #define ENGAPI DECLSPEC_IMPORT
49 #endif
50
51 #ifndef _NO_DDRAWINT_NO_COM
52
53 #if !defined(EXTERN_C)
54 #ifdef __cplusplus
55 #define EXTERN_C extern "C"
56 #define __EXTERN_C extern "C"
57 #else
58 #define EXTERN_C extern
59 #define __EXTERN_C
60 #endif
61 #endif /* !defined(EXTERN_C) */
62
63 #if !defined(DEFINE_GUID)
64 #ifdef INITGUID
65 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
66 __EXTERN_C const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
67 #else /* !INITGUID */
68 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
69 EXTERN_C const GUID FAR name
70 #endif /* !INITGUID */
71 #endif /* !defined(DEFINE_GUID) */
72
73 #if !defined(DEFINE_GUIDEX)
74 #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
75 #endif /* !defined(DEFINE_GUIDEX) */
76
77 #if !defined(STATICGUIDOF)
78 #define STATICGUIDOF(guid) STATIC_##guid
79 #endif /* !defined(STATICGUIDOF) */
80
81 #if !defined(GUID_DEFINED)
82 #define GUID_DEFINED
83 typedef struct _GUID
84 {
85 ULONG Data1;
86 USHORT Data2;
87 USHORT Data3;
88 UCHAR Data4[8];
89 } GUID;
90 #endif /* !defined(GUID_DEFINED) */
91
92 #if !defined(IsEqualGUID)
93 #define IsEqualGUID(guid1, guid2) \
94 (!memcmp((guid1), (guid2), sizeof(GUID)))
95 #endif /* !defined(IsEqualGUID) */
96
97 #ifndef IsEqualIID
98 #define IsEqualIID IsEqualGUID
99 #endif /* !defined(IsEqualIID) */
100
101 #endif /* !_NO_DDRAWINT_NO_COM */
102
103 #define DDI_DRIVER_VERSION_NT4 0x00020000
104 #define DDI_DRIVER_VERSION_SP3 0x00020003
105 #define DDI_DRIVER_VERSION_NT5 0x00030000
106 #define DDI_DRIVER_VERSION_NT5_01 0x00030100
107 #define DDI_DRIVER_VERSION_NT5_01_SP1 0x00030101
108
109 #define GDI_DRIVER_VERSION 0x4000
110
111 #if defined(_X86_) && !defined(USERMODE_DRIVER) && !defined(BUILD_WOW6432)
112 typedef DWORD FLOATL;
113 #else
114 typedef FLOAT FLOATL;
115 #endif
116
117 typedef SHORT FWORD;
118 typedef LONG LDECI4;
119 typedef ULONG IDENT;
120
121 typedef ULONG_PTR HFF;
122 typedef ULONG_PTR HFC;
123
124 typedef LONG PTRDIFF;
125 typedef PTRDIFF *PPTRDIFF;
126 typedef LONG FIX;
127 typedef FIX *PFIX;
128 typedef ULONG ROP4;
129 typedef ULONG MIX;
130 typedef ULONG HGLYPH;
131 typedef HGLYPH *PHGLYPH;
132
133 typedef LONG_PTR (APIENTRY *PFN)();
134
135 DECLARE_HANDLE(HBM);
136 DECLARE_HANDLE(HDEV);
137 DECLARE_HANDLE(HSURF);
138 DECLARE_HANDLE(DHSURF);
139 DECLARE_HANDLE(DHPDEV);
140 DECLARE_HANDLE(HDRVOBJ);
141 DECLARE_HANDLE(HSEMAPHORE);
142
143 typedef _Return_type_success_(return >= 0) long NTSTATUS;
144
145 #ifndef _NTDDVDEO_
146 typedef struct _ENG_EVENT *PEVENT;
147 #endif
148
149 #define OPENGL_CMD 4352
150 #define OPENGL_GETINFO 4353
151 #define WNDOBJ_SETUP 4354
152
153 #define FD_ERROR 0xFFFFFFFF
154 #define DDI_ERROR 0xFFFFFFFF
155
156 #define HFF_INVALID ((HFF) 0)
157 #define HFC_INVALID ((HFC) 0)
158 #define HGLYPH_INVALID ((HGLYPH) -1)
159
160 #define FP_ALTERNATEMODE 1
161 #define FP_WINDINGMODE 2
162
163 #define DN_ACCELERATION_LEVEL 1
164 #define DN_DEVICE_ORIGIN 2
165 #define DN_SLEEP_MODE 3
166 #define DN_DRAWING_BEGIN 4
167 #if (NTDDI_VERSION >= NTDDI_WIN8)
168 #define DN_ASSOCIATE_WINDOW 5
169 #define DN_COMPOSITION_CHANGED 6
170 #define DN_DRAWING_BEGIN_APIBITMAP 7
171 #define DN_SURFOBJ_DESTRUCTION 8
172 #endif /* (NTDDI_VERSION >= NTDDI_WIN8) */
173
174 #define SGI_EXTRASPACE 0
175
176 #define DCR_SOLID 0
177 #define DCR_DRIVER 1
178 #define DCR_HALFTONE 2
179
180 #define GX_IDENTITY 0
181 #define GX_OFFSET 1
182 #define GX_SCALE 2
183 #define GX_GENERAL 3
184
185 #define LTOFX(x) ((x) << 4)
186 #define FXTOL(x) ((x) >> 4)
187 #define FXTOLFLOOR(x) ((x) >> 4)
188 #define FXTOLCEILING(x) ((x + 0x0F) >> 4)
189 #define FXTOLROUND(x) ((((x) >> 3) + 1) >> 1)
190
191 #define SIZEOFDV(cAxes) (offsetof(DESIGNVECTOR, dvValues) + (cAxes) * sizeof(LONG))
192 #define SIZEOFAXIW(cAxes) (offsetof(AXESLISTW, axlAxisInfo) + (cAxes) * sizeof(AXISINFOW))
193 #define SIZEOFAXIA(cAxes) (offsetof(AXESLISTA, axlAxisInfo) + (cAxes) * sizeof(AXISINFOA))
194
195 typedef struct _POINTE {
196 FLOATL x;
197 FLOATL y;
198 } POINTE, *PPOINTE;
199
200 typedef union _FLOAT_LONG {
201 FLOATL e;
202 LONG l;
203 } FLOAT_LONG, *PFLOAT_LONG;
204
205 typedef struct _POINTFIX {
206 FIX x;
207 FIX y;
208 } POINTFIX, *PPOINTFIX;
209
210 typedef struct _RECTFX {
211 FIX xLeft;
212 FIX yTop;
213 FIX xRight;
214 FIX yBottom;
215 } RECTFX, *PRECTFX;
216
217 typedef struct _POINTQF {
218 LARGE_INTEGER x;
219 LARGE_INTEGER y;
220 } POINTQF, *PPOINTQF;
221
222
223 typedef struct _BLENDOBJ {
224 BLENDFUNCTION BlendFunction;
225 } BLENDOBJ,*PBLENDOBJ;
226
227 /* BRUSHOBJ.flColorType */
228 #define BR_DEVICE_ICM 0x01
229 #define BR_HOST_ICM 0x02
230 #define BR_CMYKCOLOR 0x04
231 #define BR_ORIGCOLOR 0x08
232
233 typedef struct _BRUSHOBJ {
234 ULONG iSolidColor;
235 PVOID pvRbrush;
236 FLONG flColorType;
237 } BRUSHOBJ;
238
239 typedef struct _CIECHROMA {
240 LDECI4 x;
241 LDECI4 y;
242 LDECI4 Y;
243 } CIECHROMA;
244
245 typedef struct _RUN {
246 LONG iStart;
247 LONG iStop;
248 } RUN, *PRUN;
249
250 typedef struct _CLIPLINE {
251 POINTFIX ptfxA;
252 POINTFIX ptfxB;
253 LONG lStyleState;
254 ULONG c;
255 _Field_size_(c) RUN arun[1];
256 } CLIPLINE, *PCLIPLINE;
257
258 /* CLIPOBJ.iDComplexity constants */
259 #define DC_TRIVIAL 0
260 #define DC_RECT 1
261 #define DC_COMPLEX 3
262
263 /* CLIPOBJ.iFComplexity constants */
264 #define FC_RECT 1
265 #define FC_RECT4 2
266 #define FC_COMPLEX 3
267
268 /* CLIPOBJ.iMode constants */
269 #define TC_RECTANGLES 0
270 #define TC_PATHOBJ 2
271
272 /* CLIPOBJ.fjOptions constants */
273 #define OC_BANK_CLIP 1
274
275 typedef struct _CLIPOBJ {
276 ULONG iUniq;
277 RECTL rclBounds;
278 BYTE iDComplexity;
279 BYTE iFComplexity;
280 BYTE iMode;
281 BYTE fjOptions;
282 } CLIPOBJ;
283
284 typedef struct _COLORINFO {
285 CIECHROMA Red;
286 CIECHROMA Green;
287 CIECHROMA Blue;
288 CIECHROMA Cyan;
289 CIECHROMA Magenta;
290 CIECHROMA Yellow;
291 CIECHROMA AlignmentWhite;
292 LDECI4 RedGamma;
293 LDECI4 GreenGamma;
294 LDECI4 BlueGamma;
295 LDECI4 MagentaInCyanDye;
296 LDECI4 YellowInCyanDye;
297 LDECI4 CyanInMagentaDye;
298 LDECI4 YellowInMagentaDye;
299 LDECI4 CyanInYellowDye;
300 LDECI4 MagentaInYellowDye;
301 } COLORINFO, *PCOLORINFO;
302
303 /* DEVHTADJDATA.DeviceFlags constants */
304 #define DEVHTADJF_COLOR_DEVICE 0x00000001
305 #define DEVHTADJF_ADDITIVE_DEVICE 0x00000002
306
307 typedef struct _DEVHTINFO {
308 DWORD HTFlags;
309 DWORD HTPatternSize;
310 DWORD DevPelsDPI;
311 COLORINFO ColorInfo;
312 } DEVHTINFO, *PDEVHTINFO;
313
314 typedef struct _DEVHTADJDATA {
315 DWORD DeviceFlags;
316 DWORD DeviceXDPI;
317 DWORD DeviceYDPI;
318 PDEVHTINFO pDefHTInfo;
319 PDEVHTINFO pAdjHTInfo;
320 } DEVHTADJDATA, *PDEVHTADJDATA;
321
322 /* DEVINFO.flGraphicsCaps flags */
323 #define GCAPS_BEZIERS 0x00000001
324 #define GCAPS_GEOMETRICWIDE 0x00000002
325 #define GCAPS_ALTERNATEFILL 0x00000004
326 #define GCAPS_WINDINGFILL 0x00000008
327 #define GCAPS_HALFTONE 0x00000010
328 #define GCAPS_COLOR_DITHER 0x00000020
329 #define GCAPS_HORIZSTRIKE 0x00000040
330 #define GCAPS_VERTSTRIKE 0x00000080
331 #define GCAPS_OPAQUERECT 0x00000100
332 #define GCAPS_VECTORFONT 0x00000200
333 #define GCAPS_MONO_DITHER 0x00000400
334 #define GCAPS_ASYNCCHANGE 0x00000800
335 #define GCAPS_ASYNCMOVE 0x00001000
336 #define GCAPS_DONTJOURNAL 0x00002000
337 #define GCAPS_DIRECTDRAW 0x00004000
338 #define GCAPS_ARBRUSHOPAQUE 0x00008000
339 #define GCAPS_PANNING 0x00010000
340 #define GCAPS_HIGHRESTEXT 0x00040000
341 #define GCAPS_PALMANAGED 0x00080000
342 #define GCAPS_DITHERONREALIZE 0x00200000
343 #define GCAPS_NO64BITMEMACCESS 0x00400000
344 #define GCAPS_FORCEDITHER 0x00800000
345 #define GCAPS_GRAY16 0x01000000
346 #define GCAPS_ICM 0x02000000
347 #define GCAPS_CMYKCOLOR 0x04000000
348 #define GCAPS_LAYERED 0x08000000
349 #define GCAPS_ARBRUSHTEXT 0x10000000
350 #define GCAPS_SCREENPRECISION 0x20000000
351 #define GCAPS_FONT_RASTERIZER 0x40000000
352 #define GCAPS_NUP 0x80000000
353
354 /* DEVINFO.iDitherFormat constants */
355 #define BMF_1BPP 1L
356 #define BMF_4BPP 2L
357 #define BMF_8BPP 3L
358 #define BMF_16BPP 4L
359 #define BMF_24BPP 5L
360 #define BMF_32BPP 6L
361 #define BMF_4RLE 7L
362 #define BMF_8RLE 8L
363 #define BMF_JPEG 9L
364 #define BMF_PNG 10L
365
366 /* DEVINFO.flGraphicsCaps2 flags */
367 #define GCAPS2_JPEGSRC 0x00000001
368 #define GCAPS2_xxxx 0x00000002
369 #define GCAPS2_PNGSRC 0x00000008
370 #define GCAPS2_CHANGEGAMMARAMP 0x00000010
371 #define GCAPS2_ALPHACURSOR 0x00000020
372 #define GCAPS2_SYNCFLUSH 0x00000040
373 #define GCAPS2_SYNCTIMER 0x00000080
374 #define GCAPS2_ICD_MULTIMON 0x00000100
375 #define GCAPS2_MOUSETRAILS 0x00000200
376 #define GCAPS2_RESERVED1 0x00000400
377 #if (NTDDI_VERSION >= NTDDI_VISTA)
378 #define GCAPS2_EXCLUDELAYERED 0x00000800
379 #define GCAPS2_INCLUDEAPIBITMAPS 0x00001000
380 #define GCAPS2_SHOWHIDDENPOINTER 0x00002000
381 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
382 #if (NTDDI_VERSION >= NTDDI_WIN7)
383 #define GCAPS2_CLEARTYPE 0x00004000
384 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
385 #if (NTDDI_VERSION >= NTDDI_WIN8)
386 #define GCAPS2_ACC_DRIVER 0x00008000
387 #endif /* (NTDDI_VERSION >= NTDDI_WIN8) */
388
389 typedef struct _DEVINFO {
390 FLONG flGraphicsCaps;
391 LOGFONTW lfDefaultFont;
392 LOGFONTW lfAnsiVarFont;
393 LOGFONTW lfAnsiFixFont;
394 ULONG cFonts;
395 ULONG iDitherFormat;
396 USHORT cxDither;
397 USHORT cyDither;
398 HPALETTE hpalDefault;
399 FLONG flGraphicsCaps2;
400 } DEVINFO, *PDEVINFO;
401
402 struct _DRIVEROBJ;
403
404 typedef BOOL
405 (APIENTRY CALLBACK *FREEOBJPROC)(
406 _In_ struct _DRIVEROBJ *pDriverObj);
407
408 typedef struct _DRIVEROBJ {
409 PVOID pvObj;
410 FREEOBJPROC pFreeProc;
411 HDEV hdev;
412 DHPDEV dhpdev;
413 } DRIVEROBJ;
414
415 /* DRVFN.iFunc constants */
416 #define INDEX_DrvEnablePDEV 0L
417 #define INDEX_DrvCompletePDEV 1L
418 #define INDEX_DrvDisablePDEV 2L
419 #define INDEX_DrvEnableSurface 3L
420 #define INDEX_DrvDisableSurface 4L
421 #define INDEX_DrvAssertMode 5L
422 #define INDEX_DrvOffset 6L
423 #define INDEX_DrvResetPDEV 7L
424 #define INDEX_DrvDisableDriver 8L
425 #define INDEX_DrvUnknown1 9L
426 #define INDEX_DrvCreateDeviceBitmap 10L
427 #define INDEX_DrvDeleteDeviceBitmap 11L
428 #define INDEX_DrvRealizeBrush 12L
429 #define INDEX_DrvDitherColor 13L
430 #define INDEX_DrvStrokePath 14L
431 #define INDEX_DrvFillPath 15L
432 #define INDEX_DrvStrokeAndFillPath 16L
433 #define INDEX_DrvPaint 17L
434 #define INDEX_DrvBitBlt 18L
435 #define INDEX_DrvCopyBits 19L
436 #define INDEX_DrvStretchBlt 20L
437 #define INDEX_DrvUnknown2 21L
438 #define INDEX_DrvSetPalette 22L
439 #define INDEX_DrvTextOut 23L
440 #define INDEX_DrvEscape 24L
441 #define INDEX_DrvDrawEscape 25L
442 #define INDEX_DrvQueryFont 26L
443 #define INDEX_DrvQueryFontTree 27L
444 #define INDEX_DrvQueryFontData 28L
445 #define INDEX_DrvSetPointerShape 29L
446 #define INDEX_DrvMovePointer 30L
447 #define INDEX_DrvLineTo 31L
448 #define INDEX_DrvSendPage 32L
449 #define INDEX_DrvStartPage 33L
450 #define INDEX_DrvEndDoc 34L
451 #define INDEX_DrvStartDoc 35L
452 #define INDEX_DrvUnknown3 36L
453 #define INDEX_DrvGetGlyphMode 37L
454 #define INDEX_DrvSynchronize 38L
455 #define INDEX_DrvUnknown4 39L
456 #define INDEX_DrvSaveScreenBits 40L
457 #define INDEX_DrvGetModes 41L
458 #define INDEX_DrvFree 42L
459 #define INDEX_DrvDestroyFont 43L
460 #define INDEX_DrvQueryFontCaps 44L
461 #define INDEX_DrvLoadFontFile 45L
462 #define INDEX_DrvUnloadFontFile 46L
463 #define INDEX_DrvFontManagement 47L
464 #define INDEX_DrvQueryTrueTypeTable 48L
465 #define INDEX_DrvQueryTrueTypeOutline 49L
466 #define INDEX_DrvGetTrueTypeFile 50L
467 #define INDEX_DrvQueryFontFile 51L
468 #define INDEX_DrvMovePanning 52L
469 #define INDEX_DrvQueryAdvanceWidths 53L
470 #define INDEX_DrvSetPixelFormat 54L
471 #define INDEX_DrvDescribePixelFormat 55L
472 #define INDEX_DrvSwapBuffers 56L
473 #define INDEX_DrvStartBanding 57L
474 #define INDEX_DrvNextBand 58L
475 #define INDEX_DrvGetDirectDrawInfo 59L
476 #define INDEX_DrvEnableDirectDraw 60L
477 #define INDEX_DrvDisableDirectDraw 61L
478 #define INDEX_DrvQuerySpoolType 62L
479 #define INDEX_DrvUnknown5 63L
480 #define INDEX_DrvIcmCreateColorTransform 64L
481 #define INDEX_DrvIcmDeleteColorTransform 65L
482 #define INDEX_DrvIcmCheckBitmapBits 66L
483 #define INDEX_DrvIcmSetDeviceGammaRamp 67L
484 #define INDEX_DrvGradientFill 68L
485 #define INDEX_DrvStretchBltROP 69L
486 #define INDEX_DrvPlgBlt 70L
487 #define INDEX_DrvAlphaBlend 71L
488 #define INDEX_DrvSynthesizeFont 72L
489 #define INDEX_DrvGetSynthesizedFontFiles 73L
490 #define INDEX_DrvTransparentBlt 74L
491 #define INDEX_DrvQueryPerBandInfo 75L
492 #define INDEX_DrvQueryDeviceSupport 76L
493 #define INDEX_DrvReserved1 77L
494 #define INDEX_DrvReserved2 78L
495 #define INDEX_DrvReserved3 79L
496 #define INDEX_DrvReserved4 80L
497 #define INDEX_DrvReserved5 81L
498 #define INDEX_DrvReserved6 82L
499 #define INDEX_DrvReserved7 83L
500 #define INDEX_DrvReserved8 84L
501 #define INDEX_DrvDeriveSurface 85L
502 #define INDEX_DrvQueryGlyphAttrs 86L
503 #define INDEX_DrvNotify 87L
504 #define INDEX_DrvSynchronizeSurface 88L
505 #define INDEX_DrvResetDevice 89L
506 #define INDEX_DrvReserved9 90L
507 #define INDEX_DrvReserved10 91L
508 #define INDEX_DrvReserved11 92L
509 #if (NTDDI_VERSION >= NTDDI_VISTA)
510 #define INDEX_DrvRenderHint 93L
511 #if (NTDDI_VERSION >= NTDDI_WIN7)
512 #define INDEX_DrvCreateDeviceBitmapEx 94L
513 #define INDEX_DrvDeleteDeviceBitmapEx 95L
514 #define INDEX_DrvAssociateSharedSurface 96L
515 #define INDEX_DrvSynchronizeRedirectionBitmaps 97L
516 #define INDEX_DrvAccumulateD3DDirtyRect 98L
517 #define INDEX_DrvStartDxInterop 99L
518 #define INDEX_DrvEndDxInterop 100L
519 #define INDEX_DrvLockDisplayArea 101L
520 #define INDEX_DrvUnlockDisplayArea 102L
521 #define INDEX_LAST 103L
522 #else /* (NTDDI_VERSION >= NTDDI_WIN7) */
523 #define INDEX_LAST 94L
524 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
525 #else /* (NTDDI_VERSION >= NTDDI_VISTA) */
526 #define INDEX_LAST 93L
527 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
528
529 typedef struct _DRVFN {
530 ULONG iFunc;
531 PFN pfn;
532 } DRVFN, *PDRVFN;
533
534 /* DRVENABLEDATA.iDriverVersion constants */
535 #define DDI_DRIVER_VERSION_NT4 0x00020000
536 #define DDI_DRIVER_VERSION_SP3 0x00020003
537 #define DDI_DRIVER_VERSION_NT5 0x00030000
538 #define DDI_DRIVER_VERSION_NT5_01 0x00030100
539 #define DDI_DRIVER_VERSION_NT5_01_SP1 0x00030101
540
541 typedef struct _DRVENABLEDATA {
542 ULONG iDriverVersion;
543 ULONG c;
544 DRVFN *pdrvfn;
545 } DRVENABLEDATA, *PDRVENABLEDATA;
546
547 /* Font file status values */
548 #define FF_SIGNATURE_VERIFIED 0x00000001L
549 #define FF_IGNORED_SIGNATURE 0x00000002L
550
551 /* Obsolete in Windows 2000 and later */
552 typedef struct {
553 DWORD nSize;
554 HDC hdc;
555 PBYTE pvEMF;
556 PBYTE pvCurrentRecord;
557 } EMFINFO, *PEMFINFO;
558
559 typedef struct _ENGSAFESEMAPHORE {
560 HSEMAPHORE hsem;
561 LONG lCount;
562 } ENGSAFESEMAPHORE;
563
564 typedef struct _ENG_TIME_FIELDS {
565 _Field_range_(1601,MAXUSHORT) USHORT usYear;
566 _Field_range_(1,12) USHORT usMonth;
567 _Field_range_(1,31) USHORT usDay;
568 _Field_range_(0,23) USHORT usHour;
569 _Field_range_(0,59) USHORT usMinute;
570 _Field_range_(0,59) USHORT usSecond;
571 _Field_range_(0,999) USHORT usMilliseconds;
572 _Field_range_(0,6) USHORT usWeekday; // 0 == Sunday
573 } ENG_TIME_FIELDS, *PENG_TIME_FIELDS;
574
575 typedef struct _ENUMRECTS {
576 ULONG c;
577 RECTL arcl[1];
578 } ENUMRECTS;
579
580 typedef struct _FD_XFORM {
581 FLOATL eXX;
582 FLOATL eXY;
583 FLOATL eYX;
584 FLOATL eYY;
585 } FD_XFORM, *PFD_XFORM;
586
587 /* FD_DEVICEMETRICS.flRealizedType constants */
588 #define FDM_TYPE_BM_SIDE_CONST 0x00000001
589 #define FDM_TYPE_MAXEXT_EQUAL_BM_SIDE 0x00000002
590 #define FDM_TYPE_CHAR_INC_EQUAL_BM_BASE 0x00000004
591 #define FDM_TYPE_ZERO_BEARINGS 0x00000008
592 #define FDM_TYPE_CONST_BEARINGS 0x00000010
593
594 typedef struct _FD_DEVICEMETRICS {
595 FLONG flRealizedType;
596 POINTE pteBase;
597 POINTE pteSide;
598 LONG lD;
599 FIX fxMaxAscender;
600 FIX fxMaxDescender;
601 POINTL ptlUnderline1;
602 POINTL ptlStrikeout;
603 POINTL ptlULThickness;
604 POINTL ptlSOThickness;
605 ULONG cxMax;
606 ULONG cyMax;
607 ULONG cjGlyphMax;
608 FD_XFORM fdxQuantized;
609 LONG lNonLinearExtLeading;
610 LONG lNonLinearIntLeading;
611 LONG lNonLinearMaxCharWidth;
612 LONG lNonLinearAvgCharWidth;
613 LONG lMinA;
614 LONG lMinC;
615 LONG lMinD;
616 LONG alReserved[1];
617 } FD_DEVICEMETRICS, *PFD_DEVICEMETRICS;
618
619 /* FD_GLYPHATTR.iMode constants */
620 #define FO_ATTR_MODE_ROTATE 1
621
622 typedef struct _FD_GLYPHATTR {
623 ULONG cjThis;
624 ULONG cGlyphs;
625 ULONG iMode;
626 _Field_size_((cGlyphs+7)/8) BYTE aGlyphAttr[1];
627 } FD_GLYPHATTR, *PFD_GLYPHATTR;
628
629 /* FD_GLYPHSET.flAccel */
630 #define GS_UNICODE_HANDLES 0x00000001
631 #define GS_8BIT_HANDLES 0x00000002
632 #define GS_16BIT_HANDLES 0x00000004
633
634 typedef struct _WCRUN {
635 WCHAR wcLow;
636 USHORT cGlyphs;
637 HGLYPH *phg;
638 } WCRUN, *PWCRUN;
639
640 typedef struct _FD_GLYPHSET {
641 ULONG cjThis;
642 FLONG flAccel;
643 ULONG cGlyphsSupported;
644 ULONG cRuns;
645 _Field_size_(cRuns) WCRUN awcrun[1];
646 } FD_GLYPHSET, *PFD_GLYPHSET;
647
648 typedef struct _FD_KERNINGPAIR {
649 WCHAR wcFirst;
650 WCHAR wcSecond;
651 FWORD fwdKern;
652 } FD_KERNINGPAIR;
653
654 /* Obsolete in Windows 2000 and later */
655 typedef struct _LIGATURE {
656 ULONG culSize;
657 LPWSTR pwsz;
658 ULONG chglyph;
659 HGLYPH ahglyph[1];
660 } LIGATURE, *PLIGATURE;
661
662 /* Obsolete in Windows 2000 and later */
663 typedef struct _FD_LIGATURE {
664 ULONG culThis;
665 ULONG ulType;
666 ULONG cLigatures;
667 LIGATURE alig[1];
668 } FD_LIGATURE;
669
670 #if defined(_X86_) && !defined(USERMODE_DRIVER)
671 typedef struct _FLOATOBJ
672 {
673 ULONG ul1;
674 ULONG ul2;
675 } FLOATOBJ, *PFLOATOBJ;
676 #else
677 typedef FLOAT FLOATOBJ, *PFLOATOBJ;
678 #endif
679
680 #ifndef USERMODE_DRIVER
681 typedef struct tagFLOATOBJ_XFORM {
682 FLOATOBJ eM11;
683 FLOATOBJ eM12;
684 FLOATOBJ eM21;
685 FLOATOBJ eM22;
686 FLOATOBJ eDx;
687 FLOATOBJ eDy;
688 } FLOATOBJ_XFORM, *PFLOATOBJ_XFORM, FAR *LPFLOATOBJ_XFORM;
689 #else
690 typedef XFORML FLOATOBJ_XFORM, *PFLOATOBJ_XFORM, FAR *LPFLOATOBJ_XFORM;
691 #endif
692
693 /* FONTDIFF.fsSelection */
694 #define FM_SEL_ITALIC 0x0001
695 #define FM_SEL_UNDERSCORE 0x0002
696 #define FM_SEL_NEGATIVE 0x0004
697 #define FM_SEL_OUTLINED 0x0008
698 #define FM_SEL_STRIKEOUT 0x0010
699 #define FM_SEL_BOLD 0x0020
700 #define FM_SEL_REGULAR 0x0040
701
702 typedef struct _FONTDIFF {
703 BYTE jReserved1;
704 BYTE jReserved2;
705 BYTE jReserved3;
706 BYTE bWeight;
707 USHORT usWinWeight;
708 FSHORT fsSelection;
709 FWORD fwdAveCharWidth;
710 FWORD fwdMaxCharInc;
711 POINTL ptlCaret;
712 } FONTDIFF;
713
714 typedef struct _FONTSIM {
715 PTRDIFF dpBold;
716 PTRDIFF dpItalic;
717 PTRDIFF dpBoldItalic;
718 } FONTSIM;
719
720 /* FONTINFO.flCaps constants */
721 #define FO_DEVICE_FONT 1L
722 #define FO_OUTLINE_CAPABLE 2L
723
724 typedef struct _FONTINFO {
725 ULONG cjThis;
726 FLONG flCaps;
727 ULONG cGlyphsSupported;
728 ULONG cjMaxGlyph1;
729 ULONG cjMaxGlyph4;
730 ULONG cjMaxGlyph8;
731 ULONG cjMaxGlyph32;
732 } FONTINFO, *PFONTINFO;
733
734 /* FONTOBJ.flFontType constants */
735 #define FO_TYPE_RASTER RASTER_FONTTYPE
736 #define FO_TYPE_DEVICE DEVICE_FONTTYPE
737 #define FO_TYPE_TRUETYPE TRUETYPE_FONTTYPE
738 #define FO_TYPE_OPENTYPE OPENTYPE_FONTTYPE
739
740 #define FO_SIM_BOLD 0x00002000
741 #define FO_SIM_ITALIC 0x00004000
742 #define FO_EM_HEIGHT 0x00008000
743 #define FO_GRAY16 0x00010000
744 #define FO_NOGRAY16 0x00020000
745 #define FO_NOHINTS 0x00040000
746 #define FO_NO_CHOICE 0x00080000
747 #define FO_CFF 0x00100000
748 #define FO_POSTSCRIPT 0x00200000
749 #define FO_MULTIPLEMASTER 0x00400000
750 #define FO_VERT_FACE 0x00800000
751 #define FO_DBCS_FONT 0X01000000
752 #define FO_NOCLEARTYPE 0x02000000
753 #define FO_CLEARTYPE_X 0x10000000
754 #define FO_CLEARTYPE_Y 0x20000000
755 #define FO_CLEARTYPENATURAL_X 0x40000000
756
757 #define FD_NEGATIVE_FONT 1L /* Obsolete in Windows 2000 and later */
758 #define FO_DEVICE_FONT 1L
759 #define FO_OUTLINE_CAPABLE 2L
760
761 typedef struct _FONTOBJ {
762 ULONG iUniq;
763 ULONG iFace;
764 ULONG cxMax;
765 FLONG flFontType;
766 ULONG_PTR iTTUniq;
767 ULONG_PTR iFile;
768 SIZE sizLogResPpi;
769 ULONG ulStyleSize;
770 PVOID pvConsumer;
771 PVOID pvProducer;
772 } FONTOBJ;
773
774 typedef struct _GAMMARAMP {
775 WORD Red[256];
776 WORD Green[256];
777 WORD Blue[256];
778 } GAMMARAMP, *PGAMMARAMP;
779
780 /* GDIINFO.ulPrimaryOrder constants */
781 #define PRIMARY_ORDER_ABC 0
782 #define PRIMARY_ORDER_ACB 1
783 #define PRIMARY_ORDER_BAC 2
784 #define PRIMARY_ORDER_BCA 3
785 #define PRIMARY_ORDER_CBA 4
786 #define PRIMARY_ORDER_CAB 5
787
788 /* GDIINFO.ulHTPatternSize constants */
789 #define HT_PATSIZE_2x2 0
790 #define HT_PATSIZE_2x2_M 1
791 #define HT_PATSIZE_4x4 2
792 #define HT_PATSIZE_4x4_M 3
793 #define HT_PATSIZE_6x6 4
794 #define HT_PATSIZE_6x6_M 5
795 #define HT_PATSIZE_8x8 6
796 #define HT_PATSIZE_8x8_M 7
797 #define HT_PATSIZE_10x10 8
798 #define HT_PATSIZE_10x10_M 9
799 #define HT_PATSIZE_12x12 10
800 #define HT_PATSIZE_12x12_M 11
801 #define HT_PATSIZE_14x14 12
802 #define HT_PATSIZE_14x14_M 13
803 #define HT_PATSIZE_16x16 14
804 #define HT_PATSIZE_16x16_M 15
805 #define HT_PATSIZE_SUPERCELL 16
806 #define HT_PATSIZE_SUPERCELL_M 17
807 #define HT_PATSIZE_USER 18
808 #define HT_PATSIZE_MAX_INDEX HT_PATSIZE_USER
809 #define HT_PATSIZE_DEFAULT HT_PATSIZE_SUPERCELL_M
810 #define HT_USERPAT_CX_MIN 4
811 #define HT_USERPAT_CX_MAX 256
812 #define HT_USERPAT_CY_MIN 4
813 #define HT_USERPAT_CY_MAX 256
814
815 /* GDIINFO.ulHTOutputFormat constants */
816 #define HT_FORMAT_1BPP 0
817 #define HT_FORMAT_4BPP 2
818 #define HT_FORMAT_4BPP_IRGB 3
819 #define HT_FORMAT_8BPP 4
820 #define HT_FORMAT_16BPP 5
821 #define HT_FORMAT_24BPP 6
822 #define HT_FORMAT_32BPP 7
823
824 /* GDIINFO.flHTFlags */
825 #define HT_FLAG_SQUARE_DEVICE_PEL 0x00000001
826 #define HT_FLAG_HAS_BLACK_DYE 0x00000002
827 #define HT_FLAG_ADDITIVE_PRIMS 0x00000004
828 #define HT_FLAG_USE_8BPP_BITMASK 0x00000008
829 #define HT_FLAG_INK_HIGH_ABSORPTION 0x00000010
830 #define HT_FLAG_INK_ABSORPTION_INDICES 0x00000060
831 #define HT_FLAG_DO_DEVCLR_XFORM 0x00000080
832 #define HT_FLAG_OUTPUT_CMY 0x00000100
833 #define HT_FLAG_PRINT_DRAFT_MODE 0x00000200
834 #define HT_FLAG_INVERT_8BPP_BITMASK_IDX 0x00000400
835 #define HT_FLAG_8BPP_CMY332_MASK 0xFF000000
836
837 #define MAKE_CMYMASK_BYTE(c,m,y) ((BYTE)(((BYTE)(c) & 0x07) << 5) \
838 |(BYTE)(((BYTE)(m) & 0x07) << 2) \
839 |(BYTE)((BYTE)(y) & 0x03))
840
841 #define MAKE_CMY332_MASK(c,m,y) ((DWORD)(((DWORD)(c) & 0x07) << 29)\
842 |(DWORD)(((DWORD)(m) & 0x07) << 26)\
843 |(DWORD)(((DWORD)(y) & 0x03) << 24))
844
845 /* GDIINFO.flHTFlags constants */
846 #define HT_FLAG_INK_ABSORPTION_IDX0 0x00000000
847 #define HT_FLAG_INK_ABSORPTION_IDX1 0x00000020
848 #define HT_FLAG_INK_ABSORPTION_IDX2 0x00000040
849 #define HT_FLAG_INK_ABSORPTION_IDX3 0x00000060
850
851 #define HT_FLAG_HIGHEST_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION \
852 |HT_FLAG_INK_ABSORPTION_IDX3)
853 #define HT_FLAG_HIGHER_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION \
854 |HT_FLAG_INK_ABSORPTION_IDX2)
855 #define HT_FLAG_HIGH_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION \
856 |HT_FLAG_INK_ABSORPTION_IDX1)
857 #define HT_FLAG_NORMAL_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX0
858 #define HT_FLAG_LOW_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX1
859 #define HT_FLAG_LOWER_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX2
860 #define HT_FLAG_LOWEST_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX3
861
862 #define HT_BITMASKPALRGB (DWORD)'0BGR'
863 #define HT_SET_BITMASKPAL2RGB(pPal) (*((LPDWORD)(pPal)) = HT_BITMASKPALRGB)
864 #define HT_IS_BITMASKPALRGB(pPal) (*((LPDWORD)(pPal)) == (DWORD)0)
865
866 /* GDIINFO.ulPhysicalPixelCharacteristics constants */
867 #define PPC_DEFAULT 0x0
868 #define PPC_UNDEFINED 0x1
869 #define PPC_RGB_ORDER_VERTICAL_STRIPES 0x2
870 #define PPC_BGR_ORDER_VERTICAL_STRIPES 0x3
871 #define PPC_RGB_ORDER_HORIZONTAL_STRIPES 0x4
872 #define PPC_BGR_ORDER_HORIZONTAL_STRIPES 0x5
873
874 #define PPG_DEFAULT 0
875 #define PPG_SRGB 1
876
877 typedef struct _GDIINFO {
878 ULONG ulVersion;
879 ULONG ulTechnology;
880 ULONG ulHorzSize;
881 ULONG ulVertSize;
882 ULONG ulHorzRes;
883 ULONG ulVertRes;
884 ULONG cBitsPixel;
885 ULONG cPlanes;
886 ULONG ulNumColors;
887 ULONG flRaster;
888 ULONG ulLogPixelsX;
889 ULONG ulLogPixelsY;
890 ULONG flTextCaps;
891 ULONG ulDACRed;
892 ULONG ulDACGreen;
893 ULONG ulDACBlue;
894 ULONG ulAspectX;
895 ULONG ulAspectY;
896 ULONG ulAspectXY;
897 LONG xStyleStep;
898 LONG yStyleStep;
899 LONG denStyleStep;
900 POINTL ptlPhysOffset;
901 SIZEL szlPhysSize;
902 ULONG ulNumPalReg;
903 COLORINFO ciDevice;
904 ULONG ulDevicePelsDPI;
905 ULONG ulPrimaryOrder;
906 ULONG ulHTPatternSize;
907 ULONG ulHTOutputFormat;
908 ULONG flHTFlags;
909 ULONG ulVRefresh;
910 ULONG ulBltAlignment;
911 ULONG ulPanningHorzRes;
912 ULONG ulPanningVertRes;
913 ULONG xPanningAlignment;
914 ULONG yPanningAlignment;
915 ULONG cxHTPat;
916 ULONG cyHTPat;
917 LPBYTE pHTPatA;
918 LPBYTE pHTPatB;
919 LPBYTE pHTPatC;
920 ULONG flShadeBlend;
921 ULONG ulPhysicalPixelCharacteristics;
922 ULONG ulPhysicalPixelGamma;
923 } GDIINFO, *PGDIINFO;
924
925 /* PATHDATA.flags constants */
926 #define PD_BEGINSUBPATH 0x00000001
927 #define PD_ENDSUBPATH 0x00000002
928 #define PD_RESETSTYLE 0x00000004
929 #define PD_CLOSEFIGURE 0x00000008
930 #define PD_BEZIERS 0x00000010
931 #define PD_ALL (PD_BEGINSUBPATH \
932 |PD_ENDSUBPATH \
933 |PD_RESETSTYLE \
934 |PD_CLOSEFIGURE \
935 PD_BEZIERS)
936
937 typedef struct _PATHDATA {
938 FLONG flags;
939 ULONG count;
940 POINTFIX *pptfx;
941 } PATHDATA, *PPATHDATA;
942
943 /* PATHOBJ.fl constants */
944 #define PO_BEZIERS 0x00000001
945 #define PO_ELLIPSE 0x00000002
946 #define PO_ALL_INTEGERS 0x00000004
947 #define PO_ENUM_AS_INTEGERS 0x00000008
948 #if (NTDDI_VERSION >= NTDDI_WIN7)
949 #define PO_WIDENED 0x00000010
950 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
951
952 typedef struct _PATHOBJ {
953 FLONG fl;
954 ULONG cCurves;
955 } PATHOBJ;
956
957 typedef BYTE GAMMA_TABLES[2][256];
958
959 typedef struct _GLYPHBITS {
960 POINTL ptlOrigin;
961 SIZEL sizlBitmap;
962 BYTE aj[1];
963 } GLYPHBITS;
964
965 typedef union _GLYPHDEF {
966 GLYPHBITS *pgb;
967 PATHOBJ *ppo;
968 } GLYPHDEF;
969
970 typedef struct _GLYPHPOS {
971 HGLYPH hg;
972 GLYPHDEF *pgdf;
973 POINTL ptl;
974 } GLYPHPOS, *PGLYPHPOS;
975
976 typedef struct _GLYPHDATA {
977 GLYPHDEF gdf;
978 HGLYPH hg;
979 FIX fxD;
980 FIX fxA;
981 FIX fxAB;
982 FIX fxInkTop;
983 FIX fxInkBottom;
984 RECTL rclInk;
985 POINTQF ptqD;
986 } GLYPHDATA;
987
988 typedef struct _IFIEXTRA {
989 ULONG ulIdentifier;
990 PTRDIFF dpFontSig;
991 ULONG cig;
992 PTRDIFF dpDesignVector;
993 PTRDIFF dpAxesInfoW;
994 ULONG aulReserved[1];
995 } IFIEXTRA, *PIFIEXTRA;
996
997 /* IFIMETRICS constants */
998
999 #define FM_VERSION_NUMBER 0x0
1000
1001 /* IFIMETRICS.fsType constants */
1002 #define FM_TYPE_LICENSED 0x2
1003 #define FM_READONLY_EMBED 0x4
1004 #define FM_EDITABLE_EMBED 0x8
1005 #define FM_NO_EMBEDDING FM_TYPE_LICENSED
1006
1007 /* IFIMETRICS.flInfo constants */
1008 #define FM_INFO_TECH_TRUETYPE 0x00000001
1009 #define FM_INFO_TECH_BITMAP 0x00000002
1010 #define FM_INFO_TECH_STROKE 0x00000004
1011 #define FM_INFO_TECH_OUTLINE_NOT_TRUETYPE 0x00000008
1012 #define FM_INFO_ARB_XFORMS 0x00000010
1013 #define FM_INFO_1BPP 0x00000020
1014 #define FM_INFO_4BPP 0x00000040
1015 #define FM_INFO_8BPP 0x00000080
1016 #define FM_INFO_16BPP 0x00000100
1017 #define FM_INFO_24BPP 0x00000200
1018 #define FM_INFO_32BPP 0x00000400
1019 #define FM_INFO_INTEGER_WIDTH 0x00000800
1020 #define FM_INFO_CONSTANT_WIDTH 0x00001000
1021 #define FM_INFO_NOT_CONTIGUOUS 0x00002000
1022 #define FM_INFO_TECH_MM 0x00004000
1023 #define FM_INFO_RETURNS_OUTLINES 0x00008000
1024 #define FM_INFO_RETURNS_STROKES 0x00010000
1025 #define FM_INFO_RETURNS_BITMAPS 0x00020000
1026 #define FM_INFO_DSIG 0x00040000
1027 #define FM_INFO_RIGHT_HANDED 0x00080000
1028 #define FM_INFO_INTEGRAL_SCALING 0x00100000
1029 #define FM_INFO_90DEGREE_ROTATIONS 0x00200000
1030 #define FM_INFO_OPTICALLY_FIXED_PITCH 0x00400000
1031 #define FM_INFO_DO_NOT_ENUMERATE 0x00800000
1032 #define FM_INFO_ISOTROPIC_SCALING_ONLY 0x01000000
1033 #define FM_INFO_ANISOTROPIC_SCALING_ONLY 0x02000000
1034 #define FM_INFO_TECH_CFF 0x04000000
1035 #define FM_INFO_FAMILY_EQUIV 0x08000000
1036 #define FM_INFO_DBCS_FIXED_PITCH 0x10000000
1037 #define FM_INFO_NONNEGATIVE_AC 0x20000000
1038 #define FM_INFO_IGNORE_TC_RA_ABLE 0x40000000
1039 #define FM_INFO_TECH_TYPE1 0x80000000
1040
1041 #define MAXCHARSETS 16 /* Obsolete in Windows 2000 and later */
1042
1043 /* IFIMETRICS.ulPanoseCulture constants */
1044 #define FM_PANOSE_CULTURE_LATIN 0x0
1045
1046 typedef struct _IFIMETRICS {
1047 ULONG cjThis;
1048 ULONG cjIfiExtra;
1049 PTRDIFF dpwszFamilyName;
1050 PTRDIFF dpwszStyleName;
1051 PTRDIFF dpwszFaceName;
1052 PTRDIFF dpwszUniqueName;
1053 PTRDIFF dpFontSim;
1054 LONG lEmbedId;
1055 LONG lItalicAngle;
1056 LONG lCharBias;
1057 PTRDIFF dpCharSets;
1058 BYTE jWinCharSet;
1059 BYTE jWinPitchAndFamily;
1060 USHORT usWinWeight;
1061 ULONG flInfo;
1062 USHORT fsSelection;
1063 USHORT fsType;
1064 FWORD fwdUnitsPerEm;
1065 FWORD fwdLowestPPEm;
1066 FWORD fwdWinAscender;
1067 FWORD fwdWinDescender;
1068 FWORD fwdMacAscender;
1069 FWORD fwdMacDescender;
1070 FWORD fwdMacLineGap;
1071 FWORD fwdTypoAscender;
1072 FWORD fwdTypoDescender;
1073 FWORD fwdTypoLineGap;
1074 FWORD fwdAveCharWidth;
1075 FWORD fwdMaxCharInc;
1076 FWORD fwdCapHeight;
1077 FWORD fwdXHeight;
1078 FWORD fwdSubscriptXSize;
1079 FWORD fwdSubscriptYSize;
1080 FWORD fwdSubscriptXOffset;
1081 FWORD fwdSubscriptYOffset;
1082 FWORD fwdSuperscriptXSize;
1083 FWORD fwdSuperscriptYSize;
1084 FWORD fwdSuperscriptXOffset;
1085 FWORD fwdSuperscriptYOffset;
1086 FWORD fwdUnderscoreSize;
1087 FWORD fwdUnderscorePosition;
1088 FWORD fwdStrikeoutSize;
1089 FWORD fwdStrikeoutPosition;
1090 BYTE chFirstChar;
1091 BYTE chLastChar;
1092 BYTE chDefaultChar;
1093 BYTE chBreakChar;
1094 WCHAR wcFirstChar;
1095 WCHAR wcLastChar;
1096 WCHAR wcDefaultChar;
1097 WCHAR wcBreakChar;
1098 POINTL ptlBaseline;
1099 POINTL ptlAspect;
1100 POINTL ptlCaret;
1101 RECTL rclFontBox;
1102 BYTE achVendId[4];
1103 ULONG cKerningPairs;
1104 ULONG ulPanoseCulture;
1105 PANOSE panose;
1106 #if defined(_WIN64)
1107 PVOID Align;
1108 #endif
1109 } IFIMETRICS, *PIFIMETRICS;
1110
1111 /* LINEATTRS.fl */
1112 #define LA_GEOMETRIC 0x00000001
1113 #define LA_ALTERNATE 0x00000002
1114 #define LA_STARTGAP 0x00000004
1115 #define LA_STYLED 0x00000008
1116
1117 /* LINEATTRS.iJoin */
1118 #define JOIN_ROUND 0L
1119 #define JOIN_BEVEL 1L
1120 #define JOIN_MITER 2L
1121
1122 /* LINEATTRS.iEndCap */
1123 #define ENDCAP_ROUND 0L
1124 #define ENDCAP_SQUARE 1L
1125 #define ENDCAP_BUTT 2L
1126
1127 typedef struct _LINEATTRS {
1128 FLONG fl;
1129 ULONG iJoin;
1130 ULONG iEndCap;
1131 FLOAT_LONG elWidth;
1132 FLOATL eMiterLimit;
1133 ULONG cstyle;
1134 PFLOAT_LONG pstyle;
1135 FLOAT_LONG elStyleState;
1136 } LINEATTRS, *PLINEATTRS;
1137
1138 typedef struct _PALOBJ {
1139 ULONG ulReserved;
1140 } PALOBJ;
1141
1142 typedef struct _PERBANDINFO {
1143 BOOL bRepeatThisBand;
1144 SIZEL szlBand;
1145 ULONG ulHorzRes;
1146 ULONG ulVertRes;
1147 } PERBANDINFO, *PPERBANDINFO;
1148
1149 /* STROBJ.flAccel constants */
1150 #define SO_FLAG_DEFAULT_PLACEMENT 0x00000001
1151 #define SO_HORIZONTAL 0x00000002
1152 #define SO_VERTICAL 0x00000004
1153 #define SO_REVERSED 0x00000008
1154 #define SO_ZERO_BEARINGS 0x00000010
1155 #define SO_CHAR_INC_EQUAL_BM_BASE 0x00000020
1156 #define SO_MAXEXT_EQUAL_BM_SIDE 0x00000040
1157 #define SO_DO_NOT_SUBSTITUTE_DEVICE_FONT 0x00000080
1158 #define SO_GLYPHINDEX_TEXTOUT 0x00000100
1159 #define SO_ESC_NOT_ORIENT 0x00000200
1160 #define SO_DXDY 0x00000400
1161 #define SO_CHARACTER_EXTRA 0x00000800
1162 #define SO_BREAK_EXTRA 0x00001000
1163
1164 typedef struct _STROBJ {
1165 ULONG cGlyphs;
1166 FLONG flAccel;
1167 ULONG ulCharInc;
1168 RECTL rclBkGround;
1169 GLYPHPOS *pgp;
1170 LPWSTR pwszOrg;
1171 } STROBJ;
1172
1173
1174 /* SURFOBJ.iType constants */
1175 #define STYPE_BITMAP 0L
1176 #define STYPE_DEVICE 1L
1177 #define STYPE_DEVBITMAP 3L
1178
1179 /* SURFOBJ.fjBitmap constants */
1180 #define BMF_TOPDOWN 0x0001
1181 #define BMF_NOZEROINIT 0x0002
1182 #define BMF_DONTCACHE 0x0004
1183 #define BMF_USERMEM 0x0008
1184 #define BMF_KMSECTION 0x0010
1185 #define BMF_NOTSYSMEM 0x0020
1186 #define BMF_WINDOW_BLT 0x0040
1187 #define BMF_UMPDMEM 0x0080
1188 #if (NTDDI_VERSION >= NTDDI_WIN7)
1189 #define BMF_TEMP_ALPHA 0x0100
1190 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
1191 #if (NTDDI_VERSION >= NTDDI_WIN8)
1192 #define BMF_ACC_NOTIFY 0x8000
1193 #define BMF_RMT_ENTER 0x4000
1194 #endif /* (NTDDI_VERSION >= NTDDI_WIN8) */
1195
1196 #if (NTDDI_VERSION >= NTDDI_WIN8)
1197 #define BMF_RESERVED 0x3E00
1198 #elif (NTDDI_VERSION >= NTDDI_WIN7)
1199 #define BMF_RESERVED 0xFE00
1200 #else
1201 #define BMF_RESERVED 0xFF00
1202 #endif
1203
1204 typedef struct _SURFOBJ {
1205 DHSURF dhsurf;
1206 HSURF hsurf;
1207 DHPDEV dhpdev;
1208 HDEV hdev;
1209 SIZEL sizlBitmap;
1210 ULONG cjBits;
1211 PVOID pvBits;
1212 PVOID pvScan0;
1213 LONG lDelta;
1214 ULONG iUniq;
1215 ULONG iBitmapFormat;
1216 USHORT iType;
1217 USHORT fjBitmap;
1218 } SURFOBJ;
1219
1220 typedef struct _TYPE1_FONT {
1221 HANDLE hPFM;
1222 HANDLE hPFB;
1223 ULONG ulIdentifier;
1224 } TYPE1_FONT;
1225
1226 typedef struct _WNDOBJ {
1227 CLIPOBJ coClient;
1228 PVOID pvConsumer;
1229 RECTL rclClient;
1230 SURFOBJ *psoOwner;
1231 } WNDOBJ, *PWNDOBJ;
1232
1233 typedef struct _XFORML {
1234 FLOATL eM11;
1235 FLOATL eM12;
1236 FLOATL eM21;
1237 FLOATL eM22;
1238 FLOATL eDx;
1239 FLOATL eDy;
1240 } XFORML, *PXFORML;
1241
1242 typedef struct _XFORMOBJ {
1243 ULONG ulReserved;
1244 } XFORMOBJ;
1245
1246 /* XLATEOBJ.flXlate constants */
1247 #define XO_TRIVIAL 0x00000001
1248 #define XO_TABLE 0x00000002
1249 #define XO_TO_MONO 0x00000004
1250 #define XO_FROM_CMYK 0x00000008
1251 #define XO_DEVICE_ICM 0x00000010
1252 #define XO_HOST_ICM 0x00000020
1253
1254 typedef struct _XLATEOBJ {
1255 ULONG iUniq;
1256 FLONG flXlate;
1257 USHORT iSrcType;
1258 USHORT iDstType;
1259 ULONG cEntries;
1260 ULONG *pulXlate;
1261 } XLATEOBJ;
1262
1263 /* WNDOBJCHANGEPROC.fl constants */
1264 #define WOC_RGN_CLIENT_DELTA 0x00000001
1265 #define WOC_RGN_CLIENT 0x00000002
1266 #define WOC_RGN_SURFACE_DELTA 0x00000004
1267 #define WOC_RGN_SURFACE 0x00000008
1268 #define WOC_CHANGED 0x00000010
1269 #define WOC_DELETE 0x00000020
1270 #define WOC_DRAWN 0x00000040
1271 #define WOC_SPRITE_OVERLAP 0x00000080
1272 #define WOC_SPRITE_NO_OVERLAP 0x00000100
1273 #if (NTDDI_VERSION >= NTDDI_VISTA)
1274 #define WOC_RGN_SPRITE 0x00000200
1275 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
1276
1277 typedef VOID (APIENTRY CALLBACK *WNDOBJCHANGEPROC)(
1278 _In_ WNDOBJ *pwo,
1279 _In_ FLONG fl);
1280
1281
1282 ENGAPI
1283 HANDLE
1284 APIENTRY
1285 BRUSHOBJ_hGetColorTransform(
1286 _In_ BRUSHOBJ *pbo);
1287
1288 _Ret_opt_bytecount_(cj)
1289 ENGAPI
1290 PVOID
1291 APIENTRY
1292 BRUSHOBJ_pvAllocRbrush(
1293 _In_ BRUSHOBJ *pbo,
1294 _In_ ULONG cj);
1295
1296 ENGAPI
1297 PVOID
1298 APIENTRY
1299 BRUSHOBJ_pvGetRbrush(
1300 _In_ BRUSHOBJ *pbo);
1301
1302 ENGAPI
1303 ULONG
1304 APIENTRY
1305 BRUSHOBJ_ulGetBrushColor(
1306 _In_ BRUSHOBJ *pbo);
1307
1308 ENGAPI
1309 BOOL
1310 APIENTRY
1311 CLIPOBJ_bEnum(
1312 _In_ CLIPOBJ *pco,
1313 _In_ ULONG cj,
1314 _Out_bytecap_(cj) ULONG *pul);
1315
1316 /* CLIPOBJ_cEnumStart.iType constants */
1317 #define CT_RECTANGLES 0L
1318
1319 /* CLIPOBJ_cEnumStart.iDirection constants */
1320 #define CD_RIGHTDOWN 0x00000000
1321 #define CD_LEFTDOWN 0x00000001
1322 #define CD_LEFTWARDS 0x00000001
1323 #define CD_RIGHTUP 0x00000002
1324 #define CD_UPWARDS 0x00000002
1325 #define CD_LEFTUP 0x00000003
1326 #define CD_ANY 0x00000004
1327
1328 ENGAPI
1329 ULONG
1330 APIENTRY
1331 CLIPOBJ_cEnumStart(
1332 _Inout_ CLIPOBJ *pco,
1333 _In_ BOOL bAll,
1334 _In_ ULONG iType,
1335 _In_ ULONG iDirection,
1336 _In_ ULONG cLimit);
1337
1338 ENGAPI
1339 PATHOBJ*
1340 APIENTRY
1341 CLIPOBJ_ppoGetPath(
1342 _In_ CLIPOBJ *pco);
1343
1344 #if (NTDDI_VERSION >= NTDDI_VISTA)
1345 ENGAPI
1346 HANDLE
1347 APIENTRY
1348 CLIPOBJ_GetRgn(
1349 _In_ CLIPOBJ* pco);
1350 #endif
1351
1352 ENGAPI
1353 VOID
1354 APIENTRY
1355 EngAcquireSemaphore(
1356 _Inout_ HSEMAPHORE hsem);
1357
1358 #define FL_ZERO_MEMORY 0x00000001
1359 #define FL_NONPAGED_MEMORY 0x00000002
1360 #if (NTDDI_VERSION >= NTDDI_WIN7)
1361 #define FL_NON_SESSION 0x00000004
1362 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
1363
1364 #ifdef USERMODE_DRIVER
1365
1366 #define EngAllocMem(fl, cj, tag) ((PVOID)GlobalAlloc(((fl) & FL_ZERO_MEMORY) ? GPTR : GMEM_FIXED, cj))
1367 #define EngAllocPrivateUserMem(psl, cj, tag) ((PVOID)GlobalAlloc(GMEM_FIXED, cj))
1368 #define EngAllocUserMem(cj, tag) ((PVOID)GlobalAlloc(GMEM_FIXED, cj))
1369
1370 #else /* !USERMODE_DRIVER */
1371
1372 _Must_inspect_result_
1373 _When_(fl & FL_ZERO_MEMORY, _Ret_opt_bytecount_(cjMemSize))
1374 _When_(!(fl & FL_ZERO_MEMORY), _Ret_opt_bytecap_(cjMemSize))
1375 ENGAPI
1376 PVOID
1377 APIENTRY
1378 EngAllocMem(
1379 _In_ ULONG fl,
1380 _In_ ULONG cjMemSize,
1381 _In_ ULONG ulTag);
1382
1383 _Must_inspect_result_
1384 _Ret_opt_bytecount_(cjMemSize)
1385 ENGAPI
1386 PVOID
1387 APIENTRY
1388 EngAllocPrivateUserMem(
1389 _In_ PDD_SURFACE_LOCAL psl,
1390 _In_ SIZE_T cjMemSize,
1391 _In_ ULONG ulTag);
1392
1393 _Must_inspect_result_
1394 _Ret_opt_bytecount_(cjMemSize)
1395 ENGAPI
1396 PVOID
1397 APIENTRY
1398 EngAllocUserMem(
1399 _In_ SIZE_T cjMemSize,
1400 _In_ ULONG ulTag);
1401
1402 #endif /* !USERMODE_DRIVER */
1403
1404 ENGAPI
1405 BOOL
1406 APIENTRY
1407 EngAlphaBlend(
1408 _Inout_ SURFOBJ *psoDest,
1409 _In_ SURFOBJ *psoSrc,
1410 _In_opt_ CLIPOBJ *pco,
1411 _In_opt_ XLATEOBJ *pxlo,
1412 _In_ RECTL *prclDest,
1413 _In_ RECTL *prclSrc,
1414 _In_ BLENDOBJ *pBlendObj);
1415
1416 /* EngAssociateSurface.flHooks constants */
1417 #define HOOK_BITBLT 0x00000001
1418 #define HOOK_STRETCHBLT 0x00000002
1419 #define HOOK_PLGBLT 0x00000004
1420 #define HOOK_TEXTOUT 0x00000008
1421 #define HOOK_PAINT 0x00000010
1422 #define HOOK_STROKEPATH 0x00000020
1423 #define HOOK_FILLPATH 0x00000040
1424 #define HOOK_STROKEANDFILLPATH 0x00000080
1425 #define HOOK_LINETO 0x00000100
1426 #define HOOK_COPYBITS 0x00000400
1427 #define HOOK_MOVEPANNING 0x00000800
1428 #define HOOK_SYNCHRONIZE 0x00001000
1429 #define HOOK_STRETCHBLTROP 0x00002000
1430 #define HOOK_SYNCHRONIZEACCESS 0x00004000
1431 #define HOOK_TRANSPARENTBLT 0x00008000
1432 #define HOOK_ALPHABLEND 0x00010000
1433 #define HOOK_GRADIENTFILL 0x00020000
1434 #if (NTDDI_VERSION >= NTDDI_VISTA)
1435 #define HOOK_FLAGS 0x0003b5ef
1436 #else
1437 #define HOOK_FLAGS 0x0003b5ff
1438 #endif
1439
1440 ENGAPI
1441 BOOL
1442 APIENTRY
1443 EngAssociateSurface(
1444 _In_ HSURF hsurf,
1445 _In_ HDEV hdev,
1446 _In_ FLONG flHooks);
1447
1448 ENGAPI
1449 BOOL
1450 APIENTRY
1451 EngBitBlt(
1452 _Inout_ SURFOBJ *psoTrg,
1453 _In_opt_ SURFOBJ *psoSrc,
1454 _In_opt_ SURFOBJ *psoMask,
1455 _In_opt_ CLIPOBJ *pco,
1456 _In_opt_ XLATEOBJ *pxlo,
1457 _In_ RECTL *prclTrg,
1458 _In_opt_ POINTL *pptlSrc,
1459 _In_opt_ POINTL *pptlMask,
1460 _In_opt_ BRUSHOBJ *pbo,
1461 _In_opt_ POINTL *pptlBrush,
1462 _In_ ROP4 rop4);
1463
1464 ENGAPI
1465 BOOL
1466 APIENTRY
1467 EngCheckAbort(
1468 _In_ SURFOBJ *pso);
1469
1470 ENGAPI
1471 VOID
1472 APIENTRY
1473 EngClearEvent(
1474 _In_ PEVENT pEvent);
1475
1476 _Success_(return != 0)
1477 ENGAPI
1478 FD_GLYPHSET*
1479 APIENTRY
1480 EngComputeGlyphSet(
1481 _In_ INT nCodePage,
1482 _In_ INT nFirstChar,
1483 _In_ INT cChars);
1484
1485 /* EngControlSprites.fl constants */
1486 #define ECS_TEARDOWN 0x00000001
1487 #define ECS_REDRAW 0x00000002
1488
1489 ENGAPI
1490 BOOL
1491 APIENTRY
1492 EngControlSprites(
1493 _Inout_ WNDOBJ *pwo,
1494 _In_ FLONG fl);
1495
1496 ENGAPI
1497 BOOL
1498 APIENTRY
1499 EngCopyBits(
1500 _In_ SURFOBJ *psoDest,
1501 _In_ SURFOBJ *psoSrc,
1502 _In_opt_ CLIPOBJ *pco,
1503 _In_opt_ XLATEOBJ *pxlo,
1504 _In_ __in_data_source(USER_MODE) RECTL *prclDest,
1505 _In_ __in_data_source(USER_MODE) POINTL *pptlSrc);
1506
1507 ENGAPI
1508 HBITMAP
1509 APIENTRY
1510 EngCreateBitmap(
1511 _In_ SIZEL sizl,
1512 _In_ LONG lWidth,
1513 _In_ ULONG iFormat,
1514 _In_ FLONG fl,
1515 _In_opt_ PVOID pvBits);
1516
1517 ENGAPI
1518 CLIPOBJ*
1519 APIENTRY
1520 EngCreateClip(VOID);
1521
1522 _Must_inspect_result_
1523 ENGAPI
1524 HBITMAP
1525 APIENTRY
1526 EngCreateDeviceBitmap(
1527 _In_ DHSURF dhsurf,
1528 _In_ SIZEL sizl,
1529 _In_ ULONG iFormatCompat);
1530
1531 _Must_inspect_result_
1532 ENGAPI
1533 HSURF
1534 APIENTRY
1535 EngCreateDeviceSurface(
1536 _In_ DHSURF dhsurf,
1537 _In_ SIZEL sizl,
1538 _In_ ULONG iFormatCompat);
1539
1540 _Must_inspect_result_
1541 ENGAPI
1542 HDRVOBJ
1543 APIENTRY
1544 EngCreateDriverObj(
1545 _In_ PVOID pvObj,
1546 _In_opt_ FREEOBJPROC pFreeObjProc,
1547 _In_ HDEV hdev);
1548
1549 _Must_inspect_result_
1550 _Success_(return != FALSE)
1551 ENGAPI
1552 BOOL
1553 APIENTRY
1554 EngCreateEvent(
1555 _Outptr_ PEVENT *ppEvent);
1556
1557 /* EngCreatePalette.iMode constants */
1558 #define PAL_INDEXED 0x00000001
1559 #define PAL_BITFIELDS 0x00000002
1560 #define PAL_RGB 0x00000004
1561 #define PAL_BGR 0x00000008
1562 #define PAL_CMYK 0x00000010
1563
1564 _Must_inspect_result_
1565 ENGAPI
1566 HPALETTE
1567 APIENTRY
1568 EngCreatePalette(
1569 _In_ ULONG iMode,
1570 _In_ ULONG cColors,
1571 _In_ ULONG *pulColors,
1572 _In_ FLONG flRed,
1573 _In_ FLONG flGreen,
1574 _In_ FLONG flBlue);
1575
1576 ENGAPI
1577 PATHOBJ*
1578 APIENTRY
1579 EngCreatePath(VOID);
1580
1581 ENGAPI
1582 HSEMAPHORE
1583 APIENTRY
1584 EngCreateSemaphore(VOID);
1585
1586 /* EngCreateWnd.fl constants */
1587 #define WO_RGN_CLIENT_DELTA 0x00000001
1588 #define WO_RGN_CLIENT 0x00000002
1589 #define WO_RGN_SURFACE_DELTA 0x00000004
1590 #define WO_RGN_SURFACE 0x00000008
1591 #define WO_RGN_UPDATE_ALL 0x00000010
1592 #define WO_RGN_WINDOW 0x00000020
1593 #define WO_DRAW_NOTIFY 0x00000040
1594 #define WO_SPRITE_NOTIFY 0x00000080
1595 #define WO_RGN_DESKTOP_COORD 0x00000100
1596 #if (NTDDI_VERSION >= NTDDI_VISTA)
1597 #define WO_RGN_SPRITE 0x00000200
1598 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
1599
1600 _Must_inspect_result_
1601 ENGAPI
1602 WNDOBJ*
1603 APIENTRY
1604 EngCreateWnd(
1605 _In_ SURFOBJ *pso,
1606 _In_ HWND hwnd,
1607 _In_ WNDOBJCHANGEPROC pfn,
1608 _In_ FLONG fl,
1609 _In_ INT iPixelFormat);
1610
1611 _Analysis_noreturn_
1612 ENGAPI
1613 VOID
1614 APIENTRY
1615 EngDebugBreak(VOID);
1616
1617 ENGAPI
1618 VOID
1619 APIENTRY
1620 EngDebugPrint(
1621 _In_z_ PCHAR StandardPrefix,
1622 _In_z_ PCHAR DebugMessage,
1623 _In_ va_list ap);
1624
1625 ENGAPI
1626 VOID
1627 APIENTRY
1628 EngDeleteClip(
1629 _In_ _Post_ptr_invalid_ CLIPOBJ *pco);
1630
1631 ENGAPI
1632 BOOL
1633 APIENTRY
1634 EngDeleteDriverObj(
1635 _In_ _Post_ptr_invalid_ HDRVOBJ hdo,
1636 _In_ BOOL bCallBack,
1637 _In_ BOOL bLocked);
1638
1639 ENGAPI
1640 BOOL
1641 APIENTRY
1642 EngDeleteEvent(
1643 _In_ _Post_ptr_invalid_ PEVENT pEvent);
1644
1645 ENGAPI
1646 BOOL
1647 APIENTRY
1648 EngDeleteFile(
1649 _In_ LPWSTR pwszFileName);
1650
1651 ENGAPI
1652 BOOL
1653 APIENTRY
1654 EngDeletePalette(
1655 _In_ _Post_ptr_invalid_ HPALETTE hpal);
1656
1657 ENGAPI
1658 VOID
1659 APIENTRY
1660 EngDeletePath(
1661 _In_ _Post_ptr_invalid_ PATHOBJ *ppo);
1662
1663 ENGAPI
1664 VOID
1665 APIENTRY
1666 EngDeleteSafeSemaphore(
1667 _Inout_ ENGSAFESEMAPHORE *pssem);
1668
1669 ENGAPI
1670 VOID
1671 APIENTRY
1672 EngDeleteSemaphore(
1673 _In_ _Post_ptr_invalid_ HSEMAPHORE hsem);
1674
1675 ENGAPI
1676 BOOL
1677 APIENTRY
1678 EngDeleteSurface(
1679 _In_ _Post_ptr_invalid_ HSURF hsurf);
1680
1681 ENGAPI
1682 VOID
1683 APIENTRY
1684 EngDeleteWnd(
1685 _In_ _Post_ptr_invalid_ WNDOBJ *pwo);
1686
1687 _Success_(return==0)
1688 ENGAPI
1689 DWORD
1690 APIENTRY
1691 EngDeviceIoControl(
1692 _In_ HANDLE hDevice,
1693 _In_ DWORD dwIoControlCode,
1694 _In_reads_bytes_opt_(cjInBufferSize) LPVOID lpInBuffer,
1695 _In_ DWORD cjInBufferSize,
1696 _Out_writes_bytes_opt_(cjOutBufferSize) LPVOID lpOutBuffer,
1697 _In_ DWORD cjOutBufferSize,
1698 _Out_ LPDWORD lpBytesReturned);
1699
1700 #define DM_DEFAULT 0x00000001
1701 #define DM_MONOCHROME 0x00000002
1702
1703 ENGAPI
1704 ULONG
1705 APIENTRY
1706 EngDitherColor(
1707 _In_ HDEV hdev,
1708 _In_ ULONG iMode,
1709 _In_ ULONG rgb,
1710 _When_(iMode == DM_DEFAULT, _Out_writes_bytes_(16*8))
1711 _When_(iMode == DM_MONOCHROME, _Out_writes_bytes_(8))
1712 ULONG *pul);
1713
1714 /* Obsolete in Windows 2000 and later */
1715 ENGAPI
1716 HRESULT
1717 APIENTRY
1718 EngDxIoctl(
1719 _In_ ULONG ulIoctl,
1720 _Inout_ PVOID pBuffer,
1721 _In_ ULONG ulBufferSize);
1722
1723 #ifdef USERMODE_DRIVER
1724 #define EngEnumForms EnumForms
1725 #else /* !USERMODE_DRIVER */
1726 ENGAPI
1727 BOOL
1728 APIENTRY
1729 EngEnumForms(
1730 _In_ HANDLE hPrinter,
1731 _In_ DWORD Level,
1732 _Out_writes_bytes_opt_(cbBuf) LPBYTE pForm,
1733 _In_ DWORD cbBuf,
1734 _Out_ LPDWORD pcbNeeded,
1735 _Out_ LPDWORD pcReturned);
1736 #endif /* !USERMODE_DRIVER */
1737
1738 ENGAPI
1739 BOOL
1740 APIENTRY
1741 EngEraseSurface(
1742 _In_ SURFOBJ *pso,
1743 _In_ RECTL *prcl,
1744 _In_ ULONG iColor);
1745
1746 ENGAPI
1747 BOOL
1748 APIENTRY
1749 EngFillPath(
1750 _Inout_ SURFOBJ *pso,
1751 _In_ PATHOBJ *ppo,
1752 _In_ CLIPOBJ *pco,
1753 _In_ BRUSHOBJ *pbo,
1754 _In_ POINTL *pptlBrushOrg,
1755 _In_ MIX mix,
1756 _In_ FLONG flOptions);
1757
1758 #ifdef USERMODE_DRIVER
1759 #define EngFindImageProcAddress(h, procname) ((PVOID) GetProcAddress(h, procname))
1760 #else /* !USERMODE_DRIVER */
1761 ENGAPI
1762 PVOID
1763 APIENTRY
1764 EngFindImageProcAddress(
1765 _In_ HANDLE hModule,
1766 _In_ LPSTR lpProcName);
1767 #endif /* !USERMODE_DRIVER */
1768
1769 ENGAPI
1770 PVOID
1771 APIENTRY
1772 EngFindResource(
1773 _In_ HANDLE h,
1774 _In_ INT iName,
1775 _In_ INT iType,
1776 _Out_ PULONG pulSize);
1777
1778 _Must_inspect_result_
1779 _Ret_opt_bytecap_(cjSize)
1780 ENGAPI
1781 PVOID
1782 APIENTRY
1783 EngFntCacheAlloc(
1784 _In_ ULONG ulFastCheckSum,
1785 _In_ ULONG cjSize);
1786
1787 /* EngFntCacheFault.iFaultMode constants */
1788 #define ENG_FNT_CACHE_READ_FAULT 0x00000001
1789 #define ENG_FNT_CACHE_WRITE_FAULT 0x00000002
1790
1791 ENGAPI
1792 VOID
1793 APIENTRY
1794 EngFntCacheFault(
1795 _In_ ULONG ulFastCheckSum,
1796 _In_ ULONG iFaultMode);
1797
1798 ENGAPI
1799 PVOID
1800 APIENTRY
1801 EngFntCacheLookUp(
1802 _In_ ULONG FastCheckSum,
1803 _Out_ ULONG *pulSize);
1804
1805 #ifdef USERMODE_DRIVER
1806
1807 #define EngFreeMem(p) GlobalFree((HGLOBAL) (p))
1808 #define EngFreePrivateUserMem( psl, p) GlobalFree((HGLOBAL) (p))
1809 #define EngFreeUserMem(p) GlobalFree((HGLOBAL) (p))
1810
1811 #else /* !USERMODE_DRIVER */
1812
1813 ENGAPI
1814 VOID
1815 APIENTRY
1816 EngFreeMem(
1817 _In_ _Post_ptr_invalid_ PVOID pv);
1818
1819 ENGAPI
1820 VOID
1821 APIENTRY
1822 EngFreePrivateUserMem(
1823 _In_ PDD_SURFACE_LOCAL psl,
1824 _In_ _Post_ptr_invalid_ PVOID pv);
1825
1826 ENGAPI
1827 VOID
1828 APIENTRY
1829 EngFreeUserMem(
1830 _In_ _Post_ptr_invalid_ PVOID pv);
1831
1832 #endif /* !USERMODE_DRIVER */
1833
1834 ENGAPI
1835 VOID
1836 APIENTRY
1837 EngFreeModule(
1838 _In_ HANDLE h);
1839
1840
1841 ENGAPI
1842 VOID
1843 APIENTRY
1844 EngGetCurrentCodePage(
1845 _Out_ PUSHORT OemCodePage,
1846 _Out_ PUSHORT AnsiCodePage);
1847
1848 ENGAPI
1849 HANDLE
1850 APIENTRY
1851 EngGetCurrentProcessId(VOID);
1852
1853 ENGAPI
1854 HANDLE
1855 APIENTRY
1856 EngGetCurrentThreadId(VOID);
1857
1858 _Must_inspect_result_ _Ret_z_
1859 ENGAPI
1860 LPWSTR
1861 APIENTRY
1862 EngGetDriverName(
1863 _In_ HDEV hdev);
1864
1865 ENGAPI
1866 BOOL
1867 APIENTRY
1868 EngGetFileChangeTime(
1869 _In_ HANDLE h,
1870 _Out_ LARGE_INTEGER *pChangeTime);
1871
1872 ENGAPI
1873 BOOL
1874 APIENTRY
1875 EngGetFilePath(
1876 _In_ HANDLE h,
1877 _Out_ WCHAR (*pDest)[MAX_PATH+1]);
1878
1879 #ifdef USERMODE_DRIVER
1880 #define EngGetForm GetForm
1881 #define EngGetLastError GetLastError
1882 #define EngGetPrinter GetPrinter
1883 #define EngGetPrinterData GetPrinterData
1884 #else /* !USERMODE_DRIVER */
1885 ENGAPI
1886 BOOL
1887 APIENTRY
1888 EngGetForm(
1889 _In_ HANDLE hPrinter,
1890 _In_ LPWSTR pFormName,
1891 _In_ DWORD Level,
1892 _In_reads_bytes_opt_(cbBuf) LPBYTE pForm,
1893 _In_ DWORD cbBuf,
1894 _Out_ LPDWORD pcbNeeded);
1895
1896 ENGAPI
1897 ULONG
1898 APIENTRY
1899 EngGetLastError(VOID);
1900
1901 ENGAPI
1902 BOOL
1903 APIENTRY
1904 EngGetPrinter(
1905 _In_ HANDLE hPrinter,
1906 _In_ DWORD dwLevel,
1907 _Out_writes_bytes_opt_(cbBuf) LPBYTE pPrinter,
1908 _In_ DWORD cbBuf,
1909 _Out_ LPDWORD pcbNeeded);
1910
1911 ENGAPI
1912 DWORD
1913 APIENTRY
1914 EngGetPrinterData(
1915 _In_ HANDLE hPrinter,
1916 _In_ LPWSTR pValueName,
1917 _Out_opt_ LPDWORD pType,
1918 _Out_writes_bytes_opt_(cjSize) LPBYTE pData,
1919 _In_ DWORD cjSize,
1920 _Out_ LPDWORD pcjNeeded);
1921 #endif /* !USERMODE_DRIVER */
1922
1923 ENGAPI
1924 LPWSTR
1925 APIENTRY
1926 EngGetPrinterDataFileName(
1927 _In_ HDEV hdev);
1928
1929 #ifdef USERMODE_DRIVER
1930 #define EngGetPrinterDriver GetPrinterDriver
1931 #else /* !USERMODE_DRIVER */
1932 ENGAPI
1933 BOOL
1934 APIENTRY
1935 EngGetPrinterDriver(
1936 _In_ HANDLE hPrinter,
1937 _In_opt_ LPWSTR pEnvironment,
1938 _In_ DWORD dwLevel,
1939 _Out_writes_bytes_opt_(cjBufSize) BYTE *lpbDrvInfo,
1940 _In_ DWORD cjBufSize,
1941 _Out_ DWORD *pcjNeeded);
1942 #endif /* !USERMODE_DRIVER */
1943
1944 ENGAPI
1945 HANDLE
1946 APIENTRY
1947 EngGetProcessHandle(VOID);
1948
1949 ENGAPI
1950 BOOL
1951 APIENTRY
1952 EngGetType1FontList(
1953 _In_ HDEV hdev,
1954 _Out_writes_bytes_opt_(cjType1Buffer) TYPE1_FONT *pType1Buffer,
1955 _In_ ULONG cjType1Buffer,
1956 _Out_ PULONG pulLocalFonts,
1957 _Out_ PULONG pulRemoteFonts,
1958 _Out_ LARGE_INTEGER *pLastModified);
1959
1960 ENGAPI
1961 BOOL
1962 APIENTRY
1963 EngGradientFill(
1964 _Inout_ SURFOBJ *psoDest,
1965 _In_ CLIPOBJ *pco,
1966 _In_opt_ XLATEOBJ *pxlo,
1967 _In_ TRIVERTEX *pVertex,
1968 _In_ ULONG nVertex,
1969 _In_ PVOID pMesh,
1970 _In_ ULONG nMesh,
1971 _In_ RECTL *prclExtents,
1972 _In_ POINTL *pptlDitherOrg,
1973 _In_ ULONG ulMode);
1974
1975 /* EngHangNotification return values */
1976 #define EHN_RESTORED 0x00000000
1977 #define EHN_ERROR 0x00000001
1978
1979 ENGAPI
1980 ULONG
1981 APIENTRY
1982 EngHangNotification(
1983 _In_ HDEV hDev,
1984 _Reserved_ PVOID Reserved);
1985
1986 ENGAPI
1987 BOOL
1988 APIENTRY
1989 EngInitializeSafeSemaphore(
1990 _Out_ ENGSAFESEMAPHORE *pssem);
1991
1992 ENGAPI
1993 BOOL
1994 APIENTRY
1995 EngIsSemaphoreOwned(
1996 _In_ HSEMAPHORE hsem);
1997
1998 ENGAPI
1999 BOOL
2000 APIENTRY
2001 EngIsSemaphoreOwnedByCurrentThread(
2002 _In_ HSEMAPHORE hsem);
2003
2004 ENGAPI
2005 BOOL
2006 APIENTRY
2007 EngLineTo(
2008 _Inout_ SURFOBJ *pso,
2009 _In_ CLIPOBJ *pco,
2010 _In_ BRUSHOBJ *pbo,
2011 _In_ LONG x1,
2012 _In_ LONG y1,
2013 _In_ LONG x2,
2014 _In_ LONG y2,
2015 _In_opt_ RECTL *prclBounds,
2016 _In_ MIX mix);
2017
2018 #ifdef USERMODE_DRIVER
2019 #define EngLoadImage(pwszDriver) ((HANDLE)LoadLibraryW(pwszDriver))
2020 #else /* !USERMODE_DRIVER */
2021 ENGAPI
2022 HANDLE
2023 APIENTRY
2024 EngLoadImage(
2025 _In_ LPWSTR pwszDriver);
2026 #endif /* !USERMODE_DRIVER */
2027
2028 ENGAPI
2029 HANDLE
2030 APIENTRY
2031 EngLoadModule(
2032 _In_ LPWSTR pwsz);
2033
2034 ENGAPI
2035 HANDLE
2036 APIENTRY
2037 EngLoadModuleForWrite(
2038 _In_ LPWSTR pwsz,
2039 _In_ ULONG cjSizeOfModule);
2040
2041 ENGAPI
2042 PDD_SURFACE_LOCAL
2043 APIENTRY
2044 EngLockDirectDrawSurface(
2045 _In_ HANDLE hSurface);
2046
2047 ENGAPI
2048 DRIVEROBJ*
2049 APIENTRY
2050 EngLockDriverObj(
2051 _In_ HDRVOBJ hdo);
2052
2053 ENGAPI
2054 SURFOBJ*
2055 APIENTRY
2056 EngLockSurface(
2057 _In_ HSURF hsurf);
2058
2059 ENGAPI
2060 BOOL
2061 APIENTRY
2062 EngLpkInstalled(VOID);
2063
2064 ENGAPI
2065 PEVENT
2066 APIENTRY
2067 EngMapEvent(
2068 _In_ HDEV hDev,
2069 _In_ HANDLE hUserObject,
2070 _Reserved_ PVOID Reserved1,
2071 _Reserved_ PVOID Reserved2,
2072 _Reserved_ PVOID Reserved3);
2073
2074 _Success_(return != 0)
2075 _When_(cjSize != 0, _At_(return, _Out_writes_bytes_(cjSize)))
2076 ENGAPI
2077 PVOID
2078 APIENTRY
2079 EngMapFile(
2080 _In_ LPWSTR pwsz,
2081 _In_ ULONG cjSize,
2082 _Out_ ULONG_PTR *piFile);
2083
2084 __drv_preferredFunction("EngMapFontFileFD", "Obsolete")
2085 ENGAPI
2086 BOOL
2087 APIENTRY
2088 EngMapFontFile(
2089 _In_ ULONG_PTR iFile,
2090 _Outptr_result_bytebuffer_(*pcjBuf) PULONG *ppjBuf,
2091 _Out_ ULONG *pcjBuf);
2092
2093 ENGAPI
2094 BOOL
2095 APIENTRY
2096 EngMapFontFileFD(
2097 _In_ ULONG_PTR iFile,
2098 _Outptr_result_bytebuffer_(*pcjBuf) PULONG *ppjBuf,
2099 _Out_ ULONG *pcjBuf);
2100
2101 ENGAPI
2102 PVOID
2103 APIENTRY
2104 EngMapModule(
2105 _In_ HANDLE h,
2106 _Out_ PULONG pSize);
2107
2108 ENGAPI
2109 BOOL
2110 APIENTRY
2111 EngMarkBandingSurface(
2112 _In_ HSURF hsurf);
2113
2114 /* EngModifySurface.flSurface constants */
2115 #define MS_NOTSYSTEMMEMORY 0x00000001
2116 #define MS_SHAREDACCESS 0x00000002
2117 #define MS_CDDDEVICEBITMAP 0x00000004
2118
2119 ENGAPI
2120 BOOL
2121 APIENTRY
2122 EngModifySurface(
2123 _In_ HSURF hsurf,
2124 _In_ HDEV hdev,
2125 _In_ FLONG flHooks,
2126 _In_ FLONG flSurface,
2127 _In_ DHSURF dhsurf,
2128 _In_ PVOID pvScan0,
2129 _In_ LONG lDelta,
2130 _Reserved_ PVOID pvReserved);
2131
2132 ENGAPI
2133 VOID
2134 APIENTRY
2135 EngMovePointer(
2136 _In_ SURFOBJ *pso,
2137 _In_ LONG x,
2138 _In_ LONG y,
2139 _In_ RECTL *prcl);
2140
2141 #ifdef USERMODE_DRIVER
2142 #define EngMulDiv MulDiv
2143 #else /* !USERMODE_DRIVER */
2144 ENGAPI
2145 INT
2146 APIENTRY
2147 EngMulDiv(
2148 _In_ INT a,
2149 _In_ INT b,
2150 _In_ INT c);
2151 #endif /* !USERMODE_DRIVER */
2152
2153 ENGAPI
2154 VOID
2155 APIENTRY
2156 EngMultiByteToUnicodeN(
2157 _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) LPWSTR UnicodeString,
2158 _In_ ULONG MaxBytesInUnicodeString,
2159 _Out_opt_ PULONG BytesInUnicodeString,
2160 _In_reads_bytes_(BytesInMultiByteString) PCHAR MultiByteString,
2161 _In_ ULONG BytesInMultiByteString);
2162
2163 ENGAPI
2164 INT
2165 APIENTRY
2166 EngMultiByteToWideChar(
2167 _In_ UINT CodePage,
2168 _Out_writes_bytes_opt_(cjWideCharString) LPWSTR WideCharString,
2169 _In_ INT cjWideCharString,
2170 _In_reads_bytes_opt_(cjMultiByteString) LPSTR MultiByteString,
2171 _In_ INT cjMultiByteString);
2172
2173 ENGAPI
2174 BOOL
2175 APIENTRY
2176 EngPaint(
2177 _In_ SURFOBJ *pso,
2178 _In_ CLIPOBJ *pco,
2179 _In_ BRUSHOBJ *pbo,
2180 _In_ POINTL *pptlBrushOrg,
2181 _In_ __in_data_source(USER_MODE) MIX mix);
2182
2183 ENGAPI
2184 BOOL
2185 APIENTRY
2186 EngPlgBlt(
2187 _In_ SURFOBJ *psoTrg,
2188 _In_ SURFOBJ *psoSrc,
2189 _In_opt_ SURFOBJ *psoMsk,
2190 _In_ CLIPOBJ *pco,
2191 _In_opt_ XLATEOBJ *pxlo,
2192 _In_ COLORADJUSTMENT *pca,
2193 _In_ POINTL *pptlBrushOrg,
2194 _In_ POINTFIX *pptfx,
2195 _In_ RECTL *prcl,
2196 _When_(psoMsk, _In_) POINTL *pptl,
2197 _In_ __in_data_source(USER_MODE) ULONG iMode);
2198
2199 ENGAPI
2200 VOID
2201 APIENTRY
2202 EngProbeForRead(
2203 _In_reads_bytes_(Length) PVOID Address,
2204 _In_ SIZE_T Length,
2205 _In_ ULONG Alignment);
2206
2207 ENGAPI
2208 VOID
2209 APIENTRY
2210 EngProbeForReadAndWrite(
2211 _Inout_updates_bytes_(Length) PVOID Address,
2212 _In_ SIZE_T Length,
2213 _In_ ULONG Alignment);
2214
2215 typedef enum _ENG_DEVICE_ATTRIBUTE {
2216 QDA_RESERVED = 0,
2217 QDA_ACCELERATION_LEVEL
2218 } ENG_DEVICE_ATTRIBUTE;
2219
2220 ENGAPI
2221 BOOL
2222 APIENTRY
2223 EngQueryDeviceAttribute(
2224 _In_ HDEV hdev,
2225 _In_ ENG_DEVICE_ATTRIBUTE devAttr,
2226 _In_reads_bytes_(cjInSize) PVOID pvIn,
2227 _In_ ULONG cjInSize,
2228 _Out_writes_bytes_(cjOutSize) PVOID pvOut,
2229 _In_ ULONG cjOutSize);
2230
2231 /* Obsolete in Windows 2000 and later */
2232 DECLSPEC_DEPRECATED_DDK
2233 BOOL APIENTRY
2234 EngQueryEMFInfo(
2235 _In_ HDEV hdev,
2236 _Out_ EMFINFO *pEMFInfo);
2237
2238 ENGAPI
2239 LARGE_INTEGER
2240 APIENTRY
2241 EngQueryFileTimeStamp(
2242 _In_ LPWSTR pwsz);
2243
2244 ENGAPI
2245 VOID
2246 APIENTRY
2247 EngQueryLocalTime(
2248 _Out_ PENG_TIME_FIELDS ptf);
2249
2250 ENGAPI
2251 ULONG
2252 APIENTRY
2253 EngQueryPalette(
2254 _In_ HPALETTE hPal,
2255 _Out_ ULONG *piMode,
2256 _In_ ULONG cColors,
2257 _Out_writes_opt_(cColors) ULONG *pulColors);
2258
2259 ENGAPI
2260 VOID
2261 APIENTRY
2262 EngQueryPerformanceCounter(
2263 _Out_ LONGLONG *pPerformanceCount);
2264
2265 ENGAPI
2266 VOID
2267 APIENTRY
2268 EngQueryPerformanceFrequency(
2269 _Out_ LONGLONG *pFrequency);
2270
2271 typedef enum _ENG_SYSTEM_ATTRIBUTE {
2272 EngProcessorFeature = 1,
2273 EngNumberOfProcessors,
2274 EngOptimumAvailableUserMemory,
2275 EngOptimumAvailableSystemMemory,
2276 } ENG_SYSTEM_ATTRIBUTE;
2277
2278 #define QSA_MMX 0x00000100
2279 #define QSA_SSE 0x00002000
2280 #define QSA_3DNOW 0x00004000
2281 #if (NTDDI_VERSION >= NTDDI_VISTA)
2282 #define QSA_SSE1 QSA_SSE
2283 #define QSA_SSE2 0x00010000
2284 #define QSA_SSE3 0x00080000
2285 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
2286
2287 _Check_return_
2288 _Success_(return)
2289 ENGAPI
2290 BOOL
2291 APIENTRY
2292 EngQuerySystemAttribute(
2293 _In_ ENG_SYSTEM_ATTRIBUTE CapNum,
2294 _Out_ PDWORD pCapability);
2295
2296 ENGAPI
2297 LONG
2298 APIENTRY
2299 EngReadStateEvent(
2300 _In_ PEVENT pEvent);
2301
2302 ENGAPI
2303 VOID
2304 APIENTRY
2305 EngReleaseSemaphore(
2306 _In_ HSEMAPHORE hsem);
2307
2308 #if defined(_M_AMD64) && (NTDDI_VERSION >= NTDDI_VISTA)
2309
2310 _Check_return_
2311 _Success_(return)
2312 _Kernel_float_restored_
2313 _At_(*pBuffer, _Kernel_requires_resource_held_(EngFloatState)
2314 _Kernel_releases_resource_(EngFloatState))
2315 ENGAPI
2316 BOOL
2317 APIENTRY
2318 EngRestoreFloatingPointState(
2319 _In_reads_(_Inexpressible_(statesize))
2320 PVOID pBuffer)
2321 {
2322 UNREFERENCED_PARAMETER(pBuffer);
2323 return TRUE;
2324 }
2325
2326 _Check_return_
2327 _Success_(((pBuffer != NULL && cjBufferSize != 0) && return == 1) ||
2328 ((pBuffer == NULL || cjBufferSize == 0) && return > 0))
2329 _When_(pBuffer != NULL && cjBufferSize != 0 && return == 1, _Kernel_float_saved_
2330 _At_(*pBuffer, _Post_valid_ _Kernel_acquires_resource_(EngFloatState)))
2331 _On_failure_(_Post_satisfies_(return == 0))
2332 ENGAPI
2333 ULONG
2334 APIENTRY
2335 EngSaveFloatingPointState(
2336 _At_(*pBuffer, _Kernel_requires_resource_not_held_(EngFloatState))
2337 _Out_writes_bytes_opt_(cjBufferSize) PVOID pBuffer,
2338 _Inout_ ULONG cjBufferSize)
2339 {
2340 return ((((pBuffer) == NULL) || ((cjBufferSize) == 0)) ? 8 : TRUE);
2341 }
2342
2343 #else /* !(defined(_M_AMD64) && (NTDDI_VERSION >= NTDDI_VISTA)) */
2344
2345 _Check_return_
2346 _Success_(return)
2347 _Kernel_float_restored_
2348 _At_(*pBuffer, _Kernel_requires_resource_held_(EngFloatState)
2349 _Kernel_releases_resource_(EngFloatState))
2350 ENGAPI
2351 BOOL
2352 APIENTRY
2353 EngRestoreFloatingPointState(
2354 _In_reads_(_Inexpressible_(statesize))
2355 PVOID pBuffer);
2356
2357 _Check_return_
2358 _Success_(((pBuffer != NULL && cjBufferSize != 0) && return == 1) ||
2359 ((pBuffer == NULL || cjBufferSize == 0) && return > 0))
2360 _When_(pBuffer != NULL && cjBufferSize != 0 && return == 1, _Kernel_float_saved_
2361 _At_(*pBuffer, _Post_valid_ _Kernel_acquires_resource_(EngFloatState)))
2362 _On_failure_(_Post_satisfies_(return == 0))
2363 ENGAPI
2364 ULONG
2365 APIENTRY
2366 EngSaveFloatingPointState(
2367 _At_(*pBuffer, _Kernel_requires_resource_not_held_(EngFloatState))
2368 _Out_writes_bytes_opt_(cjBufferSize) PVOID pBuffer,
2369 _Inout_ ULONG cjBufferSize);
2370
2371
2372 #endif /* defined(_M_AMD64) && (NTDDI_VERSION >= NTDDI_VISTA) */
2373
2374 ENGAPI
2375 HANDLE
2376 APIENTRY
2377 EngSecureMem(
2378 _In_reads_bytes_(cjLength) PVOID Address,
2379 _In_ ULONG cjLength);
2380
2381 ENGAPI
2382 LONG
2383 APIENTRY
2384 EngSetEvent(
2385 _In_ PEVENT pEvent);
2386
2387 #ifdef USERMODE_DRIVER
2388 #define EngSetLastError SetLastError
2389 #else /* !USERMODE_DRIVER */
2390 ENGAPI
2391 VOID
2392 APIENTRY
2393 EngSetLastError(
2394 _In_ ULONG iError);
2395 #endif /* !USERMODE_DRIVER */
2396
2397 ENGAPI
2398 ULONG
2399 APIENTRY
2400 EngSetPointerShape(
2401 _In_ SURFOBJ *pso,
2402 _In_opt_ SURFOBJ *psoMask,
2403 _In_opt_ SURFOBJ *psoColor,
2404 _In_opt_ XLATEOBJ *pxlo,
2405 _In_ LONG xHot,
2406 _In_ LONG yHot,
2407 _In_ LONG x,
2408 _In_ LONG y,
2409 _In_ RECTL *prcl,
2410 _In_ FLONG fl);
2411
2412 __drv_preferredFunction("(see documentation)", "Obsolete, always returns false. ")
2413 ENGAPI
2414 BOOL
2415 APIENTRY
2416 EngSetPointerTag(
2417 _In_ HDEV hdev,
2418 _In_opt_ SURFOBJ *psoMask,
2419 _In_opt_ SURFOBJ *psoColor,
2420 _Reserved_ XLATEOBJ *pxlo,
2421 _In_ FLONG fl);
2422
2423 #ifdef USERMODE_DRIVER
2424 #define EngSetPrinterData SetPrinterData
2425 #else /* !USERMODE_DRIVER */
2426 ENGAPI
2427 DWORD
2428 APIENTRY
2429 EngSetPrinterData(
2430 _In_ HANDLE hPrinter,
2431 _In_ LPWSTR pType,
2432 _In_ DWORD dwType,
2433 _In_reads_bytes_(cjPrinterData) LPBYTE lpbPrinterData,
2434 _In_ DWORD cjPrinterData);
2435 #endif /* !USERMODE_DRIVER */
2436
2437 typedef int (CDECL *SORTCOMP)(const void *pv1, const void *pv2);
2438
2439 ENGAPI
2440 VOID
2441 APIENTRY
2442 EngSort(
2443 _Inout_updates_bytes_(c * cjElem) PBYTE pjBuf,
2444 _In_ ULONG c,
2445 _In_ ULONG cjElem,
2446 _In_ SORTCOMP pfnComp);
2447
2448 ENGAPI
2449 BOOL
2450 APIENTRY
2451 EngStretchBlt(
2452 _In_ SURFOBJ *psoDest,
2453 _In_ SURFOBJ *psoSrc,
2454 _In_opt_ SURFOBJ *psoMask,
2455 _In_opt_ CLIPOBJ *pco,
2456 _In_opt_ XLATEOBJ *pxlo,
2457 _In_opt_ COLORADJUSTMENT *pca,
2458 _In_ POINTL *pptlHTOrg,
2459 _In_ RECTL *prclDest,
2460 _In_ RECTL *prclSrc,
2461 _When_(psoMask, _In_) POINTL *pptlMask,
2462 _In_ ULONG iMode);
2463
2464 ENGAPI
2465 BOOL
2466 APIENTRY
2467 EngStretchBltROP(
2468 _In_ SURFOBJ *psoDest,
2469 _In_ SURFOBJ *psoSrc,
2470 _In_opt_ SURFOBJ *psoMask,
2471 _In_opt_ CLIPOBJ *pco,
2472 _In_opt_ XLATEOBJ *pxlo,
2473 _In_opt_ COLORADJUSTMENT *pca,
2474 _In_ POINTL *pptlHTOrg,
2475 _In_ RECTL *prclDest,
2476 _In_ RECTL *prclSrc,
2477 _When_(psoMask, _In_) POINTL *pptlMask,
2478 _In_ ULONG iMode,
2479 _In_opt_ BRUSHOBJ *pbo,
2480 _In_ DWORD rop4);
2481
2482 ENGAPI
2483 BOOL
2484 APIENTRY
2485 EngStrokeAndFillPath(
2486 _Inout_ SURFOBJ *pso,
2487 _In_ PATHOBJ *ppo,
2488 _In_ CLIPOBJ *pco,
2489 _In_ XFORMOBJ *pxo,
2490 _In_ BRUSHOBJ *pboStroke,
2491 _In_ LINEATTRS *plineattrs,
2492 _In_ BRUSHOBJ *pboFill,
2493 _In_ POINTL *pptlBrushOrg,
2494 _In_ __in_data_source(USER_MODE) MIX mixFill,
2495 _In_ __in_data_source(USER_MODE) FLONG flOptions);
2496
2497 ENGAPI
2498 BOOL
2499 APIENTRY
2500 EngStrokePath(
2501 _In_ SURFOBJ *pso,
2502 _In_ PATHOBJ *ppo,
2503 _In_ CLIPOBJ *pco,
2504 _In_ XFORMOBJ *pxo,
2505 _In_ BRUSHOBJ *pbo,
2506 _In_ POINTL *pptlBrushOrg,
2507 _In_ LINEATTRS *plineattrs,
2508 _In_ MIX mix);
2509
2510 ENGAPI
2511 BOOL
2512 APIENTRY
2513 EngTextOut(
2514 _In_ SURFOBJ *pso,
2515 _In_ STROBJ *pstro,
2516 _In_ FONTOBJ *pfo,
2517 _In_ CLIPOBJ *pco,
2518 _Null_ RECTL *prclExtra,
2519 _In_opt_ RECTL *prclOpaque,
2520 _In_ BRUSHOBJ *pboFore,
2521 _In_ BRUSHOBJ *pboOpaque,
2522 _In_ POINTL *pptlOrg,
2523 _In_ MIX mix);
2524
2525 ENGAPI
2526 BOOL
2527 APIENTRY
2528 EngTransparentBlt(
2529 _In_ SURFOBJ *psoDst,
2530 _In_ SURFOBJ *psoSrc,
2531 _In_opt_ CLIPOBJ *pco,
2532 _In_opt_ XLATEOBJ *pxlo,
2533 _In_ RECTL *prclDst,
2534 _In_ RECTL *prclSrc,
2535 _In_ ULONG iTransColor,
2536 _In_ ULONG ulReserved);
2537
2538 ENGAPI
2539 VOID
2540 APIENTRY
2541 EngUnicodeToMultiByteN(
2542 _Out_writes_bytes_to_(cjMultiByteBuf, *pcjMultiByteString) PCHAR pchMultiByteString,
2543 _In_ ULONG cjMultiByteBuf,
2544 _Out_opt_ PULONG pcjMultiByteString,
2545 _In_reads_bytes_(cjUnicodeString) PWSTR pwszUnicodeString,
2546 _In_ ULONG cjUnicodeString);
2547
2548 #ifdef USERMODE_DRIVER
2549 #define EngUnloadImage(h) FreeLibrary((HMODULE) (h))
2550 #else /* !USERMODE_DRIVER */
2551 ENGAPI
2552 VOID
2553 APIENTRY
2554 EngUnloadImage(
2555 _In_ HANDLE hModule);
2556 #endif /* !USERMODE_DRIVER */
2557
2558 ENGAPI
2559 BOOL
2560 APIENTRY
2561 EngUnlockDirectDrawSurface(
2562 _In_ PDD_SURFACE_LOCAL pSurface);
2563
2564 ENGAPI
2565 BOOL
2566 APIENTRY
2567 EngUnlockDriverObj(
2568 _In_ _Post_ptr_invalid_ HDRVOBJ hdo);
2569
2570 ENGAPI
2571 VOID
2572 APIENTRY
2573 EngUnlockSurface(
2574 _In_ _Post_ptr_invalid_ SURFOBJ *pso);
2575
2576 ENGAPI
2577 BOOL
2578 APIENTRY
2579 EngUnmapEvent(
2580 _In_ PEVENT pEvent);
2581
2582 ENGAPI
2583 BOOL
2584 APIENTRY
2585 EngUnmapFile(
2586 _In_ ULONG_PTR iFile);
2587
2588 __drv_preferredFunction("EngUnmapFontFileFD", "Obsolete")
2589 ENGAPI
2590 VOID
2591 APIENTRY
2592 EngUnmapFontFile(
2593 _In_ ULONG_PTR iFile);
2594
2595 ENGAPI
2596 VOID
2597 APIENTRY
2598 EngUnmapFontFileFD(
2599 _In_ ULONG_PTR iFile);
2600
2601 ENGAPI
2602 VOID
2603 APIENTRY
2604 EngUnsecureMem(
2605 _In_ HANDLE hSecure);
2606
2607 ENGAPI
2608 BOOL
2609 APIENTRY
2610 EngWaitForSingleObject(
2611 _In_ PEVENT pEvent,
2612 _In_opt_ PLARGE_INTEGER pTimeOut);
2613
2614 ENGAPI
2615 INT
2616 APIENTRY
2617 EngWideCharToMultiByte(
2618 _In_ UINT CodePage,
2619 _In_reads_bytes_opt_(cjWideCharString) LPWSTR pwszWideCharString,
2620 _In_ INT cjWideCharString,
2621 _Out_z_bytecap_(cjMultiByteString) LPSTR pszMultiByteString,
2622 _In_ INT cjMultiByteString);
2623
2624 #ifdef USERMODE_DRIVER
2625 #define EngWritePrinter WritePrinter
2626 #else /* !USERMODE_DRIVER */
2627 ENGAPI
2628 BOOL
2629 APIENTRY
2630 EngWritePrinter(
2631 _In_ HANDLE hPrinter,
2632 _In_reads_bytes_(cjBuf) LPVOID pvBuf,
2633 _In_ DWORD cjBuf,
2634 _Out_ LPDWORD pcWritten);
2635 #endif /* !USERMODE_DRIVER */
2636
2637 #if defined(_X86_) && !defined(USERMODE_DRIVER)
2638 ENGAPI
2639 VOID
2640 APIENTRY
2641 FLOATOBJ_Add(
2642 _Inout_ PFLOATOBJ pf,
2643 _In_ PFLOATOBJ pf1);
2644
2645 ENGAPI
2646 VOID
2647 APIENTRY
2648 FLOATOBJ_AddFloat(
2649 _Inout_ PFLOATOBJ pf,
2650 _In_ FLOATL f);
2651
2652 ENGAPI
2653 VOID
2654 APIENTRY
2655 FLOATOBJ_AddLong(
2656 _Inout_ PFLOATOBJ pf,
2657 _In_ LONG l);
2658
2659 ENGAPI
2660 VOID
2661 APIENTRY
2662 FLOATOBJ_Div(
2663 _Inout_ PFLOATOBJ pf,
2664 _In_ PFLOATOBJ pf1);
2665
2666 ENGAPI
2667 VOID
2668 APIENTRY
2669 FLOATOBJ_DivFloat(
2670 _Inout_ PFLOATOBJ pf,
2671 _In_ FLOATL f);
2672
2673 ENGAPI
2674 VOID
2675 APIENTRY
2676 FLOATOBJ_DivLong(
2677 _Inout_ PFLOATOBJ pf,
2678 _In_ LONG l);
2679
2680 ENGAPI
2681 BOOL
2682 APIENTRY
2683 FLOATOBJ_Equal(
2684 _In_ PFLOATOBJ pf,
2685 _In_ PFLOATOBJ pf1);
2686
2687 ENGAPI
2688 BOOL
2689 APIENTRY
2690 FLOATOBJ_EqualLong(
2691 _In_ PFLOATOBJ pf,
2692 _In_ LONG l);
2693
2694 ENGAPI
2695 LONG
2696 APIENTRY
2697 FLOATOBJ_GetFloat(
2698 _In_ PFLOATOBJ pf);
2699
2700 ENGAPI
2701 LONG
2702 APIENTRY
2703 FLOATOBJ_GetLong(
2704 _In_ PFLOATOBJ pf);
2705
2706 ENGAPI
2707 BOOL
2708 APIENTRY
2709 FLOATOBJ_GreaterThan(
2710 _In_ PFLOATOBJ pf,
2711 _In_ PFLOATOBJ pf1);
2712
2713 ENGAPI
2714 BOOL
2715 APIENTRY
2716 FLOATOBJ_GreaterThanLong(
2717 _In_ PFLOATOBJ pf,
2718 _In_ LONG l);
2719
2720 ENGAPI
2721 BOOL
2722 APIENTRY
2723 FLOATOBJ_LessThan(
2724 _In_ PFLOATOBJ pf,
2725 _In_ PFLOATOBJ pf1);
2726
2727 ENGAPI
2728 BOOL
2729 APIENTRY
2730 FLOATOBJ_LessThanLong(
2731 _In_ PFLOATOBJ pf,
2732 _In_ LONG l);
2733
2734 ENGAPI
2735 VOID
2736 APIENTRY
2737 FLOATOBJ_Mul(
2738 _Inout_ PFLOATOBJ pf,
2739 _In_ PFLOATOBJ pf1);
2740
2741 ENGAPI
2742 VOID
2743 APIENTRY
2744 FLOATOBJ_MulFloat(
2745 _Inout_ PFLOATOBJ pf,
2746 _In_ FLOATL f);
2747
2748 ENGAPI
2749 VOID
2750 APIENTRY
2751 FLOATOBJ_MulLong(
2752 _Inout_ PFLOATOBJ pf,
2753 _In_ LONG l);
2754
2755 ENGAPI
2756 VOID
2757 APIENTRY
2758 FLOATOBJ_Neg(
2759 _Inout_ PFLOATOBJ pf);
2760
2761 ENGAPI
2762 VOID
2763 APIENTRY
2764 FLOATOBJ_SetFloat(
2765 _Out_ PFLOATOBJ pf,
2766 _In_ FLOATL f);
2767
2768 ENGAPI
2769 VOID
2770 APIENTRY
2771 FLOATOBJ_SetLong(
2772 _Out_ PFLOATOBJ pf,
2773 _In_ LONG l);
2774
2775 ENGAPI
2776 VOID
2777 APIENTRY
2778 FLOATOBJ_Sub(
2779 _Inout_ PFLOATOBJ pf,
2780 _In_ PFLOATOBJ pf1);
2781
2782 ENGAPI
2783 VOID
2784 APIENTRY
2785 FLOATOBJ_SubFloat(
2786 _Inout_ PFLOATOBJ pf,
2787 _In_ FLOATL f);
2788
2789 ENGAPI
2790 VOID
2791 APIENTRY
2792 FLOATOBJ_SubLong(
2793 _Inout_ PFLOATOBJ pf,
2794 _In_ LONG l);
2795
2796 #else
2797
2798 #define FLOATOBJ_SetFloat(pf, f) {*(pf) = (f);}
2799 #define FLOATOBJ_SetLong(pf, l) {*(pf) = (FLOAT)(l);}
2800 #define FLOATOBJ_GetFloat(pf) (*(PULONG)(pf))
2801 #define FLOATOBJ_GetLong(pf) ((LONG)*(pf))
2802 #define FLOATOBJ_Add(pf, pf1) {*(pf) += *(pf1);}
2803 #define FLOATOBJ_AddFloat(pf, f) {*(pf) += (f);}
2804 #define FLOATOBJ_AddLong(pf, l) {*(pf) += (l);}
2805 #define FLOATOBJ_Sub(pf, pf1) {*(pf) -= *(pf1);}
2806 #define FLOATOBJ_SubFloat(pf, f) {*(pf) -= (f);}
2807 #define FLOATOBJ_SubLong(pf, l) {*(pf) -= (l);}
2808 #define FLOATOBJ_Mul(pf, pf1) {*(pf) *= *(pf1);}
2809 #define FLOATOBJ_MulFloat(pf, f) {*(pf) *= (f);}
2810 #define FLOATOBJ_MulLong(pf, l) {*(pf) *= (l);}
2811 #define FLOATOBJ_Div(pf, pf1) {*(pf) /= *(pf1);}
2812 #define FLOATOBJ_DivFloat(pf, f) {*(pf) /= (f);}
2813 #define FLOATOBJ_DivLong(pf, l) {*(pf) /= (l);}
2814 #define FLOATOBJ_Neg(pf) {*(pf) = -(*(pf));}
2815 #define FLOATOBJ_Equal(pf, pf1) (*(pf) == *(pf1))
2816 #define FLOATOBJ_GreaterThan(pf, pf1) (*(pf) > *(pf1))
2817 #define FLOATOBJ_LessThan(pf, pf1) (*(pf) < *(pf1))
2818 #define FLOATOBJ_EqualLong(pf, l) (*(pf) == (FLOAT)(l))
2819 #define FLOATOBJ_GreaterThanLong(pf, l) (*(pf) > (FLOAT)(l))
2820 #define FLOATOBJ_LessThanLong(pf, l) (*(pf) < (FLOAT)(l))
2821
2822 #endif
2823
2824 ENGAPI
2825 ULONG
2826 APIENTRY
2827 FONTOBJ_cGetAllGlyphHandles(
2828 _In_ FONTOBJ *pfo,
2829 _Out_opt_ HGLYPH *phg);
2830
2831 ENGAPI
2832 ULONG
2833 APIENTRY
2834 FONTOBJ_cGetGlyphs(
2835 _In_ FONTOBJ *pfo,
2836 _In_ ULONG iMode,
2837 _In_ ULONG cGlyph,
2838 _In_count_(cGlyph) HGLYPH *phg,
2839 _Out_ PVOID *ppvGlyph);
2840
2841 ENGAPI
2842 FD_GLYPHSET*
2843 APIENTRY
2844 FONTOBJ_pfdg(
2845 _In_ FONTOBJ *pfo);
2846
2847 ENGAPI
2848 IFIMETRICS*
2849 APIENTRY
2850 FONTOBJ_pifi(
2851 _In_ FONTOBJ *pfo);
2852
2853 _Ret_opt_bytecount_(*pcjTable)
2854 ENGAPI
2855 PBYTE
2856 APIENTRY
2857 FONTOBJ_pjOpenTypeTablePointer(
2858 _In_ FONTOBJ *pfo,
2859 _In_ ULONG ulTag,
2860 _Out_ ULONG *pcjTable);
2861
2862 ENGAPI
2863 PFD_GLYPHATTR
2864 APIENTRY
2865 FONTOBJ_pQueryGlyphAttrs(
2866 _In_ FONTOBJ *pfo,
2867 _In_ ULONG iMode);
2868
2869 _Ret_opt_bytecount_(*pcjFile)
2870 ENGAPI
2871 PVOID
2872 APIENTRY
2873 FONTOBJ_pvTrueTypeFontFile(
2874 _In_ FONTOBJ *pfo,
2875 _Out_ ULONG *pcjFile);
2876
2877 ENGAPI
2878 LPWSTR
2879 APIENTRY
2880 FONTOBJ_pwszFontFilePaths(
2881 _In_ FONTOBJ *pfo,
2882 _Out_ ULONG *pcwc);
2883
2884 ENGAPI
2885 XFORMOBJ*
2886 APIENTRY
2887 FONTOBJ_pxoGetXform(
2888 _In_ FONTOBJ *pfo);
2889
2890 ENGAPI
2891 VOID
2892 APIENTRY
2893 FONTOBJ_vGetInfo(
2894 _In_ FONTOBJ *pfo,
2895 _In_ ULONG cjSize,
2896 _Out_bytecap_(cjSize) FONTINFO *pfi);
2897
2898 #if (NTDDI_VERSION <= NTDDI_WINXP)
2899 /* Obsolete in Windows 2000 and later */
2900 GAMMA_TABLES*
2901 APIENTRY
2902 FONTOBJ_pGetGammaTables(
2903 _In_ FONTOBJ *pfo);
2904 #endif
2905
2906 ENGAPI
2907 LONG
2908 APIENTRY
2909 HT_ComputeRGBGammaTable(
2910 _In_ USHORT GammaTableEntries,
2911 _In_ USHORT GammaTableType,
2912 _In_ USHORT RedGamma,
2913 _In_ USHORT GreenGamma,
2914 _In_ USHORT BlueGamma,
2915 _Out_writes_bytes_(GammaTableEntries * 3) LPBYTE pGammaTable);
2916
2917 ENGAPI
2918 LONG
2919 APIENTRY
2920 HT_Get8BPPFormatPalette(
2921 _Out_opt_ LPPALETTEENTRY pPaletteEntry,
2922 _In_ USHORT RedGamma,
2923 _In_ USHORT GreenGamma,
2924 _In_ USHORT BlueGamma);
2925
2926 ENGAPI
2927 LONG
2928 APIENTRY
2929 HT_Get8BPPMaskPalette(
2930 _Out_opt_ LPPALETTEENTRY pPaletteEntry,
2931 _In_ BOOL Use8BPPMaskPal,
2932 _In_ BYTE CMYMask,
2933 _In_ USHORT RedGamma,
2934 _In_ USHORT GreenGamma,
2935 _In_ USHORT BlueGamma);
2936
2937 ENGAPI
2938 LONG
2939 APIENTRY
2940 HTUI_DeviceColorAdjustment(
2941 _In_ LPSTR pDeviceName,
2942 _Out_ PDEVHTADJDATA pDevHTAdjData);
2943
2944 ENGAPI
2945 ULONG
2946 APIENTRY
2947 PALOBJ_cGetColors(
2948 _In_ PALOBJ *ppalo,
2949 _In_ ULONG iStart,
2950 _In_ ULONG cColors,
2951 _Out_writes_(cColors) ULONG *pulColors);
2952
2953 ENGAPI
2954 BOOL
2955 APIENTRY
2956 PATHOBJ_bCloseFigure(
2957 _In_ PATHOBJ *ppo);
2958
2959 ENGAPI
2960 BOOL
2961 APIENTRY
2962 PATHOBJ_bEnum(
2963 _In_ PATHOBJ *ppo,
2964 _Out_ PATHDATA *ppd);
2965
2966 ENGAPI
2967 BOOL
2968 APIENTRY
2969 PATHOBJ_bEnumClipLines(
2970 _In_ PATHOBJ *ppo,
2971 _In_ ULONG cj,
2972 _Out_bytecap_(cj) CLIPLINE *pcl);
2973
2974 ENGAPI
2975 BOOL
2976 APIENTRY
2977 PATHOBJ_bMoveTo(
2978 _In_ PATHOBJ *ppo,
2979 _In_ POINTFIX ptfx);
2980
2981 ENGAPI
2982 BOOL
2983 APIENTRY
2984 PATHOBJ_bPolyBezierTo(
2985 _In_ PATHOBJ *ppo,
2986 _In_count_(cptfx) POINTFIX *pptfx,
2987 _In_ ULONG cptfx);
2988
2989 ENGAPI
2990 BOOL
2991 APIENTRY
2992 PATHOBJ_bPolyLineTo(
2993 _In_ PATHOBJ *ppo,
2994 _In_count_(cptfx) POINTFIX *pptfx,
2995 _In_ ULONG cptfx);
2996
2997 ENGAPI
2998 VOID
2999 APIENTRY
3000 PATHOBJ_vEnumStart(
3001 _Inout_ PATHOBJ *ppo);
3002
3003 ENGAPI
3004 VOID
3005 APIENTRY
3006 PATHOBJ_vEnumStartClipLines(
3007 _Inout_ PATHOBJ *ppo,
3008 _In_ CLIPOBJ *pco,
3009 _In_ SURFOBJ *pso,
3010 _In_ LINEATTRS *pla);
3011
3012 ENGAPI
3013 VOID
3014 APIENTRY
3015 PATHOBJ_vGetBounds(
3016 _In_ PATHOBJ *ppo,
3017 _Out_ PRECTFX prectfx);
3018
3019 ENGAPI
3020 BOOL
3021 APIENTRY
3022 STROBJ_bEnum(
3023 _Inout_ STROBJ *pstro,
3024 _Out_ ULONG *pc,
3025 _Out_ PGLYPHPOS *ppgpos); // FIXME_ size?
3026
3027 ENGAPI
3028 BOOL
3029 APIENTRY
3030 STROBJ_bEnumPositionsOnly(
3031 _In_ STROBJ *pstro,
3032 _Out_ ULONG *pc,
3033 _Out_ PGLYPHPOS *ppgpos); // FIXME_ size?
3034
3035 ENGAPI
3036 BOOL
3037 APIENTRY
3038 STROBJ_bGetAdvanceWidths(
3039 _In_ STROBJ *pso,
3040 _In_ ULONG iFirst,
3041 _In_ ULONG c,
3042 _Out_cap_(c) POINTQF *pptqD);
3043
3044 ENGAPI
3045 DWORD
3046 APIENTRY
3047 STROBJ_dwGetCodePage(
3048 _In_ STROBJ *pstro);
3049
3050 ENGAPI
3051 FIX
3052 APIENTRY
3053 STROBJ_fxBreakExtra(
3054 _In_ STROBJ *pstro);
3055
3056 ENGAPI
3057 FIX
3058 APIENTRY
3059 STROBJ_fxCharacterExtra(
3060 _In_ STROBJ *pstro);
3061
3062 ENGAPI
3063 VOID
3064 APIENTRY
3065 STROBJ_vEnumStart(
3066 _Inout_ STROBJ *pstro);
3067
3068 ENGAPI
3069 BOOL
3070 APIENTRY
3071 WNDOBJ_bEnum(
3072 _Inout_ WNDOBJ *pwo,
3073 _In_ ULONG cj,
3074 _Out_bytecap_(cj) ULONG *pul);
3075
3076 ENGAPI
3077 ULONG
3078 APIENTRY
3079 WNDOBJ_cEnumStart(
3080 _Inout_ WNDOBJ *pwo,
3081 _In_ ULONG iType,
3082 _In_ ULONG iDirection,
3083 _In_ ULONG cLimit);
3084
3085 ENGAPI
3086 VOID
3087 APIENTRY
3088 WNDOBJ_vSetConsumer(
3089 _Inout_ WNDOBJ *pwo,
3090 _In_ PVOID pvConsumer);
3091
3092 /* XFORMOBJ_bApplyXform.iMode constants */
3093 #define XF_LTOL 0L
3094 #define XF_INV_LTOL 1L
3095 #define XF_LTOFX 2L
3096 #define XF_INV_FXTOL 3L
3097
3098 ENGAPI
3099 BOOL
3100 APIENTRY
3101 XFORMOBJ_bApplyXform(
3102 _In_ XFORMOBJ *pxo,
3103 _In_ ULONG iMode,
3104 _In_ ULONG cPoints,
3105 _In_reads_bytes_(cPoints * sizeof(POINTL)) PVOID pvIn,
3106 _Out_writes_bytes_(cPoints * sizeof(POINTL)) PVOID pvOut);
3107
3108 /* Obsolete in Windows 2000 and later */
3109 DECLSPEC_DEPRECATED_DDK
3110 ENGAPI
3111 HANDLE
3112 APIENTRY
3113 XFORMOBJ_cmGetTransform(
3114 XFORMOBJ *pxo);
3115
3116 #if !defined(USERMODE_DRIVER)
3117 ENGAPI
3118 ULONG
3119 APIENTRY
3120 XFORMOBJ_iGetFloatObjXform(
3121 _In_ XFORMOBJ *pxo,
3122 _Out_ FLOATOBJ_XFORM *pxfo);
3123 #else
3124 #define XFORMOBJ_iGetFloatObjXform XFORMOBJ_iGetXform
3125 #endif
3126
3127 ENGAPI
3128 ULONG
3129 APIENTRY
3130 XFORMOBJ_iGetXform(
3131 _In_ XFORMOBJ *pxo,
3132 _Out_ XFORML *pxform);
3133
3134 /* XLATEOBJ_cGetPalette.iPal constants */
3135 #define XO_SRCPALETTE 1
3136 #define XO_DESTPALETTE 2
3137 #define XO_DESTDCPALETTE 3
3138 #define XO_SRCBITFIELDS 4
3139 #define XO_DESTBITFIELDS 5
3140
3141 ENGAPI
3142 ULONG
3143 APIENTRY
3144 XLATEOBJ_cGetPalette(
3145 _In_ XLATEOBJ *pxlo,
3146 _In_ ULONG iPal,
3147 _In_ ULONG cPal,
3148 _Out_cap_(cPal) ULONG *pPal);
3149
3150 ENGAPI
3151 HANDLE
3152 APIENTRY
3153 XLATEOBJ_hGetColorTransform(
3154 _In_ XLATEOBJ *pxlo);
3155
3156 ENGAPI
3157 ULONG
3158 APIENTRY
3159 XLATEOBJ_iXlate(
3160 _In_ XLATEOBJ *pxlo,
3161 _In_ ULONG iColor);
3162
3163 ENGAPI
3164 ULONG*
3165 APIENTRY
3166 XLATEOBJ_piVector(
3167 _In_ XLATEOBJ *pxlo);
3168
3169 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
3170
3171 ENGAPI
3172 VOID
3173 APIENTRY
3174 EngBugCheckEx(
3175 _In_ ULONG BugCheckCode,
3176 _In_ ULONG_PTR P1,
3177 _In_ ULONG_PTR P2,
3178 _In_ ULONG_PTR P3,
3179 _In_ ULONG_PTR P4);
3180
3181 #endif /* (NTDDI_VERSION >= NTDDI_WINXPSP2) */
3182
3183 #if (NTDDI_VERSION >= NTDDI_VISTA)
3184
3185 ENGAPI
3186 HANDLE
3187 APIENTRY
3188 EngCreateRectRgn(
3189 _In_ INT left,
3190 _In_ INT top,
3191 _In_ INT right,
3192 _In_ INT bottom);
3193
3194 ENGAPI
3195 VOID
3196 APIENTRY
3197 EngDeleteRgn(
3198 _In_ HANDLE hrgn);
3199
3200 ENGAPI
3201 INT
3202 APIENTRY
3203 EngCombineRgn(
3204 _In_ HANDLE hrgnTrg,
3205 _In_ HANDLE hrgnSrc1,
3206 _In_ HANDLE hrgnSrc2,
3207 _In_ INT iMode);
3208
3209 ENGAPI
3210 INT
3211 APIENTRY
3212 EngCopyRgn(
3213 _In_ HANDLE hrgnDst,
3214 _In_ HANDLE hrgnSrc);
3215
3216 ENGAPI
3217 INT
3218 APIENTRY
3219 EngIntersectRgn(
3220 _In_ HANDLE hrgnResult,
3221 _In_ HANDLE hRgnA,
3222 _In_ HANDLE hRgnB);
3223
3224 ENGAPI
3225 INT
3226 APIENTRY
3227 EngSubtractRgn(
3228 _In_ HANDLE hrgnResult,
3229 _In_ HANDLE hRgnA,
3230 _In_ HANDLE hRgnB);
3231
3232 ENGAPI
3233 INT
3234 APIENTRY
3235 EngUnionRgn(
3236 _In_ HANDLE hrgnResult,
3237 _In_ HANDLE hRgnA,
3238 _In_ HANDLE hRgnB);
3239
3240 ENGAPI
3241 INT
3242 APIENTRY
3243 EngXorRgn(
3244 _In_ HANDLE hrgnResult,
3245 _In_ HANDLE hRgnA,
3246 _In_ HANDLE hRgnB);
3247
3248 ENGAPI
3249 BOOL
3250 APIENTRY
3251 EngRectInRgn(
3252 _In_ HANDLE hrgn,
3253 _In_ LPRECT prcl);
3254
3255 ENGAPI
3256 BOOL
3257 APIENTRY
3258 EngEqualRgn(
3259 _In_ HANDLE hrgn1,
3260 _In_ HANDLE hrgn2);
3261
3262 ENGAPI
3263 DWORD
3264 APIENTRY
3265 EngGetRgnData(
3266 _In_ HANDLE hrgn,
3267 _In_ DWORD nCount,
3268 _Out_cap_(nCount) LPRGNDATA lpRgnData);
3269
3270 ENGAPI
3271 BOOL
3272 APIENTRY
3273 EngSetRectRgn(
3274 _In_ HANDLE hrgn,
3275 _In_ INT left,
3276 _In_ INT top,
3277 _In_ INT right,
3278 _In_ INT bottom);
3279
3280 ENGAPI
3281 INT
3282 APIENTRY
3283 EngGetRgnBox(
3284 _In_ HANDLE hrgn,
3285 _Out_ LPRECT prcl);
3286
3287 ENGAPI
3288 INT
3289 APIENTRY
3290 EngOffsetRgn(
3291 _In_ HANDLE hrgn,
3292 _In_ INT x,
3293 _In_ INT y);
3294
3295 ENGAPI
3296 VOID
3297 APIENTRY
3298 EngRenderHint(
3299 _In_ DHPDEV dhpdev,
3300 _In_ ULONG NotifyCode,
3301 _In_ SIZE_T Length,
3302 _In_reads_bytes_opt_(Length) PVOID Data);
3303
3304 ENGAPI
3305 VOID
3306 APIENTRY
3307 EngAcquireSemaphoreShared(
3308 _In_ HSEMAPHORE hsem);
3309
3310 ENGAPI
3311 BOOL
3312 APIENTRY
3313 EngAcquireSemaphoreNoWait(
3314 _In_ HSEMAPHORE hsem);
3315
3316 ENGAPI
3317 BOOL
3318 APIENTRY
3319 EngAcquireSemaphoreSharedNoWait(
3320 _In_ HSEMAPHORE hsem);
3321
3322 ENGAPI
3323 BOOL
3324 APIENTRY
3325 EngIsSemaphoreSharedByCurrentThread(
3326 _In_ HSEMAPHORE hsem);
3327
3328 DECLARE_HANDLE(HFASTMUTEX);
3329
3330 ENGAPI
3331 HFASTMUTEX
3332 APIENTRY
3333 EngCreateFastMutex(
3334 VOID);
3335
3336 ENGAPI
3337 VOID
3338 APIENTRY
3339 EngDeleteFastMutex(
3340 _In_ HFASTMUTEX hfm);
3341
3342 ENGAPI
3343 VOID
3344 APIENTRY
3345 EngAcquireFastMutex(
3346 _In_ HFASTMUTEX hfm);
3347
3348 ENGAPI
3349 VOID
3350 APIENTRY
3351 EngReleaseFastMutex(
3352 _In_ HFASTMUTEX hfm);
3353
3354 ENGAPI
3355 BOOL
3356 APIENTRY
3357 EngUpdateDeviceSurface(
3358 _In_ SURFOBJ *pso,
3359 _Inout_ CLIPOBJ **ppco);
3360
3361 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
3362
3363 #if (NTDDI_VERSION >= NTDDI_WIN7)
3364
3365 ENGAPI
3366 HBITMAP
3367 APIENTRY
3368 EngCreateRedirectionDeviceBitmap(
3369 __in_data_source(USER_MODE) DHSURF dhsurf,
3370 __in_data_source(USER_MODE) SIZEL sizl,
3371 _In_ ULONG iFormatCompat);
3372
3373 VOID
3374 APIENTRY
3375 EngCTGetGammaTable(
3376 _In_ ULONG ulGamma,
3377 _Out_ CONST BYTE** pGammaTable,
3378 _Out_ CONST BYTE** pInverseGammaTable);
3379
3380 ULONG
3381 APIENTRY
3382 EngCTGetCurrentGamma(
3383 _In_ HDEV hdev);
3384
3385 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
3386
3387 /* Graphics Driver Functions */
3388
3389 typedef BOOL
3390 (APIENTRY FN_DrvAlphaBlend)(
3391 _Inout_ SURFOBJ *psoDest,
3392 _In_ SURFOBJ *psoSrc,
3393 _In_ CLIPOBJ *pco,
3394 _In_opt_ XLATEOBJ *pxlo,
3395 _In_ RECTL *prclDest,
3396 _In_ RECTL *prclSrc,
3397 _In_ BLENDOBJ *pBlendObj);
3398 typedef FN_DrvAlphaBlend *PFN_DrvAlphaBlend;
3399 extern FN_DrvAlphaBlend DrvAlphaBlend;
3400
3401 typedef BOOL
3402 (APIENTRY FN_DrvAssertMode)(
3403 _In_ DHPDEV dhpdev,
3404 _In_ BOOL bEnable);
3405 typedef FN_DrvAssertMode *PFN_DrvAssertMode;
3406 extern FN_DrvAssertMode DrvAssertMode;
3407
3408 typedef BOOL
3409 (APIENTRY FN_DrvBitBlt)(
3410 _Inout_ SURFOBJ *psoTrg,
3411 _In_opt_ SURFOBJ *psoSrc,
3412 _In_opt_ SURFOBJ *psoMask,
3413 _In_ CLIPOBJ *pco,
3414 _In_opt_ XLATEOBJ *pxlo,
3415 _In_ RECTL *prclTrg,
3416 _In_opt_ POINTL *pptlSrc,
3417 _In_opt_ POINTL *pptlMask,
3418 _In_opt_ BRUSHOBJ *pbo,
3419 _In_opt_ POINTL *pptlBrush,
3420 _In_ ROP4 rop4);
3421 typedef FN_DrvBitBlt *PFN_DrvBitBlt;
3422 extern FN_DrvBitBlt DrvBitBlt;
3423
3424 typedef VOID
3425 (APIENTRY FN_DrvCompletePDEV)(
3426 _In_ DHPDEV dhpdev,
3427 _In_ HDEV hdev);
3428 typedef FN_DrvCompletePDEV *PFN_DrvCompletePDEV;
3429 extern FN_DrvCompletePDEV DrvCompletePDEV;
3430
3431 typedef BOOL
3432 (APIENTRY FN_DrvCopyBits)(
3433 _In_ SURFOBJ *psoDest,
3434 _In_ SURFOBJ *psoSrc,
3435 _In_ CLIPOBJ *pco,
3436 _In_opt_ XLATEOBJ *pxlo,
3437 _In_ RECTL *prclDest,
3438 _In_ POINTL *pptlSrc);
3439 typedef FN_DrvCopyBits *PFN_DrvCopyBits;
3440 extern FN_DrvCopyBits DrvCopyBits;
3441
3442 typedef HBITMAP
3443 (APIENTRY FN_DrvCreateDeviceBitmap)(
3444 _In_ DHPDEV dhpdev,
3445 _In_ SIZEL sizl,
3446 _In_ ULONG iFormat);
3447 typedef FN_DrvCreateDeviceBitmap *PFN_DrvCreateDeviceBitmap;
3448 extern FN_DrvCreateDeviceBitmap DrvCreateDeviceBitmap;
3449
3450 typedef VOID
3451 (APIENTRY FN_DrvDeleteDeviceBitmap)(
3452 _In_ _Post_ptr_invalid_ DHSURF dhsurf);
3453 typedef FN_DrvDeleteDeviceBitmap *PFN_DrvDeleteDeviceBitmap;
3454 extern FN_DrvDeleteDeviceBitmap DrvDeleteDeviceBitmap;
3455
3456 typedef HBITMAP
3457 (APIENTRY FN_DrvDeriveSurface)(
3458 _In_ DD_DIRECTDRAW_GLOBAL *pDirectDraw,
3459 _In_ DD_SURFACE_LOCAL *pSurface);
3460 typedef FN_DrvDeriveSurface *PFN_DrvDeriveSurface;
3461 extern FN_DrvDeriveSurface DrvDeriveSurface;
3462
3463 typedef LONG
3464 (APIENTRY FN_DrvDescribePixelFormat)(
3465 _In_ DHPDEV dhpdev,
3466 _In_ LONG iPixelFormat,
3467 _In_ ULONG cjpfd,
3468 _Out_opt_ PIXELFORMATDESCRIPTOR *ppfd);
3469 typedef FN_DrvDescribePixelFormat *PFN_DrvDescribePixelFormat;
3470 extern FN_DrvDescribePixelFormat DrvDescribePixelFormat;
3471
3472 typedef VOID
3473 (APIENTRY FN_DrvDestroyFont)(
3474 _In_ FONTOBJ *pfo);
3475 typedef FN_DrvDestroyFont *PFN_DrvDestroyFont;
3476 extern FN_DrvDestroyFont DrvDestroyFont;
3477
3478 typedef VOID
3479 (APIENTRY FN_DrvDisableDriver)(VOID);
3480 typedef FN_DrvDisableDriver *PFN_DrvDisableDriver;
3481 extern FN_DrvDisableDriver DrvDisableDriver;
3482
3483 typedef VOID
3484 (APIENTRY FN_DrvDisablePDEV)(
3485 _In_ DHPDEV dhpdev);
3486 typedef FN_DrvDisablePDEV *PFN_DrvDisablePDEV;
3487 extern FN_DrvDisablePDEV DrvDisablePDEV;
3488
3489 typedef VOID
3490 (APIENTRY FN_DrvDisableSurface)(
3491 _In_ DHPDEV dhpdev);
3492 typedef FN_DrvDisableSurface *PFN_DrvDisableSurface;
3493 extern FN_DrvDisableSurface DrvDisableSurface;
3494
3495 typedef ULONG
3496 (APIENTRY FN_DrvDitherColor)(
3497 _In_ DHPDEV dhpdev,
3498 _In_ ULONG iMode,
3499 _In_ ULONG rgb,
3500 _Inout_updates_(8 * 8) ULONG *pul); // FIXME: compare EngDitherColor
3501 typedef FN_DrvDitherColor *PFN_DrvDitherColor;
3502 extern FN_DrvDitherColor DrvDitherColor;
3503
3504 typedef ULONG
3505 (APIENTRY FN_DrvDrawEscape)(
3506 _In_ SURFOBJ *pso,
3507 _In_ ULONG iEsc,
3508 _In_ CLIPOBJ *pco,
3509 _In_ RECTL *prcl,
3510 _In_ ULONG cjIn,
3511 _In_reads_bytes_(cjIn) PVOID pvIn);
3512 typedef FN_DrvDrawEscape *PFN_DrvDrawEscape;
3513 extern FN_DrvDrawEscape DrvDrawEscape;
3514
3515 typedef BOOL
3516 (APIENTRY FN_DrvEnableDriver)(
3517 _In_ ULONG iEngineVersion,
3518 _In_ ULONG cj,
3519 _Inout_bytecount_(cj) DRVENABLEDATA *pded); // Zero initialized
3520 typedef FN_DrvEnableDriver *PFN_DrvEnableDriver;
3521 extern FN_DrvEnableDriver DrvEnableDriver;
3522
3523 typedef DHPDEV
3524 (APIENTRY FN_DrvEnablePDEV)(
3525 _In_ DEVMODEW *pdm,
3526 _In_ LPWSTR pwszLogAddress,
3527 _In_ ULONG cPat,
3528 _Out_opt_cap_(cPat) HSURF *phsurfPatterns,
3529 _In_ ULONG cjCaps,
3530 _Out_bytecap_(cjCaps) ULONG *pdevcaps,
3531 _In_ ULONG cjDevInfo,
3532 _Out_ DEVINFO *pdi,
3533 _In_ HDEV hdev,
3534 _In_ LPWSTR pwszDeviceName,
3535 _In_ HANDLE hDriver);
3536 typedef FN_DrvEnablePDEV *PFN_DrvEnablePDEV;
3537 extern FN_DrvEnablePDEV DrvEnablePDEV;
3538
3539 typedef HSURF
3540 (APIENTRY FN_DrvEnableSurface)(
3541 _In_ DHPDEV dhpdev);
3542 typedef FN_DrvEnableSurface *PFN_DrvEnableSurface;
3543 extern FN_DrvEnableSurface DrvEnableSurface;
3544
3545 /* DrvEndDoc.fl constants */
3546 #define ED_ABORTDOC 0x00000001
3547
3548 typedef BOOL
3549 (APIENTRY FN_DrvEndDoc)(
3550 _In_ SURFOBJ *pso,
3551 _In_ FLONG fl);
3552 typedef FN_DrvEndDoc *PFN_DrvEndDoc;
3553 extern FN_DrvEndDoc DrvEndDoc;
3554
3555 typedef ULONG
3556 (APIENTRY FN_DrvEscape)(
3557 _In_ SURFOBJ *pso,
3558 _In_ ULONG iEsc,
3559 _In_ ULONG cjIn,
3560 _In_bytecount_(cjIn) PVOID pvIn,
3561 _In_ ULONG cjOut,
3562 _Out_bytecap_(cjOut) PVOID pvOut);
3563 typedef FN_DrvEscape *PFN_DrvEscape;
3564 extern FN_DrvEscape DrvEscape;
3565
3566 typedef BOOL
3567 (APIENTRY FN_DrvFillPath)(
3568 _Inout_ SURFOBJ *pso,
3569 _In_ PATHOBJ *ppo,
3570 _In_ CLIPOBJ *pco,
3571 _In_ BRUSHOBJ *pbo,
3572 _In_ POINTL *pptlBrushOrg,
3573 _In_ MIX mix,
3574 _In_ FLONG flOptions);
3575 typedef FN_DrvFillPath *PFN_DrvFillPath;
3576 extern FN_DrvFillPath DrvFillPath;
3577
3578 typedef ULONG
3579 (APIENTRY FN_DrvFontManagement)(
3580 _In_ SURFOBJ *pso,
3581 _In_opt_ FONTOBJ *pfo,
3582 _In_ ULONG iMode,
3583 _In_ ULONG cjIn,
3584 _In_bytecount_(cjIn) PVOID pvIn,
3585 _In_ ULONG cjOut,
3586 _Out_bytecap_(cjOut) PVOID pvOut);
3587 typedef FN_DrvFontManagement *PFN_DrvFontManagement;
3588 extern FN_DrvFontManagement DrvFontManagement;
3589
3590 typedef VOID
3591 (APIENTRY FN_DrvFree)(
3592 _In_ _Post_ptr_invalid_ PVOID pv,
3593 _In_ ULONG_PTR id);
3594 typedef FN_DrvFree *PFN_DrvFree;
3595 extern FN_DrvFree DrvFree;
3596
3597 /* DrvGetGlyphMode return values */
3598 #define FO_HGLYPHS 0L
3599 #define FO_GLYPHBITS 1L
3600 #define FO_PATHOBJ 2L
3601
3602 typedef ULONG
3603 (APIENTRY FN_DrvGetGlyphMode)(
3604 _In_ DHPDEV dhpdev,
3605 _In_ FONTOBJ *pfo);
3606 typedef FN_DrvGetGlyphMode *PFN_DrvGetGlyphMode;
3607 extern FN_DrvGetGlyphMode DrvGetGlyphMode;
3608
3609 typedef ULONG
3610 (APIENTRY FN_DrvGetModes)(
3611 _In_ HANDLE hDriver,
3612 _In_ ULONG cjSize,
3613 _Out_opt_bytecap_(cjSize) DEVMODEW *pdm);
3614 typedef FN_DrvGetModes *PFN_DrvGetModes;
3615 extern FN_DrvGetModes DrvGetModes;
3616
3617 typedef PVOID
3618 (APIENTRY FN_DrvGetTrueTypeFile)(
3619 _In_ ULONG_PTR iFile,
3620 _In_ ULONG *pcj);
3621 typedef FN_DrvGetTrueTypeFile *PFN_DrvGetTrueTypeFile;
3622 extern FN_DrvGetTrueTypeFile DrvGetTrueTypeFile;
3623
3624 typedef BOOL
3625 (APIENTRY FN_DrvGradientFill)(
3626 _Inout_ SURFOBJ *psoDest,
3627 _In_ CLIPOBJ *pco,
3628 _In_opt_ XLATEOBJ *pxlo,
3629 _In_ TRIVERTEX *pVertex,
3630 _In_ ULONG nVertex,
3631 _In_ PVOID pMesh,
3632 _In_ ULONG nMesh,
3633 _In_ RECTL *prclExtents,
3634 _In_ POINTL *pptlDitherOrg,
3635 _In_ ULONG ulMode);
3636 typedef FN_DrvGradientFill *PFN_DrvGradientFill;
3637 extern FN_DrvGradientFill DrvGradientFill;
3638
3639 typedef BOOL
3640 (APIENTRY FN_DrvIcmCheckBitmapBits)(
3641 _In_ DHPDEV dhpdev,
3642 _In_ HANDLE hColorTransform,
3643 _In_ SURFOBJ *pso,
3644 _Out_bytecap_(pso->sizlBitmap.cx * pso->sizlBitmap.cy) PBYTE paResults);
3645 typedef FN_DrvIcmCheckBitmapBits *PFN_DrvIcmCheckBitmapBits;
3646 extern FN_DrvIcmCheckBitmapBits DrvIcmCheckBitmapBits;
3647
3648 typedef HANDLE
3649 (APIENTRY FN_DrvIcmCreateColorTransform)(
3650 _In_ DHPDEV dhpdev,
3651 _In_ LPLOGCOLORSPACEW pLogColorSpace,
3652 _In_reads_bytes_opt_(cjSourceProfile) PVOID pvSourceProfile,
3653 _In_ ULONG cjSourceProfile,
3654 _In_reads_bytes_(cjDestProfile) PVOID pvDestProfile,
3655 _In_ ULONG cjDestProfile,
3656 _In_reads_bytes_opt_(cjTargetProfile) PVOID pvTargetProfile,
3657 _In_ ULONG cjTargetProfile,
3658 _In_ DWORD dwReserved);
3659 typedef FN_DrvIcmCreateColorTransform *PFN_DrvIcmCreateColorTransform;
3660 extern FN_DrvIcmCreateColorTransform DrvIcmCreateColorTransform;
3661
3662 typedef BOOL
3663 (APIENTRY FN_DrvIcmDeleteColorTransform)(
3664 _In_ DHPDEV dhpdev,
3665 _In_ HANDLE hcmXform);
3666 typedef FN_DrvIcmDeleteColorTransform *PFN_DrvIcmDeleteColorTransform;
3667 extern FN_DrvIcmDeleteColorTransform DrvIcmDeleteColorTransform;
3668
3669 /* DrvIcmSetDeviceGammaRamp.iFormat constants */
3670 #define IGRF_RGB_256BYTES 0x00000000
3671 #define IGRF_RGB_256WORDS 0x00000001
3672
3673 typedef BOOL
3674 (APIENTRY FN_DrvIcmSetDeviceGammaRamp)(
3675 _In_ DHPDEV dhpdev,
3676 _In_ ULONG iFormat,
3677 _In_bytecount_(sizeof(GAMMARAMP)) LPVOID lpRamp);
3678 typedef FN_DrvIcmSetDeviceGammaRamp *PFN_DrvIcmSetDeviceGammaRamp;
3679 extern FN_DrvIcmSetDeviceGammaRamp DrvIcmSetDeviceGammaRamp;
3680
3681 typedef BOOL
3682 (APIENTRY FN_DrvLineTo)(
3683 _Inout_ SURFOBJ *pso,
3684 _In_ CLIPOBJ *pco,
3685 _In_ BRUSHOBJ *pbo,
3686 _In_ LONG x1,
3687 _In_ LONG y1,
3688 _In_ LONG x2,
3689 _In_ LONG y2,
3690 _In_opt_ RECTL *prclBounds,
3691 _In_ MIX mix);
3692 typedef FN_DrvLineTo *PFN_DrvLineTo;
3693 extern FN_DrvLineTo DrvLineTo;
3694
3695 typedef ULONG_PTR
3696 (APIENTRY FN_DrvLoadFontFile)(
3697 _In_ ULONG cFiles,
3698 _In_ ULONG_PTR *piFile,
3699 _In_count_(cFiles) PVOID *ppvView,
3700 _In_count_(cFiles) ULONG *pcjView,
3701 _In_opt_ DESIGNVECTOR *pdv,
3702 _In_ ULONG ulLangID,
3703 _In_ ULONG ulFastCheckSum);
3704 typedef FN_DrvLoadFontFile *PFN_DrvLoadFontFile;
3705 extern FN_DrvLoadFontFile DrvLoadFontFile;
3706
3707 typedef VOID
3708 (APIENTRY FN_DrvMovePointer)(
3709 _In_ SURFOBJ *pso,
3710 _In_ LONG x,
3711 _In_ LONG y,
3712 _In_opt_ RECTL *prcl);
3713 typedef FN_DrvMovePointer *PFN_DrvMovePointer;
3714 extern FN_DrvMovePointer DrvMovePointer;
3715
3716 typedef BOOL
3717 (APIENTRY FN_DrvNextBand)(
3718 _In_ SURFOBJ *pso,
3719 _In_ POINTL *pptl);
3720 typedef FN_DrvNextBand *PFN_DrvNextBand;
3721 extern FN_DrvNextBand DrvNextBand;
3722
3723 typedef VOID
3724 (APIENTRY FN_DrvNotify)(
3725 _In_ SURFOBJ *pso,
3726 _In_ ULONG iType,
3727 _In_opt_ PVOID pvData);
3728 typedef FN_DrvNotify *PFN_DrvNotify;
3729 extern FN_DrvNotify DrvNotify;
3730
3731 typedef BOOL
3732 (APIENTRY FN_DrvOffset)(
3733 _In_ SURFOBJ *pso,
3734 _In_ LONG x,
3735 _In_ LONG y,
3736 _In_ FLONG flReserved);
3737 typedef FN_DrvOffset *PFN_DrvOffset;
3738 extern FN_DrvOffset DrvOffset;
3739
3740 typedef BOOL
3741 (APIENTRY FN_DrvPaint)(
3742 _Inout_ SURFOBJ *pso,
3743 _In_ CLIPOBJ *pco,
3744 _In_ BRUSHOBJ *pbo,
3745 _In_ POINTL *pptlBrushOrg,
3746 _In_ MIX mix);
3747 typedef FN_DrvPaint *PFN_DrvPaint;
3748 extern FN_DrvPaint DrvPaint;
3749
3750 typedef BOOL
3751 (APIENTRY FN_DrvPlgBlt)(
3752 _Inout_ SURFOBJ *psoTrg,
3753 _Inout_ SURFOBJ *psoSrc,
3754 _In_opt_ SURFOBJ *psoMsk,
3755 _In_ CLIPOBJ *pco,
3756 _In_opt_ XLATEOBJ *pxlo,
3757 _In_opt_ COLORADJUSTMENT *pca,
3758 _In_opt_ POINTL *pptlBrushOrg,
3759 _In_ POINTFIX *pptfx,
3760 _In_ RECTL *prcl,
3761 _In_opt_ POINTL *pptl,
3762 _In_ ULONG iMode);
3763 typedef FN_DrvPlgBlt *PFN_DrvPlgBlt;
3764 extern FN_DrvPlgBlt DrvPlgBlt;
3765
3766 /* DrvQueryAdvanceWidths.iMode constants */
3767 #define QAW_GETWIDTHS 0
3768 #define QAW_GETEASYWIDTHS 1
3769
3770 typedef BOOL
3771 (APIENTRY FN_DrvQueryAdvanceWidths)(
3772 _In_ DHPDEV dhpdev,
3773 _In_ FONTOBJ *pfo,
3774 _In_ ULONG iMode,
3775 _In_reads_(cGlyphs) HGLYPH *phg,
3776 _Out_writes_bytes_(cGlyphs * sizeof(USHORT)) PVOID pvWidths,
3777 _In_ ULONG cGlyphs);
3778 typedef FN_DrvQueryAdvanceWidths *PFN_DrvQueryAdvanceWidths;
3779 extern FN_DrvQueryAdvanceWidths DrvQueryAdvanceWidths;
3780
3781 /* DrvQueryDeviceSupport.iType constants */
3782 #define QDS_CHECKJPEGFORMAT 0x00000000
3783 #define QDS_CHECKPNGFORMAT 0x00000001
3784
3785 typedef BOOL
3786 (APIENTRY FN_DrvQueryDeviceSupport)(
3787 _In_ SURFOBJ *pso,
3788 _In_ XLATEOBJ *pxlo,
3789 _In_ XFORMOBJ *pxo,
3790 _In_ ULONG iType,
3791 _In_ ULONG cjIn,
3792 _In_bytecount_(cjIn) PVOID pvIn,
3793 _In_ ULONG cjOut,
3794 _Out_bytecap_(cjOut) PVOID pvOut);
3795 typedef FN_DrvQueryDeviceSupport *PFN_DrvQueryDeviceSupport;
3796 extern FN_DrvQueryDeviceSupport DrvQueryDeviceSupport;
3797
3798 /* DrvQueryDriverInfo.dwMode constants */
3799 #define DRVQUERY_USERMODE 0x00000001
3800
3801 typedef BOOL
3802 (APIENTRY FN_DrvQueryDriverInfo)(
3803 _In_ DWORD dwMode,
3804 _Out_bytecap_(cjBuf) PVOID pBuffer,
3805 _In_ DWORD cjBuf,
3806 _Out_ PDWORD pcbNeeded);
3807 typedef FN_DrvQueryDriverInfo *PFN_DrvQueryDriverInfo;
3808 extern FN_DrvQueryDriverInfo DrvQueryDriverInfo;
3809
3810 typedef PIFIMETRICS
3811 (APIENTRY FN_DrvQueryFont)(
3812 _In_ DHPDEV dhpdev,
3813 _In_ ULONG_PTR iFile,
3814 _In_ ULONG iFace,
3815 _Out_ ULONG_PTR *pid);
3816 typedef FN_DrvQueryFont *PFN_DrvQueryFont;
3817 extern FN_DrvQueryFont DrvQueryFont;
3818
3819 /* DrvQueryFontCaps.pulCaps constants */
3820 #define QC_OUTLINES 0x00000001
3821 #define QC_1BIT 0x00000002
3822 #define QC_4BIT 0x00000004
3823 #define QC_FONTDRIVERCAPS (QC_OUTLINES | QC_1BIT | QC_4BIT)
3824
3825 typedef LONG
3826 (APIENTRY FN_DrvQueryFontCaps)(
3827 _In_ ULONG culCaps,
3828 _Out_cap_(culCaps) ULONG *pulCaps);
3829 typedef FN_DrvQueryFontCaps *PFN_DrvQueryFontCaps;
3830 extern FN_DrvQueryFontCaps DrvQueryFontCaps;
3831
3832 /* DrvQueryFontData.iMode constants */
3833 #define QFD_GLYPHANDBITMAP 1L
3834 #define QFD_GLYPHANDOUTLINE 2L
3835 #define QFD_MAXEXTENTS 3L
3836 #define QFD_TT_GLYPHANDBITMAP 4L
3837 #define QFD_TT_GRAY1_BITMAP 5L
3838 #define QFD_TT_GRAY2_BITMAP 6L
3839 #define QFD_TT_GRAY4_BITMAP 8L
3840 #define QFD_TT_GRAY8_BITMAP 9L
3841
3842 #define QFD_TT_MONO_BITMAP QFD_TT_GRAY1_BITMAP
3843
3844 typedef LONG
3845 (APIENTRY FN_DrvQueryFontData)(
3846 _In_ DHPDEV dhpdev,
3847 _In_ FONTOBJ *pfo,
3848 _In_ ULONG iMode,
3849 _In_ HGLYPH hg,