Moved implementation of LoadKeyboardLayout from ASCII to Unicode.

This commit is contained in:
Stefan Leichter 2002-11-18 19:47:20 +00:00 committed by Alexandre Julliard
parent f9128d79d2
commit 5d0b987151
1 changed files with 14 additions and 9 deletions

View File

@ -40,6 +40,7 @@
#include "input.h"
#include "message.h"
#include "queue.h"
#include "winternl.h"
#include "wine/debug.h"
#include "winerror.h"
@ -887,26 +888,30 @@ BOOL WINAPI UnregisterHotKey(HWND hwnd,INT id) {
}
/***********************************************************************
* LoadKeyboardLayoutA (USER32.@)
* LoadKeyboardLayoutW (USER32.@)
* Call ignored. WINE supports only system default keyboard layout.
*/
HKL WINAPI LoadKeyboardLayoutA(LPCSTR pwszKLID, UINT Flags)
HKL WINAPI LoadKeyboardLayoutW(LPCWSTR pwszKLID, UINT Flags)
{
TRACE_(keyboard)("(%s, %d)\n", pwszKLID, Flags);
TRACE_(keyboard)("(%s, %d)\n", debugstr_w(pwszKLID), Flags);
ERR_(keyboard)("Only default system keyboard layout supported. Call ignored.\n");
return 0;
}
/***********************************************************************
* LoadKeyboardLayoutW (USER32.@)
* LoadKeyboardLayoutA (USER32.@)
*/
HKL WINAPI LoadKeyboardLayoutW(LPCWSTR pwszKLID, UINT Flags)
HKL WINAPI LoadKeyboardLayoutA(LPCSTR pwszKLID, UINT Flags)
{
char buf[9];
HKL ret;
UNICODE_STRING pwszKLIDW;
WideCharToMultiByte( CP_ACP, 0, pwszKLID, -1, buf, sizeof(buf), NULL, NULL );
buf[8] = 0;
return LoadKeyboardLayoutA(buf, Flags);
if (pwszKLID) RtlCreateUnicodeStringFromAsciiz(&pwszKLIDW, pwszKLID);
else pwszKLIDW.Buffer = NULL;
ret = LoadKeyboardLayoutW(pwszKLIDW.Buffer, Flags);
RtlFreeUnicodeString(&pwszKLIDW);
return ret;
}