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 done in user-mode. */
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. */
683 INT STDCALL
NtGdiGetStretchBltMode(HDC hDC
);
685 /* Use NtGdiDoPalette with GdiPalSetSystemEntries. */
688 NtGdiGetSystemPaletteEntries (
695 /* Should be done in user-mode using shared GDI Objects. */
696 UINT STDCALL
NtGdiGetTextAlign(HDC hDC
);
698 /* Should be done in user-mode using shared GDI Objects. */
701 NtGdiGetTextCharset(HDC hDC
);
703 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
704 COLORREF STDCALL
NtGdiGetTextColor(HDC hDC
);
706 /* Rename to NtGdiGetTextExtentExW. Add 0 at the end. */
709 NtGdiGetTextExtentExPoint(HDC hDC
,
717 /* Rename to NtGdiGetTextExtent. Add 0 at the end. */
720 NtGdiGetTextExtentPoint(HDC hDC
,
725 /* Rename to NtGdiGetTextFaceW, add FALSE at the end. */
728 NtGdiGetTextFace(HDC hDC
,
732 /* Use NtGdiGetTextMetricsW with 0 at the end */
735 NtGdiGetTextMetrics(HDC hDC
,
738 /* Use NtGdiGetDCPoint with GdiGetViewPortExt */
739 BOOL STDCALL
NtGdiGetViewportExtEx(HDC hDC
, LPSIZE viewportExt
);
741 /* Needs to be done in user-mode. */
742 BOOL STDCALL
NtGdiGetViewportOrgEx(HDC hDC
, LPPOINT viewportOrg
);
744 /* Metafiles are user-mode. */
747 NtGdiGetWinMetaFileBits (
755 /* Needs to be done in user-mode. */
756 BOOL STDCALL
NtGdiGetWindowExtEx(HDC hDC
, LPSIZE windowExt
);
758 /* Needs to be done in user-mode. */
759 BOOL STDCALL
NtGdiGetWindowOrgEx(HDC hDC
, LPPOINT windowOrg
);
761 /* Use NtGdiGetTransform with GdiWorldSpaceToPageSpace */
764 NtGdiGetWorldTransform (
769 /* Use NtGdiTransformPoints with GdiDpToLp */
778 /* Needs to be done in user-mode. */
781 NtGdiMoveToEx(HDC hDC
,
786 /* Needs to be done in user-mode. */
789 NtGdiOffsetViewportOrgEx (
796 /* Needs to be done in user-mode. */
799 NtGdiOffsetWindowOrgEx (
806 /* Use NtGdiFillRgn. Add 0 at the end. */
809 NtGdiPaintRgn(HDC hDC
,
812 /* Use NtGdiArcInternal with GdiTypePie. */
825 /* Metafiles are user-mode. */
828 NtGdiPlayEnhMetaFile (
834 /* Metafiles are user-mode. */
837 NtGdiPlayEnhMetaFileRecord (
839 LPHANDLETABLE Handletable
,
840 CONST ENHMETARECORD
* EnhMetaRecord
,
844 /* Metafiles are user-mode. */
852 /* Metafiles are user-mode. */
855 NtGdiPlayMetaFileRecord (
857 LPHANDLETABLE Handletable
,
858 LPMETARECORD MetaRecord
,
862 /* Use NtGdiPolyPolyDraw with GdiPolyBezier. */
865 NtGdiPolyBezier(HDC hDC
,
869 /* Use NtGdiPolyPolyDraw with GdiPolyBezierTo. */
872 NtGdiPolyBezierTo(HDC hDC
,
876 /* Use NtGdiPolyPolyDraw with GdiPolyPolyLine. */
879 NtGdiPolyline(HDC hDC
,
883 /* Use NtGdiPolyPolyDraw with GdiPolyLineTo. */
886 NtGdiPolylineTo(HDC hDC
,
890 /* Use NtGdiPolyPolyDraw with GdiPolyPolyLine. */
893 NtGdiPolyPolyline(HDC hDC
,
895 CONST LPDWORD PolyPoints
,
898 /* Use NtGdiPolyTextOutW with 0 at the end. */
901 NtGdiPolyTextOut(HDC hDC
,
902 CONST LPPOLYTEXTW txt
,
905 /* Use NtGdiPolyPolyDraw with GdiPolyPolygon. */
908 NtGdiPolygon(HDC hDC
,
912 /* Use NtGdiPolyPolyDraw with GdiPolyPolygon. */
915 NtGdiPolyPolygon(HDC hDC
,
916 CONST LPPOINT Points
,
917 CONST LPINT PolyCounts
,
920 /* Call UserRealizePalette. */
923 NtGdiRealizePalette (
927 /* Should be done in user-mode. */
930 NtGdiRemoveFontResource(LPCWSTR FileName
);
932 /* Use NtGdiExtSelectClipRgn with RGN_COPY. */
940 /* Should be done in user-mode. */
941 HGDIOBJ STDCALL
NtGdiSelectObject(HDC hDC
, HGDIOBJ hGDIObj
);
943 /* Use NtUserSelectPalette. */
952 /* Should be done in user-mode. */
955 NtGdiSetAbortProc(HDC hDC
,
956 ABORTPROC AbortProc
);
958 /* Use NtGdiGetAndSetDCDword with GdiGetSetArcDirection. */
961 NtGdiSetArcDirection(HDC hDC
,
964 /* Use NtGdiSetBitmapDimension. */
967 NtGdiSetBitmapDimensionEx (
974 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
975 COLORREF STDCALL
NtGdiSetBkColor (HDC hDC
, COLORREF Color
);
977 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
978 INT STDCALL
NtGdiSetBkMode(HDC hDC
, INT backgroundMode
);
980 /* Use NtGdiSetBrushOrg. */
988 /* Use NtGdiDoPalette with GdiPalSetColorTable, TRUE. */
991 NtGdiSetDIBColorTable (
995 CONST RGBQUAD
* Colors
998 /* Use SetDIBitsToDevice in gdi32. */
1007 CONST BITMAPINFO
* bmi
,
1011 /* Use NtGdiSetDIBitsToDeviceInternal. */
1014 NtGdiSetDIBitsToDevice (
1025 CONST BITMAPINFO
* bmi
,
1029 /* Metafiles are user-mode. */
1032 NtGdiSetEnhMetaFileBits (
1037 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1040 NtGdiSetGraphicsMode (
1045 /* Use NtGdiSetIcmMode. */
1048 NtGdiSetICMMode(HDC hDC
,
1051 /* Should be done in user-mode. */
1054 NtGdiSetICMProfile(HDC hDC
,
1057 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1065 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1068 NtGdiSetMapperFlags(HDC hDC
,
1071 /* Metafiles are user-mode. */
1074 NtGdiSetMetaFileBitsEx (
1079 /* Use NtGdiDoPalette with GdiPalSetEntries, TRUE. */
1082 NtGdiSetPaletteEntries (
1086 CONST LPPALETTEENTRY pe
1089 /* Use NtGdiSetPixel(hdc, x, y, color) != CLR_INVALID; */
1099 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1100 INT STDCALL
NtGdiSetPolyFillMode(HDC hDC
, INT polyFillMode
);
1102 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1103 INT STDCALL
NtGdiSetROP2(HDC hDC
, INT ROPmode
);
1105 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1106 INT STDCALL
NtGdiSetStretchBltMode(HDC hDC
, INT stretchBltMode
);
1108 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1111 NtGdiSetTextAlign(HDC hDC
,
1114 /* Needs to be done in user-mode, using shared GDI Object Attributes. */
1115 COLORREF STDCALL
NtGdiSetTextColor(HDC hDC
, COLORREF color
);
1117 /* Needs to be done in user-mode. */
1120 NtGdiSetWindowExtEx (
1127 /* Needs to be done in user-mode. */
1130 NtGdiSetViewportOrgEx (
1137 /* Needs to be done in user-mode. */
1140 NtGdiSetViewportExtEx (
1147 /* Needs to be done in user-mode. */
1150 NtGdiSetWindowOrgEx (
1157 /* Use NtGdiModifyWorldTransform with MWT_MAX + 1; */
1160 NtGdiSetWorldTransform (
1165 /* Use NtGdiStretchDIBitsInternal. */
1168 NtGdiStretchDIBits (
1179 CONST BITMAPINFO
* BitsInfo
,
1184 /* Use NtGdiExtTextOutW with 0, 0 at the end. */
1187 NtGdiTextOut(HDC hDC
,
1193 /* Needs to be done in user-mode. */
1196 NtGdiUpdateICMRegKey(DWORD Reserved
,
1201 /* These shouldn't even be called NtGdi */
1202 HDC STDCALL
NtGdiGetDCState(HDC hDC
);
1203 WORD STDCALL
NtGdiSetHookFlags(HDC hDC
, WORD Flags
);
1206 NtGdiSelectVisRgn(HDC hdc
,
1208 VOID STDCALL
NtGdiSetDCState ( HDC hDC
, HDC hDCSave
);
1210 /* All this Should be in user-mode, not NtUser calls. Especially not in GDI! */
1218 #define TWOPARAM_ROUTINE_SETDCPENCOLOR 0x45
1219 #define TWOPARAM_ROUTINE_SETDCBRUSHCOLOR 0x46
1220 #define TWOPARAM_ROUTINE_GETDCCOLOR 0x47
1222 #define NtUserGetDCBrushColor(hbr) \
1223 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR)
1225 #define NtUserGetDCPenColor(hbr) \
1226 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_PEN, TWOPARAM_ROUTINE_GETDCCOLOR)
1228 #define NtUserSetDCBrushColor(hbr, crColor) \
1229 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCBRUSHCOLOR)
1231 #define NtUserSetDCPenColor(hbr, crColor) \
1232 (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCPENCOLOR)
1234 #endif /* WIN32K_NTGDI_BAD_INCLUDED */