Commit in reactos/lib/user32/windows on MAIN
input.c+12-71.26 -> 1.27
Implement ToAscii() and ToAsciiEx()

reactos/lib/user32/windows
input.c 1.26 -> 1.27
diff -u -r1.26 -r1.27
--- input.c	11 Dec 2004 18:43:06 -0000	1.26
+++ input.c	28 Dec 2004 08:58:35 -0000	1.27
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: input.c,v 1.26 2004/12/11 18:43:06 sedwards Exp $
+/* $Id: input.c,v 1.27 2004/12/28 08:58:35 gvg Exp $
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/input.c
@@ -392,7 +392,7 @@
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 int STDCALL
 ToAscii(UINT uVirtKey,
@@ -401,13 +401,12 @@
 	LPWORD lpChar,
 	UINT uFlags)
 {
-  UNIMPLEMENTED;
-  return 0;
+  return ToAsciiEx(uVirtKey, uScanCode, lpKeyState, lpChar, uFlags, 0);
 }
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 int STDCALL
 ToAsciiEx(UINT uVirtKey,
@@ -417,8 +416,14 @@
 	  UINT uFlags,
 	  HKL dwhkl)
 {
-  UNIMPLEMENTED;
-  return 0;
+  WCHAR UniChars[2];
+  int Ret, CharCount;
+
+  Ret = ToUnicodeEx(uVirtKey, uScanCode, lpKeyState, UniChars, 2, uFlags, dwhkl);
+  CharCount = (Ret < 0 ? 1 : Ret);
+  WideCharToMultiByte(CP_ACP, 0, UniChars, CharCount, (LPSTR) lpChar, 2, NULL, NULL);
+
+  return Ret;
 }
 
 
CVSspam 0.2.8