1 #ifndef WIN32K_NTGDI_BAD_INCLUDED
2 #define WIN32K_NTGDI_BAD_INCLUDED
6 * If you want to help, please read this:
8 * This file contains NtGdi APIs which are specific to ROS, including
9 * a short comment describing the solution on how to use the actual NtGdi
10 * call documented in ntgdi.h. Here are the main cases and information on
11 * how to remove them from this header.
13 * - Simple rename. This deals with an API simply having a different name,
14 * with absolutely no other changes needed.
15 * - Rename and new parameters. This deals with a case similar to the one
16 * above, except that new parameters have now
17 * been added. This is also usually extremly
18 * simple to fix. Either pass the right params
19 * or pass null/0 values that you ignore.
20 * - Rename and new structure. This is similar to the above, except that the
21 * information is now passed in a differently
22 * named and organized structure. Ask Alex for
23 * the structure you need and he will add it to
25 * - Rename and different semantics. Similar to the previous examples, except
26 * that parameters have usually been removed
27 * or need to be converted in user-mode in
28 * one form of another.
29 * - Does not exist: user-mode. This means that the API can be fully done in
30 * user mode. In 80% of cases, our API was already
31 * returning NOT_IMPLEMENTED in kernel-mode, so
32 * the work to be done is minimal. A good example
33 * are the ICM and Metafile APIs, which can simply
34 * be removed and added into gdi32.
35 * - Does not exist: GDI Shared Objects. This is by far the hardest case. This
36 * class cannot be fixed until ReactOS
37 * has a working Shared GDI Object table
38 * and a DC_ATTR structure in which the
39 * attributes, selection and deletion of
40 * objects can be quickly done from user-
41 * mode without requiring a kernel mode
44 /* Should be using ENUMFONTDATAW */
45 typedef struct tagFONTFAMILYINFO
47 ENUMLOGFONTEXW EnumLogFontEx
;
48 NEWTEXTMETRICEXW NewTextMetricEx
;
50 } FONTFAMILYINFO
, *PFONTFAMILYINFO
;
52 /* Should be using NtGdiHfontCreate with an ENUMLOGFONT */
55 NtGdiCreateFontIndirect(CONST LPLOGFONTW lf
);
57 /* Should be using NtGdiHfontCreate with an ENUMLOGFONT */
70 DWORD OutputPrecision
,
77 /* Should be using NtGdiEnumFontChunk */
80 NtGdiGetFontFamilyInfo(
87 /* Should be using NtGdiEnumFontChunk */
90 NtGdiTranslateCharsetInfo(
96 /* The gdi32 call does all the work in user-mode, save for NtGdiMakeFontDir */
99 NtGdiCreateScalableFontResource(
106 /* The gdi32 call Should Use NtGdiGetRandomRgn and nothing else */
109 NtGdiGetClipRgn(HDC hDC
);
111 /* The gdi32 call Should Use NtGdiGetTextExtent */
114 NtGdiGetTextExtentPoint32(
130 /* Use NtGdiOpenDCW */
134 PUNICODE_STRING Driver
,
135 PUNICODE_STRING Device
,
136 PUNICODE_STRING Output
,
137 CONST PDEVMODEW InitData
143 PUNICODE_STRING Driver
,
144 PUNICODE_STRING Device
,
145 PUNICODE_STRING Output
,
146 CONST PDEVMODEW DevMode
149 /* Use NtGdiAddFontResourceW */
152 NtGdiAddFontResource(PUNICODE_STRING Filename
,
155 /* Use NtGdiDoPalette with GdiPalAnimate */
158 NtGdiAnimatePalette (
162 CONST PPALETTEENTRY ppe
165 /* Use NtGdiArcInternal with GdiTypeArc */
178 /* Use NtGdiArcInternal with GdiTypeArcTo */
194 NtGdiCheckColorsInGamut(HDC hDC
,
199 /* Use NtGdiArcInternal with GdiTypeChord */
212 /* Metafiles are user mode */
215 NtGdiCloseEnhMetaFile (
219 /* Metafiles are user mode */
229 NtGdiColorMatchToTarget(HDC hDC
,
233 /* Metafiles are user mode */
236 NtGdiCopyEnhMetaFile (
241 /* Metafiles are user mode */
249 /* Use NtGdiCreateBitmap and expand the pbm-> */
252 NtGdiCreateBitmapIndirect (
256 /* Use NtGdiCreateDIBitmapInternal */
259 NtGdiCreateDIBitmap (
261 CONST BITMAPINFOHEADER
* bmih
,
264 CONST BITMAPINFO
* bmi
,
268 /* Use NtGdiCreateCompatibleBitmap */
271 NtGdiCreateDiscardableBitmap (
277 /* Use NtGdiCreateEllipticRgn and expand the lprect-> */
280 NtGdiCreateEllipticRgnIndirect(CONST PRECT rc
);
282 /* Metafiles are user mode */
285 NtGdiCreateEnhMetaFile (
292 /* Use NtGdiCreateHatchBrushInternal with FALSE at the end. */
294 NtGdiCreateHatchBrush(
298 /* Metafiles are user mode */
301 NtGdiCreateMetaFile (
305 /* Use NtGdiCreatePaletteInternal with palNumEntries at the end. */
309 CONST PLOGPALETTE lgpl
312 /* Use NtGdiCreatePatternBrushInternal with false, false at the end. */
314 NtGdiCreatePatternBrush(
317 /* Use NtGdiCreatePen with -> as parameters. */
319 NtGdiCreatePenIndirect(
320 CONST PLOGPEN LogBrush
);
322 /* Use NtGdiPolyPolyDraw with PolyPolyRgn. */
325 NtGdiCreatePolygonRgn(CONST PPOINT pt
,
329 /* Use NtGdiPolyPolyDraw with PolyPolyRgn. */
332 NtGdiCreatePolyPolygonRgn(CONST PPOINT pt
,
333 CONST PINT PolyCounts
,
337 /* Use NtGdiCreateRectRgn with expanded paraemters. */
340 NtGdiCreateRectRgnIndirect(CONST PRECT rc
);
342 /* Use NtGdiTransformPoints with GdiDpToLp. */
351 /* Use NtGdiDeleteObjectApp. */
352 BOOL STDCALL
NtGdiDeleteDC(HDC hDC
);
354 /* Meta are user-mode. */
357 NtGdiDeleteEnhMetaFile (
361 /* Meta are user-mode. */
364 NtGdiDeleteMetaFile (
368 /* Should be done in user-mode. */
369 BOOL STDCALL
NtGdiDeleteObject(HGDIOBJ hObject
);
371 /* Meta are user-mode. */
374 NtGdiEnumEnhMetaFile (
377 ENHMFENUMPROC EnhMetaFunc
,
382 /* Should be done in user-mode. */
385 NtGdiEnumFonts(HDC hDC
,
387 FONTENUMPROCW FontFunc
,
390 /* Should be done in user-mode. */
393 NtGdiEnumICMProfiles(HDC hDC
,
397 /* Meta are user-mode. */
407 /* Should be done in user-mode. */
416 /* Use NtGdiExtTextOutW with 0, 0 at the end. */
419 NtGdiExtTextOut(HDC hdc
,
428 /* Use NtGdiExtFloodFill with FLOODFILLBORDER. */
438 /* Should be done in user-mode. */
447 /* Should be done in user-mode. */
448 BOOL STDCALL
NtGdiGdiFlush (VOID
);
450 /* Should be done in user-mode. */
451 DWORD STDCALL
NtGdiGdiGetBatchLimit (VOID
);
453 /* Should be done in user-mode. */
454 DWORD STDCALL
NtGdiGdiSetBatchLimit (DWORD Limit
);
456 /* Use NtGdiGetDCDword with GdiGetArcDirection. */
459 NtGdiGetArcDirection ( HDC hDC
);
461 /* Should be done in user-mode. */
464 NtGdiGetAspectRatioFilterEx(HDC hDC
,
467 /* Should be done in user-mode using shared GDI Objects. */
470 NtGdiGetBitmapDimensionEx (
475 /* Should be done in user-mode using shared GDI Objects. */
476 COLORREF STDCALL
NtGdiGetBkColor(HDC hDC
);
478 /* Should be done in user-mode using shared GDI Objects. */
479 INT STDCALL
NtGdiGetBkMode(HDC hDC
);
481 /* Should be done in user-mode using shared GDI Objects. */
482 BOOL STDCALL
NtGdiGetBrushOrgEx(HDC hDC
, LPPOINT brushOrg
);
484 /* Use NtGdiGetCharABCWidthsW */
487 NtGdiGetCharABCWidths(HDC hDC
,
492 /* Should be done in user mode. */
495 NtGdiGetCharABCWidthsFloat(HDC hDC
,
500 /* Should be done in user mode. */
503 NtGdiGetCharacterPlacement(HDC hDC
,
507 LPGCP_RESULTSW Results
,
510 /* Should be done in user mode. */
513 NtGdiGetCharWidthFloat(HDC hDC
,
518 /* Use NtGdiGetAppClipBox. */
526 /* Use NtGdiGetColorSpaceforBitmap. */
529 NtGdiGetColorSpace(HDC hDC
);
531 /* Should be done in user-mode and/or NtGdiGetDCObject. */
532 HGDIOBJ STDCALL
NtGdiGetCurrentObject(HDC hDC
, UINT ObjectType
);
534 /* Should be done in user mode. */
535 BOOL STDCALL
NtGdiGetCurrentPositionEx(HDC hDC
, LPPOINT currentPosition
);
537 /* Use NtGdiGetDCPoint with GdiGetDCOrg. */
538 BOOL STDCALL
NtGdiGetDCOrgEx(HDC hDC
, LPPOINT Point
);
540 /* Use NtGdiDoPalette with GdiPalGetColorTable. */
543 NtGdiGetDIBColorTable (
550 /* Use NtGdiGetDIBitsInternal. */
564 /* Meta are user-mode. */
567 NtGdiGetEnhMetaFile (
571 /* Meta are user-mode. */
574 NtGdiGetEnhMetaFileBits (
580 /* Meta are user-mode. */
583 NtGdiGetEnhMetaFileDescription (
589 /* Meta are user-mode. */
592 NtGdiGetEnhMetaFileHeader (
598 /* Meta are user-mode. */
601 NtGdiGetEnhMetaFilePaletteEntries (
607 /* Meta are user-mode. */
610 NtGdiGetEnhMetaFilePixelFormat(HENHMETAFILE hEMF
,
612 CONST PPIXELFORMATDESCRIPTOR pfd
);
614 /* Should be done in user-mode. */
617 NtGdiGetFontLanguageInfo(HDC hDC
);
619 /* Should be done in user-mode. */
622 NtGdiGetGraphicsMode ( HDC hDC
);
624 /* Should be done in user-mode. */
627 NtGdiGetICMProfile(HDC hDC
,
631 /* Should be done in user-mode. */
634 NtGdiGetLogColorSpace(HCOLORSPACE hColorSpace
,
635 LPLOGCOLORSPACEW Buffer
,
638 /* Should be done in user-mode using shared GDI Objects. */
639 INT STDCALL
NtGdiGetMapMode(HDC hDC
);
641 /* Meta files are user-mode. */
648 /* Meta files are user-mode. */
651 NtGdiGetMetaFileBitsEx (
657 /* Meta files are user-mode. */
665 /* Should be done in user-mode using shared GDI Objects. */
666 INT STDCALL
NtGdiGetObject(HGDIOBJ hGDIObj
,
670 /* Should be done in user-mode using shared GDI Objects. */
671 DWORD STDCALL
NtGdiGetObjectType(HGDIOBJ hGDIObj
);
673 /* Use NtGdiGetOutlineTextMetricsInternalW. */
676 NtGdiGetOutlineTextMetrics(HDC hDC
,
678 LPOUTLINETEXTMETRICW otm
);
680 /* Use NtGdiDoPalette with GdiPalGetEntries. */
683 NtGdiGetPaletteEntries (
690 /* Should be done in user-mode using shared GDI Objects. */
693 NtGdiGetPixelFormat(HDC hDC
);
695 /* Should be done in user-mode using shared GDI Objects. */
696 INT STDCALL
NtGdiGetPolyFillMode(HDC hDC
);
698 /* Should be done in user-mode using shared GDI Objects. */
699 INT STDCALL
NtGdiGetROP2(HDC hDC
);
701 /* Should be done in user-mode using shared GDI Objects. */
702 INT STDCALL
NtGdiGetRelAbs(HDC hDC
);
704 /* Should be done in user-mode using shared GDI Objects. */
705 INT STDCALL
NtGdiGetStretchBltMode(HDC hDC
);
707 /* Use NtGdiDoPalette with GdiPalSetSystemEntries. */
710 NtGdiGetSystemPaletteEntries (
717 /* Should be done in user-mode using shared GDI Objects. */
718 UINT STDCALL
NtGdiGetTextAlign(HDC hDC
);
720 /* Should be done in user-mode using shared GDI Objects. */
723 NtGdiGetTextCharset(HDC hDC
);
725 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
726 COLORREF STDCALL
NtGdiGetTextColor(HDC hDC
);
728 /* Rename to NtGdiGetTextExtentExW. Add 0 at the end. */
731 NtGdiGetTextExtentExPoint(HDC hDC
,
739 /* Rename to NtGdiGetTextExtent. Add 0 at the end. */
742 NtGdiGetTextExtentPoint(HDC hDC
,
747 /* Rename to NtGdiGetTextFaceW, add FALSE at the end. */
750 NtGdiGetTextFace(HDC hDC
,
754 /* Use NtGdiGetTextMetricsW with 0 at the end */
757 NtGdiGetTextMetrics(HDC hDC
,
760 /* Use NtGdiGetDCPoint with GdiGetViewPortExt */
761 BOOL STDCALL
NtGdiGetViewportExtEx(HDC hDC
, LPSIZE viewportExt
);
763 /* Needs to be done in user-mode. */
764 BOOL STDCALL
NtGdiGetViewportOrgEx(HDC hDC
, LPPOINT viewportOrg
);
766 /* Metafiles are user-mode. */
769 NtGdiGetWinMetaFileBits (
777 /* Needs to be done in user-mode. */
778 BOOL STDCALL
NtGdiGetWindowExtEx(HDC hDC
, LPSIZE windowExt
);
780 /* Needs to be done in user-mode. */
781 BOOL STDCALL
NtGdiGetWindowOrgEx(HDC hDC
, LPPOINT windowOrg
);
783 /* Use NtGdiGetTransform with GdiWorldSpaceToPageSpace */
786 NtGdiGetWorldTransform (
791 /* Use NtGdiTransformPoints with GdiDpToLp */
800 /* Needs to be done in user-mode. */
803 NtGdiMoveToEx(HDC hDC
,
808 /* Needs to be done in user-mode. */
811 NtGdiOffsetViewportOrgEx (
818 /* Needs to be done in user-mode. */
821 NtGdiOffsetWindowOrgEx (
828 /* Use NtGdiFillRgn. Add 0 at the end. */
831 NtGdiPaintRgn(HDC hDC
,
834 /* Use NtGdiArcInternal with GdiTypePie. */
847 /* Metafiles are user-mode. */
850 NtGdiPlayEnhMetaFile (
856 /* Metafiles are user-mode. */
859 NtGdiPlayEnhMetaFileRecord (
861 LPHANDLETABLE Handletable
,
862 CONST ENHMETARECORD
* EnhMetaRecord
,
866 /* Metafiles are user-mode. */
874 /* Metafiles are user-mode. */
877 NtGdiPlayMetaFileRecord (
879 LPHANDLETABLE Handletable
,
880 LPMETARECORD MetaRecord
,
884 /* Use NtGdiPolyPolyDraw with GdiPolyBezier. */
887 NtGdiPolyBezier(HDC hDC
,
891 /* Use NtGdiPolyPolyDraw with GdiPolyBezierTo. */
894 NtGdiPolyBezierTo(HDC hDC
,
898 /* Use NtGdiPolyPolyDraw with GdiPolyPolyLine. */
901 NtGdiPolyline(HDC hDC
,
905 /* Use NtGdiPolyPolyDraw with GdiPolyLineTo. */
908 NtGdiPolylineTo(HDC hDC
,
912 /* Use NtGdiPolyPolyDraw with GdiPolyPolyLine. */
915 NtGdiPolyPolyline(HDC hDC
,
917 CONST LPDWORD PolyPoints
,
920 /* Use NtGdiPolyTextOutW with 0 at the end. */
923 NtGdiPolyTextOut(HDC hDC
,
924 CONST LPPOLYTEXTW txt
,
927 /* Use NtGdiPolyPolyDraw with GdiPolyPolygon. */
930 NtGdiPolygon(HDC hDC
,
934 /* Use NtGdiPolyPolyDraw with GdiPolyPolygon. */
937 NtGdiPolyPolygon(HDC hDC
,
938 CONST LPPOINT Points
,
939 CONST LPINT PolyCounts
,
942 /* Call UserRealizePalette. */
945 NtGdiRealizePalette (
949 /* Should be done in user-mode. */
952 NtGdiRemoveFontResource(LPCWSTR FileName
);
954 /* Use NtGdiExtSelectClipRgn with RGN_COPY. */
962 /* Should be done in user-mode. */
963 HGDIOBJ STDCALL
NtGdiSelectObject(HDC hDC
, HGDIOBJ hGDIObj
);
965 /* Use NtUserSelectPalette. */
974 /* Should be done in user-mode. */
977 NtGdiSetAbortProc(HDC hDC
,
978 ABORTPROC AbortProc
);
980 /* Use NtGdiGetAndSetDCDword with GdiGetSetArcDirection. */
983 NtGdiSetArcDirection(HDC hDC
,
986 /* Use NtGdiSetBitmapDimension. */
989 NtGdiSetBitmapDimensionEx (
996 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
997 COLORREF STDCALL
NtGdiSetBkColor (HDC hDC
, COLORREF Color
);
999 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1000 INT STDCALL
NtGdiSetBkMode(HDC hDC
, INT backgroundMode
);
1002 /* Use NtGdiSetBrushOrg. */
1010 /* Use NtGdiDoPalette with GdiPalSetColorTable, TRUE. */
1013 NtGdiSetDIBColorTable (
1017 CONST RGBQUAD
* Colors
1020 /* Use SetDIBitsToDevice in gdi32. */
1029 CONST BITMAPINFO
* bmi
,
1033 /* Use NtGdiSetDIBitsToDeviceInternal. */
1036 NtGdiSetDIBitsToDevice (
1047 CONST BITMAPINFO
* bmi
,
1051 /* Metafiles are user-mode. */
1054 NtGdiSetEnhMetaFileBits (
1059 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1062 NtGdiSetGraphicsMode (
1067 /* Use NtGdiSetIcmMode. */
1070 NtGdiSetICMMode(HDC hDC
,
1073 /* Should be done in user-mode. */
1076 NtGdiSetICMProfile(HDC hDC
,
1079 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1087 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1090 NtGdiSetMapperFlags(HDC hDC
,
1093 /* Metafiles are user-mode. */
1096 NtGdiSetMetaFileBitsEx (
1101 /* Use NtGdiDoPalette with GdiPalSetEntries, TRUE. */
1104 NtGdiSetPaletteEntries (
1108 CONST LPPALETTEENTRY pe
1111 /* Use NtGdiSetPixel(hdc, x, y, color) != CLR_INVALID; */
1121 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1122 INT STDCALL
NtGdiSetPolyFillMode(HDC hDC
, INT polyFillMode
);
1124 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1125 INT STDCALL
NtGdiSetROP2(HDC hDC
, INT ROPmode
);
1127 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1128 INT STDCALL
NtGdiSetStretchBltMode(HDC hDC
, INT stretchBltMode
);
1130 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1133 NtGdiSetTextAlign(HDC hDC
,
1136 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1137 COLORREF STDCALL
NtGdiSetTextColor(HDC hDC
, COLORREF color
);
1139 /* Needs to be done in user-mode. */
1142 NtGdiSetWindowExtEx (
1149 /* Needs to be done in user-mode. */
1152 NtGdiSetViewportOrgEx (
1159 /* Needs to be done in user-mode. */
1162 NtGdiSetViewportExtEx (
1169 /* Needs to be done in user-mode. */
1172 NtGdiSetWindowOrgEx (
1179 /* Use NtGdiModifyWorldTransform with MWT_MAX + 1; */
1182 NtGdiSetWorldTransform (
1187 /* Use NtGdiStretchDIBitsInternal. */
1190 NtGdiStretchDIBits (
1201 CONST BITMAPINFO
* BitsInfo
,
1206 /* Use NtGdiExtTextOutW with 0, 0 at the end. */
1209 NtGdiTextOut(HDC hDC
,
1215 /* Needs to be done in user-mode. */
1218 NtGdiUpdateICMRegKey(DWORD Reserved
,
1223 /* These shouldn't even be called NtGdi */
1224 HDC STDCALL
NtGdiGetDCState(HDC hDC
);
1225 WORD STDCALL
NtGdiSetHookFlags(HDC hDC
, WORD Flags
);
1228 NtGdiSelectVisRgn(HDC hdc
,
1230 VOID STDCALL
NtGdiSetDCState ( HDC hDC
, HDC hDCSave
);
1232 /* All this Should be in user-mode, not NtUser calls. Especially not in GDI! */
1240 #define TWOPARAM_ROUTINE_SETDCPENCOLOR 0x45
1241 #define TWOPARAM_ROUTINE_SETDCBRUSHCOLOR 0x46
1242 #define TWOPARAM_ROUTINE_GETDCCOLOR 0x47
1244 #define NtUserGetDCBrushColor(hbr) \
1245 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR)
1247 #define NtUserGetDCPenColor(hbr) \
1248 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_PEN, TWOPARAM_ROUTINE_GETDCCOLOR)
1250 #define NtUserSetDCBrushColor(hbr, crColor) \
1251 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCBRUSHCOLOR)
1253 #define NtUserSetDCPenColor(hbr, crColor) \
1254 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCPENCOLOR)
1256 #endif /* WIN32K_NTGDI_BAD_INCLUDED */