From d0578c080a360f5f8d8ce7c0bb2921f35ac43fee Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 14 Apr 2010 12:31:59 +0200 Subject: [PATCH] kernel32: Map the new detailed direction information back to the Windows constants. --- dlls/kernel32/locale.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 7a141b2b110..76076ea27f9 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -2261,6 +2261,26 @@ DWORD WINAPI VerLanguageNameW( DWORD wLang, LPWSTR szLang, DWORD nSize ) */ BOOL WINAPI GetStringTypeW( DWORD type, LPCWSTR src, INT count, LPWORD chartype ) { + static const unsigned char type2_map[16] = + { + C2_NOTAPPLICABLE, /* unassigned */ + C2_LEFTTORIGHT, /* L */ + C2_RIGHTTOLEFT, /* R */ + C2_EUROPENUMBER, /* EN */ + C2_EUROPESEPARATOR, /* ES */ + C2_EUROPETERMINATOR, /* ET */ + C2_ARABICNUMBER, /* AN */ + C2_COMMONSEPARATOR, /* CS */ + C2_BLOCKSEPARATOR, /* B */ + C2_SEGMENTSEPARATOR, /* S */ + C2_WHITESPACE, /* WS */ + C2_OTHERNEUTRAL, /* ON */ + C2_RIGHTTOLEFT, /* AL */ + C2_NOTAPPLICABLE, /* NSM */ + C2_NOTAPPLICABLE, /* BN */ + C2_OTHERNEUTRAL /* LRE, LRO, RLE, RLO, PDF */ + }; + if (count == -1) count = strlenW(src) + 1; switch(type) { @@ -2268,7 +2288,7 @@ BOOL WINAPI GetStringTypeW( DWORD type, LPCWSTR src, INT count, LPWORD chartype while (count--) *chartype++ = get_char_typeW( *src++ ) & 0xfff; break; case CT_CTYPE2: - while (count--) *chartype++ = get_char_typeW( *src++ ) >> 12; + while (count--) *chartype++ = type2_map[get_char_typeW( *src++ ) >> 12]; break; case CT_CTYPE3: {