From f47751a992967af7bb35534fa424baaea867750c Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 2 Aug 2021 20:46:35 +0300 Subject: [PATCH] gdi32: Update font realization structure definition. Signed-off-by: Nikolay Sivov Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/dwrite/gdiinterop.c | 12 +++++++----- dlls/dwrite/tests/font.c | 2 +- dlls/gdi32/font.c | 8 ++++---- dlls/gdi32/ntgdi_private.h | 2 +- dlls/gdi32/tests/font.c | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index 6a5953a67e9..8df3f9f97ca 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -737,17 +737,19 @@ static HRESULT WINAPI gdiinterop_ConvertFontFaceToLOGFONT(IDWriteGdiInterop1 *if return S_OK; } -struct font_realization_info { +struct font_realization_info +{ DWORD size; DWORD flags; DWORD cache_num; DWORD instance_id; - DWORD unk; + DWORD file_count; WORD face_index; WORD simulations; }; -struct font_fileinfo { +struct font_fileinfo +{ FILETIME writetime; LARGE_INTEGER size; WCHAR path[1]; @@ -755,8 +757,8 @@ struct font_fileinfo { /* Undocumented gdi32 exports, used to access actually selected font information */ extern BOOL WINAPI GetFontRealizationInfo(HDC hdc, struct font_realization_info *info); -extern BOOL WINAPI GetFontFileInfo(DWORD instance_id, DWORD unknown, struct font_fileinfo *info, SIZE_T size, SIZE_T *needed); -extern BOOL WINAPI GetFontFileData(DWORD instance_id, DWORD unknown, UINT64 offset, void *buff, DWORD buff_size); +extern BOOL WINAPI GetFontFileInfo(DWORD instance_id, DWORD file_index, struct font_fileinfo *info, SIZE_T size, SIZE_T *needed); +extern BOOL WINAPI GetFontFileData(DWORD instance_id, DWORD file_index, UINT64 offset, void *buff, DWORD buff_size); static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface, HDC hdc, IDWriteFontFace **fontface) diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 9f814504a44..be367463414 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -4276,7 +4276,7 @@ struct font_realization_info DWORD flags; DWORD cache_num; DWORD instance_id; - DWORD unk; + DWORD file_count; WORD face_index; WORD simulations; }; diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 16d3bdf26ba..442c76fb026 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3177,7 +3177,7 @@ static BOOL CDECL font_GetFontRealizationInfo( PHYSDEV dev, void *ptr ) info->instance_id = physdev->font->handle; if (info->size == sizeof(*info)) { - info->unk = 0; + info->file_count = 1; info->face_index = physdev->font->face_index; info->simulations = 0; if (physdev->font->fake_bold) info->simulations |= 0x1; @@ -8304,7 +8304,7 @@ BOOL WINAPI FontIsLinked(HDC hdc) */ BOOL WINAPI GetFontRealizationInfo(HDC hdc, struct font_realization_info *info) { - BOOL is_v0 = info->size == FIELD_OFFSET(struct font_realization_info, unk); + BOOL is_v0 = info->size == FIELD_OFFSET(struct font_realization_info, file_count); PHYSDEV dev; BOOL ret; DC *dc; @@ -8334,7 +8334,7 @@ BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes) /************************************************************************* * GetFontFileData (GDI32.@) */ -BOOL WINAPI GetFontFileData( DWORD instance_id, DWORD unknown, UINT64 offset, void *buff, DWORD buff_size ) +BOOL WINAPI GetFontFileData( DWORD instance_id, DWORD file_index, UINT64 offset, void *buff, DWORD buff_size ) { struct gdi_font *font; DWORD tag = 0, size; @@ -8366,7 +8366,7 @@ struct font_fileinfo /************************************************************************* * GetFontFileInfo (GDI32.@) */ -BOOL WINAPI GetFontFileInfo( DWORD instance_id, DWORD unknown, struct font_fileinfo *info, +BOOL WINAPI GetFontFileInfo( DWORD instance_id, DWORD file_index, struct font_fileinfo *info, SIZE_T size, SIZE_T *needed ) { SIZE_T required_size = 0; diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h index 4817e428a46..ebcaef89f1c 100644 --- a/dlls/gdi32/ntgdi_private.h +++ b/dlls/gdi32/ntgdi_private.h @@ -289,7 +289,7 @@ struct font_realization_info DWORD flags; /* 1 for bitmap fonts, 3 for scalable fonts */ DWORD cache_num; /* keeps incrementing - num of fonts that have been created allowing for caching?? */ DWORD instance_id; /* identifies a realized font instance */ - DWORD unk; /* unknown */ + DWORD file_count; /* number of files that make up this font */ WORD face_index; /* face index in case of font collections */ WORD simulations; /* 0 bit - bold simulation, 1 bit - oblique simulation */ }; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 7aee0a86d23..ef1dc26595d 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -4334,7 +4334,7 @@ struct font_realization_info DWORD flags; DWORD cache_num; DWORD instance_id; - DWORD unk; + DWORD file_count; WORD face_index; WORD simulations; };