Hi Dmitry,

On Tue, 26 Jul 2005 16:56:31 +0900
"Dmitry Timoshkov" <[EMAIL PROTECTED]> wrote:

> The key word is "the whole" wparam. So, there is no need to truncate it
> by using LOWORD.

Oh sorry. For some reason I thought that HIWORD(wParam) is used for some
other data. Here is a new patch, is it ok?

> > > > AFAIK in DBCS two separate messages are used.
> > > 
> > > A test under Windows would say it for sure.
> > 
> > I can't test it as I don't have a Windows with DBCS locales installed,
> 
> Just install one of such locales then, NT/2k/XP have built-in support
> for DBCS locales.

I'll try to find a distro that has. However, my 2000 and XP distros have an
installation option for CJK locales, but the needed files are not on the
installation CDs.

-- Ph.
Index: dlls/user/message.c
===================================================================
RCS file: /home/wine/wine/dlls/user/message.c,v
retrieving revision 1.86
diff -p -u -r1.86 message.c
--- dlls/user/message.c	19 Jul 2005 19:14:32 -0000	1.86
+++ dlls/user/message.c	26 Jul 2005 09:06:33 -0000
@@ -368,10 +368,12 @@ static WPARAM map_wparam_AtoW( UINT mess
     case WM_SYSDEADCHAR:
     case WM_MENUCHAR:
         {
-            char ch = LOWORD(wparam);
-            WCHAR wch;
-            MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wch, 1);
-            wparam = MAKEWPARAM( wch, HIWORD(wparam) );
+            BYTE ch[2];
+            WCHAR wch[2];
+            ch[0] = (wparam & 0xFF);
+            ch[1] = (wparam >> 8);
+            MultiByteToWideChar(CP_ACP, 0, ch, 2, wch, 2);
+            wparam = MAKEWPARAM(wch[0], wch[1]);
         }
         break;
     case WM_IME_CHAR:
@@ -407,10 +409,12 @@ static WPARAM map_wparam_WtoA( UINT mess
     case WM_SYSDEADCHAR:
     case WM_MENUCHAR:
         {
-            WCHAR wch = LOWORD(wparam);
-            BYTE ch;
-            WideCharToMultiByte( CP_ACP, 0, &wch, 1, (LPSTR)&ch, 1, NULL, NULL );
-            wparam = MAKEWPARAM( ch, HIWORD(wparam) );
+            WCHAR wch[2];
+            BYTE ch[2];
+            wch[0] = LOWORD(wparam);
+            wch[1] = HIWORD(wparam);
+            WideCharToMultiByte( CP_ACP, 0, wch, 2, (LPSTR)ch, 2, NULL, NULL );
+            wparam = MAKEWPARAM( ch[0] | (ch[1] << 8), 0 );
         }
         break;
     case WM_IME_CHAR:

Reply via email to