[I8042PRT]

- check the right buffer's length
[WIN32K]
- simplify IntKeyboardUpdateLeds a bit and mind previous mode
- fixes keyboard indicators
CORE-8547

svn path=/trunk/; revision=64908
This commit is contained in:
Kamil Hornicek 2014-10-22 20:05:32 +00:00
parent b990d9a4c9
commit 0f21d941ce
2 changed files with 10 additions and 15 deletions

View file

@ -694,7 +694,7 @@ cleanup:
{
TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_KEYBOARD_QUERY_INDICATORS\n");
if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KEYBOARD_INDICATOR_PARAMETERS))
if (Stack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KEYBOARD_INDICATOR_PARAMETERS))
{
Status = STATUS_BUFFER_TOO_SMALL;
}

View file

@ -61,7 +61,7 @@ IntKeyboardGetIndicatorTrans(HANDLE hKeyboardDevice,
while (pRet)
{
Status = NtDeviceIoControlFile(hKeyboardDevice,
Status = ZwDeviceIoControlFile(hKeyboardDevice,
NULL,
NULL,
NULL,
@ -104,8 +104,7 @@ static
NTSTATUS APIENTRY
IntKeyboardUpdateLeds(HANDLE hKeyboardDevice,
WORD wVk,
WORD wScanCode,
BOOL bEnabled)
WORD wScanCode)
{
NTSTATUS Status;
UINT i;
@ -133,13 +132,10 @@ IntKeyboardUpdateLeds(HANDLE hKeyboardDevice,
if (LedFlag)
{
if (bEnabled)
gIndicators.LedFlags |= LedFlag;
else
gIndicators.LedFlags = ~LedFlag;
gIndicators.LedFlags ^= LedFlag;
/* Update the lights on the hardware */
Status = NtDeviceIoControlFile(hKeyboardDevice,
Status = ZwDeviceIoControlFile(hKeyboardDevice,
NULL,
NULL,
NULL,
@ -164,10 +160,10 @@ UserInitKeyboard(HANDLE hKeyboardDevice)
{
NTSTATUS Status;
IO_STATUS_BLOCK Block;
/*
IntKeyboardGetIndicatorTrans(hKeyboardDevice, &gpKeyboardIndicatorTrans);
Status = NtDeviceIoControlFile(hKeyboardDevice,
Status = ZwDeviceIoControlFile(hKeyboardDevice,
NULL,
NULL,
NULL,
@ -186,9 +182,9 @@ UserInitKeyboard(HANDLE hKeyboardDevice)
gIndicators.LedFlags & KEYBOARD_NUM_LOCK_ON);
SET_KEY_LOCKED(gafAsyncKeyState, VK_SCROLL,
gIndicators.LedFlags & KEYBOARD_SCROLL_LOCK_ON);
*/
// FIXME: Need device driver to work! HID support more than one!!!!
Status = NtDeviceIoControlFile(hKeyboardDevice,
Status = ZwDeviceIoControlFile(hKeyboardDevice,
NULL,
NULL,
NULL,
@ -808,8 +804,7 @@ ProcessKeyEvent(WORD wVk, WORD wScanCode, DWORD dwFlags, BOOL bInjected, DWORD d
/* Update keyboard LEDs */
IntKeyboardUpdateLeds(ghKeyboardDevice,
wSimpleVk,
wScanCode,
IS_KEY_LOCKED(gafAsyncKeyState, wSimpleVk));
wScanCode);
}
/* Call WH_KEYBOARD_LL hook */