Author: tkreuzer
Date: Wed Dec 23 19:43:27 2009
New Revision: 44743
URL:
http://svn.reactos.org/svn/reactos?rev=44743&view=rev
Log:
[i8042prt]
- Fix Ctrl-Scroll key combination, by ignoring ACK codes and not relying on a 0xe0
sequence code, which is not being sent at least on VBox.
- Fix Tab-K handling at high irql, by moving it out of the DPC routine into the ISR.
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 Dec 23 19:43:27 2009
@@ -15,7 +15,6 @@
/* GLOBALS *******************************************************************/
-static IO_WORKITEM_ROUTINE i8042DebugWorkItem;
static IO_WORKITEM_ROUTINE i8042PowerWorkItem;
/* This structure starts with the same layout as KEYBOARD_INDICATOR_TRANSLATION */
@@ -30,23 +29,6 @@
{0x46, KEYBOARD_SCROLL_LOCK_ON}}};
/* FUNCTIONS *****************************************************************/
-
-static VOID NTAPI
-i8042DebugWorkItem(
- IN PDEVICE_OBJECT DeviceObject,
- IN PVOID Key)
-{
- UNREFERENCED_PARAMETER(DeviceObject);
- INFO_(I8042PRT, "Debug key: p\n", Key);
-
- if (!Key)
- return;
-
- /* We hope kernel would understand this. If
- * that's not the case, nothing would happen.
- */
- KdSystemDebugControl(' soR', Key, 0, NULL, 0, NULL, KernelMode);
-}
/*
* These functions are callbacks for filter driver custom interrupt
@@ -366,26 +348,6 @@
KeysInBufferCopy = DeviceExtension->KeysInBuffer;
KeReleaseInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt, Irql);
-
- if (PortDeviceExtension->Settings.CrashOnCtrlScroll)
- {
- PKEYBOARD_INPUT_DATA InputData;
- InputData = DeviceExtension->KeyboardBuffer + KeysInBufferCopy - 1;
-
- /* Test for TAB + key combination */
- if (InputData->MakeCode == 0x0F)
- DeviceExtension->TabPressed = !(InputData->Flags & KEY_BREAK);
- else if (DeviceExtension->TabPressed)
- {
- DeviceExtension->TabPressed = FALSE;
-
- IoQueueWorkItem(
- DeviceExtension->DebugWorkItem,
- &i8042DebugWorkItem,
- DelayedWorkQueue,
- (PVOID)(ULONG_PTR)InputData->MakeCode);
- }
- }
TRACE_(I8042PRT, "Send a key\n");
@@ -827,18 +789,40 @@
if (PortDeviceExtension->Settings.CrashOnCtrlScroll)
{
/* Test for CTRL + SCROLL LOCK twice */
- static const UCHAR ScanCodes[] = { 0xe0, 0x1d, 0x46, 0xc6, 0x46, 0 };
+ static const UCHAR ScanCodes[] = { 0x1d, 0x46, 0xc6, 0x46, 0 };
if (Output == ScanCodes[DeviceExtension->ComboPosition])
{
DeviceExtension->ComboPosition++;
if (ScanCodes[DeviceExtension->ComboPosition] == 0)
KeBugCheck(MANUALLY_INITIATED_CRASH);
+ }
+ else if (Output == 0xfa)
+ {
+ /* Ignore ACK */
}
else if (Output == ScanCodes[0])
DeviceExtension->ComboPosition = 1;
else
DeviceExtension->ComboPosition = 0;
+
+ /* Test for TAB + key combination */
+ if (InputData->MakeCode == 0x0F)
+ DeviceExtension->TabPressed = !(InputData->Flags & KEY_BREAK);
+ else if (DeviceExtension->TabPressed)
+ {
+ DeviceExtension->TabPressed = FALSE;
+
+ /* Send request to the kernel debugger.
+ * Unknown requests will be ignored. */
+ KdSystemDebugControl(' soR',
+ (PVOID)(ULONG_PTR)InputData->MakeCode,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ KernelMode);
+ }
}
if (i8042KbdCallIsrHook(DeviceExtension, PortStatus, Output, &ToReturn))