The ANSI string may be longer than the Unicode one.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- This fixes the ja_JP and zh_CN tests. https://test.winehq.org/data/patterns.html#shlwapi:ordinal
Hindi still fails because it is a Unicode-only locale so all the underlying kernel32 ANSI functions fail (bug 51407). --- dlls/shlwapi/ordinal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 52cc3b725fa..a45d75254a9 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -4360,7 +4360,8 @@ INT WINAPI SHFormatDateTimeA(const FILETIME UNALIGNED *fileTime, DWORD *flags, retval = SHFormatDateTimeW(fileTime, flags, bufW, size);
if (retval != 0) - WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, size, NULL, NULL); + /* the ANSI length may differ from the Unicode one */ + retval = WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, size, NULL, NULL);
HeapFree(GetProcessHeap(), 0, bufW); return retval;