Author: jimtabor
Date: Wed Aug 8 04:46:11 2007
New Revision: 28234
URL:
http://svn.reactos.org/svn/reactos?rev=28234&view=rev
Log:
Moved CurrentPos to Dc_Attr.ptlCurrent. Plugged in NtGdiGet-AndSetDCDword with out any
internal support code. Still sorting out internal calls to old NtGdi functions. Ntgdibad.h
will be updated on each removed external call of these functions are gone from
w32ksvc.db.
Modified:
trunk/reactos/subsystems/win32/win32k/include/dc.h
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/objects/line.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
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 Wed Aug 8 04:46:11 2007
@@ -46,8 +46,6 @@
FARPROC lpfnPrint; /* AbortProc for Printing */
#endif
- INT CursPosX; /* Current position */
- INT CursPosY;
INT ArcDirection;
XFORM xformWorld2Wnd; /* World-to-window transformation */
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 Wed Aug 8 04:46:11 2007
@@ -1150,7 +1150,7 @@
return SelObject;
}
-DC_GET_VAL_EX ( GetCurrentPositionEx, w.CursPosX, w.CursPosY, POINT, x, y )
+DC_GET_VAL_EX ( GetCurrentPositionEx, Dc_Attr.ptlCurrent.x, Dc_Attr.ptlCurrent.y, POINT,
x, y )
BOOL FASTCALL
IntGdiGetDCOrgEx(DC *dc, LPPOINT Point)
@@ -1317,8 +1317,8 @@
newdc->w.DCOrgX = dc->w.DCOrgX;
newdc->w.DCOrgY = dc->w.DCOrgY;
#endif
- newdc->w.CursPosX = dc->w.CursPosX;
- newdc->w.CursPosY = dc->w.CursPosY;
+ newdc->Dc_Attr.ptlCurrent.x = dc->Dc_Attr.ptlCurrent.x;
+ newdc->Dc_Attr.ptlCurrent.y = dc->Dc_Attr.ptlCurrent.y;
newdc->w.ArcDirection = dc->w.ArcDirection;
newdc->w.xformWorld2Wnd = dc->w.xformWorld2Wnd;
newdc->w.xformWorld2Vport = dc->w.xformWorld2Vport;
@@ -1398,8 +1398,8 @@
dc->w.DCOrgX = dcs->w.DCOrgX;
dc->w.DCOrgY = dcs->w.DCOrgY;
#endif
- dc->w.CursPosX = dcs->w.CursPosX;
- dc->w.CursPosY = dcs->w.CursPosY;
+ dc->Dc_Attr.ptlCurrent.x = dcs->Dc_Attr.ptlCurrent.x;
+ dc->Dc_Attr.ptlCurrent.y = dcs->Dc_Attr.ptlCurrent.y;
dc->w.ArcDirection = dcs->w.ArcDirection;
dc->w.xformWorld2Wnd = dcs->w.xformWorld2Wnd;
@@ -2127,6 +2127,167 @@
return wRet;
}
+
+
+BOOL
+STDCALL
+NtGdiGetDCDword(
+ HDC hDC,
+ UINT u,
+ DWORD *Result
+ )
+{
+ BOOL Ret = TRUE;
+ DC *dc;
+ DWORD SafeResult = 0;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ if(!Result)
+ {
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ dc = DC_LockDc(hDC);
+ if(!dc)
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ switch (u)
+ {
+ case GdiGetJournal:
+ break;
+ case GdiGetRelAbs:
+ break;
+ case GdiGetBreakExtra:
+ break;
+ case GdiGerCharBreak:
+ break;
+ case GdiGetArcDirection:
+ break;
+ case GdiGetEMFRestorDc:
+ break;
+ case GdiGetFontLanguageInfo:
+ break;
+ case GdiGetIsMemDc:
+ break;
+ case GdiGetMapMode:
+ break;
+ case GdiGetTextCharExtra:
+ break;
+ default:
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ Ret = FALSE;
+ break;
+ }
+
+ if (Ret)
+ {
+ _SEH_TRY
+ {
+ ProbeForWrite(Result,
+ sizeof(DWORD),
+ 1);
+ *Result = SafeResult;
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+ }
+
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ DC_UnlockDc(dc);
+ return FALSE;
+ }
+
+ DC_UnlockDc(dc);
+ return Ret;
+}
+
+BOOL
+STDCALL
+NtGdiGetAndSetDCDword(
+ HDC hDC,
+ UINT u,
+ DWORD dwIn,
+ DWORD *Result
+ )
+{
+ BOOL Ret = TRUE;
+ DC *dc;
+ DWORD SafeResult = 0;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ if(!Result)
+ {
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ dc = DC_LockDc(hDC);
+ if(!dc)
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ switch (u)
+ {
+ case GdtGetSetCopyCount:
+ break;
+ case GdiGetSetTextAlign:
+ break;
+ case GdiGetSetRelAbs:
+ break;
+ case GdiGetSetTextCharExtra:
+ break;
+ case GdiGetSetSelectFont:
+ break;
+ case GdiGetSetMapperFlagsInternal:
+ break;
+ case GdiGetSetMapMode:
+ break;
+ case GdiGetSetArcDirection:
+ break;
+ default:
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ Ret = FALSE;
+ break;
+ }
+
+ if (Ret)
+ {
+ _SEH_TRY
+ {
+ ProbeForWrite(Result,
+ sizeof(DWORD),
+ 1);
+ *Result = SafeResult;
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+ }
+
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ DC_UnlockDc(dc);
+ return FALSE;
+ }
+
+ DC_UnlockDc(dc);
+ return Ret;
+}
+
DC_SET_MODE( NtGdiSetBkMode, Dc_Attr.jBkMode, TRANSPARENT, OPAQUE )
DC_SET_MODE( NtGdiSetPolyFillMode, Dc_Attr.jFillMode, ALTERNATE, WINDING )
Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/line.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/line.c Wed Aug 8 04:46:11 2007
@@ -35,11 +35,11 @@
if ( Point )
{
- Point->x = dc->w.CursPosX;
- Point->y = dc->w.CursPosY;
- }
- dc->w.CursPosX = X;
- dc->w.CursPosY = Y;
+ Point->x = dc->Dc_Attr.ptlCurrent.x;
+ Point->y = dc->Dc_Attr.ptlCurrent.y;
+ }
+ dc->Dc_Attr.ptlCurrent.x = X;
+ dc->Dc_Attr.ptlCurrent.y = Y;
PathIsOpen = PATH_IsPathOpen(dc->w.path);
@@ -67,8 +67,8 @@
if (Ret)
{
// FIXME - PATH_LineTo should maybe do this...
- dc->w.CursPosX = XEnd;
- dc->w.CursPosY = YEnd;
+ dc->Dc_Attr.ptlCurrent.x = XEnd;
+ dc->Dc_Attr.ptlCurrent.y = YEnd;
}
return Ret;
}
@@ -81,8 +81,8 @@
return FALSE;
}
- Points[0].x = dc->w.CursPosX;
- Points[0].y = dc->w.CursPosY;
+ Points[0].x = dc->Dc_Attr.ptlCurrent.x;
+ Points[0].y = dc->Dc_Attr.ptlCurrent.y;
Points[1].x = XEnd;
Points[1].y = YEnd;
@@ -122,8 +122,8 @@
if (Ret)
{
- dc->w.CursPosX = XEnd;
- dc->w.CursPosY = YEnd;
+ dc->Dc_Attr.ptlCurrent.x = XEnd;
+ dc->Dc_Attr.ptlCurrent.y = YEnd;
}
return Ret;
@@ -172,8 +172,8 @@
npt = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * (Count + 1), TAG_BEZIER);
if ( npt )
{
- npt[0].x = dc->w.CursPosX;
- npt[0].y = dc->w.CursPosY;
+ npt[0].x = dc->Dc_Attr.ptlCurrent.x;
+ npt[0].y = dc->Dc_Attr.ptlCurrent.y;
memcpy(npt + 1, pt, sizeof(POINT) * Count);
ret = IntGdiPolyBezier(dc, npt, Count+1);
ExFreePool(npt);
@@ -181,8 +181,8 @@
}
if ( ret )
{
- dc->w.CursPosX = pt[Count-1].x;
- dc->w.CursPosY = pt[Count-1].y;
+ dc->Dc_Attr.ptlCurrent.x = pt[Count-1].x;
+ dc->Dc_Attr.ptlCurrent.y = pt[Count-1].y;
}
return ret;
@@ -262,8 +262,8 @@
POINT *pts = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * (Count + 1),
TAG_SHAPE);
if ( pts )
{
- pts[0].x = dc->w.CursPosX;
- pts[0].y = dc->w.CursPosY;
+ pts[0].x = dc->Dc_Attr.ptlCurrent.x;
+ pts[0].y = dc->Dc_Attr.ptlCurrent.y;
memcpy( pts + 1, pt, sizeof(POINT) * Count);
ret = IntGdiPolyline(dc, pts, Count + 1);
ExFreePool(pts);
@@ -271,8 +271,8 @@
}
if ( ret )
{
- dc->w.CursPosX = pt[Count-1].x;
- dc->w.CursPosY = pt[Count-1].y;
+ dc->Dc_Attr.ptlCurrent.x = pt[Count-1].x;
+ dc->Dc_Attr.ptlCurrent.y = pt[Count-1].y;
}
return ret;
@@ -636,8 +636,8 @@
}
/* if no moveto occurs, we will close the figure here */
- lastmove.x = dc->w.CursPosX;
- lastmove.y = dc->w.CursPosY;
+ lastmove.x = dc->Dc_Attr.ptlCurrent.x;
+ lastmove.y = dc->Dc_Attr.ptlCurrent.y;
/* now let's draw */
for( i = 0; i < cCount; i++ )
@@ -645,16 +645,16 @@
if( lpbTypes[i] == PT_MOVETO )
{
IntGdiMoveToEx( dc, lppt[i].x, lppt[i].y, NULL );
- lastmove.x = dc->w.CursPosX;
- lastmove.y = dc->w.CursPosY;
+ lastmove.x = dc->Dc_Attr.ptlCurrent.x;
+ lastmove.y = dc->Dc_Attr.ptlCurrent.y;
}
else if( lpbTypes[i] & PT_LINETO )
IntGdiLineTo( dc, lppt[i].x, lppt[i].y );
else if( lpbTypes[i] & PT_BEZIERTO )
{
POINT pts[4];
- pts[0].x = dc->w.CursPosX;
- pts[0].y = dc->w.CursPosY;
+ pts[0].x = dc->Dc_Attr.ptlCurrent.x;
+ pts[0].y = dc->Dc_Attr.ptlCurrent.y;
RtlCopyMemory(pts + 1, &lppt[i], sizeof(POINT) * 3);
IntGdiPolyBezier(dc, pts, 4);
i += 2;
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 Wed Aug 8 04:46:11 2007
@@ -161,7 +161,7 @@
# NtGdiForceUFIMapping 2
NtGdiFrameRgn 5
# NtGdiFullscreenControl 5
-# NtGdiGetAndSetDCDword 4
+NtGdiGetAndSetDCDword 4
# NtGdiGetAppClipBox 2
NtGdiGetBitmapBits 3
# NtGdiGetBitmapDimension 2
@@ -173,7 +173,7 @@
# NtGdiGetCharWidthInfo 2
NtGdiGetColorAdjustment 2
# NtGdiGetColorSpaceforBitmap 1
-# NtGdiGetDCDword 3
+NtGdiGetDCDword 3
# NtGdiGetDCforBitmap 1
# NtGdiGetDCObject 2
NtGdiGetDCPoint 3