[KERNEL32] Use wine case mapping instead of ntdll

Previously tolowerW/toupperW was defined to towlower/towupper, which was imported from ntdll. These functions don't work correctly though. Instead use wine's case mapping table.
The "unhacking" is done in k32.h, because the original hacks in wine/unicode.h are still needed in other places.
Fixes 1 LCMApString test and prevents further regression when fixing iswctype in libcntpr.
This commit is contained in:
Timo Kreuzer
2025-12-10 09:55:30 +02:00
parent 2e1478ba93
commit ba14c5f390
+15
View File
@@ -77,4 +77,19 @@
/* Virtual DOS Machines (VDM) Support Definitions */
#include "include/vdm.h"
/* Undo hacks in wine/unicode.h */
#undef tolowerW
static inline WCHAR tolowerW( WCHAR ch )
{
extern WINE_UNICODE_API const WCHAR wine_casemap_lower[];
return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
}
#undef toupperW
static inline WCHAR toupperW( WCHAR ch )
{
extern WINE_UNICODE_API const WCHAR wine_casemap_upper[];
return ch + wine_casemap_upper[wine_casemap_upper[ch >> 8] + (ch & 0xff)];
}
#endif /* __K32_H */