Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/kernel32/locale.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index b546cb0..2698b3d 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -2726,6 +2726,7 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen, { ret = wine_cp_wcstombs( unix_cptable, flags, src, srclen, dst, dstlen, defchar, used ? &used_tmp : NULL ); + if (used) *used = used_tmp; break; } /* fall through */
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
In my opinion, when using CP_UNIXCP, the caller shouldn't care whether it fell back to UTF-8 or not, and it should not fail if the last two parameters are non-NULL.
This should simplify caller code that uses CP_UNIXCP with a non-NULL 'used' parameter.
dlls/kernel32/locale.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 2698b3d..1770319 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -2729,6 +2729,9 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen, if (used) *used = used_tmp; break; } + if (used) *used = FALSE; + defchar = NULL; + used = NULL; /* fall through */ case CP_UTF8: if (defchar || used)
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=56234
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit Chinese:China report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (64 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
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=56233
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit Chinese:China report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (64 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)