From 8ac9f334b4b7591a42c6aabf90d5326fe3e0fd02 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Mon, 10 May 2021 15:54:11 +0200 Subject: [PATCH] infosoft/tests: Fix the pfnFillTextBuffer() return value. Windows Vista to Windows 10 1507 expect pfnFillTextBuffer() to return WBREAK_E_END_OF_TEXT to signal the end of the string. Returning unexpected values such as E_FAIL causes BreakText() to abort and report them to the caller. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50843 Signed-off-by: Francois Gouget Signed-off-by: Alexandre Julliard --- dlls/infosoft/tests/infosoft.c | 5 +++-- include/cierror.h | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/infosoft/tests/infosoft.c b/dlls/infosoft/tests/infosoft.c index d221cee5732..c76aba63466 100644 --- a/dlls/infosoft/tests/infosoft.c +++ b/dlls/infosoft/tests/infosoft.c @@ -24,6 +24,7 @@ #include #include #include "indexsrv.h" +#include "cierror.h" #include "wine/test.h" @@ -141,7 +142,7 @@ static wordsink_impl wordsink = { { &wsvt } }; static HRESULT WINAPI fillbuf_none(TEXT_SOURCE *ts) { - return E_FAIL; + return WBREAK_E_END_OF_TEXT; } static HRESULT WINAPI fillbuf_many(TEXT_SOURCE *ts) @@ -154,7 +155,7 @@ static HRESULT WINAPI fillbuf_many(TEXT_SOURCE *ts) ts->awcBuffer += ts->iCur; if (!ts->awcBuffer[0]) - return E_FAIL; + return WBREAK_E_END_OF_TEXT; for( i=0; ts->awcBuffer[i] && ts->awcBuffer[i] != ' '; i++) ; diff --git a/include/cierror.h b/include/cierror.h index 049985beb11..e646c18e4b0 100644 --- a/include/cierror.h +++ b/include/cierror.h @@ -19,6 +19,13 @@ #ifndef __WINE_CIERROR_H__ #define __WINE_CIERROR_H__ +#define WBREAK_E_END_OF_TEXT 0x80041780 +#define LANGUAGE_S_LARGE_WORD 0x00041781 +#define WBREAK_E_QUERY_ONLY 0x80041782 +#define WBREAK_E_BUFFER_TOO_SMALL 0x80041783 +#define LANGUAGE_E_DATABASE_NOT_FOUND 0x80041784 +#define WBREAK_E_INIT_FAILED 0x80041785 + #define CI_E_ALREADY_INITIALIZED 0x8004180a #define CI_E_NOT_INITIALIZED 0x8004180b #define CI_E_BUFFERTOOSMALL 0x8004180c