winex11: Make sure GetKeyNameText gets the correct length to return.
This commit is contained in:
parent
7363b6e2e3
commit
349337d7ef
|
@ -2349,11 +2349,7 @@ INT CDECL X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize)
|
||||||
TRACE("found scan=%04x keyc=%04x keysym=%04x string=%s\n",
|
TRACE("found scan=%04x keyc=%04x keysym=%04x string=%s\n",
|
||||||
scanCode, keyc, (int)keys, name);
|
scanCode, keyc, (int)keys, name);
|
||||||
if (lpBuffer && nSize && name)
|
if (lpBuffer && nSize && name)
|
||||||
{
|
return MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize);
|
||||||
MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize);
|
|
||||||
lpBuffer[nSize - 1] = 0;
|
|
||||||
return nSize;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finally issue WARN for unknown keys */
|
/* Finally issue WARN for unknown keys */
|
||||||
|
|
Loading…
Reference in New Issue