From 6dfa2e3740fd791d546d4a5c9b2f20dc428de9e7 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 30 Aug 2021 13:54:44 +0200 Subject: [PATCH] gdi32: Use NtGdiGetFontFileData for GetFontFileData. Signed-off-by: Jacek Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/gdi32/font.c | 9 +++++---- dlls/gdi32/text.c | 9 +++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 90673fb5d24..de3787988d8 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -6753,9 +6753,10 @@ BOOL WINAPI NtGdiGetRasterizerCaps( RASTERIZER_STATUS *status, UINT size ) } /************************************************************************* - * GetFontFileData (GDI32.@) + * NtGdiGetFontFileData (win32u.@) */ -BOOL WINAPI GetFontFileData( DWORD instance_id, DWORD file_index, UINT64 offset, void *buff, DWORD buff_size ) +BOOL WINAPI NtGdiGetFontFileData( DWORD instance_id, DWORD file_index, UINT64 *offset, + void *buff, DWORD buff_size ) { struct gdi_font *font; DWORD tag = 0, size; @@ -6767,8 +6768,8 @@ BOOL WINAPI GetFontFileData( DWORD instance_id, DWORD file_index, UINT64 offset, { if (font->ttc_item_offset) tag = MS_TTCF_TAG; size = font_funcs->get_font_data( font, tag, 0, NULL, 0 ); - if (size != GDI_ERROR && size >= buff_size && offset <= size - buff_size) - ret = font_funcs->get_font_data( font, tag, offset, buff, buff_size ) != GDI_ERROR; + if (size != GDI_ERROR && size >= buff_size && *offset <= size - buff_size) + ret = font_funcs->get_font_data( font, tag, *offset, buff, buff_size ) != GDI_ERROR; else SetLastError( ERROR_INVALID_PARAMETER ); } diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 98840af111d..22c67e79c71 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1968,3 +1968,12 @@ BOOL WINAPI EnableEUDC( BOOL enable ) FIXME( "(%d): stub\n", enable ); return FALSE; } + +/************************************************************************* + * GetFontFileData (GDI32.@) + */ +BOOL WINAPI GetFontFileData( DWORD instance_id, DWORD file_index, UINT64 offset, + void *buff, DWORD buff_size ) +{ + return NtGdiGetFontFileData( instance_id, file_index, &offset, buff, buff_size ); +}