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 */
191 /* Use NtGdiArcInternal with GdiTypeChord */
204 /* Metafiles are user mode */
207 NtGdiCloseEnhMetaFile (
211 /* Metafiles are user mode */
221 NtGdiColorMatchToTarget(HDC hDC
,
225 /* Metafiles are user mode */
228 NtGdiCopyEnhMetaFile (
233 /* Metafiles are user mode */
241 /* Use NtGdiCreateBitmap and expand the pbm-> */
244 NtGdiCreateBitmapIndirect (
248 /* Use NtGdiCreateDIBitmapInternal */
251 NtGdiCreateDIBitmap (
253 CONST BITMAPINFOHEADER
* bmih
,
256 CONST BITMAPINFO
* bmi
,
260 /* Use NtGdiCreateCompatibleBitmap */
263 NtGdiCreateDiscardableBitmap (
269 /* Use NtGdiCreateEllipticRgn and expand the lprect-> */
272 NtGdiCreateEllipticRgnIndirect(CONST PRECT rc
);
274 /* Metafiles are user mode */
277 NtGdiCreateEnhMetaFile (
284 /* Metafiles are user mode */
287 NtGdiCreateMetaFile (
291 /* Use NtGdiCreatePaletteInternal with palNumEntries at the end. */
295 CONST PLOGPALETTE lgpl
298 /* Use NtGdiCreatePen with -> as parameters. */
300 NtGdiCreatePenIndirect(
301 CONST PLOGPEN LogBrush
);
303 /* Use NtGdiPolyPolyDraw with PolyPolyRgn. */
306 NtGdiCreatePolygonRgn(CONST PPOINT pt
,
310 /* Use NtGdiPolyPolyDraw with PolyPolyRgn. */
313 NtGdiCreatePolyPolygonRgn(CONST PPOINT pt
,
314 CONST PINT PolyCounts
,
318 /* Use NtGdiCreateRectRgn with expanded paraemters. */
321 NtGdiCreateRectRgnIndirect(CONST PRECT rc
);
323 /* Use NtGdiTransformPoints with GdiDpToLp. */
332 /* Meta are user-mode. */
335 NtGdiDeleteEnhMetaFile (
339 /* Meta are user-mode. */
342 NtGdiDeleteMetaFile (
346 /* Should be done in user-mode. */
347 BOOL STDCALL
NtGdiDeleteObject(HGDIOBJ hObject
);
349 /* Meta are user-mode. */
352 NtGdiEnumEnhMetaFile (
355 ENHMFENUMPROC EnhMetaFunc
,
360 /* Should be done in user-mode. */
363 NtGdiEnumFonts(HDC hDC
,
365 FONTENUMPROCW FontFunc
,
368 /* Should be done in user-mode. */
371 NtGdiEnumICMProfiles(HDC hDC
,
375 /* Meta are user-mode. */
385 /* Should be done in user-mode. */
394 /* Use NtGdiExtTextOutW with 0, 0 at the end. */
397 NtGdiExtTextOut(HDC hdc
,
406 /* Use NtGdiExtFloodFill with FLOODFILLBORDER. */
416 /* Should be done in user-mode. */
425 /* Should be NtGdiFlush. */
426 BOOL STDCALL
NtGdiGdiFlush (VOID
);
428 /* Should be done in user-mode. */
429 DWORD STDCALL
NtGdiGdiGetBatchLimit (VOID
);
431 /* Should be done in user-mode. */
432 DWORD STDCALL
NtGdiGdiSetBatchLimit (DWORD Limit
);
434 /* Use NtGdiGetDCDword with GdiGetArcDirection. */
437 NtGdiGetArcDirection ( HDC hDC
);
439 /* Should be done in user-mode. */
442 NtGdiGetAspectRatioFilterEx(HDC hDC
,
445 /* Should be done in user-mode using shared GDI Objects. */
448 NtGdiGetBitmapDimensionEx (
453 /* Should be done in user-mode using shared GDI Objects. */
454 COLORREF STDCALL
NtGdiGetBkColor(HDC hDC
);
456 /* Should be done in user-mode using shared GDI Objects. */
457 INT STDCALL
NtGdiGetBkMode(HDC hDC
);
459 /* Should be done in user-mode using shared GDI Objects. */
460 BOOL STDCALL
NtGdiGetBrushOrgEx(HDC hDC
, LPPOINT brushOrg
);
462 /* Use NtGdiGetCharABCWidthsW */
465 NtGdiGetCharABCWidths(HDC hDC
,
470 /* Should be done in user mode. */
473 NtGdiGetCharABCWidthsFloat(HDC hDC
,
478 /* Should be done in user mode. */
481 NtGdiGetCharacterPlacement(HDC hDC
,
485 LPGCP_RESULTSW Results
,
488 /* Should be done in user mode. */
491 NtGdiGetCharWidthFloat(HDC hDC
,
496 /* Use NtGdiGetAppClipBox. */
504 /* Use NtGdiGetColorSpaceforBitmap. */
507 NtGdiGetColorSpace(HDC hDC
);
509 /* Should be done in user-mode and/or NtGdiGetDCObject. */
510 HGDIOBJ STDCALL
NtGdiGetCurrentObject(HDC hDC
, UINT ObjectType
);
512 /* Should be done in user mode. */
513 BOOL STDCALL
NtGdiGetCurrentPositionEx(HDC hDC
, LPPOINT currentPosition
);
515 /* Use NtGdiGetDCPoint with GdiGetDCOrg. */
516 BOOL STDCALL
NtGdiGetDCOrgEx(HDC hDC
, LPPOINT Point
);
518 /* Use NtGdiDoPalette with GdiPalGetColorTable. */
521 NtGdiGetDIBColorTable (
528 /* Use NtGdiGetDIBitsInternal. */
542 /* Meta are user-mode. */
545 NtGdiGetEnhMetaFile (
549 /* Meta are user-mode. */
552 NtGdiGetEnhMetaFileBits (
558 /* Meta are user-mode. */
561 NtGdiGetEnhMetaFileDescription (
567 /* Meta are user-mode. */
570 NtGdiGetEnhMetaFileHeader (
576 /* Meta are user-mode. */
579 NtGdiGetEnhMetaFilePaletteEntries (
585 /* Meta are user-mode. */
588 NtGdiGetEnhMetaFilePixelFormat(HENHMETAFILE hEMF
,
590 CONST PPIXELFORMATDESCRIPTOR pfd
);
592 /* Should be done in user-mode. */
595 NtGdiGetFontLanguageInfo(HDC hDC
);
597 /* Should be done in user-mode. */
600 NtGdiGetGraphicsMode ( HDC hDC
);
602 /* Should be done in user-mode. */
605 NtGdiGetICMProfile(HDC hDC
,
609 /* Should be done in user-mode. */
612 NtGdiGetLogColorSpace(HCOLORSPACE hColorSpace
,
613 LPLOGCOLORSPACEW Buffer
,
616 /* Should be done in user-mode using shared GDI Objects. */
617 INT STDCALL
NtGdiGetMapMode(HDC hDC
);
619 /* Meta files are user-mode. */
626 /* Meta files are user-mode. */
629 NtGdiGetMetaFileBitsEx (
635 /* Meta files are user-mode. */
643 /* Should be done in user-mode using shared GDI Objects. */
644 INT STDCALL
NtGdiGetObject(HGDIOBJ hGDIObj
,
648 /* Should be done in user-mode using shared GDI Objects. */
649 DWORD STDCALL
NtGdiGetObjectType(HGDIOBJ hGDIObj
);
651 /* Use NtGdiGetOutlineTextMetricsInternalW. */
654 NtGdiGetOutlineTextMetrics(HDC hDC
,
656 LPOUTLINETEXTMETRICW otm
);
658 /* Use NtGdiDoPalette with GdiPalGetEntries. */
661 NtGdiGetPaletteEntries (
668 /* Should be done in user-mode using shared GDI Objects. */
671 NtGdiGetPixelFormat(HDC hDC
);
673 /* Should be done in user-mode using shared GDI Objects. */
674 INT STDCALL
NtGdiGetPolyFillMode(HDC hDC
);
676 /* Should be done in user-mode using shared GDI Objects. */
677 INT STDCALL
NtGdiGetROP2(HDC hDC
);
679 /* Should be done in user-mode using shared GDI Objects. */
680 INT STDCALL
NtGdiGetRelAbs(HDC hDC
);
682 /* Should be done in user-mode using shared GDI Objects. */
685 NtGdiGetSetTextCharExtra( HDC hDC
, INT CharExtra
, BOOL Set
);
687 /* Should be done in user-mode using shared GDI Objects. */
688 INT STDCALL
NtGdiGetStretchBltMode(HDC hDC
);
690 /* Use NtGdiDoPalette with GdiPalSetSystemEntries. */
693 NtGdiGetSystemPaletteEntries (
700 /* Should be done in user-mode using shared GDI Objects. */
701 UINT STDCALL
NtGdiGetTextAlign(HDC hDC
);
703 /* Should be done in user-mode using shared GDI Objects. */
706 NtGdiGetTextCharset(HDC hDC
);
708 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
709 COLORREF STDCALL
NtGdiGetTextColor(HDC hDC
);
711 /* Rename to NtGdiGetTextExtentExW. Add 0 at the end. */
714 NtGdiGetTextExtentExPoint(HDC hDC
,
722 /* Rename to NtGdiGetTextFaceW, add FALSE at the end. */
725 NtGdiGetTextFace(HDC hDC
,
729 /* Use NtGdiGetTextMetricsW with 0 at the end */
732 NtGdiGetTextMetrics(HDC hDC
,
735 /* Use NtGdiGetDCPoint with GdiGetViewPortExt */
736 BOOL STDCALL
NtGdiGetViewportExtEx(HDC hDC
, LPSIZE viewportExt
);
738 /* Needs to be done in user-mode. */
739 BOOL STDCALL
NtGdiGetViewportOrgEx(HDC hDC
, LPPOINT viewportOrg
);
741 /* Metafiles are user-mode. */
744 NtGdiGetWinMetaFileBits (
752 /* Needs to be done in user-mode. */
753 BOOL STDCALL
NtGdiGetWindowExtEx(HDC hDC
, LPSIZE windowExt
);
755 /* Needs to be done in user-mode. */
756 BOOL STDCALL
NtGdiGetWindowOrgEx(HDC hDC
, LPPOINT windowOrg
);
758 /* Use NtGdiGetTransform with GdiWorldSpaceToPageSpace */
761 NtGdiGetWorldTransform (
766 /* Use NtGdiTransformPoints with GdiDpToLp */
775 /* Needs to be done in user-mode. */
778 NtGdiMoveToEx(HDC hDC
,
783 /* Needs to be done in user-mode. */
786 NtGdiOffsetViewportOrgEx (
793 /* Needs to be done in user-mode. */
796 NtGdiOffsetWindowOrgEx (
803 /* Use NtGdiFillRgn. Add 0 at the end. */
806 NtGdiPaintRgn(HDC hDC
,
809 /* Use NtGdiArcInternal with GdiTypePie. */
822 /* Metafiles are user-mode. */
825 NtGdiPlayEnhMetaFile (
831 /* Metafiles are user-mode. */
834 NtGdiPlayEnhMetaFileRecord (
836 LPHANDLETABLE Handletable
,
837 CONST ENHMETARECORD
* EnhMetaRecord
,
841 /* Metafiles are user-mode. */
849 /* Metafiles are user-mode. */
852 NtGdiPlayMetaFileRecord (
854 LPHANDLETABLE Handletable
,
855 LPMETARECORD MetaRecord
,
859 /* Use NtGdiPolyPolyDraw with GdiPolyBezier. */
862 NtGdiPolyBezier(HDC hDC
,
866 /* Use NtGdiPolyPolyDraw with GdiPolyBezierTo. */
869 NtGdiPolyBezierTo(HDC hDC
,
873 /* Use NtGdiPolyPolyDraw with GdiPolyPolyLine. */
876 NtGdiPolyline(HDC hDC
,
880 /* Use NtGdiPolyPolyDraw with GdiPolyLineTo. */
883 NtGdiPolylineTo(HDC hDC
,
887 /* Use NtGdiPolyPolyDraw with GdiPolyPolyLine. */
890 NtGdiPolyPolyline(HDC hDC
,
892 CONST LPDWORD PolyPoints
,
895 /* Use NtGdiPolyTextOutW with 0 at the end. */
898 NtGdiPolyTextOut(HDC hDC
,
899 CONST LPPOLYTEXTW txt
,
902 /* Use NtGdiPolyPolyDraw with GdiPolyPolygon. */
905 NtGdiPolygon(HDC hDC
,
909 /* Use NtGdiPolyPolyDraw with GdiPolyPolygon. */
912 NtGdiPolyPolygon(HDC hDC
,
913 CONST LPPOINT Points
,
914 CONST LPINT PolyCounts
,
917 /* Call UserRealizePalette. */
920 NtGdiRealizePalette (
924 /* Should be done in user-mode. */
927 NtGdiRemoveFontResource(LPCWSTR FileName
);
929 /* Use NtGdiExtSelectClipRgn with RGN_COPY. */
937 /* Should be done in user-mode. */
938 HGDIOBJ STDCALL
NtGdiSelectObject(HDC hDC
, HGDIOBJ hGDIObj
);
940 /* Use NtUserSelectPalette. */
949 /* Should be done in user-mode. */
952 NtGdiSetAbortProc(HDC hDC
,
953 ABORTPROC AbortProc
);
955 /* Use NtGdiGetAndSetDCDword with GdiGetSetArcDirection. */
958 NtGdiSetArcDirection(HDC hDC
,
961 /* Use NtGdiSetBitmapDimension. */
964 NtGdiSetBitmapDimensionEx (
971 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
972 COLORREF STDCALL
NtGdiSetBkColor (HDC hDC
, COLORREF Color
);
974 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
975 INT STDCALL
NtGdiSetBkMode(HDC hDC
, INT backgroundMode
);
977 /* Use NtGdiSetBrushOrg. */
985 /* Use NtGdiDoPalette with GdiPalSetColorTable, TRUE. */
988 NtGdiSetDIBColorTable (
992 CONST RGBQUAD
* Colors
995 /* Use SetDIBitsToDevice in gdi32. */
1004 CONST BITMAPINFO
* bmi
,
1008 /* Use NtGdiSetDIBitsToDeviceInternal. */
1011 NtGdiSetDIBitsToDevice (
1022 CONST BITMAPINFO
* bmi
,
1026 /* Metafiles are user-mode. */
1029 NtGdiSetEnhMetaFileBits (
1034 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1037 NtGdiSetGraphicsMode (
1042 /* Use NtGdiSetIcmMode. */
1045 NtGdiSetICMMode(HDC hDC
,
1048 /* Should be done in user-mode. */
1051 NtGdiSetICMProfile(HDC hDC
,
1054 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1062 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1065 NtGdiSetMapperFlags(HDC hDC
,
1068 /* Metafiles are user-mode. */
1071 NtGdiSetMetaFileBitsEx (
1076 /* Use NtGdiDoPalette with GdiPalSetEntries, TRUE. */
1079 NtGdiSetPaletteEntries (
1083 CONST LPPALETTEENTRY pe
1086 /* Use NtGdiSetPixel(hdc, x, y, color) != CLR_INVALID; */
1096 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1097 INT STDCALL
NtGdiSetPolyFillMode(HDC hDC
, INT polyFillMode
);
1099 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1100 INT STDCALL
NtGdiSetROP2(HDC hDC
, INT ROPmode
);
1102 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1103 INT STDCALL
NtGdiSetStretchBltMode(HDC hDC
, INT stretchBltMode
);
1105 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1108 NtGdiSetTextAlign(HDC hDC
,
1111 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1112 COLORREF STDCALL
NtGdiSetTextColor(HDC hDC
, COLORREF color
);
1114 /* Needs to be done in user-mode. */
1117 NtGdiSetWindowExtEx (
1124 /* Needs to be done in user-mode. */
1127 NtGdiSetViewportOrgEx (
1134 /* Needs to be done in user-mode. */
1137 NtGdiSetViewportExtEx (
1144 /* Needs to be done in user-mode. */
1147 NtGdiSetWindowOrgEx (
1154 /* Use NtGdiModifyWorldTransform with MWT_MAX + 1; */
1157 NtGdiSetWorldTransform (
1162 /* Use NtGdiStretchDIBitsInternal. */
1165 NtGdiStretchDIBits (
1176 CONST BITMAPINFO
* BitsInfo
,
1181 /* Use NtGdiExtTextOutW with 0, 0 at the end. */
1184 NtGdiTextOut(HDC hDC
,
1190 /* Needs to be done in user-mode. */
1193 NtGdiUpdateICMRegKey(DWORD Reserved
,
1198 /* These shouldn't even be called NtGdi */
1199 HDC STDCALL
NtGdiGetDCState(HDC hDC
);
1200 WORD STDCALL
NtGdiSetHookFlags(HDC hDC
, WORD Flags
);
1203 NtGdiSelectVisRgn(HDC hdc
,
1205 VOID STDCALL
NtGdiSetDCState ( HDC hDC
, HDC hDCSave
);
1207 /* All this Should be in user-mode, not NtUser calls. Especially not in GDI! */
1215 #define TWOPARAM_ROUTINE_SETDCPENCOLOR 0x45
1216 #define TWOPARAM_ROUTINE_SETDCBRUSHCOLOR 0x46
1217 #define TWOPARAM_ROUTINE_GETDCCOLOR 0x47
1219 #define NtUserGetDCBrushColor(hbr) \
1220 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR)
1222 #define NtUserGetDCPenColor(hbr) \
1223 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_PEN, TWOPARAM_ROUTINE_GETDCCOLOR)
1225 #define NtUserSetDCBrushColor(hbr, crColor) \
1226 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCBRUSHCOLOR)
1228 #define NtUserSetDCPenColor(hbr, crColor) \
1229 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCPENCOLOR)
1231 #endif /* WIN32K_NTGDI_BAD_INCLUDED */