gdi32: Use ntgdi names for GetPath and PathToRegion.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-08-19 10:24:34 +02:00 committed by Alexandre Julliard
parent 37a5c8b9f3
commit 59b2aabd61
2 changed files with 38 additions and 41 deletions

View File

@ -326,7 +326,7 @@
@ stdcall GetOutlineTextMetricsA(long long ptr) @ stdcall GetOutlineTextMetricsA(long long ptr)
@ stdcall GetOutlineTextMetricsW(long long ptr) @ stdcall GetOutlineTextMetricsW(long long ptr)
@ stdcall GetPaletteEntries(long long long ptr) @ stdcall GetPaletteEntries(long long long ptr)
@ stdcall GetPath(long ptr ptr long) @ stdcall GetPath(long ptr ptr long) NtGdiGetPath
@ stdcall GetPixel(long long long) NtGdiGetPixel @ stdcall GetPixel(long long long) NtGdiGetPixel
@ stdcall GetPixelFormat(long) @ stdcall GetPixelFormat(long)
@ stdcall GetPolyFillMode(long) @ stdcall GetPolyFillMode(long)
@ -388,7 +388,7 @@
@ stdcall OffsetWindowOrgEx(long long long ptr) @ stdcall OffsetWindowOrgEx(long long long ptr)
@ stdcall PaintRgn(long long) @ stdcall PaintRgn(long long)
@ stdcall PatBlt(long long long long long long) @ stdcall PatBlt(long long long long long long)
@ stdcall PathToRegion(long) @ stdcall PathToRegion(long) NtGdiPathToRegion
@ stdcall Pie(long long long long long long long long long) @ stdcall Pie(long long long long long long long long long)
@ stdcall PlayEnhMetaFile(long long ptr) @ stdcall PlayEnhMetaFile(long long ptr)
@ stdcall PlayEnhMetaFileRecord(long ptr ptr long) @ stdcall PlayEnhMetaFileRecord(long ptr ptr long)

View File

@ -624,9 +624,9 @@ BOOL WINAPI NtGdiCloseFigure( HDC hdc )
/*********************************************************************** /***********************************************************************
* GetPath (GDI32.@) * NtGdiGetPath (win32u.@)
*/ */
INT WINAPI GetPath(HDC hdc, LPPOINT pPoints, LPBYTE pTypes, INT nSize) INT WINAPI NtGdiGetPath( HDC hdc, POINT *points, BYTE *types, INT size )
{ {
INT ret = -1; INT ret = -1;
DC *dc = get_dc_ptr( hdc ); DC *dc = get_dc_ptr( hdc );
@ -636,40 +636,37 @@ INT WINAPI GetPath(HDC hdc, LPPOINT pPoints, LPBYTE pTypes, INT nSize)
if (!dc->path) if (!dc->path)
{ {
SetLastError( ERROR_CAN_NOT_COMPLETE ); SetLastError( ERROR_CAN_NOT_COMPLETE );
goto done;
} }
else if (size == 0)
if(nSize==0) {
ret = dc->path->count; ret = dc->path->count;
else if(nSize<dc->path->count) }
else if (size < dc->path->count)
{ {
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
goto done;
} }
else else
{ {
memcpy(pPoints, dc->path->points, sizeof(POINT)*dc->path->count); memcpy( points, dc->path->points, sizeof(POINT) * dc->path->count );
memcpy(pTypes, dc->path->flags, sizeof(BYTE)*dc->path->count); memcpy( types, dc->path->flags, sizeof(BYTE) * dc->path->count );
/* Convert the points to logical coordinates */ /* Convert the points to logical coordinates */
if(!dp_to_lp(dc, pPoints, dc->path->count)) if (dp_to_lp( dc, points, dc->path->count ))
{ ret = dc->path->count;
else
/* FIXME: Is this the correct value? */ /* FIXME: Is this the correct value? */
SetLastError( ERROR_CAN_NOT_COMPLETE ); SetLastError( ERROR_CAN_NOT_COMPLETE );
goto done;
} }
else ret = dc->path->count;
}
done:
release_dc_ptr( dc ); release_dc_ptr( dc );
return ret; return ret;
} }
/*********************************************************************** /***********************************************************************
* PathToRegion (GDI32.@) * NtGdiPathToRegion (win32u.@)
*/ */
HRGN WINAPI PathToRegion(HDC hdc) HRGN WINAPI NtGdiPathToRegion( HDC hdc )
{ {
HRGN ret = 0; HRGN ret = 0;
DC *dc = get_dc_ptr( hdc ); DC *dc = get_dc_ptr( hdc );
@ -721,7 +718,7 @@ BOOL WINAPI NtGdiSelectClipPath( HDC hdc, INT mode )
BOOL ret = FALSE; BOOL ret = FALSE;
HRGN rgn; HRGN rgn;
if ((rgn = PathToRegion( hdc ))) if ((rgn = NtGdiPathToRegion( hdc )))
{ {
ret = NtGdiExtSelectClipRgn( hdc, rgn, mode ) != ERROR; ret = NtGdiExtSelectClipRgn( hdc, rgn, mode ) != ERROR;
DeleteObject( rgn ); DeleteObject( rgn );
@ -2008,21 +2005,21 @@ BOOL CDECL nulldrv_CloseFigure( PHYSDEV dev )
BOOL CDECL nulldrv_FillPath( PHYSDEV dev ) BOOL CDECL nulldrv_FillPath( PHYSDEV dev )
{ {
if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE; if (NtGdiGetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
NtGdiAbortPath( dev->hdc ); NtGdiAbortPath( dev->hdc );
return TRUE; return TRUE;
} }
BOOL CDECL nulldrv_StrokeAndFillPath( PHYSDEV dev ) BOOL CDECL nulldrv_StrokeAndFillPath( PHYSDEV dev )
{ {
if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE; if (NtGdiGetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
NtGdiAbortPath( dev->hdc ); NtGdiAbortPath( dev->hdc );
return TRUE; return TRUE;
} }
BOOL CDECL nulldrv_StrokePath( PHYSDEV dev ) BOOL CDECL nulldrv_StrokePath( PHYSDEV dev )
{ {
if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE; if (NtGdiGetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
NtGdiAbortPath( dev->hdc ); NtGdiAbortPath( dev->hdc );
return TRUE; return TRUE;
} }