[KBDHID] IOCTL_KEYBOARD_QUERY_ATTRIBUTES: Return proper KEYBOARD_ATTRIBUTES buffer size

This commit is contained in:
Eric Kohl 2021-09-12 16:33:02 +02:00
parent 984c7da24d
commit b6249d5ede

View file

@ -381,7 +381,7 @@ KbdHid_InternalDeviceControl(
{
case IOCTL_KEYBOARD_QUERY_ATTRIBUTES:
/* verify output buffer length */
if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(MOUSE_ATTRIBUTES))
if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KEYBOARD_ATTRIBUTES))
{
/* invalid request */
DPRINT1("[KBDHID] IOCTL_KEYBOARD_QUERY_ATTRIBUTES Buffer too small\n");
@ -399,7 +399,7 @@ KbdHid_InternalDeviceControl(
sizeof(KEYBOARD_ATTRIBUTES));
/* complete request */
Irp->IoStatus.Information = sizeof(MOUSE_ATTRIBUTES);
Irp->IoStatus.Information = sizeof(KEYBOARD_ATTRIBUTES);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;