win32u: Use syscall interface for more painting functions.

This commit is contained in:
Jacek Caban 2023-05-25 12:02:35 +02:00 committed by Alexandre Julliard
parent 8cc95b5487
commit 0cccc08cd6
7 changed files with 108 additions and 77 deletions

View file

@ -1033,7 +1033,6 @@ static struct unix_funcs unix_funcs =
NtGdiAbortDoc,
NtGdiAbortPath,
NtGdiAlphaBlend,
NtGdiAngleArc,
NtGdiBeginPath,
NtGdiBitBlt,
NtGdiCloseFigure,
@ -1060,13 +1059,10 @@ static struct unix_funcs unix_funcs =
NtGdiEnumFonts,
NtGdiExcludeClipRect,
NtGdiExtEscape,
NtGdiExtFloodFill,
NtGdiExtTextOutW,
NtGdiExtSelectClipRgn,
NtGdiFillPath,
NtGdiFillRgn,
NtGdiFontIsLinked,
NtGdiFrameRgn,
NtGdiGetAndSetDCDword,
NtGdiGetAppClipBox,
NtGdiGetBoundsRect,
@ -1090,16 +1086,12 @@ static struct unix_funcs unix_funcs =
NtGdiGetTextExtentExW,
NtGdiGetTextFaceW,
NtGdiGetTextMetricsW,
NtGdiGradientFill,
NtGdiIntersectClipRect,
NtGdiInvertRgn,
NtGdiMaskBlt,
NtGdiModifyWorldTransform,
NtGdiOffsetClipRgn,
NtGdiPatBlt,
NtGdiPlgBlt,
NtGdiPolyDraw,
NtGdiPolyPolyDraw,
NtGdiPtVisible,
NtGdiRectVisible,
NtGdiResetDC,

View file

@ -38,6 +38,7 @@ static void * const syscalls[] =
{
NtGdiAddFontMemResourceEx,
NtGdiAddFontResourceW,
NtGdiAngleArc,
NtGdiArcInternal,
NtGdiCombineRgn,
NtGdiCreateBitmap,
@ -64,9 +65,12 @@ static void * const syscalls[] =
NtGdiEqualRgn,
NtGdiExtCreatePen,
NtGdiExtCreateRegion,
NtGdiExtFloodFill,
NtGdiExtGetObjectW,
NtGdiFillRgn,
NtGdiFlattenPath,
NtGdiFlush,
NtGdiFrameRgn,
NtGdiGetBitmapBits,
NtGdiGetBitmapDimension,
NtGdiGetColorAdjustment,
@ -83,13 +87,17 @@ static void * const syscalls[] =
NtGdiGetSpoolMessage,
NtGdiGetSystemPaletteUse,
NtGdiGetTransform,
NtGdiGradientFill,
NtGdiHfontCreate,
NtGdiInitSpool,
NtGdiInvertRgn,
NtGdiLineTo,
NtGdiMoveTo,
NtGdiOffsetRgn,
NtGdiOpenDCW,
NtGdiPathToRegion,
NtGdiPolyDraw,
NtGdiPolyPolyDraw,
NtGdiPtInRegion,
NtGdiRectInRegion,
NtGdiRectangle,

View file

@ -113,7 +113,7 @@
@ stub NtGdiAddRemoteFontToDC
@ stub NtGdiAddRemoteMMInstanceToDC
@ stdcall NtGdiAlphaBlend(long long long long long long long long long long long ptr)
@ stdcall NtGdiAngleArc(long long long long long long)
@ stdcall -syscall NtGdiAngleArc(long long long long long long)
@ stub NtGdiAnyLinkedFonts
@ stdcall -syscall NtGdiArcInternal(long long long long long long long long long long)
@ stub NtGdiBRUSHOBJ_DeleteRbrush
@ -421,7 +421,7 @@
@ 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)
@ stdcall -syscall NtGdiExtFloodFill(long long long long long)
@ stdcall -syscall NtGdiExtGetObjectW(long long ptr)
@ stdcall NtGdiExtSelectClipRgn(long long long)
@ stdcall NtGdiExtTextOutW(long long long long ptr ptr long ptr long)
@ -434,12 +434,12 @@
@ stub NtGdiFONTOBJ_pxoGetXform
@ stub NtGdiFONTOBJ_vGetInfo
@ stdcall NtGdiFillPath(long)
@ stdcall NtGdiFillRgn(long long long)
@ stdcall -syscall NtGdiFillRgn(long long long)
@ stdcall -syscall NtGdiFlattenPath(long)
@ stdcall -syscall NtGdiFlush()
@ stdcall NtGdiFontIsLinked(long)
@ stub NtGdiForceUFIMapping
@ stdcall NtGdiFrameRgn(long long long long long)
@ stdcall -syscall NtGdiFrameRgn(long long long long long)
@ stub NtGdiFullscreenControl
@ stdcall NtGdiGetAndSetDCDword(long long long ptr)
@ stdcall NtGdiGetAppClipBox(long ptr)
@ -524,7 +524,7 @@
@ stub NtGdiGetUFI
@ stub NtGdiGetUFIPathname
@ stub NtGdiGetWidthTable
@ stdcall NtGdiGradientFill(long ptr long ptr long long)
@ stdcall -syscall NtGdiGradientFill(long ptr long ptr long long)
@ stub NtGdiHLSurfGetInformation
@ stub NtGdiHLSurfSetInformation
@ stub NtGdiHT_Get8BPPFormatPalette
@ -534,7 +534,7 @@
@ stub NtGdiInit
@ stdcall -syscall NtGdiInitSpool()
@ stdcall NtGdiIntersectClipRect(long long long long long)
@ stdcall NtGdiInvertRgn(long long)
@ stdcall -syscall NtGdiInvertRgn(long long)
@ stdcall -syscall NtGdiLineTo(long long long)
@ stub NtGdiMakeFontDir
@ stub NtGdiMakeInfoDC
@ -556,9 +556,9 @@
@ stdcall NtGdiPatBlt(long long long long long long)
@ stdcall -syscall NtGdiPathToRegion(long)
@ stdcall NtGdiPlgBlt(long ptr long long long long long long long long long)
@ stdcall NtGdiPolyDraw(long ptr ptr long)
@ stdcall -syscall NtGdiPolyDraw(long ptr ptr long)
@ stub NtGdiPolyPatBlt
@ stdcall NtGdiPolyPolyDraw(long ptr ptr long long)
@ stdcall -syscall NtGdiPolyPolyDraw(long ptr ptr long long)
@ stub NtGdiPolyTextOutW
@ stdcall -syscall NtGdiPtInRegion(long long long)
@ stdcall NtGdiPtVisible(long long long)

