https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3d3bd4e77e71e96699589…
commit 3d3bd4e77e71e96699589d642d8c6e903df6219b
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Sep 23 19:28:09 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Sep 23 20:03:14 2018 +0200
[WIN32K] Work around GCC builds inventing dead keys.
CORE-14948
---
win32ss/user/ntuser/keyboard.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/win32ss/user/ntuser/keyboard.c b/win32ss/user/ntuser/keyboard.c
index 6167f9d6ff..f72e275cf2 100644
--- a/win32ss/user/ntuser/keyboard.c
+++ b/win32ss/user/ntuser/keyboard.c
@@ -467,17 +467,30 @@ IntToUnicodeEx(UINT wVirtKey,
WCHAR wchFirst, wchSecond;
TRACE("Previous dead char: %lc (%x)\n", wchDead, wchDead);
- for (i = 0; pKbdTbl->pDeadKey[i].dwBoth; i++)
+ if (pKbdTbl->pDeadKey)
{
- wchFirst = pKbdTbl->pDeadKey[i].dwBoth >> 16;
- wchSecond = pKbdTbl->pDeadKey[i].dwBoth & 0xFFFF;
- if (wchFirst == wchDead && wchSecond == wchTranslatedChar)
+ for (i = 0; pKbdTbl->pDeadKey[i].dwBoth; i++)
{
- wchTranslatedChar = pKbdTbl->pDeadKey[i].wchComposed;
+ wchFirst = pKbdTbl->pDeadKey[i].dwBoth >> 16;
+ wchSecond = pKbdTbl->pDeadKey[i].dwBoth & 0xFFFF;
+ if (wchFirst == wchDead && wchSecond == wchTranslatedChar)
+ {
+ wchTranslatedChar = pKbdTbl->pDeadKey[i].wchComposed;
+ wchDead = 0;
+ bDead = FALSE;
+ break;
+ }
+ }
+ }
+ else
+ {
+#if defined(__GNUC__)
+ if (wchDead == 0x8000)
+ {
+ ERR("GCC is inventing bits, ignoring fake dead key\n");
wchDead = 0;
- bDead = FALSE;
- break;
}
+#endif
}
TRACE("Final char: %lc (%x)\n", wchTranslatedChar, wchTranslatedChar);