Author: jimtabor
Date: Fri May 9 23:08:56 2014
New Revision: 63210
URL:
http://svn.reactos.org/svn/reactos?rev=63210&view=rev
Log:
- Fix API see CORE-8107.
Modified:
trunk/reactos/win32ss/user/user32/windows/accel.c
Modified: trunk/reactos/win32ss/user/user32/windows/accel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/accel.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/accel.c [iso-8859-1] Fri May 9 23:08:56
2014
@@ -344,21 +344,26 @@
*/
int WINAPI TranslateAcceleratorA(HWND hWnd, HACCEL hAccTable, LPMSG lpMsg)
{
- MSG mCopy = *lpMsg;
- CHAR cChar;
- WCHAR wChar;
- NTSTATUS Status;
-
- if(!U32IsValidAccelMessage(lpMsg->message)) return 0;
-
- Status = RtlMultiByteToUnicodeN(&wChar, sizeof(wChar), NULL, &cChar,
sizeof(cChar));
- if(!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return 0;
- }
-
- return TranslateAcceleratorW(hWnd, hAccTable, &mCopy);
+ switch (lpMsg->message)
+ {
+ case WM_KEYDOWN:
+ case WM_SYSKEYDOWN:
+ return TranslateAcceleratorW( hWnd, hAccTable, lpMsg );
+
+ case WM_CHAR:
+ case WM_SYSCHAR:
+ {
+ MSG msgW = *lpMsg;
+ char ch = LOWORD(lpMsg->wParam);
+ WCHAR wch;
+ MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wch, 1);
+ msgW.wParam = MAKEWPARAM(wch, HIWORD(lpMsg->wParam));
+ return TranslateAcceleratorW( hWnd, hAccTable, &msgW );
+ }
+
+ default:
+ return 0;
+ }
}
/* EOF */