[PATCH] msvcrt: Correct return value of ___mb_cur_max_l_func().
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> --- dlls/msvcr90/tests/msvcr90.c | 17 +++++++++++++++++ dlls/msvcrt/mbcs.c | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index 050699e4857..c32677addd5 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -136,6 +136,7 @@ static int (__cdecl *p__memicmp_l)(const char*, const char*, size_t, _locale_t); static int (__cdecl *p__vsnwprintf)(wchar_t *buffer,size_t count, const wchar_t *format, __ms_va_list valist); static size_t (__cdecl *p___strncnt)(const char *str, size_t count); static int (__cdecl *p_swscanf)(const wchar_t *str, const wchar_t* format, ...); +static int (__cdecl *p____mb_cur_max_l_func)(_locale_t locale); /* make sure we use the correct errno */ #undef errno @@ -407,6 +408,7 @@ static BOOL init(void) SET(p__vsnwprintf, "_vsnwprintf"); SET(p___strncnt, "__strncnt"); SET(p_swscanf, "swscanf"); + SET(p____mb_cur_max_l_func, "___mb_cur_max_l_func"); if (sizeof(void *) == 8) { @@ -1938,6 +1940,20 @@ static void test_swscanf(void) ok( ret == (short)WEOF, "ret = %d\n", ret ); } +static void test____mb_cur_max_l_func(void) +{ + int ret; + _locale_t l; + + ret = p____mb_cur_max_l_func(NULL); + ok( ret == 1, "MB_CUR_MAX_L(NULL) = %d\n", ret ); + + l = _create_locale(LC_ALL, "chinese-traditional"); + ret = p____mb_cur_max_l_func(l); + ok( ret == 2, "MB_CUR_MAX_L(cht) = %d\n", ret ); + _free_locale(l); +} + START_TEST(msvcr90) { if(!init()) @@ -1977,4 +1993,5 @@ START_TEST(msvcr90) #endif test___strncnt(); test_swscanf(); + test____mb_cur_max_l_func(); } diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index a9dbcfff661..39f94b17a36 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -184,7 +184,7 @@ int CDECL MSVCRT____mb_cur_max_func(void) /********************************************************************* * ___mb_cur_max_l_func (MSVCR80.@) */ -int* CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale) +int CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale) { MSVCRT_pthreadlocinfo locinfo; @@ -193,7 +193,7 @@ int* CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale) else locinfo = locale->locinfo; - return &locinfo->mb_cur_max; + return locinfo->mb_cur_max; } #endif -- 2.24.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=61916 Your paranoid android. === wxppro (32 bit report) === msvcr90: msvcr90: Timeout === w2003std (task log) === Task errors: The task timed out === wvistau64 (32 bit report) === msvcr90: msvcr90: Timeout === w2008s64 (32 bit report) === msvcr90: msvcr90: Timeout === w7u (32 bit report) === msvcr90: msvcr90: Timeout === wvistau64 (64 bit report) === msvcr90: msvcr90: Timeout === w2008s64 (64 bit report) === msvcr90: msvcr90: Timeout
participants (2)
-
Chip Davis -
Marvin