From 914d8319915a795de5be6b80ddb62c0450fba10f Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 7 Aug 2007 05:58:29 +0000 Subject: [PATCH] Removed NtGdiGetDCOrgEx, GetViewportExt/OrgEx, GetWindowExt/OrgEx. Added NtGdiGetDCPoint. Will update ntgdibad.h once we sort out the internal use of these functions. svn path=/trunk/; revision=28209 --- reactos/dll/win32/gdi32/gdi32.def | 10 +- reactos/dll/win32/gdi32/misc/stubs.c | 16 --- reactos/dll/win32/gdi32/objects/dc.c | 115 ++++++++++++++++++- reactos/subsystems/win32/win32k/objects/dc.c | 34 +++++- reactos/subsystems/win32/win32k/w32ksvc.db | 7 +- 5 files changed, 149 insertions(+), 33 deletions(-) diff --git a/reactos/dll/win32/gdi32/gdi32.def b/reactos/dll/win32/gdi32/gdi32.def index 32d08cee5d0..d38a2989553 100644 --- a/reactos/dll/win32/gdi32/gdi32.def +++ b/reactos/dll/win32/gdi32/gdi32.def @@ -366,7 +366,7 @@ GetColorSpace@4 GetCurrentObject@8=NtGdiGetCurrentObject@8 GetCurrentPositionEx@8=NtGdiGetCurrentPositionEx@8 GetDCBrushColor@4 -GetDCOrgEx@8=NtGdiGetDCOrgEx@8 +GetDCOrgEx@8 GetDCPenColor@4 GetDIBColorTable@16=NtGdiGetDIBColorTable@16 GetDIBits@28=NtGdiGetDIBits@28 @@ -454,11 +454,11 @@ GetTextFaceAliasW@12 GetTextMetricsA@8 GetTextMetricsW@8 GetTransform@12 -GetViewportExtEx@8=NtGdiGetViewportExtEx@8 -GetViewportOrgEx@8=NtGdiGetViewportOrgEx@8 +GetViewportExtEx@8 +GetViewportOrgEx@8 GetWinMetaFileBits@20 -GetWindowExtEx@8=NtGdiGetWindowExtEx@8 -GetWindowOrgEx@8=NtGdiGetWindowOrgEx@8 +GetWindowExtEx@8 +GetWindowOrgEx@8 GetWorldTransform@8=NtGdiGetWorldTransform@8 HT_Get8BPPFormatPalette@16 HT_Get8BPPMaskPalette@24 diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index b7a8991db53..101009f47bb 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -97,22 +97,6 @@ ExtCreateRegion( } -/* - * @unimplemented - */ -BOOL -STDCALL -GetAspectRatioFilterEx( - HDC a0, - LPSIZE a1 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - /* * @unimplemented */ diff --git a/reactos/dll/win32/gdi32/objects/dc.c b/reactos/dll/win32/gdi32/objects/dc.c index 1e2d4d0ec9a..2b18dd5296b 100644 --- a/reactos/dll/win32/gdi32/objects/dc.c +++ b/reactos/dll/win32/gdi32/objects/dc.c @@ -356,9 +356,34 @@ GetDCDWord( HDC hDC, INT u, DWORD Result ) } +BOOL +STDCALL +GetAspectRatioFilterEx( + HDC hdc, + LPSIZE lpAspectRatio + ) +{ + return NtGdiGetDCPoint( hdc, GdiGetAspectRatioFilter, (LPPOINT) lpAspectRatio ); +} + + /* * @implemented -*/ + */ +BOOL +STDCALL +GetDCOrgEx( + HDC hdc, + LPPOINT lpPoint + ) +{ + return NtGdiGetDCPoint( hdc, GdiGetDCOrg, lpPoint ); +} + + +/* + * @implemented + */ LONG STDCALL GetDCOrg( @@ -367,7 +392,7 @@ GetDCOrg( { // Officially obsolete by Microsoft POINT Pt; - if (!NtGdiGetDCOrgEx(hdc, &Pt)) + if (!GetDCOrgEx(hdc, &Pt)) return 0; return(MAKELONG(Pt.x, Pt.y)); } @@ -781,3 +806,89 @@ GetStockObject( return Ret; } + +BOOL +STDCALL +GetViewportExtEx( + HDC hdc, + LPSIZE lpSize + ) +{ +#if 0 + PDC_ATTR Dc_Attr; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + + if ( Dc_Attr->flXform & PAGE_EXTENTS_CHANGED ) // Something was updated, go to kernel. +#endif + return NtGdiGetDCPoint( hdc, GdiGetViewPortExt, (LPPOINT) lpSize ); +#if 0 + else + { + lpSize->cx = Dc_Attr->szlViewportExt.cx; + lpSize->cy = Dc_Attr->szlViewportExt.cy; + } + return TRUE; +#endif +} + + +BOOL +STDCALL +GetViewportOrgEx( + HDC hdc, + LPPOINT lpPoint + ) +{ +#if 0 + PDC_ATTR Dc_Attr; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + lpPoint->x = Dc_Attr->ptlViewportOrg.x; + lpPoint->x = Dc_Attr->ptlViewportOrg.x; + return TRUE; +#endif + // Do it this way for now. + return NtGdiGetDCPoint( hdc, GdiGetViewPortOrg, lpPoint ); +} + + +BOOL +STDCALL +GetWindowExtEx( + HDC hdc, + LPSIZE lpSize + ) +{ +#if 0 + PDC_ATTR Dc_Attr; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + lpSize->cx = Dc_Attr->szlWindowExt.cx; + lpSize->cy = Dc_Attr->szlWindowExt.cy; + return TRUE; +#endif + // Do it this way for now. + return NtGdiGetDCPoint( hdc, GdiGetWindowExt, (LPPOINT) lpSize ); +} + + +BOOL +STDCALL +GetWindowOrgEx( + HDC hdc, + LPPOINT lpPoint + ) +{ +#if 0 + PDC_ATTR Dc_Attr; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + lpPoint->x = Dc_Attr->ptlWindowOrg.x; + lpPoint->x = Dc_Attr->ptlWindowOrg.x; + return TRUE; +#endif + // Do it this way for now. + return NtGdiGetDCPoint( hdc, GdiGetWindowOrg, lpPoint ); +} + diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index 5e54bb7f851..3aeb0d02b47 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -1162,11 +1162,12 @@ IntGdiGetDCOrgEx(DC *dc, LPPOINT Point) } BOOL STDCALL -NtGdiGetDCOrgEx(HDC hDC, LPPOINT Point) +NtGdiGetDCPoint( HDC hDC, UINT iPoint, PPOINTL Point) { - BOOL Ret; + BOOL Ret = TRUE; DC *dc; POINT SafePoint; + SIZE Size; NTSTATUS Status = STATUS_SUCCESS; if(!Point) @@ -1182,8 +1183,33 @@ NtGdiGetDCOrgEx(HDC hDC, LPPOINT Point) return FALSE; } - Ret = IntGdiGetDCOrgEx(dc, &SafePoint); - + switch (iPoint) + { + case GdiGetViewPortExt: + IntGetViewportExtEx(dc, &Size); + SafePoint.x = Size.cx; + SafePoint.y = Size.cy; + break; + case GdiGetWindowExt: + IntGetWindowExtEx(dc, &Size); + SafePoint.x = Size.cx; + SafePoint.y = Size.cy; + break; + case GdiGetViewPortOrg: + IntGetViewportOrgEx(dc, &SafePoint); + break; + case GdiGetWindowOrg: + IntGetWindowOrgEx(dc, &SafePoint); + break; + case GdiGetDCOrg: + Ret = IntGdiGetDCOrgEx(dc, &SafePoint); + break; + case GdiGetAspectRatioFilter: + default: + SetLastWin32Error(ERROR_INVALID_PARAMETER); + Ret = FALSE; + break; + } _SEH_TRY { ProbeForWrite(Point, diff --git a/reactos/subsystems/win32/win32k/w32ksvc.db b/reactos/subsystems/win32/win32k/w32ksvc.db index 3e394c6795d..0a91ee518db 100644 --- a/reactos/subsystems/win32/win32k/w32ksvc.db +++ b/reactos/subsystems/win32/win32k/w32ksvc.db @@ -176,7 +176,7 @@ NtGdiGetColorAdjustment 2 # NtGdiGetDCDword 3 # NtGdiGetDCforBitmap 1 # NtGdiGetDCObject 2 -# NtGdiGetDCPoint 3 +NtGdiGetDCPoint 3 NtGdiGetDeviceCaps 2 NtGdiGetDeviceGammaRamp 2 # NtGdiGetDeviceCapsAll 2 @@ -799,7 +799,6 @@ NtGdiGetClipRgn 1 NtGdiGetColorSpace 1 NtGdiGetCurrentObject 2 NtGdiGetCurrentPositionEx 2 -NtGdiGetDCOrgEx 2 NtGdiGetDIBColorTable 4 NtGdiGetDIBits 7 NtGdiGetEnhMetaFile 1 @@ -825,10 +824,6 @@ NtGdiGetSystemPaletteEntries 4 NtGdiGetTextAlign 1 NtGdiGetTextColor 1 NtGdiGetTextExtentPoint32 4 -NtGdiGetViewportExtEx 2 -NtGdiGetViewportOrgEx 2 -NtGdiGetWindowExtEx 2 -NtGdiGetWindowOrgEx 2 NtGdiGetWorldTransform 2 NtGdiLPtoDP 3 NtGdiMoveToEx 4