Author: jimtabor
Date: Tue Nov 20 22:56:57 2007
New Revision: 30603
URL:
http://svn.reactos.org/svn/reactos?rev=30603&view=rev
Log:
Removing old syscalls and updated related files. Old syscalls will be renamed for internal
use.
Modified:
trunk/reactos/dll/win32/gdi32/misc/hacks.c
trunk/reactos/dll/win32/gdi32/misc/stubs.c
trunk/reactos/dll/win32/gdi32/objects/brush.c
trunk/reactos/dll/win32/gdi32/objects/dc.c
trunk/reactos/dll/win32/gdi32/objects/text.c
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/subsystems/win32/win32k/include/dc.h
trunk/reactos/subsystems/win32/win32k/include/intgdi.h
trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/objects/dcutil.c
trunk/reactos/subsystems/win32/win32k/objects/text.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/misc/hacks.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/hacks…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/hacks.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/hacks.c Tue Nov 20 22:56:57 2007
@@ -43,21 +43,6 @@
* @implemented
*
*/
-int
-STDCALL
-GetROP2(HDC hdc)
-{
- /* FIXME do not use reactos own syscall for this,
- * this hack need be remove
- */
- return NtGdiGetROP2(hdc);
-}
-
-
-/*
- * @implemented
- *
- */
INT
STDCALL
SetDIBitsToDevice(
@@ -96,18 +81,6 @@
* @implemented
*
*/
-int
-STDCALL
-SetBkMode(HDC hdc,
- int iBkMode)
-{
- return NtGdiSetBkMode(hdc,iBkMode);
-}
-
-/*
- * @implemented
- *
- */
HGDIOBJ
STDCALL
SelectObject(HDC hdc,
@@ -137,29 +110,6 @@
GetStretchBltMode(HDC hdc)
{
return NtGdiGetStretchBltMode(hdc);
-}
-
-/*
- * @implemented
- *
- */
-UINT
-STDCALL
-GetTextAlign(HDC hdc)
-{
- return NtGdiGetTextAlign(hdc);
-}
-
-
-/*
- * @implemented
- *
- */
-COLORREF
-STDCALL
-GetTextColor(HDC hdc)
-{
- return NtGdiGetTextColor(hdc);
}
/*
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Tue Nov 20 22:56:57 2007
@@ -111,18 +111,6 @@
{
/* FIXME metadc stuff */
return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect);
-}
-
-/*
- * @unimplemented
- */
-UINT
-STDCALL
-SetTextAlign(HDC hdc,
- UINT fMode)
-{
- /* FIXME share memory */
- return NtGdiSetTextAlign(hdc, fMode);
}
/*
@@ -2342,30 +2330,6 @@
* @implemented
*
*/
-COLORREF
-STDCALL
-GetBkColor(HDC hdc)
-{
- /* FIXME some part are done in user mode */
- return NtGdiGetBkColor(hdc);
-}
-
-/*
- * @implemented
- *
- */
-int
-STDCALL
-GetBkMode(HDC hdc)
-{
- /* FIXME some part are done in user mode */
- return NtGdiGetBkMode(hdc);
-}
-
-/*
- * @implemented
- *
- */
int
STDCALL
GetDeviceCaps(HDC hdc,
Modified: trunk/reactos/dll/win32/gdi32/objects/brush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/br…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/brush.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/brush.c Tue Nov 20 22:56:57 2007
@@ -204,6 +204,18 @@
return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode);
}
+/*
+ * @implemented
+ *
+ */
+int
+STDCALL
+GetROP2(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->jROP2;
+}
/*
* @implemented
Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Tue Nov 20 22:56:57 2007
@@ -823,53 +823,19 @@
}
}
return OldColor;
-// return NtUserSetDCPenColor(hdc, crColor);
-}
-
-/*
- * @implemented
+}
+
+/*
+ * @implemented
+ *
*/
COLORREF
STDCALL
-SetTextColor(
- HDC hdc,
- COLORREF crColor
-)
-{
- PDC_ATTR Dc_Attr;
- COLORREF OldColor = CLR_INVALID;
-
- if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor;
-#if 0
- if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
- {
- if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
- return MFDRV_SetTextColor( hDC, crColor );
- else
- {
- PLDC pLDC = Dc_Attr->pvLDC;
- if ( !pLDC )
- {
- SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
- }
- if (pLDC->iType == LDC_EMFLDC)
- {
- if return EMFDRV_SetTextColor( hDC, crColor );
- }
- }
- }
-#endif
- OldColor = (COLORREF) Dc_Attr->ulForegroundClr;
- Dc_Attr->ulForegroundClr = (ULONG) crColor;
-
- if ( Dc_Attr->crForegroundClr != crColor )
- {
- Dc_Attr->ulDirty_ |= DIRTY_TEXT;
- Dc_Attr->crForegroundClr = crColor;
- }
- return OldColor;
-// return NtGdiSetTextColor(hdc, crColor);
+GetBkColor(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->ulBackgroundClr;
}
/*
@@ -915,7 +881,58 @@
Dc_Attr->crBackgroundClr = crColor;
}
return OldColor;
-// return NtGdiSetBkColor(hdc, crColor);
+}
+
+/*
+ * @implemented
+ *
+ */
+int
+STDCALL
+GetBkMode(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->lBkMode;
+}
+
+/*
+ * @implemented
+ *
+ */
+int
+STDCALL
+SetBkMode(HDC hdc,
+ int iBkMode)
+{
+ PDC_ATTR Dc_Attr;
+ INT OldMode = 0;
+
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode;
+#if 0
+ if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_SetBkMode( hdc, iBkMode )
+ else
+ {
+ PLDC pLDC = Dc_Attr->pvLDC;
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ if return EMFDRV_SetBkMode( hdc, iBkMode )
+ }
+ }
+ }
+#endif
+ OldMode = Dc_Attr->lBkMode;
+ Dc_Attr->jBkMode = iBkMode; // Processed
+ Dc_Attr->lBkMode = iBkMode; // Raw
+ return OldMode;
}
/*
Modified: trunk/reactos/dll/win32/gdi32/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/text.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/text.c Tue Nov 20 22:56:57 2007
@@ -458,4 +458,117 @@
// return GetAndSetDCDWord( hDC, GdiGetSetTextCharExtra, CharExtra, 0, 0, 0 );
}
-
+/*
+ * @implemented
+ *
+ */
+UINT
+STDCALL
+GetTextAlign(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->lTextAlign;
+}
+
+
+/*
+ * @implemented
+ *
+ */
+COLORREF
+STDCALL
+GetTextColor(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->ulForegroundClr;
+}
+
+
+
+/*
+ * @unimplemented
+ */
+UINT
+STDCALL
+SetTextAlign(HDC hdc,
+ UINT fMode)
+{
+ PDC_ATTR Dc_Attr;
+ INT OldMode = 0;
+
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode;
+#if 0
+ if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_SetTextAlign( hdc, fMode )
+ else
+ {
+ PLDC pLDC = Dc_Attr->pvLDC;
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ if return EMFDRV_SetTextAlign( hdc, fMode )
+ }
+ }
+ }
+#endif
+ OldMode = Dc_Attr->lTextAlign;
+ Dc_Attr->lTextAlign = fMode; // Raw
+ Dc_Attr->flTextAlign = fMode & 0x1f;
+ return OldMode;
+
+}
+
+
+/*
+ * @implemented
+ */
+COLORREF
+STDCALL
+SetTextColor(
+ HDC hdc,
+ COLORREF crColor
+)
+{
+ PDC_ATTR Dc_Attr;
+ COLORREF OldColor = CLR_INVALID;
+
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor;
+#if 0
+ if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_SetTextColor( hDC, crColor );
+ else
+ {
+ PLDC pLDC = Dc_Attr->pvLDC;
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ if return EMFDRV_SetTextColor( hDC, crColor );
+ }
+ }
+ }
+#endif
+ OldColor = (COLORREF) Dc_Attr->ulForegroundClr;
+ Dc_Attr->ulForegroundClr = (ULONG) crColor;
+
+ if ( Dc_Attr->crForegroundClr != crColor )
+ {
+ Dc_Attr->ulDirty_ |= DIRTY_TEXT;
+ Dc_Attr->crForegroundClr = crColor;
+ }
+ return OldColor;
+}
+
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Tue Nov 20 22:56:57 2007
@@ -196,20 +196,6 @@
NtGdiGetAspectRatioFilterEx(HDC hDC,
LPSIZE AspectRatio);
-/* Should be done in user-mode using shared GDI Objects. */
-COLORREF STDCALL NtGdiGetBkColor(HDC hDC);
-
-/* Should be done in user-mode using shared GDI Objects. */
-INT STDCALL NtGdiGetBkMode(HDC hDC);
-
-/* Use NtGdiGetCharABCWidthsW */
-BOOL
-STDCALL
-NtGdiGetCharABCWidths(HDC hDC,
- UINT FirstChar,
- UINT LastChar,
- LPABC abc);
-
/* Use NtGdiGetColorSpaceforBitmap. */
HCOLORSPACE
STDCALL
@@ -307,21 +293,12 @@
INT STDCALL NtGdiGetPolyFillMode(HDC hDC);
/* Should be done in user-mode using shared GDI Objects. */
-INT STDCALL NtGdiGetROP2(HDC hDC);
+INT STDCALL NtGdiGetStretchBltMode(HDC hDC);
/* Should be done in user-mode using shared GDI Objects. */
-INT STDCALL NtGdiGetStretchBltMode(HDC hDC);
-
-/* Should be done in user-mode using shared GDI Objects. */
-UINT STDCALL NtGdiGetTextAlign(HDC hDC);
-
-/* Should be done in user-mode using shared GDI Objects. */
UINT
STDCALL
NtGdiGetTextCharset(HDC hDC);
-
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-COLORREF STDCALL NtGdiGetTextColor(HDC hDC);
/* Use NtGdiGetDCPoint with GdiGetViewPortExt */
BOOL STDCALL NtGdiGetViewportExtEx(HDC hDC, LPSIZE viewportExt);
@@ -403,12 +380,6 @@
/* Should be done in user-mode. */
HGDIOBJ STDCALL NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj);
-
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-COLORREF STDCALL NtGdiSetBkColor (HDC hDC, COLORREF Color);
-
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-INT STDCALL NtGdiSetBkMode(HDC hDC, INT backgroundMode);
/* Use SetDIBitsToDevice in gdi32. */
INT
@@ -455,19 +426,7 @@
INT STDCALL NtGdiSetPolyFillMode(HDC hDC, INT polyFillMode);
/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-INT STDCALL NtGdiSetROP2(HDC hDC, INT ROPmode);
-
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
INT STDCALL NtGdiSetStretchBltMode(HDC hDC, INT stretchBltMode);
-
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-UINT
-STDCALL
-NtGdiSetTextAlign(HDC hDC,
- UINT Mode);
-
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-COLORREF STDCALL NtGdiSetTextColor(HDC hDC, COLORREF color);
/* Needs to be done in user-mode. */
BOOL
@@ -536,29 +495,6 @@
LPWSTR Filename,
UINT Command);
-/* All this Should be in user-mode, not NtUser calls. Especially not in GDI! */
-DWORD
-NTAPI
-NtUserCallTwoParam(
- DWORD Param1,
- DWORD Param2,
- DWORD Routine);
-
-#define TWOPARAM_ROUTINE_SETDCPENCOLOR 0x45
-#define TWOPARAM_ROUTINE_SETDCBRUSHCOLOR 0x46
-#define TWOPARAM_ROUTINE_GETDCCOLOR 0x47
-
-#define NtUserGetDCBrushColor(hbr) \
- (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR)
-
-#define NtUserGetDCPenColor(hbr) \
- (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_PEN, TWOPARAM_ROUTINE_GETDCCOLOR)
-
-#define NtUserSetDCBrushColor(hbr, crColor) \
- (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor,
TWOPARAM_ROUTINE_SETDCBRUSHCOLOR)
-
-#define NtUserSetDCPenColor(hbr, crColor) \
- (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor,
TWOPARAM_ROUTINE_SETDCPENCOLOR)
#endif /* WIN32K_NTGDI_BAD_INCLUDED */
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h Tue Nov 20 22:56:57 2007
@@ -104,6 +104,15 @@
NTSTATUS STDCALL NtGdiFlushUserBatch(VOID);
+COLORREF FASTCALL NtGdiSetBkColor (HDC hDC, COLORREF Color);
+INT FASTCALL NtGdiSetBkMode(HDC hDC, INT backgroundMode);
+COLORREF STDCALL NtGdiGetBkColor(HDC hDC);
+INT STDCALL NtGdiGetBkMode(HDC hDC);
+COLORREF FASTCALL NtGdiSetTextColor(HDC hDC, COLORREF color);
+UINT FASTCALL NtGdiSetTextAlign(HDC hDC, UINT Mode);
+UINT STDCALL NtGdiGetTextAlign(HDC hDC);
+COLORREF STDCALL NtGdiGetTextColor(HDC hDC);
+
/* For Metafile and MetaEnhFile not in windows this struct taken from wine cvs
15/9-2006*/
typedef struct
{
Modified: trunk/reactos/subsystems/win32/win32k/include/intgdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/intgdi.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/intgdi.h Tue Nov 20 22:56:57 2007
@@ -164,12 +164,6 @@
CONST PDEVMODEW InitData,
BOOL CreateAsIC);
-COLORREF FASTCALL
-IntGetDCColor(HDC hDC, ULONG Object);
-
-COLORREF FASTCALL
-IntSetDCColor(HDC hDC, ULONG Object, COLORREF Color);
-
/* Coord functions */
BOOL FASTCALL
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/misc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/misc.c Tue Nov 20 22:56:57 2007
@@ -485,18 +485,6 @@
switch(Routine)
{
- case TWOPARAM_ROUTINE_SETDCPENCOLOR:
- {
- RETURN( (DWORD)IntSetDCColor((HDC)Param1, OBJ_PEN, (COLORREF)Param2));
- }
- case TWOPARAM_ROUTINE_SETDCBRUSHCOLOR:
- {
- RETURN( (DWORD)IntSetDCColor((HDC)Param1, OBJ_BRUSH, (COLORREF)Param2));
- }
- case TWOPARAM_ROUTINE_GETDCCOLOR:
- {
- RETURN( (DWORD)IntGetDCColor((HDC)Param1, (ULONG)Param2));
- }
case TWOPARAM_ROUTINE_GETWINDOWRGNBOX:
{
DWORD Ret;
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Tue Nov 20 22:56:57 2007
@@ -150,8 +150,11 @@
NewDC->PalIndexed = OrigDC->PalIndexed;
NewDC->w.hPalette = OrigDC->w.hPalette;
+ nDc_Attr->lTextAlign = oDc_Attr->lTextAlign;
+ nDc_Attr->ulForegroundClr = oDc_Attr->ulForegroundClr;
+ nDc_Attr->ulBackgroundClr = oDc_Attr->ulBackgroundClr;
+ nDc_Attr->lBkMode = oDc_Attr->lBkMode;
nDc_Attr->crForegroundClr = oDc_Attr->crForegroundClr;
- nDc_Attr->lTextAlign = oDc_Attr->lTextAlign;
nDc_Attr->crBackgroundClr = oDc_Attr->crBackgroundClr;
nDc_Attr->jBkMode = oDc_Attr->jBkMode;
nDc_Attr->jROP2 = oDc_Attr->jROP2;
@@ -1203,8 +1206,11 @@
nDc_Attr->jStretchBltMode = Dc_Attr->jStretchBltMode;
nDc_Attr->lRelAbs = Dc_Attr->lRelAbs;
nDc_Attr->jBkMode = Dc_Attr->jBkMode;
+ nDc_Attr->lBkMode = Dc_Attr->lBkMode;
nDc_Attr->crBackgroundClr = Dc_Attr->crBackgroundClr;
nDc_Attr->crForegroundClr = Dc_Attr->crForegroundClr;
+ nDc_Attr->ulBackgroundClr = Dc_Attr->ulBackgroundClr;
+ nDc_Attr->ulForegroundClr = Dc_Attr->ulForegroundClr;
nDc_Attr->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin;
nDc_Attr->lTextAlign = Dc_Attr->lTextAlign;
nDc_Attr->lTextExtra = Dc_Attr->lTextExtra;
@@ -1273,6 +1279,9 @@
Dc_Attr->jBkMode = sDc_Attr->jBkMode;
Dc_Attr->crBackgroundClr = sDc_Attr->crBackgroundClr;
Dc_Attr->crForegroundClr = sDc_Attr->crForegroundClr;
+ Dc_Attr->lBkMode = sDc_Attr->lBkMode;
+ Dc_Attr->ulBackgroundClr = sDc_Attr->ulBackgroundClr;
+ Dc_Attr->ulForegroundClr = sDc_Attr->ulForegroundClr;
Dc_Attr->ptlBrushOrigin = sDc_Attr->ptlBrushOrigin;
Dc_Attr->lTextAlign = sDc_Attr->lTextAlign;
@@ -2579,42 +2588,6 @@
return SurfObj->hsurf == PrimarySurface.Handle;
}
-/*
- * Returns the color of the brush or pen that is currently selected into the DC.
- * This function is called from GetDCBrushColor() and GetDCPenColor()
- */
-COLORREF FASTCALL
-IntGetDCColor(HDC hDC, ULONG Object)
-{
- /*
- * The previous implementation was completly incorrect. It modified the
- * brush that was currently selected into the device context, but in fact
- * the DC pen/brush color should be stored directly in the device context
- * (at address 0x2C of the user mode DC object memory on Windows 2K/XP).
- * The actual color is then used when DC_BRUSH/DC_PEN object is selected
- * into the device context and BRUSHOBJ for drawing is composed (belongs
- * to IntGdiInitBrushInstance in the current ReactOS implementation). Also
- * the implementation should be moved to user mode GDI32.dll when UM
- * mapped GDI objects will be implemented.
- */
-
- DPRINT("WIN32K:IntGetDCColor is unimplemented\n");
- return 0xFFFFFF; /* The default DC color. */
-}
-
-/*
- * Changes the color of the brush or pen that is currently selected into the DC.
- * This function is called from SetDCBrushColor() and SetDCPenColor()
- */
-COLORREF FASTCALL
-IntSetDCColor(HDC hDC, ULONG Object, COLORREF Color)
-{
- /* See the comment in IntGetDCColor. */
-
- DPRINT("WIN32K:IntSetDCColor is unimplemented\n");
- return CLR_INVALID;
-}
-
#define SIZEOF_DEVMODEW_300 188
#define SIZEOF_DEVMODEW_400 212
#define SIZEOF_DEVMODEW_500 220
Modified: trunk/reactos/subsystems/win32/win32k/objects/dcutil.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dcutil.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dcutil.c Tue Nov 20 22:56:57 2007
@@ -157,14 +157,13 @@
DC_GET_VAL_EX( GetWindowOrgEx, ptlWindowOrg.x, ptlWindowOrg.y, POINT, x, y )
DC_GET_VAL_EX ( GetCurrentPositionEx, ptlCurrent.x, ptlCurrent.y, POINT, x, y )
-DC_SET_MODE( NtGdiSetBkMode, jBkMode, TRANSPARENT, OPAQUE )
DC_SET_MODE( NtGdiSetPolyFillMode, jFillMode, ALTERNATE, WINDING )
DC_SET_MODE( NtGdiSetROP2, jROP2, R2_BLACK, R2_WHITE )
DC_SET_MODE( NtGdiSetStretchBltMode, jStretchBltMode, BLACKONWHITE, HALFTONE )
-COLORREF STDCALL
+COLORREF FASTCALL
NtGdiSetBkColor(HDC hDC, COLORREF color)
{
COLORREF oldColor;
@@ -181,9 +180,80 @@
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
oldColor = Dc_Attr->crBackgroundClr;
Dc_Attr->crBackgroundClr = color;
+ Dc_Attr->ulBackgroundClr = (ULONG)color;
+ Dc_Attr->ulDirty_ &= ~DIRTY_LINE; // Clear Flag if set.
hBrush = Dc_Attr->hbrush;
DC_UnlockDc(dc);
NtGdiSelectObject(hDC, hBrush);
return oldColor;
}
+INT FASTCALL
+NtGdiSetBkMode(HDC hDC, INT Mode)
+{
+ COLORREF oldMode;
+ PDC dc;
+ PDC_ATTR Dc_Attr;
+
+ if (!(dc = DC_LockDc(hDC)))
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return CLR_INVALID;
+ }
+ Dc_Attr = dc->pDc_Attr;
+ if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ oldMode = Dc_Attr->lBkMode;
+ Dc_Attr->jBkMode = Mode;
+ Dc_Attr->lBkMode = Mode;
+ DC_UnlockDc(dc);
+ return oldMode;
+}
+
+UINT
+FASTCALL
+NtGdiSetTextAlign(HDC hDC,
+ UINT Mode)
+{
+ UINT prevAlign;
+ DC *dc;
+ PDC_ATTR Dc_Attr;
+
+ dc = DC_LockDc(hDC);
+ if (!dc)
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return GDI_ERROR;
+ }
+ Dc_Attr = dc->pDc_Attr;
+ if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ prevAlign = Dc_Attr->lTextAlign;
+ Dc_Attr->lTextAlign = Mode;
+ DC_UnlockDc( dc );
+ return prevAlign;
+}
+
+COLORREF
+FASTCALL
+NtGdiSetTextColor(HDC hDC,
+ COLORREF color)
+{
+ COLORREF oldColor;
+ PDC dc = DC_LockDc(hDC);
+ PDC_ATTR Dc_Attr;
+ HBRUSH hBrush;
+
+ if (!dc)
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return CLR_INVALID;
+ }
+ Dc_Attr = dc->pDc_Attr;
+ if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+
+ oldColor = Dc_Attr->crForegroundClr;
+ Dc_Attr->crForegroundClr = color;
+ hBrush = Dc_Attr->hbrush;
+ DC_UnlockDc( dc );
+ NtGdiSelectObject(hDC, hBrush);
+ return oldColor;
+}
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/text.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/text.c Tue Nov 20 22:56:57 2007
@@ -4029,54 +4029,6 @@
return 0;
}
-UINT
-STDCALL
-NtGdiSetTextAlign(HDC hDC,
- UINT Mode)
-{
- UINT prevAlign;
- DC *dc;
- PDC_ATTR Dc_Attr;
-
- dc = DC_LockDc(hDC);
- if (!dc)
- {
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return GDI_ERROR;
- }
- Dc_Attr = dc->pDc_Attr;
- if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
- prevAlign = Dc_Attr->lTextAlign;
- Dc_Attr->lTextAlign = Mode;
- DC_UnlockDc( dc );
- return prevAlign;
-}
-
-COLORREF
-STDCALL
-NtGdiSetTextColor(HDC hDC,
- COLORREF color)
-{
- COLORREF oldColor;
- PDC dc = DC_LockDc(hDC);
- PDC_ATTR Dc_Attr;
- HBRUSH hBrush;
-
- if (!dc)
- {
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return CLR_INVALID;
- }
- Dc_Attr = dc->pDc_Attr;
- if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
-
- oldColor = Dc_Attr->crForegroundClr;
- Dc_Attr->crForegroundClr = color;
- hBrush = Dc_Attr->hbrush;
- DC_UnlockDc( dc );
- NtGdiSelectObject(hDC, hBrush);
- return oldColor;
-}
BOOL
STDCALL
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Tue Nov 20 22:56:57 2007
@@ -679,18 +679,13 @@
#
#ReactOS specify syscall
NtGdiSelectObject 2
-NtGdiSetBkColor 2
-NtGdiSetBkMode 2
NtGdiSetDIBits 7
NtGdiSetEnhMetaFileBits 2
NtGdiSetGraphicsMode 2
NtGdiSetICMProfile 2
NtGdiSetMapperFlags 2
NtGdiSetPolyFillMode 2
-NtGdiSetROP2 2
NtGdiSetStretchBltMode 2
-NtGdiSetTextAlign 2
-NtGdiSetTextColor 2
NtGdiSetViewportExtEx 4
NtGdiSetViewportOrgEx 4
NtGdiSetWindowExtEx 4
@@ -744,8 +739,6 @@
NtGdiExtTextOut 8
NtGdiGdiComment 3
NtGdiGetAspectRatioFilterEx 2
-NtGdiGetBkColor 1
-NtGdiGetBkMode 1
NtGdiGetColorSpace 1
NtGdiGetCurrentPositionEx 2
NtGdiGetEnhMetaFile 1
@@ -762,10 +755,7 @@
NtGdiGetMapMode 1
NtGdiGetPixelFormat 1
NtGdiGetPolyFillMode 1
-NtGdiGetROP2 1
NtGdiGetStretchBltMode 1
-NtGdiGetTextAlign 1
-NtGdiGetTextColor 1
NtGdiGetTextExtentPoint32 4
NtGdiMoveToEx 4
NtGdiOffsetViewportOrgEx 4