[WIN32K] - Don't send unicode characters in WM_CHAR to ascii windows
authorRafal Harabien <rafalh@reactos.org>
Wed, 5 Oct 2011 19:11:00 +0000 (19:11 +0000)
committerRafal Harabien <rafalh@reactos.org>
Wed, 5 Oct 2011 19:11:00 +0000 (19:11 +0000)
svn path=/trunk/; revision=54014

reactos/subsystems/win32/win32k/ntuser/keyboard.c

index a0a59be..4c4077e 100644 (file)
@@ -1050,7 +1050,15 @@ IntTranslateKbdMessage(LPMSG lpMsg,
         for (i = 0; i < cch; ++i)
         {
             TRACE("Msg: %x '%lc' (%04x) %08x\n", NewMsg.message, wch[i], wch[i], NewMsg.lParam);
         for (i = 0; i < cch; ++i)
         {
             TRACE("Msg: %x '%lc' (%04x) %08x\n", NewMsg.message, wch[i], wch[i], NewMsg.lParam);
-            NewMsg.wParam = wch[i];
+            if (pWnd->Unicode)
+                NewMsg.wParam = wch[i];
+            else
+            {
+                CHAR ch;
+                if (!NT_SUCCESS(RtlUnicodeToMultiByteN(&ch, sizeof(ch), NULL, &wch[i], sizeof(wch[i]))))
+                    WARN("RtlUnicodeToMultiByteN failed!\n");
+                NewMsg.wParam = ch;
+            }
             MsqPostMessage(pti->MessageQueue, &NewMsg, FALSE, QS_KEY);
         }
         bResult = TRUE;
             MsqPostMessage(pti->MessageQueue, &NewMsg, FALSE, QS_KEY);
         }
         bResult = TRUE;