From 9ec6fd85c41f148456dae7ca74758157d4f426a1 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 30 Mar 2015 11:57:28 +0300 Subject: [PATCH] dwrite: Return CreateStreamFromKey() failure code from Analyze(). --- dlls/dwrite/font.c | 6 ++++-- dlls/dwrite/tests/font.c | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 59eda809445..fc067a57fbf 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -1715,10 +1715,12 @@ HRESULT create_font_collection(IDWriteFactory2* factory, IDWriteFontFileEnumerat if (FAILED(hr)) break; + /* failed font files are skipped */ hr = IDWriteFontFile_Analyze(file, &supported, &file_type, &face_type, &face_count); if (FAILED(hr) || !supported || face_count == 0) { - TRACE("unsupported font (0x%08x, %d, %u)\n", hr, supported, face_count); + TRACE("unsupported font (%p, 0x%08x, %d, %u)\n", file, hr, supported, face_count); IDWriteFontFile_Release(file); + hr = S_OK; continue; } @@ -2080,7 +2082,7 @@ static HRESULT WINAPI dwritefontfile_Analyze(IDWriteFontFile *iface, BOOL *isSup hr = IDWriteFontFileLoader_CreateStreamFromKey(This->loader, This->reference_key, This->key_size, &stream); if (FAILED(hr)) - return S_OK; + return hr; hr = opentype_analyze_font(stream, numberOfFaces, fontFileType, fontFaceType, isSupportedFontType); diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 9762d49df45..3afcd0c1e31 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -1814,15 +1814,14 @@ static void test_CreateCustomFontFileReference(void) face_type = DWRITE_FONT_FACE_TYPE_TRUETYPE; support = TRUE; count = 1; - IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count); + ok(hr == 0x8faecafe, "got 0x%08x\n", hr); ok(support == FALSE, "got %i\n", support); ok(file_type == DWRITE_FONT_FILE_TYPE_UNKNOWN, "got %i\n", file_type); ok(face_type == DWRITE_FONT_FACE_TYPE_UNKNOWN, "got %i\n", face_type); ok(count == 0, "got %i\n", count); hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, 0, &face); -todo_wine ok(hr == 0x8faecafe, "got 0x%08x\n", hr); IDWriteFontFile_Release(file);