View file

@ -40,8 +40,6 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiAlphaBlend)( HDC hdc_dst, int x_dst, int y_dst, int width_dst, int height_dst,
HDC hdc_src, int x_src, int y_src, int width_src, int height_src,
BLENDFUNCTION blend_function, HANDLE xform );
BOOL (WINAPI *pNtGdiAngleArc)( HDC hdc, INT x, INT y, DWORD radius, DWORD start_angle,
DWORD sweep_angle );
BOOL (WINAPI *pNtGdiBeginPath)( HDC hdc );
BOOL (WINAPI *pNtGdiBitBlt)( HDC hdc_dst, INT x_dst, INT y_dst, INT width, INT height, HDC hdc_src,
INT x_src, INT y_src, DWORD rop, DWORD bk_color, FLONG fl );
@ -75,14 +73,11 @@ struct unix_funcs
INT (WINAPI *pNtGdiExcludeClipRect)( HDC hdc, INT left, INT top, INT right, INT bottom );
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 );
BOOL (WINAPI *pNtGdiExtTextOutW)( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
const WCHAR *str, UINT count, const INT *dx, DWORD cp );
INT (WINAPI *pNtGdiExtSelectClipRgn)( HDC hdc, HRGN region, INT mode );
BOOL (WINAPI *pNtGdiFillPath)( HDC hdc );
BOOL (WINAPI *pNtGdiFillRgn)( HDC hdc, HRGN hrgn, HBRUSH hbrush );
BOOL (WINAPI *pNtGdiFontIsLinked)( HDC hdc );
BOOL (WINAPI *pNtGdiFrameRgn)( HDC hdc, HRGN hrgn, HBRUSH brush, INT width, INT height );
BOOL (WINAPI *pNtGdiGetAndSetDCDword)( HDC hdc, UINT method, DWORD value, DWORD *result );
INT (WINAPI *pNtGdiGetAppClipBox)( HDC hdc, RECT *rect );
UINT (WINAPI *pNtGdiGetBoundsRect)( HDC hdc, RECT *rect, UINT flags );
@ -115,10 +110,7 @@ struct unix_funcs
INT *nfit, INT *dxs, SIZE *size, UINT flags );
INT (WINAPI *pNtGdiGetTextFaceW)( HDC hdc, INT count, WCHAR *name, BOOL alias_name );
BOOL (WINAPI *pNtGdiGetTextMetricsW)( HDC hdc, TEXTMETRICW *metrics, ULONG flags );
BOOL (WINAPI *pNtGdiGradientFill)( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
void *grad_array, ULONG ngrad, ULONG mode );
INT (WINAPI *pNtGdiIntersectClipRect)( HDC hdc, INT left, INT top, INT right, INT bottom );
BOOL (WINAPI *pNtGdiInvertRgn)( HDC hdc, HRGN hrgn );
BOOL (WINAPI *pNtGdiMaskBlt)( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, HBITMAP mask,
INT x_mask, INT y_mask, DWORD rop, DWORD bk_color );
@ -128,9 +120,6 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiPlgBlt)( HDC hdc, const POINT *point, HDC hdc_src, INT x_src, INT y_src,
INT width, INT height, HBITMAP mask, INT x_mask, INT y_mask,
DWORD bk_color );
BOOL (WINAPI *pNtGdiPolyDraw)(HDC hdc, const POINT *points, const BYTE *types, DWORD count );
ULONG (WINAPI *pNtGdiPolyPolyDraw)( HDC hdc, const POINT *points, const ULONG *counts,
DWORD count, UINT function );
BOOL (WINAPI *pNtGdiPtVisible)( HDC hdc, INT x, INT y );
BOOL (WINAPI *pNtGdiRectVisible)( HDC hdc, const RECT *rect );
BOOL (WINAPI *pNtGdiResetDC)( HDC hdc, const DEVMODEW *devmode, BOOL *banding,

View file

@ -45,12 +45,6 @@ BOOL WINAPI NtGdiAlphaBlend( HDC hdc_dst, int x_dst, int y_dst, int width_dst, i
x_src, y_src, width_src, height_src, blend_function, xform );
}
BOOL WINAPI NtGdiAngleArc( HDC hdc, INT x, INT y, DWORD radius, DWORD start_angle, DWORD sweep_angle )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtGdiAngleArc( hdc, x, y, radius, start_angle, sweep_angle );
}
BOOL WINAPI NtGdiBeginPath( HDC hdc )
{
if (!unix_funcs) return FALSE;
@ -164,12 +158,6 @@ INT WINAPI NtGdiExtEscape( HDC hdc, WCHAR *driver, INT driver_id, INT escape, IN
output_size, output );
}
BOOL WINAPI NtGdiExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT type )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtGdiExtFloodFill( hdc, x, y, color, type );
}
BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
const WCHAR *str, UINT count, const INT *dx, DWORD cp )
{
@ -189,24 +177,12 @@ BOOL WINAPI NtGdiFillPath( HDC hdc )
return unix_funcs->pNtGdiFillPath( hdc );
}
BOOL WINAPI NtGdiFillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtGdiFillRgn( hdc, hrgn, hbrush );
}
BOOL WINAPI NtGdiFontIsLinked( HDC hdc )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtGdiFontIsLinked( hdc );
}
BOOL WINAPI NtGdiFrameRgn( HDC hdc, HRGN hrgn, HBRUSH brush, INT width, INT height )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtGdiFrameRgn( hdc, hrgn, brush, width, height );
}
BOOL WINAPI NtGdiGetAndSetDCDword( HDC hdc, UINT method, DWORD value, DWORD *result )
{
if (!unix_funcs) return FALSE;
@ -355,25 +331,12 @@ BOOL WINAPI NtGdiGetTextMetricsW( HDC hdc, TEXTMETRICW *metrics, ULONG flags )
return unix_funcs->pNtGdiGetTextMetricsW( hdc, metrics, flags );
}
BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
void *grad_array, ULONG ngrad, ULONG mode )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtGdiGradientFill( hdc, vert_array, nvert, grad_array, ngrad, mode );
}
INT WINAPI NtGdiIntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom )
{
if (!unix_funcs) return ERROR;
return unix_funcs->pNtGdiIntersectClipRect( hdc, left, top, right, bottom );
}
BOOL WINAPI NtGdiInvertRgn( HDC hdc, HRGN hrgn )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtGdiInvertRgn( hdc, hrgn );
}
BOOL WINAPI NtGdiMaskBlt( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, HBITMAP mask,
INT x_mask, INT y_mask, DWORD rop, DWORD bk_color )
@ -410,19 +373,6 @@ BOOL WINAPI NtGdiPlgBlt( HDC hdc, const POINT *point, HDC hdc_src, INT x_src, IN
x_mask, y_mask, bk_color );
}
BOOL WINAPI NtGdiPolyDraw( HDC hdc, const POINT *points, const BYTE *types, DWORD count )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtGdiPolyDraw( hdc, points, types, count );
}
ULONG WINAPI NtGdiPolyPolyDraw( HDC hdc, const POINT *points, const ULONG *counts,
DWORD count, UINT function )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtGdiPolyPolyDraw( hdc, points, counts, count, function );
}
BOOL WINAPI NtGdiPtVisible( HDC hdc, INT x, INT y )
{
if (!unix_funcs) return FALSE;

View file

@ -79,6 +79,18 @@ NTSTATUS WINAPI wow64_NtGdiAddFontResourceW( UINT *args )
return NtGdiAddFontResourceW( str, size, files, flags, tid, dv );
}
NTSTATUS WINAPI wow64_NtGdiAngleArc( UINT *args )
{
HDC hdc = get_handle( &args );
INT x = get_ulong( &args );
INT y = get_ulong( &args );
DWORD radius = get_ulong( &args );
DWORD start_angle = get_ulong( &args );
DWORD sweep_angle = get_ulong( &args );
return NtGdiAngleArc( hdc, x, y, radius, start_angle, sweep_angle );
}
NTSTATUS WINAPI wow64_NtGdiArcInternal( UINT *args )
{
UINT type = get_ulong( &args );
@ -381,6 +393,17 @@ NTSTATUS WINAPI wow64_NtGdiExtCreateRegion( UINT *args )
return HandleToUlong( NtGdiExtCreateRegion( xform, count, data ));
}
NTSTATUS WINAPI wow64_NtGdiExtFloodFill( UINT *args )
{
HDC hdc = get_handle( &args );
INT x = get_ulong( &args );
INT y = get_ulong( &args );
COLORREF color = get_ulong( &args );
UINT type = get_ulong( &args );
return NtGdiExtFloodFill( hdc, x, y, color, type );
}
NTSTATUS WINAPI wow64_NtGdiExtGetObjectW( UINT *args )
{
HGDIOBJ handle = get_handle( &args );
@ -474,6 +497,15 @@ NTSTATUS WINAPI wow64_NtGdiExtGetObjectW( UINT *args )
}
}
NTSTATUS WINAPI wow64_NtGdiFillRgn( UINT *args )
{
HDC hdc = get_handle( &args );
HRGN hrgn = get_handle( &args );
HBRUSH hbrush = get_handle( &args );
return NtGdiFillRgn( hdc, hrgn, hbrush );
}
NTSTATUS WINAPI wow64_NtGdiFlattenPath( UINT *args )
{
HDC hdc = get_handle( &args );
@ -486,6 +518,17 @@ NTSTATUS WINAPI wow64_NtGdiFlush( UINT *args )
return NtGdiFlush();
}
NTSTATUS WINAPI wow64_NtGdiFrameRgn( UINT *args )
{
HDC hdc = get_handle( &args );
HRGN hrgn = get_handle( &args );
HBRUSH brush = get_handle( &args );
INT width = get_ulong( &args );
INT height = get_ulong( &args );
return NtGdiFrameRgn( hdc, hrgn, brush, width, height );
}
NTSTATUS WINAPI wow64_NtGdiGetBitmapBits( UINT *args )
{
HBITMAP bitmap = get_handle( &args );
@ -591,6 +634,26 @@ NTSTATUS WINAPI wow64_NtGdiGetPixel( UINT *args )
return NtGdiGetPixel( hdc, x, y );
}
NTSTATUS WINAPI wow64_NtGdiGradientFill( UINT *args )
{
HDC hdc = get_handle( &args );
TRIVERTEX *vert_array = get_ptr( &args );
ULONG nvert = get_ulong( &args );
void *grad_array = get_ptr( &args );
ULONG ngrad = get_ulong( &args );
ULONG mode = get_ulong( &args );
return NtGdiGradientFill( hdc, vert_array, nvert, grad_array, ngrad, mode );
}
NTSTATUS WINAPI wow64_NtGdiInvertRgn( UINT *args )
{
HDC hdc = get_handle( &args );
HRGN hrgn = get_handle( &args );
return NtGdiInvertRgn( hdc, hrgn );
}
NTSTATUS WINAPI wow64_NtGdiLineTo( UINT *args )
{
HDC hdc = get_handle( &args );
@ -610,6 +673,27 @@ NTSTATUS WINAPI wow64_NtGdiMoveTo( UINT *args )
return NtGdiMoveTo( hdc, x, y, pt );
}
NTSTATUS WINAPI wow64_NtGdiPolyDraw( UINT *args )
{
HDC hdc = get_handle( &args );
const POINT *points = get_ptr( &args );
const BYTE *types = get_ptr( &args );
DWORD count = get_ulong( &args );
return NtGdiPolyDraw( hdc, points, types, count );
}
NTSTATUS WINAPI wow64_NtGdiPolyPolyDraw( UINT *args )
{
HDC hdc = get_handle( &args );
const POINT *points = get_ptr( &args );
const ULONG *counts = get_ptr( &args );
DWORD count = get_ulong( &args );
UINT function = get_ulong( &args );
return NtGdiPolyPolyDraw( hdc, points, counts, count, function );
}
NTSTATUS WINAPI wow64_NtGdiRectangle( UINT *args )
{
HDC hdc = get_handle( &args );

View file

@ -24,6 +24,7 @@
#define ALL_WIN32_SYSCALLS \
SYSCALL_ENTRY( NtGdiAddFontMemResourceEx ) \
SYSCALL_ENTRY( NtGdiAddFontResourceW ) \
SYSCALL_ENTRY( NtGdiAngleArc ) \
SYSCALL_ENTRY( NtGdiArcInternal ) \
SYSCALL_ENTRY( NtGdiCombineRgn ) \
SYSCALL_ENTRY( NtGdiCreateBitmap ) \
@ -50,9 +51,12 @@
SYSCALL_ENTRY( NtGdiEqualRgn ) \
SYSCALL_ENTRY( NtGdiExtCreatePen ) \
SYSCALL_ENTRY( NtGdiExtCreateRegion ) \
SYSCALL_ENTRY( NtGdiExtFloodFill ) \
SYSCALL_ENTRY( NtGdiExtGetObjectW ) \
SYSCALL_ENTRY( NtGdiFillRgn ) \
SYSCALL_ENTRY( NtGdiFlattenPath ) \
SYSCALL_ENTRY( NtGdiFlush ) \
SYSCALL_ENTRY( NtGdiFrameRgn ) \
SYSCALL_ENTRY( NtGdiGetBitmapBits ) \
SYSCALL_ENTRY( NtGdiGetBitmapDimension ) \
SYSCALL_ENTRY( NtGdiGetColorAdjustment ) \
@ -69,13 +73,17 @@
SYSCALL_ENTRY( NtGdiGetSpoolMessage ) \
SYSCALL_ENTRY( NtGdiGetSystemPaletteUse ) \
SYSCALL_ENTRY( NtGdiGetTransform ) \
SYSCALL_ENTRY( NtGdiGradientFill ) \
SYSCALL_ENTRY( NtGdiHfontCreate ) \
SYSCALL_ENTRY( NtGdiInitSpool ) \
SYSCALL_ENTRY( NtGdiInvertRgn ) \
SYSCALL_ENTRY( NtGdiLineTo ) \
SYSCALL_ENTRY( NtGdiMoveTo ) \
SYSCALL_ENTRY( NtGdiOffsetRgn ) \
SYSCALL_ENTRY( NtGdiOpenDCW ) \
SYSCALL_ENTRY( NtGdiPathToRegion ) \
SYSCALL_ENTRY( NtGdiPolyDraw ) \
SYSCALL_ENTRY( NtGdiPolyPolyDraw ) \
SYSCALL_ENTRY( NtGdiPtInRegion ) \
SYSCALL_ENTRY( NtGdiRectInRegion ) \
SYSCALL_ENTRY( NtGdiRectangle ) \