- Removed NtGdiLPTODP/DPTOLP from w32ksvc.db and updated ntgdibad.h.

- Connected the gdi32 parts.

svn path=/trunk/; revision=28270
This commit is contained in:
James Tabor 2007-08-10 07:39:46 +00:00
parent 1ed0850348
commit be5bce8b2a
5 changed files with 35 additions and 137 deletions

View file

@ -89,7 +89,7 @@ CreateRoundRectRgn@24=NtGdiCreateRoundRectRgn@24
CreateScalableFontResourceA@16
CreateScalableFontResourceW@16
CreateSolidBrush@4
DPtoLP@12=NtGdiDPtoLP@12
DPtoLP@12
DeleteColorSpace@4
DeleteDC@4=NtGdiDeleteObjectApp@4
DeleteEnhMetaFile@4
@ -464,7 +464,7 @@ HT_Get8BPPFormatPalette@16
HT_Get8BPPMaskPalette@24
IntersectClipRect@20=NtGdiIntersectClipRect@20
InvertRgn@8=NtGdiInvertRgn@8
LPtoDP@12=NtGdiLPtoDP@12
LPtoDP@12
LineDDA@24
LineTo@12=NtGdiLineTo@12
MaskBlt@48

View file

@ -103,7 +103,7 @@ DPtoLP ( HDC hDC, LPPOINT Points, INT Count )
PAGE_EXTENTS_CHANGED | // do processing in kernel space.
WORLD_XFORM_CHANGED )
#endif
return NtGdiTransformPoints( hDC, Points, Points, Count, 0); // Last is 0 or 2
return NtGdiTransformPoints( hDC, Points, Points, Count, GdiDpToLp); // DPtoLP mode.
#if 0
else
{
@ -129,7 +129,7 @@ LPtoDP ( HDC hDC, LPPOINT Points, INT Count )
PAGE_EXTENTS_CHANGED |
WORLD_XFORM_CHANGED )
#endif
return NtGdiTransformPoints( hDC, Points, Points, Count, 0);
return NtGdiTransformPoints( hDC, Points, Points, Count, GdiLpToDp); // LPtoDP mode
#if 0
else
{

View file

@ -184,15 +184,6 @@ NtGdiCreatePolyPolygonRgn(CONST PPOINT pt,
INT Count,
INT PolyFillMode);
/* Use NtGdiTransformPoints with GdiDpToLp. */
BOOL
STDCALL
NtGdiDPtoLP (
HDC hDC,
LPPOINT Points,
int Count
);
/* Meta are user-mode. */
BOOL
STDCALL
@ -495,15 +486,6 @@ NtGdiGetWorldTransform (
LPXFORM Xform
);
/* Use NtGdiTransformPoints with GdiDpToLp */
BOOL
STDCALL
NtGdiLPtoDP (
HDC hDC,
LPPOINT Points,
int Count
);
/* Needs to be done in user-mode. */
BOOL
STDCALL

View file

@ -157,99 +157,6 @@ IntDPtoLP ( PDC dc, LPPOINT Points, INT Count )
CoordDPtoLP ( dc, &Points[i] );
}
/*!
* Converts points from device coordinates into logical coordinates. Conversion depends on the mapping mode,
* world transfrom, viewport origin settings for the given device context.
* \param hDC device context.
* \param Points an array of POINT structures (in/out).
* \param Count number of elements in the array of POINT structures.
* \return TRUE if success.
*/
BOOL STDCALL
NtGdiDPtoLP(HDC hDC,
LPPOINT UnsafePoints,
int Count)
{
PDC dc;
NTSTATUS Status = STATUS_SUCCESS;
LPPOINT Points;
ULONG Size;
dc = DC_LockDc(hDC);
if (!dc)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
if (!UnsafePoints || Count <= 0)
{
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
Size = Count * sizeof(POINT);
Points = (LPPOINT)ExAllocatePoolWithTag(PagedPool, Size, TAG_COORD);
if(!Points)
{
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
_SEH_TRY
{
ProbeForWrite(UnsafePoints,
Size,
1);
RtlCopyMemory(Points,
UnsafePoints,
Size);
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
if(!NT_SUCCESS(Status))
{
DC_UnlockDc(dc);
ExFreePool(Points);
SetLastNtError(Status);
return FALSE;
}
IntDPtoLP(dc, Points, Count);
_SEH_TRY
{
/* pointer was already probed! */
RtlCopyMemory(UnsafePoints,
Points,
Size);
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
if(!NT_SUCCESS(Status))
{
DC_UnlockDc(dc);
ExFreePool(Points);
SetLastNtError(Status);
return FALSE;
}
DC_UnlockDc(dc);
ExFreePool(Points);
return TRUE;
}
int
FASTCALL
IntGetGraphicsMode ( PDC dc )
@ -390,8 +297,13 @@ IntLPtoDP ( PDC dc, LPPOINT Points, INT Count )
* \param Count number of elements in the array of POINT structures.
* \return TRUE if success.
*/
BOOL STDCALL
NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
BOOL
APIENTRY
NtGdiTransformPoints( HDC hDC,
PPOINT UnsafePtsIn,
PPOINT UnsafePtOut,
INT Count,
INT iMode )
{
PDC dc;
NTSTATUS Status = STATUS_SUCCESS;
@ -405,7 +317,7 @@ NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
return FALSE;
}
if (!UnsafePoints || Count <= 0)
if (!UnsafePtsIn || !UnsafePtOut || Count <= 0)
{
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
@ -424,11 +336,14 @@ NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
_SEH_TRY
{
ProbeForWrite(UnsafePoints,
ProbeForWrite(UnsafePtOut,
Size,
1);
ProbeForRead(UnsafePtsIn,
Size,
1);
RtlCopyMemory(Points,
UnsafePoints,
UnsafePtsIn,
Size);
}
_SEH_HANDLE
@ -445,12 +360,28 @@ NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
return FALSE;
}
IntLPtoDP(dc, Points, Count);
switch (iMode)
{
case GdiDpToLp:
IntDPtoLP(dc, Points, Count);
break;
case GdiLpToDp:
IntLPtoDP(dc, Points, Count);
break;
case 2: // Not supported yet. Need testing.
default:
{
DC_UnlockDc(dc);
ExFreePool(Points);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
}
_SEH_TRY
{
/* pointer was already probed! */
RtlCopyMemory(UnsafePoints,
RtlCopyMemory(UnsafePtOut,
Points,
Size);
}
@ -473,19 +404,6 @@ NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
return TRUE;
}
BOOL
APIENTRY
NtGdiTransformPoints( HDC hdc,
PPOINT UnsafePtsIn,
PPOINT UnsafePtOut,
INT Count,
INT iMode )
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
STDCALL
NtGdiModifyWorldTransform(HDC hDC,

View file

@ -770,7 +770,6 @@ NtGdiCreatePalette 1
NtGdiCreatePolygonRgn 3
NtGdiCreatePolyPolygonRgn 4
NtGdiCreateScalableFontResource 4
NtGdiDPtoLP 3
NtGdiDeleteEnhMetaFile 1
NtGdiDeleteObject 1
NtGdiEnumEnhMetaFile 5
@ -816,7 +815,6 @@ NtGdiGetTextAlign 1
NtGdiGetTextColor 1
NtGdiGetTextExtentPoint32 4
NtGdiGetWorldTransform 2
NtGdiLPtoDP 3
NtGdiMoveToEx 4
NtGdiOffsetViewportOrgEx 4
NtGdiOffsetWindowOrgEx 4