Alexandre Julliard : kernel32: Map the new detailed direction information back to the Windows constants.

Alexandre Julliard julliard at winehq.org
Wed Apr 14 11:24:58 CDT 2010


Module: wine
Branch: master
Commit: d0578c080a360f5f8d8ce7c0bb2921f35ac43fee
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d0578c080a360f5f8d8ce7c0bb2921f35ac43fee

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Apr 14 12:31:59 2010 +0200

kernel32: Map the new detailed direction information back to the Windows constants.

---

 dlls/kernel32/locale.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 7a141b2..76076ea 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:
     {




More information about the wine-cvs mailing list