https://bugs.winehq.org/show_bug.cgi?id=55446
Bug ID: 55446 Summary: Using C run-time for unicode strings comparison breaks case insensitive LB_FINDSTRING Product: Wine Version: 8.13 Hardware: x86-64 OS: Linux Status: NEW Keywords: regression Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: dmitry@baikal.ru CC: julliard@winehq.org Regression SHA1: 9cc92365560f19c2fd2b9796f79aa75e02381bb1 Distribution: ---
If an application uses LB_FINDSTRING and provides a string that doesn't match exactly then LB_FINDSTRING fails. This is a regression, and it's caused by
commit 9cc92365560f19c2fd2b9796f79aa75e02381bb1 Author: Alexandre Julliard julliard@winehq.org Date: Mon Sep 21 13:53:21 2020 +0200
user32: Build with msvcrt.
Signed-off-by: Alexandre Julliard julliard@winehq.org
wcsnicmp() used by LB_FINDSTRING (in both user32 and comctl32) doesn't work properly because it depends on LC_TYPE locale being correctly set, otherwise _towlower_l() correctly handles only ASCII character range.
Relying on CRT locale being correctly initialized in a win32 core DLL seems undesirable because an application may not use or care about C run-time at all.
Under Windows SendMessageW(LB_FINDSTRING) works just fine regardless of system locale.
P.S. This is a much more serious problem, and is not limited to user32/comctl32 because wcsnicmp()/wcsicmp() is used everywhere in the Wine codebase.