Author: tkreuzer
Date: Wed Nov 20 21:57:51 2013
New Revision: 61060
URL:
http://svn.reactos.org/svn/reactos?rev=61060&view=rev
Log:
[I8042PRT]
Hackplement support for IOCTL_KEYBOARD_QUERY_ATTRIBUTES
Modified:
trunk/reactos/drivers/input/i8042prt/keyboard.c
Modified: trunk/reactos/drivers/input/i8042prt/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/key…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/keyboard.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/keyboard.c [iso-8859-1] Wed Nov 20 21:57:51 2013
@@ -468,6 +468,34 @@
return Status;
}
+VOID
+NTAPI
+i8042InitializeKeyboardAttributes(
+ PI8042_KEYBOARD_EXTENSION DeviceExtension)
+{
+ PPORT_DEVICE_EXTENSION PortDeviceExtension;
+ PI8042_SETTINGS Settings;
+ PKEYBOARD_ATTRIBUTES KeyboardAttributes;
+
+ PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
+ Settings = &PortDeviceExtension->Settings;
+
+ KeyboardAttributes = &DeviceExtension->KeyboardAttributes;
+
+ KeyboardAttributes->KeyboardIdentifier.Type =
(UCHAR)Settings->OverrideKeyboardType;
+ KeyboardAttributes->KeyboardIdentifier.Subtype =
(UCHAR)Settings->OverrideKeyboardSubtype;
+ KeyboardAttributes->NumberOfFunctionKeys = 4;
+ KeyboardAttributes->NumberOfIndicators = 3;
+ KeyboardAttributes->NumberOfKeysTotal = 101;
+ KeyboardAttributes->InputDataQueueLength = Settings->KeyboardDataQueueSize;
+ KeyboardAttributes->KeyRepeatMinimum.UnitId = 0;
+ KeyboardAttributes->KeyRepeatMinimum.Rate = (USHORT)Settings->SampleRate;
+ KeyboardAttributes->KeyRepeatMinimum.Delay = 0;
+ KeyboardAttributes->KeyRepeatMinimum.UnitId = 0;
+ KeyboardAttributes->KeyRepeatMinimum.Rate = (USHORT)Settings->SampleRate;
+ KeyboardAttributes->KeyRepeatMinimum.Delay = 0;
+}
+
/*
* Runs the keyboard IOCTL_INTERNAL dispatch.
*/
@@ -557,6 +585,8 @@
}
DeviceExtension->Common.PortDeviceExtension->KeyboardExtension =
DeviceExtension;
DeviceExtension->Common.PortDeviceExtension->Flags |= KEYBOARD_CONNECTED;
+
+ i8042InitializeKeyboardAttributes(DeviceExtension);
IoMarkIrpPending(Irp);
/* FIXME: DeviceExtension->KeyboardHook.IsrWritePort = ; */
@@ -601,8 +631,8 @@
}
case IOCTL_KEYBOARD_QUERY_ATTRIBUTES:
{
- DPRINT1("IOCTL_KEYBOARD_QUERY_ATTRIBUTES not implemented\n");
-#if 0
+ PKEYBOARD_ATTRIBUTES KeyboardAttributes;
+
/* FIXME: KeyboardAttributes are not initialized anywhere */
TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_KEYBOARD_QUERY_ATTRIBUTES\n");
if (Stack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(KEYBOARD_ATTRIBUTES))
@@ -611,11 +641,13 @@
break;
}
- *(PKEYBOARD_ATTRIBUTES) Irp->AssociatedIrp.SystemBuffer =
DeviceExtension->KeyboardAttributes;
+ KeyboardAttributes = Irp->AssociatedIrp.SystemBuffer;
+ *KeyboardAttributes = DeviceExtension->KeyboardAttributes;
+
Irp->IoStatus.Information = sizeof(KEYBOARD_ATTRIBUTES);
Status = STATUS_SUCCESS;
break;
-#endif
+
Status = STATUS_NOT_IMPLEMENTED;
break;
}
@@ -812,7 +844,7 @@
else if (DeviceExtension->TabPressed)
{
DeviceExtension->TabPressed = FALSE;
-
+
/* Check which action to do */
if (InputData->MakeCode == 0x25)
{
@@ -826,7 +858,7 @@
}
else
{
- /* Send request to the kernel debugger.
+ /* Send request to the kernel debugger.
* Unknown requests will be ignored. */
KdSystemDebugControl(' soR',
(PVOID)(ULONG_PTR)InputData->MakeCode,