win32u: Use NtUserCallTwoParam for MirrorRgn implementation.

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-12-07 15:28:46 +01:00 committed by Alexandre Julliard
parent ef30380d4a
commit 2aba4c5839
9 changed files with 15 additions and 12 deletions

View file

@ -24,7 +24,7 @@
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "gdi_private.h"
#include "winuser.h"
#include "ntuser.h"
#include "winreg.h"
#include "winnls.h"
#include "initguid.h"
@ -707,6 +707,14 @@ HRGN WINAPI CreatePolygonRgn( const POINT *points, INT count, INT mode )
return CreatePolyPolygonRgn( points, &count, 1, mode );
}
/***********************************************************************
* MirrorRgn (GDI32.@)
*/
BOOL WINAPI MirrorRgn( HWND hwnd, HRGN hrgn )
{
return NtUserCallTwoParam( HandleToUlong(hwnd), HandleToUlong(hrgn), NtUserMirrorRgn );
}
/***********************************************************************
* CreateColorSpaceA (GDI32.@)
*/

View file

@ -1183,7 +1183,6 @@ static struct unix_funcs unix_funcs =
NtUserVkKeyScanEx,
GetDCHook,
MirrorRgn,
SetDCHook,
SetDIBits,
SetHookFlags,

View file

@ -409,6 +409,7 @@ extern HPEN create_pen( INT style, INT width, COLORREF color ) DECLSPEC_HIDDEN;
/* region.c */
extern BOOL add_rect_to_region( HRGN rgn, const RECT *rect ) DECLSPEC_HIDDEN;
extern INT mirror_region( HRGN dst, HRGN src, INT width ) DECLSPEC_HIDDEN;
extern BOOL mirror_window_region( HWND hwnd, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y ) DECLSPEC_HIDDEN;
extern HRGN create_polypolygon_region( const POINT *pts, const INT *count, INT nbpolygons,
INT mode, const RECT *clip_rect ) DECLSPEC_HIDDEN;

View file

@ -1375,9 +1375,9 @@ INT mirror_region( HRGN dst, HRGN src, INT width )
}
/***********************************************************************
* MirrorRgn (GDI32.@)
* mirror_window_region
*/
BOOL WINAPI MirrorRgn( HWND hwnd, HRGN hrgn )
BOOL mirror_window_region( HWND hwnd, HRGN hrgn )
{
RECT rect;

View file

@ -4422,6 +4422,8 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
return get_monitor_info( UlongToHandle(arg1), (MONITORINFO *)arg2 );
case NtUserGetSystemMetricsForDpi:
return get_system_metrics_for_dpi( arg1, arg2 );
case NtUserMirrorRgn:
return mirror_window_region( UlongToHandle(arg1), UlongToHandle(arg2) );
default:
FIXME( "invalid code %u\n", code );
return 0;

View file

@ -1337,7 +1337,6 @@
@ cdecl __wine_get_vulkan_driver(long long)
# gdi32
@ stdcall MirrorRgn(long long)
@ stdcall SetDIBits(long long long long ptr ptr long)
@ cdecl __wine_get_brush_bitmap_info(long ptr ptr ptr)
@ cdecl __wine_get_icm_profile(long long ptr ptr)

View file

@ -225,7 +225,6 @@ struct unix_funcs
/* Wine-specific functions */
DWORD_PTR (WINAPI *pGetDCHook)( HDC hdc, DCHOOKPROC *proc );
BOOL (WINAPI *pMirrorRgn)( HWND hwnd, HRGN hrgn );
BOOL (WINAPI *pSetDCHook)( HDC hdc, DCHOOKPROC proc, DWORD_PTR data );
INT (WINAPI *pSetDIBits)( HDC hdc, HBITMAP hbitmap, UINT startscan,
UINT lines, const void *bits, const BITMAPINFO *info,

View file

@ -857,12 +857,6 @@ BOOL WINAPI SetDCHook( HDC hdc, DCHOOKPROC proc, DWORD_PTR data )
return unix_funcs->pSetDCHook( hdc, proc, data );
}
BOOL WINAPI MirrorRgn( HWND hwnd, HRGN hrgn )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pMirrorRgn( hwnd, hrgn );
}
INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
UINT lines, const void *bits, const BITMAPINFO *info,
UINT coloruse )

View file

@ -63,6 +63,7 @@ enum
{
NtUserGetMonitorInfo,
NtUserGetSystemMetricsForDpi,
NtUserMirrorRgn,
};
/* this is the structure stored in TEB->Win32ClientInfo */