- Removed NtGdiPoly/Polygon from source, w32ksvc.db and updated ntgdibad.h.

- Renamed the Nt function to GdiCreatePolyPolygonRgn, it is not safe so it will not be named to IntGdiXxX.

svn path=/trunk/; revision=28636
This commit is contained in:
James Tabor
2007-08-28 22:11:55 +00:00
parent 063ab9a152
commit cfae2a0eeb
5 changed files with 8 additions and 209 deletions
-23
View File
@@ -161,14 +161,6 @@ NtGdiCreatePolygonRgn(CONST PPOINT pt,
INT Count,
INT PolyFillMode);
/* Use NtGdiPolyPolyDraw with PolyPolyRgn. */
HRGN
STDCALL
NtGdiCreatePolyPolygonRgn(CONST PPOINT pt,
CONST PINT PolyCounts,
INT Count,
INT PolyFillMode);
/* Meta are user-mode. */
BOOL
STDCALL
@@ -507,21 +499,6 @@ NtGdiPolyTextOut(HDC hDC,
CONST LPPOLYTEXTW txt,
int Count);
/* Use NtGdiPolyPolyDraw with GdiPolyPolygon. */
BOOL
STDCALL
NtGdiPolygon(HDC hDC,
CONST PPOINT Points,
int Count);
/* Use NtGdiPolyPolyDraw with GdiPolyPolygon. */
BOOL
STDCALL
NtGdiPolyPolygon(HDC hDC,
CONST LPPOINT Points,
CONST LPINT PolyCounts,
int Count);
/* Call UserRealizePalette. */
UINT
STDCALL
@@ -18,6 +18,7 @@ HRGN FASTCALL RGNDATA_AllocRgn(INT n);
BOOL INTERNAL_CALL RGNDATA_Cleanup(PVOID ObjectBody);
BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN );
HRGN FASTCALL GdiCreatePolyPolygonRgn(CONST PPOINT, CONST PINT, INT, INT );
#endif
@@ -805,183 +805,6 @@ extern BOOL FillPolygon(PDC dc,
#endif
BOOL
STDCALL
NtGdiPolygon(HDC hDC,
CONST PPOINT UnsafePoints,
int Count)
{
DC *dc;
LPPOINT Safept;
NTSTATUS Status = STATUS_SUCCESS;
BOOL Ret = FALSE;
if ( Count < 2 )
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
_SEH_TRY
{
ProbeForRead(UnsafePoints,
Count * sizeof(POINT),
1);
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
if (!NT_SUCCESS(Status))
{
SetLastNtError(Status);
return FALSE;
}
dc = DC_LockDc(hDC);
if(!dc)
SetLastWin32Error(ERROR_INVALID_HANDLE);
else
{
if (dc->IsIC)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
return TRUE;
}
Safept = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * Count, TAG_SHAPE);
if(!Safept)
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
else
{
_SEH_TRY
{
/* pointer was already probed! */
RtlCopyMemory(Safept,
UnsafePoints,
Count * sizeof(POINT));
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
if(!NT_SUCCESS(Status))
SetLastNtError(Status);
else
Ret = IntGdiPolygon(dc, Safept, Count);
ExFreePool(Safept);
}
DC_UnlockDc(dc);
}
return Ret;
}
BOOL
STDCALL
NtGdiPolyPolygon(HDC hDC,
CONST LPPOINT Points,
CONST LPINT PolyCounts,
int Count)
{
DC *dc;
LPPOINT Safept;
LPINT SafePolyPoints;
NTSTATUS Status = STATUS_SUCCESS;
BOOL Ret;
dc = DC_LockDc(hDC);
if(!dc)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
if (dc->IsIC)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
return TRUE;
}
if(Count > 0)
{
_SEH_TRY
{
ProbeForRead(Points,
Count * sizeof(POINT),
1);
ProbeForRead(PolyCounts,
Count * sizeof(INT),
1);
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
if (!NT_SUCCESS(Status))
{
DC_UnlockDc(dc);
SetLastNtError(Status);
return FALSE;
}
Safept = ExAllocatePoolWithTag(PagedPool, (sizeof(POINT) + sizeof(INT)) * Count, TAG_SHAPE);
if(!Safept)
{
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
SafePolyPoints = (LPINT)&Safept[Count];
_SEH_TRY
{
/* pointers already probed! */
RtlCopyMemory(Safept,
Points,
Count * sizeof(POINT));
RtlCopyMemory(SafePolyPoints,
PolyCounts,
Count * sizeof(INT));
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
if(!NT_SUCCESS(Status))
{
DC_UnlockDc(dc);
ExFreePool(Safept);
SetLastNtError(Status);
return FALSE;
}
}
else
{
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
Ret = IntGdiPolyPolygon(dc, Safept, SafePolyPoints, Count);
ExFreePool(Safept);
DC_UnlockDc(dc);
return Ret;
}
ULONG_PTR
STDCALL
@@ -999,11 +822,11 @@ NtGdiPolyPolyDraw( IN HDC hDC,
INT nPoints, nEmpty, nInvalid, i;
if (iFunc == GdiPolyPolyRgn)
{ // Rename me to FASTCALL GdiCreatePolyPolygonRgn
return (ULONG_PTR) NtGdiCreatePolyPolygonRgn((CONST PPOINT) Points,
(CONST PINT) PolyCounts,
Count,
(INT) hDC);
{
return (ULONG_PTR) GdiCreatePolyPolygonRgn((CONST PPOINT) Points,
(CONST PINT) PolyCounts,
Count,
(INT) hDC);
}
dc = DC_LockDc(hDC);
if(!dc)
@@ -3423,8 +3423,8 @@ IntCreatePolyPolgonRgn(POINT *Pts,
HRGN
STDCALL
NtGdiCreatePolyPolygonRgn(CONST PPOINT pt,
FASTCALL
GdiCreatePolyPolygonRgn(CONST PPOINT pt,
CONST PINT PolyCounts,
INT Count,
INT PolyFillMode)
@@ -804,8 +804,6 @@ NtGdiPolyline 3
NtGdiPolylineTo 3
NtGdiPolyPolyline 4
NtGdiPolyTextOut 3
NtGdiPolygon 3
NtGdiPolyPolygon 4
NtGdiRealizePalette 1
NtGdiRemoveFontResource 1
#