Skip to content

Commit ba14c5f

Browse files
committed
[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.
1 parent 2e1478b commit ba14c5f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dll/win32/kernel32/k32.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,19 @@
7777
/* Virtual DOS Machines (VDM) Support Definitions */
7878
#include "include/vdm.h"
7979

80+
/* Undo hacks in wine/unicode.h */
81+
#undef tolowerW
82+
static inline WCHAR tolowerW( WCHAR ch )
83+
{
84+
extern WINE_UNICODE_API const WCHAR wine_casemap_lower[];
85+
return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
86+
}
87+
88+
#undef toupperW
89+
static inline WCHAR toupperW( WCHAR ch )
90+
{
91+
extern WINE_UNICODE_API const WCHAR wine_casemap_upper[];
92+
return ch + wine_casemap_upper[wine_casemap_upper[ch >> 8] + (ch & 0xff)];
93+
}
94+
8095
#endif /* __K32_H */

0 commit comments

Comments
 (0)