Commit 0dfedf79 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use syscall interface for some font functions.

parent 277d37bc
......@@ -1067,8 +1067,6 @@ static struct unix_funcs unix_funcs =
{
NtGdiAbortDoc,
NtGdiAbortPath,
NtGdiAddFontMemResourceEx,
NtGdiAddFontResourceW,
NtGdiAlphaBlend,
NtGdiAngleArc,
NtGdiArcInternal,
......@@ -1129,8 +1127,6 @@ static struct unix_funcs unix_funcs =
NtGdiGetDeviceCaps,
NtGdiGetDeviceGammaRamp,
NtGdiGetFontData,
NtGdiGetFontFileData,
NtGdiGetFontFileInfo,
NtGdiGetFontUnicodeRanges,
NtGdiGetGlyphIndicesW,
NtGdiGetGlyphOutline,
......@@ -1150,7 +1146,6 @@ static struct unix_funcs unix_funcs =
NtGdiGetTextFaceW,
NtGdiGetTextMetricsW,
NtGdiGradientFill,
NtGdiHfontCreate,
NtGdiInitSpool,
NtGdiIntersectClipRect,
NtGdiInvertRgn,
......@@ -1168,8 +1163,6 @@ static struct unix_funcs unix_funcs =
NtGdiPtVisible,
NtGdiRectVisible,
NtGdiRectangle,
NtGdiRemoveFontMemResourceEx,
NtGdiRemoveFontResourceW,
NtGdiResetDC,
NtGdiResizePalette,
NtGdiRestoreDC,
......@@ -1189,7 +1182,6 @@ static struct unix_funcs unix_funcs =
NtGdiSetMagicColors,
NtGdiSetPixel,
NtGdiSetSystemPaletteUse,
NtGdiSetTextJustification,
NtGdiSetVirtualResolution,
NtGdiStartDoc,
NtGdiStartPage,
......
......@@ -34,6 +34,8 @@
static void * const syscalls[] =
{
NtGdiAddFontMemResourceEx,
NtGdiAddFontResourceW,
NtGdiCombineRgn,
NtGdiCreateBitmap,
NtGdiCreateDIBBrush,
......@@ -51,12 +53,17 @@ static void * const syscalls[] =
NtGdiFlush,
NtGdiGetBitmapBits,
NtGdiGetBitmapDimension,
NtGdiGetFontFileData,
NtGdiGetFontFileInfo,
NtGdiGetRegionData,
NtGdiGetRgnBox,
NtGdiGetTransform,
NtGdiHfontCreate,
NtGdiOffsetRgn,
NtGdiPtInRegion,
NtGdiRectInRegion,
NtGdiRemoveFontMemResourceEx,
NtGdiRemoveFontResourceW,
NtGdiSaveDC,
NtGdiSetBitmapBits,
NtGdiSetBitmapDimension,
......@@ -64,6 +71,7 @@ static void * const syscalls[] =
NtGdiSetMetaRgn,
NtGdiSetPixelFormat,
NtGdiSetRectRgn,
NtGdiSetTextJustification,
NtGdiSwapBuffers,
};
......
......@@ -107,8 +107,8 @@
@ stdcall NtGdiAbortDoc(long)
@ stdcall NtGdiAbortPath(long)
@ stub NtGdiAddEmbFontToDC
@ stdcall NtGdiAddFontMemResourceEx(ptr long ptr long ptr)
@ stdcall NtGdiAddFontResourceW(wstr long long long long ptr)
@ stdcall -syscall NtGdiAddFontMemResourceEx(ptr long ptr long ptr)
@ stdcall -syscall NtGdiAddFontResourceW(wstr long long long long ptr)
@ stub NtGdiAddInitialFonts
@ stub NtGdiAddRemoteFontToDC
@ stub NtGdiAddRemoteMMInstanceToDC
......@@ -478,8 +478,8 @@
@ stub NtGdiGetEntry
@ stub NtGdiGetEudcTimeStampEx
@ stdcall NtGdiGetFontData(long long long ptr long)
@ stdcall NtGdiGetFontFileData(long long ptr ptr long)
@ stdcall NtGdiGetFontFileInfo(long long ptr long ptr)
@ stdcall -syscall NtGdiGetFontFileData(long long ptr ptr long)
@ stdcall -syscall NtGdiGetFontFileInfo(long long ptr long ptr)
@ stub NtGdiGetFontResourceInfoInternalW
@ stdcall NtGdiGetFontUnicodeRanges(long ptr)
@ stub NtGdiGetGammaRampCapability
......@@ -529,7 +529,7 @@
@ stub NtGdiHLSurfSetInformation
@ stub NtGdiHT_Get8BPPFormatPalette
@ stub NtGdiHT_Get8BPPMaskPalette
@ stdcall NtGdiHfontCreate(ptr long long long ptr)
@ stdcall -syscall NtGdiHfontCreate(ptr long long long ptr)
@ stub NtGdiIcmBrushInfo
@ stub NtGdiInit
@ stdcall NtGdiInitSpool()
......@@ -567,8 +567,8 @@
@ stdcall -syscall NtGdiRectInRegion(long ptr)
@ stdcall NtGdiRectVisible(long ptr)
@ stdcall NtGdiRectangle(long long long long long)
@ stdcall NtGdiRemoveFontMemResourceEx(long)
@ stdcall NtGdiRemoveFontResourceW(wstr long long long long ptr)
@ stdcall -syscall NtGdiRemoveFontMemResourceEx(long)
@ stdcall -syscall NtGdiRemoveFontResourceW(wstr long long long long ptr)
@ stub NtGdiRemoveMergeFont
@ stdcall NtGdiResetDC(long ptr ptr ptr ptr)
@ stdcall NtGdiResizePalette(long long)
......@@ -615,7 +615,7 @@
@ stdcall -syscall NtGdiSetRectRgn(long long long long long)
@ stub NtGdiSetSizeDevice
@ stdcall NtGdiSetSystemPaletteUse(long long)
@ stdcall NtGdiSetTextJustification(long long long)
@ stdcall -syscall NtGdiSetTextJustification(long long long)
@ stub NtGdiSetUMPDSandboxState
@ stdcall NtGdiSetVirtualResolution(long long long long long)
@ stdcall NtGdiStartDoc(long ptr ptr long)
......
......@@ -44,10 +44,6 @@ struct unix_funcs
/* win32u functions */
INT (WINAPI *pNtGdiAbortDoc)( HDC hdc );
BOOL (WINAPI *pNtGdiAbortPath)( HDC hdc );
HANDLE (WINAPI *pNtGdiAddFontMemResourceEx)( void *ptr, DWORD size, void *dv, ULONG dv_size,
DWORD *count );
INT (WINAPI *pNtGdiAddFontResourceW)( const WCHAR *str, ULONG size, ULONG files, DWORD flags,
DWORD tid, void *dv );
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 );
......@@ -127,10 +123,6 @@ struct unix_funcs
INT (WINAPI *pNtGdiGetDeviceCaps)( HDC hdc, INT cap );
BOOL (WINAPI *pNtGdiGetDeviceGammaRamp)( HDC hdc, void *ptr );
DWORD (WINAPI *pNtGdiGetFontData)( HDC hdc, DWORD table, DWORD offset, void *buffer, DWORD length );
BOOL (WINAPI *pNtGdiGetFontFileData)( DWORD instance_id, DWORD file_index, UINT64 *offset,
void *buff, DWORD buff_size );
BOOL (WINAPI *pNtGdiGetFontFileInfo)( DWORD instance_id, DWORD file_index, struct font_fileinfo *info,
SIZE_T size, SIZE_T *needed );
DWORD (WINAPI *pNtGdiGetFontUnicodeRanges)( HDC hdc, GLYPHSET *lpgs );
DWORD (WINAPI *pNtGdiGetGlyphIndicesW)( HDC hdc, const WCHAR *str, INT count,
WORD *indices, DWORD flags );
......@@ -156,8 +148,6 @@ struct unix_funcs
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 );
HFONT (WINAPI *pNtGdiHfontCreate)( const ENUMLOGFONTEXDVW *enumex, ULONG unk2, ULONG unk3,
ULONG unk4, void *data );
DWORD (WINAPI *pNtGdiInitSpool)(void);
INT (WINAPI *pNtGdiIntersectClipRect)( HDC hdc, INT left, INT top, INT right, INT bottom );
BOOL (WINAPI *pNtGdiInvertRgn)( HDC hdc, HRGN hrgn );
......@@ -182,9 +172,6 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiPtVisible)( HDC hdc, INT x, INT y );
BOOL (WINAPI *pNtGdiRectVisible)( HDC hdc, const RECT *rect );
BOOL (WINAPI *pNtGdiRectangle)( HDC hdc, INT left, INT top, INT right, INT bottom );
BOOL (WINAPI *pNtGdiRemoveFontMemResourceEx)( HANDLE handle );
BOOL (WINAPI *pNtGdiRemoveFontResourceW)( const WCHAR *str, ULONG size, ULONG files,
DWORD flags, DWORD tid, void *dv );
BOOL (WINAPI *pNtGdiResetDC)( HDC hdc, const DEVMODEW *devmode, BOOL *banding,
DRIVER_INFO_2W *driver_info, void *dev );
BOOL (WINAPI *pNtGdiResizePalette)( HPALETTE palette, UINT count );
......@@ -212,7 +199,6 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiSetMagicColors)( HDC hdc, DWORD magic, ULONG index );
COLORREF (WINAPI *pNtGdiSetPixel)( HDC hdc, INT x, INT y, COLORREF color );
UINT (WINAPI *pNtGdiSetSystemPaletteUse)( HDC hdc, UINT use );
BOOL (WINAPI *pNtGdiSetTextJustification)( HDC hdc, INT extra, INT breaks );
BOOL (WINAPI *pNtGdiSetVirtualResolution)( HDC hdc, DWORD horz_res, DWORD vert_res,
DWORD horz_size, DWORD vert_size );
INT (WINAPI *pNtGdiStartDoc)( HDC hdc, const DOCINFOW *doc, BOOL *banding, INT job );
......
......@@ -40,18 +40,6 @@ BOOL WINAPI NtGdiAbortPath( HDC hdc )
return unix_funcs->pNtGdiAbortPath( hdc );
}
HANDLE WINAPI NtGdiAddFontMemResourceEx( void *ptr, DWORD size, void *dv, ULONG dv_size,
DWORD *count )
{
return unix_funcs->pNtGdiAddFontMemResourceEx( ptr, size, dv, dv_size, count );
}
INT WINAPI NtGdiAddFontResourceW( const WCHAR *str, ULONG size, ULONG files, DWORD flags,
DWORD tid, void *dv )
{
return unix_funcs->pNtGdiAddFontResourceW( str, size, files, flags, tid, dv );
}
BOOL WINAPI NtGdiAlphaBlend( 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 )
......@@ -312,18 +300,6 @@ DWORD WINAPI NtGdiGetFontData( HDC hdc, DWORD table, DWORD offset, void *buffer,
return unix_funcs->pNtGdiGetFontData( hdc, table, offset, buffer, length );
}
BOOL WINAPI NtGdiGetFontFileData( DWORD instance_id, DWORD file_index, UINT64 *offset,
void *buff, DWORD buff_size )
{
return unix_funcs->pNtGdiGetFontFileData( instance_id, file_index, offset, buff, buff_size );
}
BOOL WINAPI NtGdiGetFontFileInfo( DWORD instance_id, DWORD file_index, struct font_fileinfo *info,
SIZE_T size, SIZE_T *needed )
{
return unix_funcs->pNtGdiGetFontFileInfo( instance_id, file_index, info, size, needed );
}
DWORD WINAPI NtGdiGetFontUnicodeRanges( HDC hdc, GLYPHSET *lpgs )
{
return unix_funcs->pNtGdiGetFontUnicodeRanges( hdc, lpgs );
......@@ -425,12 +401,6 @@ BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
return unix_funcs->pNtGdiGradientFill( hdc, vert_array, nvert, grad_array, ngrad, mode );
}
HFONT WINAPI NtGdiHfontCreate( const ENUMLOGFONTEXDVW *enumex, ULONG unk2, ULONG unk3,
ULONG unk4, void *data )
{
return unix_funcs->pNtGdiHfontCreate( enumex, unk2, unk3, unk4, data );
}
DWORD WINAPI NtGdiInitSpool(void)
{
return unix_funcs->pNtGdiInitSpool();
......@@ -526,17 +496,6 @@ BOOL WINAPI NtGdiRectangle( HDC hdc, INT left, INT top, INT right, INT bottom )
return unix_funcs->pNtGdiRectangle( hdc, left, top, right, bottom );
}
BOOL WINAPI NtGdiRemoveFontMemResourceEx( HANDLE handle )
{
return unix_funcs->pNtGdiRemoveFontMemResourceEx( handle );
}
BOOL WINAPI NtGdiRemoveFontResourceW( const WCHAR *str, ULONG size, ULONG files,
DWORD flags, DWORD tid, void *dv )
{
return unix_funcs->pNtGdiRemoveFontResourceW( str, size, files, flags, tid, dv );
}
BOOL WINAPI NtGdiResetDC( HDC hdc, const DEVMODEW *devmode, BOOL *banding,
DRIVER_INFO_2W *driver_info, void *dev )
{
......@@ -642,11 +601,6 @@ UINT WINAPI NtGdiSetSystemPaletteUse( HDC hdc, UINT use )
return unix_funcs->pNtGdiSetSystemPaletteUse( hdc, use );
}
BOOL WINAPI NtGdiSetTextJustification( HDC hdc, INT extra, INT breaks )
{
return unix_funcs->pNtGdiSetTextJustification( hdc, extra, breaks );
}
BOOL WINAPI NtGdiSetVirtualResolution( HDC hdc, DWORD horz_res, DWORD vert_res,
DWORD horz_size, DWORD vert_size )
{
......
......@@ -314,6 +314,95 @@ NTSTATUS WINAPI wow64_NtGdiDrawStream( UINT *args )
return NtGdiDrawStream( hdc, in, pvin );
}
NTSTATUS WINAPI wow64_NtGdiSetTextJustification( UINT *args )
{
HDC hdc = get_handle( &args );
INT extra = get_ulong( &args );
INT breaks = get_ulong( &args );
return NtGdiSetTextJustification( hdc, extra, breaks );
}
NTSTATUS WINAPI wow64_NtGdiHfontCreate( UINT *args )
{
const ENUMLOGFONTEXDVW *enumex = get_ptr( &args );
ULONG unk2 = get_ulong( &args );
ULONG unk3 = get_ulong( &args );
ULONG unk4 = get_ulong( &args );
void *data = get_ptr( &args );
return HandleToUlong( NtGdiHfontCreate( enumex, unk2, unk3, unk4, data ));
}
NTSTATUS WINAPI wow64_NtGdiGetFontFileData( UINT *args )
{
DWORD instance_id = get_ulong( &args );
DWORD file_index = get_ulong( &args );
UINT64 *offset = get_ptr( &args );
void *buff = get_ptr( &args );
DWORD buff_size = get_ulong( &args );
return NtGdiGetFontFileData( instance_id, file_index, offset, buff, buff_size );
}
NTSTATUS WINAPI wow64_NtGdiGetFontFileInfo( UINT *args )
{
DWORD instance_id = get_ulong( &args );
DWORD file_index = get_ulong( &args );
struct font_fileinfo *info = get_ptr( &args );
SIZE_T size = get_ulong( &args );
ULONG *needed32 = get_ptr( &args );
SIZE_T needed;
BOOL ret;
ret = NtGdiGetFontFileInfo( instance_id, file_index, info, size, size_32to64( &needed, needed32 ));
put_size( needed32, needed );
return ret;
}
NTSTATUS WINAPI wow64_NtGdiAddFontMemResourceEx( UINT *args )
{
void *ptr = get_ptr( &args );
DWORD size = get_ulong( &args );
void *dv = get_ptr( &args );
ULONG dv_size = get_ulong( &args );
DWORD *count = get_ptr( &args );
return HandleToUlong( NtGdiAddFontMemResourceEx( ptr, size, dv, dv_size, count ));
}
NTSTATUS WINAPI wow64_NtGdiAddFontResourceW( UINT *args )
{
const WCHAR *str = get_ptr( &args );
ULONG size = get_ulong( &args );
ULONG files = get_ulong( &args );
DWORD flags = get_ulong( &args );
DWORD tid = get_ulong( &args );
void *dv = get_ptr( &args );
return NtGdiAddFontResourceW( str, size, files, flags, tid, dv );
}
NTSTATUS WINAPI wow64_NtGdiRemoveFontMemResourceEx( UINT *args )
{
HANDLE handle = get_handle( &args );
return NtGdiRemoveFontMemResourceEx( handle );
}
NTSTATUS WINAPI wow64_NtGdiRemoveFontResourceW( UINT *args )
{
const WCHAR *str = get_ptr( &args );
ULONG size = get_ulong( &args );
ULONG files = get_ulong( &args );
DWORD flags = get_ulong( &args );
DWORD tid = get_ulong( &args );
void *dv = get_ptr( &args );
return NtGdiRemoveFontResourceW( str, size, files, flags, tid, dv );
}
NTSTATUS WINAPI wow64_NtGdiFlush( UINT *args )
{
return NtGdiFlush();
......
......@@ -22,6 +22,8 @@
#define __WOW64WIN_SYSCALL_H
#define ALL_WIN32_SYSCALLS \
SYSCALL_ENTRY( NtGdiAddFontMemResourceEx ) \
SYSCALL_ENTRY( NtGdiAddFontResourceW ) \
SYSCALL_ENTRY( NtGdiCombineRgn ) \
SYSCALL_ENTRY( NtGdiCreateBitmap ) \
SYSCALL_ENTRY( NtGdiCreateDIBBrush ) \
......@@ -39,12 +41,17 @@
SYSCALL_ENTRY( NtGdiFlush ) \
SYSCALL_ENTRY( NtGdiGetBitmapBits ) \
SYSCALL_ENTRY( NtGdiGetBitmapDimension ) \
SYSCALL_ENTRY( NtGdiGetFontFileData ) \
SYSCALL_ENTRY( NtGdiGetFontFileInfo ) \
SYSCALL_ENTRY( NtGdiGetRegionData ) \
SYSCALL_ENTRY( NtGdiGetRgnBox ) \
SYSCALL_ENTRY( NtGdiGetTransform ) \
SYSCALL_ENTRY( NtGdiHfontCreate ) \
SYSCALL_ENTRY( NtGdiOffsetRgn ) \
SYSCALL_ENTRY( NtGdiPtInRegion ) \
SYSCALL_ENTRY( NtGdiRectInRegion ) \
SYSCALL_ENTRY( NtGdiRemoveFontMemResourceEx ) \
SYSCALL_ENTRY( NtGdiRemoveFontResourceW ) \
SYSCALL_ENTRY( NtGdiSaveDC ) \
SYSCALL_ENTRY( NtGdiSetBitmapBits ) \
SYSCALL_ENTRY( NtGdiSetBitmapDimension ) \
......@@ -52,6 +59,7 @@
SYSCALL_ENTRY( NtGdiSetMetaRgn ) \
SYSCALL_ENTRY( NtGdiSetPixelFormat ) \
SYSCALL_ENTRY( NtGdiSetRectRgn ) \
SYSCALL_ENTRY( NtGdiSetTextJustification ) \
SYSCALL_ENTRY( NtGdiSwapBuffers )
#endif /* __WOW64WIN_SYSCALL_H */
......@@ -38,9 +38,21 @@ static inline void **addr_32to64( void **addr, ULONG *addr32 )
return addr;
}
static inline SIZE_T *size_32to64( SIZE_T *size, ULONG *size32 )
{
if (!size32) return NULL;
*size = *size32;
return size;
}
static inline void put_addr( ULONG *addr32, void *addr )
{
if (addr32) *addr32 = PtrToUlong( addr );
}
static inline void put_size( ULONG *size32, SIZE_T size )
{
if (size32) *size32 = min( size, MAXDWORD );
}
#endif /* __WOW64WIN_PRIVATE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment