Jacek Caban : win32u: Use syscall interface for pen constructors.

Alexandre Julliard julliard at winehq.org
Tue Oct 12 16:12:48 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Oct 12 15:29:19 2021 +0200

win32u: Use syscall interface for pen constructors.

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/win32u/gdiobj.c         |  2 --
 dlls/win32u/syscall.c        |  2 ++
 dlls/win32u/win32u.spec      |  4 ++--
 dlls/win32u/win32u_private.h |  5 -----
 dlls/win32u/wrappers.c       | 14 --------------
 dlls/wow64win/gdi.c          | 29 +++++++++++++++++++++++++++++
 dlls/wow64win/syscall.h      |  2 ++
 7 files changed, 35 insertions(+), 23 deletions(-)

diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index 4f6304ad883..1223644e4e9 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -1078,7 +1078,6 @@ static struct unix_funcs unix_funcs =
     NtGdiCreateCompatibleDC,
     NtGdiCreateDIBitmapInternal,
     NtGdiCreateMetafileDC,
-    NtGdiCreatePen,
     NtGdiDdDDICheckVidPnExclusiveOwnership,
     NtGdiDdDDICloseAdapter,
     NtGdiDdDDICreateDCFromMemory,
@@ -1100,7 +1099,6 @@ static struct unix_funcs unix_funcs =
     NtGdiEndPage,
     NtGdiEnumFonts,
     NtGdiExcludeClipRect,
-    NtGdiExtCreatePen,
     NtGdiExtEscape,
     NtGdiExtFloodFill,
     NtGdiExtTextOutW,
diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c
index e1c94b0c210..c4f9edeead8 100644
--- a/dlls/win32u/syscall.c
+++ b/dlls/win32u/syscall.c
@@ -46,6 +46,7 @@ static void * const syscalls[] =
     NtGdiCreateHatchBrushInternal,
     NtGdiCreatePaletteInternal,
     NtGdiCreatePatternBrushInternal,
+    NtGdiCreatePen,
     NtGdiCreateRectRgn,
     NtGdiCreateRoundRectRgn,
     NtGdiCreateSolidBrush,
@@ -53,6 +54,7 @@ static void * const syscalls[] =
     NtGdiDescribePixelFormat,
     NtGdiDrawStream,
     NtGdiEqualRgn,
+    NtGdiExtCreatePen,
     NtGdiExtCreateRegion,
     NtGdiExtGetObjectW,
     NtGdiFlattenPath,
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index a2b864f65bb..d9570fc5a89 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -158,7 +158,7 @@
 @ stub NtGdiCreateOPMProtectedOutputs
 @ stdcall -syscall NtGdiCreatePaletteInternal(ptr long)
 @ stdcall -syscall NtGdiCreatePatternBrushInternal(long long long)
-@ stdcall NtGdiCreatePen(long long long long)
+@ stdcall -syscall NtGdiCreatePen(long long long long)
 @ stdcall -syscall NtGdiCreateRectRgn(long long long long)
 @ stdcall -syscall NtGdiCreateRoundRectRgn(long long long long long long)
 @ stub NtGdiCreateServerMetaFile
@@ -418,7 +418,7 @@
 @ stdcall -syscall NtGdiEqualRgn(long long)
 @ stub NtGdiEudcLoadUnloadLink
 @ stdcall NtGdiExcludeClipRect(long long long long long)
-@ stdcall NtGdiExtCreatePen(long long long long long long long ptr long long long)
+@ stdcall -syscall NtGdiExtCreatePen(long long long long long long long ptr long long long)
 @ stdcall -syscall NtGdiExtCreateRegion(ptr long ptr)
 @ stdcall NtGdiExtEscape(long wstr long long long ptr long ptr)
 @ stdcall NtGdiExtFloodFill(long long long long long)
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index e7bfe13b2df..0fad351766d 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -63,7 +63,6 @@ struct unix_funcs
                                                      UINT coloruse, UINT max_info, UINT max_bits,
                                                      ULONG flags, HANDLE xform );
     HDC      (WINAPI *pNtGdiCreateMetafileDC)( HDC hdc );
-    HPEN     (WINAPI *pNtGdiCreatePen)( INT style, INT width, COLORREF color, HBRUSH brush );
     NTSTATUS (WINAPI *pNtGdiDdDDICheckVidPnExclusiveOwnership)( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc );
     NTSTATUS (WINAPI *pNtGdiDdDDICloseAdapter)( const D3DKMT_CLOSEADAPTER *desc );
     NTSTATUS (WINAPI *pNtGdiDdDDICreateDCFromMemory)( D3DKMT_CREATEDCFROMMEMORY *desc );
@@ -87,10 +86,6 @@ struct unix_funcs
     BOOL     (WINAPI *pNtGdiEnumFonts)( HDC hdc, ULONG type, ULONG win32_compat, ULONG face_name_len,
                                         const WCHAR *face_name, ULONG charset, ULONG *count, void *buf );
     INT      (WINAPI *pNtGdiExcludeClipRect)( HDC hdc, INT left, INT top, INT right, INT bottom );
