Jacek Caban : gdi32: Use ntgdi names for GetPath and PathToRegion.

Alexandre Julliard julliard at winehq.org
Thu Aug 19 16:00:06 CDT 2021


Module: wine
Branch: master
Commit: 59b2aabd6162e4903cf71afcf85f5ce02e535849
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=59b2aabd6162e4903cf71afcf85f5ce02e535849

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Aug 19 10:24:34 2021 +0200

gdi32: Use ntgdi names for GetPath and PathToRegion.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/gdi32.spec |  4 +--
 dlls/gdi32/path.c     | 75 +++++++++++++++++++++++++--------------------------
 2 files changed, 38 insertions(+), 41 deletions(-)

diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec
index b0b649ffe3b..6aef8c2dbf6 100644
--- a/dlls/gdi32/gdi32.spec
+++ b/dlls/gdi32/gdi32.spec
@@ -326,7 +326,7 @@
 @ stdcall GetOutlineTextMetricsA(long long ptr)
 @ stdcall GetOutlineTextMetricsW(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 GetPixelFormat(long)
 @ stdcall GetPolyFillMode(long)
@@ -388,7 +388,7 @@
 @ stdcall OffsetWindowOrgEx(long long long ptr)
 @ stdcall PaintRgn(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 PlayEnhMetaFile(long long ptr)
 @ stdcall PlayEnhMetaFileRecord(long ptr ptr long)
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 3eed8f78c28..b3735f60b0b 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -624,52 +624,49 @@ 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;
-   DC *dc = get_dc_ptr( hdc );
+    INT ret = -1;
+    DC *dc = get_dc_ptr( hdc );
 
-   if(!dc) return -1;
+    if (!dc) return -1;
 
-   if (!dc->path)
-   {
-      SetLastError(ERROR_CAN_NOT_COMPLETE);
-      goto done;
-   }
+    if (!dc->path)
+    {
+        SetLastError( ERROR_CAN_NOT_COMPLETE );
+    }
+    else if (size == 0)
+    {
+        ret = dc->path->count;
+    }
+    else if (size < dc->path->count)
+    {
+        SetLastError( ERROR_INVALID_PARAMETER );
+    }
+    else
+    {
+        memcpy( points, dc->path->points, sizeof(POINT) * dc->path->count );
+        memcpy( types, dc->path->flags, sizeof(BYTE) * dc->path->count );
 
-   if(nSize==0)
-      ret = dc->path->count;
-   else if(nSize<dc->path->count)
-   {
-      SetLastError(ERROR_INVALID_PARAMETER);
-      goto done;
-   }
-   else
-   {
-      memcpy(pPoints, dc->path->points, sizeof(POINT)*dc->path->count);
-      memcpy(pTypes, dc->path->flags, sizeof(BYTE)*dc->path->count);
+        /* Convert the points to logical coordinates */
+        if (dp_to_lp( dc, points, dc->path->count ))
+            ret = dc->path->count;
+        else
+            /* FIXME: Is this the correct value? */
+            SetLastError( ERROR_CAN_NOT_COMPLETE );
+    }
 
-      /* Convert the points to logical coordinates */
-      if(!dp_to_lp(dc, pPoints, dc->path->count))
-      {
-	 /* FIXME: Is this the correct value? */
-         SetLastError(ERROR_CAN_NOT_COMPLETE);
-	goto done;
-      }
-     else ret = dc->path->count;
-   }
- done:
-   release_dc_ptr( dc );
-   return ret;
+    release_dc_ptr( dc );
+    return ret;
 }
 
 
 /***********************************************************************
- *           PathToRegion    (GDI32.@)
+ *           NtGdiPathToRegion    (win32u.@)
  */
-HRGN WINAPI PathToRegion(HDC hdc)
+HRGN WINAPI NtGdiPathToRegion( HDC hdc )
 {
     HRGN ret = 0;
     DC *dc = get_dc_ptr( hdc );
@@ -721,7 +718,7 @@ BOOL WINAPI NtGdiSelectClipPath( HDC hdc, INT mode )
     BOOL ret = FALSE;
     HRGN rgn;
 
-    if ((rgn = PathToRegion( hdc )))
+    if ((rgn = NtGdiPathToRegion( hdc )))
     {
         ret = NtGdiExtSelectClipRgn( hdc, rgn, mode ) != ERROR;
         DeleteObject( rgn );
@@ -2008,21 +2005,21 @@ BOOL CDECL nulldrv_CloseFigure( 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 );
     return TRUE;
 }
 
 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 );
     return TRUE;
 }
 
 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 );
     return TRUE;
 }




More information about the wine-cvs mailing list