From: Haoyang Chen chenhaoyang@kylinos.cn
--- dlls/mlang/mlang.c | 5 +++++ dlls/mlang/tests/mlang.c | 9 +++++++++ 2 files changed, 14 insertions(+)
diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index 9f7d1159e57..2606e24a90d 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -3471,6 +3471,11 @@ static HRESULT WINAPI fnIMLangFontLink2_GetFontCodePages(IMLangFontLink2 *iface,
TRACE("(%p)->(%p %p %p)\n", This, hdc, hfont, codepages);
+ if (codepages) *codepages = 0; + + if (!hdc || !hfont) + return E_FAIL; + old_font = SelectObject(hdc, hfont); GetTextCharsetInfo(hdc, &fontsig, 0); SelectObject(hdc, old_font); diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c index 42847406eb8..17f73211082 100644 --- a/dlls/mlang/tests/mlang.c +++ b/dlls/mlang/tests/mlang.c @@ -2809,6 +2809,15 @@ static void test_MapFont(IMLangFontLink *font_link, IMLangFontLink2 *font_link2) ok((codepages & (~font_codepages)) != 0 && (codepages & font_codepages) != 0, "code pages of font is incorrect\n");
+ font_codepages = 1; + ret = IMLangFontLink_GetFontCodePages(font_link, NULL, font1, &font_codepages); + ok(ret == E_FAIL && !font_codepages, "expected E_FAIL, but got: %lx, font_codepages:%lx \n", + ret, font_codepages); + font_codepages = 2; + ret = IMLangFontLink_GetFontCodePages(font_link, hdc, NULL, &font_codepages); + ok(ret == E_FAIL && !font_codepages, "expected E_FAIL, but got: %lx, font_codepages:%lx \n", + ret, font_codepages); + IMLangFontLink_ResetFontMapping(font_link); IMLangFontLink2_ResetFontMapping(font_link2); ReleaseDC(NULL, hdc);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148917
Your paranoid android.
=== w1064v1507 (32 bit report) ===
mlang: mlang.c:2805: Test failed: expected !NULL/!NULL, got 00000000/110A06F6
=== w1064v1507 (64 bit report) ===
mlang: mlang.c:2805: Test failed: expected !NULL/!NULL, got 0000000000000000/00000000250A0529
Checking for NULL is not exactly checking handle validity. You should try with other invalid values.
On Thu Oct 10 08:08:31 2024 +0000, Alexandre Julliard wrote:
Checking for NULL is not exactly checking handle validity. You should try with other invalid values.
Yeah, I will use the return value of SelectObject to check handle validity.