-    HPEN     (WINAPI *pNtGdiExtCreatePen)( DWORD style, DWORD width, ULONG brush_style, ULONG color,
-                                           ULONG_PTR client_hatch, ULONG_PTR hatch, DWORD style_count,
-                                           const DWORD *style_bits, ULONG dib_size, BOOL old_style,
-                                           HBRUSH brush );
     INT      (WINAPI *pNtGdiExtEscape)( HDC hdc, WCHAR *driver, INT driver_id, INT escape, INT input_size,
                                         const char *input, INT output_size, char *output );
     BOOL     (WINAPI *pNtGdiExtFloodFill)( HDC hdc, INT x, INT y, COLORREF color, UINT type );
diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c
index 957646dc7c3..e0521d8a03b 100644
--- a/dlls/win32u/wrappers.c
+++ b/dlls/win32u/wrappers.c
@@ -105,11 +105,6 @@ HDC WINAPI NtGdiCreateMetafileDC( HDC hdc )
     return unix_funcs->pNtGdiCreateMetafileDC( hdc );
 }
 
-HPEN WINAPI NtGdiCreatePen( INT style, INT width, COLORREF color, HBRUSH brush )
-{
-    return unix_funcs->pNtGdiCreatePen( style, width, color, brush );
-}
-
 BOOL WINAPI NtGdiDeleteObjectApp( HGDIOBJ obj )
 {
     return unix_funcs->pNtGdiDeleteObjectApp( obj );
@@ -153,15 +148,6 @@ INT WINAPI NtGdiExcludeClipRect( HDC hdc, INT left, INT top, INT right, INT bott
     return unix_funcs->pNtGdiExcludeClipRect( hdc, left, top, right, bottom );
 }
 
-HPEN WINAPI NtGdiExtCreatePen( DWORD style, DWORD width, ULONG brush_style, ULONG color,
-                               ULONG_PTR client_hatch, ULONG_PTR hatch, DWORD style_count,
-                               const DWORD *style_bits, ULONG dib_size, BOOL old_style,
-                               HBRUSH brush )
-{
-    return unix_funcs->pNtGdiExtCreatePen( style, width, brush_style, color, client_hatch, hatch, style_count,
-                                           style_bits, dib_size, old_style, brush );
-}
-
 INT WINAPI NtGdiExtEscape( HDC hdc, WCHAR *driver, INT driver_id, INT escape, INT input_size,
                            const char *input, INT output_size, char *output )
 {
diff --git a/dlls/wow64win/gdi.c b/dlls/wow64win/gdi.c
index daba653f214..9462945d88f 100644
--- a/dlls/wow64win/gdi.c
+++ b/dlls/wow64win/gdi.c
@@ -164,6 +164,35 @@ NTSTATUS WINAPI wow64_NtGdiCreateSolidBrush( UINT *args )
     return HandleToUlong( NtGdiCreateSolidBrush( color, brush ));
 }
 
+NTSTATUS WINAPI wow64_NtGdiCreatePen( UINT *args )
+{
+    INT style = get_ulong( &args );
+    INT width = get_ulong( &args );
+    COLORREF color = get_ulong( &args );
+    HBRUSH brush = get_handle( &args );
+
+    return HandleToUlong( NtGdiCreatePen( style, width, color, brush ));
+}
+
+NTSTATUS WINAPI wow64_NtGdiExtCreatePen( UINT *args )
+{
+    DWORD style = get_ulong( &args );
+    DWORD width = get_ulong( &args );
+    ULONG brush_style = get_ulong( &args );
+    ULONG color = get_ulong( &args );
+    ULONG_PTR client_hatch = get_ulong( &args );
+    ULONG_PTR hatch = get_ulong( &args );
+    DWORD style_count = get_ulong( &args );
+    const DWORD *style_bits = get_ptr( &args );
+    ULONG dib_size = get_ulong( &args );
+    BOOL old_style = get_ulong( &args );
+    HBRUSH brush = get_handle( &args );
+
+    return HandleToUlong( NtGdiExtCreatePen( style, width, brush_style, color, client_hatch,
+                                             hatch, style_count, style_bits, dib_size,
+                                             old_style, brush ));
+}
+
 NTSTATUS WINAPI wow64_NtGdiCreateRectRgn( UINT *args )
 {
     INT left = get_ulong( &args );
diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h
index a5a38548f5e..5c43ce63a21 100644
--- a/dlls/wow64win/syscall.h
+++ b/dlls/wow64win/syscall.h
@@ -34,6 +34,7 @@
     SYSCALL_ENTRY( NtGdiCreateHatchBrushInternal ) \
     SYSCALL_ENTRY( NtGdiCreatePaletteInternal ) \
     SYSCALL_ENTRY( NtGdiCreatePatternBrushInternal ) \
+    SYSCALL_ENTRY( NtGdiCreatePen ) \
     SYSCALL_ENTRY( NtGdiCreateRectRgn ) \
     SYSCALL_ENTRY( NtGdiCreateRoundRectRgn ) \
     SYSCALL_ENTRY( NtGdiCreateSolidBrush ) \
@@ -41,6 +42,7 @@
     SYSCALL_ENTRY( NtGdiDescribePixelFormat ) \
     SYSCALL_ENTRY( NtGdiDrawStream ) \
     SYSCALL_ENTRY( NtGdiEqualRgn ) \
+    SYSCALL_ENTRY( NtGdiExtCreatePen ) \
     SYSCALL_ENTRY( NtGdiExtCreateRegion ) \
     SYSCALL_ENTRY( NtGdiExtGetObjectW ) \
     SYSCALL_ENTRY( NtGdiFlattenPath ) \




More information about the wine-cvs mailing list