/* GLOBALS *******************************************************************/
static IO_WORKITEM_ROUTINE i8042PowerWorkItem;
+static KDEFERRED_ROUTINE i8042KbdDpcRoutine;
/* This structure starts with the same layout as KEYBOARD_INDICATOR_TRANSLATION */
typedef struct _LOCAL_KEYBOARD_INDICATOR_TRANSLATION {
PIRP WaitingIrp;
NTSTATUS Status;
- DeviceExtension = (PI8042_KEYBOARD_EXTENSION)Context;
-
UNREFERENCED_PARAMETER(DeviceObject);
+ __analysis_assume(Context != NULL);
+ DeviceExtension = Context;
+
/* See http://blogs.msdn.com/doronh/archive/2006/09/08/746961.aspx */
/* Register GUID_DEVICE_SYS_BUTTON interface and report capability */
UNREFERENCED_PARAMETER(SystemArgument1);
UNREFERENCED_PARAMETER(SystemArgument2);
- DeviceExtension = (PI8042_KEYBOARD_EXTENSION)DeferredContext;
+ __analysis_assume(DeferredContext != NULL);
+ DeviceExtension = DeferredContext;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
if (HandlePowerKeys(DeviceExtension))
Irp->IoStatus.Information = sizeof(KEYBOARD_ATTRIBUTES);
Status = STATUS_SUCCESS;
break;
-
- Status = STATUS_NOT_IMPLEMENTED;
- break;
}
case IOCTL_KEYBOARD_QUERY_TYPEMATIC:
{
{
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;
}
}
/*
- * Call the customization hook. The ToReturn parameter is about wether
+ * Call the customization hook. The ToReturn parameter is about whether
* we should go on with the interrupt. The return value is what
- * we should return (indicating to the system wether someone else
+ * we should return (indicating to the system whether someone else
* should try to handle the interrupt)
*/
static BOOLEAN
UNREFERENCED_PARAMETER(Interrupt);
- DeviceExtension = (PI8042_KEYBOARD_EXTENSION)Context;
+ __analysis_assume(Context != NULL);
+ DeviceExtension = Context;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
InputData = DeviceExtension->KeyboardBuffer + DeviceExtension->KeysInBuffer;
Counter = PortDeviceExtension->Settings.PollStatusIterations;