mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:32:57 +00:00
[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:
parent
b990d9a4c9
commit
0f21d941ce
2 changed files with 10 additions and 15 deletions
|
@ -694,7 +694,7 @@ cleanup:
|
||||||
{
|
{
|
||||||
TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_KEYBOARD_QUERY_INDICATORS\n");
|
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;
|
Status = STATUS_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ IntKeyboardGetIndicatorTrans(HANDLE hKeyboardDevice,
|
||||||
|
|
||||||
while (pRet)
|
while (pRet)
|
||||||
{
|
{
|
||||||
Status = NtDeviceIoControlFile(hKeyboardDevice,
|
Status = ZwDeviceIoControlFile(hKeyboardDevice,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -104,8 +104,7 @@ static
|
||||||
NTSTATUS APIENTRY
|
NTSTATUS APIENTRY
|
||||||
IntKeyboardUpdateLeds(HANDLE hKeyboardDevice,
|
IntKeyboardUpdateLeds(HANDLE hKeyboardDevice,
|
||||||
WORD wVk,
|
WORD wVk,
|
||||||
WORD wScanCode,
|
WORD wScanCode)
|
||||||
BOOL bEnabled)
|
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UINT i;
|
UINT i;
|
||||||
|
@ -133,13 +132,10 @@ IntKeyboardUpdateLeds(HANDLE hKeyboardDevice,
|
||||||
|
|
||||||
if (LedFlag)
|
if (LedFlag)
|
||||||
{
|
{
|
||||||
if (bEnabled)
|
gIndicators.LedFlags ^= LedFlag;
|
||||||
gIndicators.LedFlags |= LedFlag;
|
|
||||||
else
|
|
||||||
gIndicators.LedFlags = ~LedFlag;
|
|
||||||
|
|
||||||
/* Update the lights on the hardware */
|
/* Update the lights on the hardware */
|
||||||
Status = NtDeviceIoControlFile(hKeyboardDevice,
|
Status = ZwDeviceIoControlFile(hKeyboardDevice,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -164,10 +160,10 @@ UserInitKeyboard(HANDLE hKeyboardDevice)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
IO_STATUS_BLOCK Block;
|
IO_STATUS_BLOCK Block;
|
||||||
/*
|
|
||||||
IntKeyboardGetIndicatorTrans(hKeyboardDevice, &gpKeyboardIndicatorTrans);
|
IntKeyboardGetIndicatorTrans(hKeyboardDevice, &gpKeyboardIndicatorTrans);
|
||||||
|
|
||||||
Status = NtDeviceIoControlFile(hKeyboardDevice,
|
Status = ZwDeviceIoControlFile(hKeyboardDevice,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -186,9 +182,9 @@ UserInitKeyboard(HANDLE hKeyboardDevice)
|
||||||
gIndicators.LedFlags & KEYBOARD_NUM_LOCK_ON);
|
gIndicators.LedFlags & KEYBOARD_NUM_LOCK_ON);
|
||||||
SET_KEY_LOCKED(gafAsyncKeyState, VK_SCROLL,
|
SET_KEY_LOCKED(gafAsyncKeyState, VK_SCROLL,
|
||||||
gIndicators.LedFlags & KEYBOARD_SCROLL_LOCK_ON);
|
gIndicators.LedFlags & KEYBOARD_SCROLL_LOCK_ON);
|
||||||
*/
|
|
||||||
// FIXME: Need device driver to work! HID support more than one!!!!
|
// FIXME: Need device driver to work! HID support more than one!!!!
|
||||||
Status = NtDeviceIoControlFile(hKeyboardDevice,
|
Status = ZwDeviceIoControlFile(hKeyboardDevice,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -808,8 +804,7 @@ ProcessKeyEvent(WORD wVk, WORD wScanCode, DWORD dwFlags, BOOL bInjected, DWORD d
|
||||||
/* Update keyboard LEDs */
|
/* Update keyboard LEDs */
|
||||||
IntKeyboardUpdateLeds(ghKeyboardDevice,
|
IntKeyboardUpdateLeds(ghKeyboardDevice,
|
||||||
wSimpleVk,
|
wSimpleVk,
|
||||||
wScanCode,
|
wScanCode);
|
||||||
IS_KEY_LOCKED(gafAsyncKeyState, wSimpleVk));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call WH_KEYBOARD_LL hook */
|
/* Call WH_KEYBOARD_LL hook */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue