516{
520
522 Irp->IoStatus.Information = 0;
524
525 switch (
Stack->Parameters.DeviceIoControl.IoControlCode)
526 {
528 {
532
533 TRACE_(I8042PRT,
"IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_KEYBOARD_CONNECT\n");
535 {
538 }
539
542
543
546 {
547 WARN_(I8042PRT,
"IoAllocateWorkItem() failed\n");
550 }
555 if (!WorkItemData)
556 {
557 WARN_(I8042PRT,
"ExAllocatePoolWithTag() failed\n");
560 }
563
564
572 {
573 WARN_(I8042PRT,
"ExAllocatePoolWithTag() failed\n");
576 }
581 DeviceExtension);
584 {
585 WARN_(I8042PRT,
"IoAllocateWorkItem() failed\n");
588 }
591 {
592 WARN_(I8042PRT,
"IoAllocateWorkItem() failed\n");
595 }
598
600
602
608 WorkItemData);
610 break;
611
621 if (WorkItemData)
623 break;
624 }
626 {
627 TRACE_(I8042PRT,
"IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_KEYBOARD_DISCONNECT\n");
628
629
630
631
633 break;
634 }
636 {
637 TRACE_(I8042PRT,
"IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_I8042_HOOK_KEYBOARD\n");
638
640 break;
641 }
643 {
645
646
647 TRACE_(I8042PRT,
"IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_KEYBOARD_QUERY_ATTRIBUTES\n");
649 {
651 break;
652 }
653
654 KeyboardAttributes =
Irp->AssociatedIrp.SystemBuffer;
656
659 break;
660 }
662 {
663 DPRINT1(
"IOCTL_KEYBOARD_QUERY_TYPEMATIC not implemented\n");
665 break;
666 }
668 {
669 DPRINT1(
"IOCTL_KEYBOARD_SET_TYPEMATIC not implemented\n");
671 break;
672 }
674 {
675 TRACE_(I8042PRT,
"IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION\n");
676
677
678
679
681 {
683 }
684 else
685 {
687 Irp->AssociatedIrp.SystemBuffer,
692 }
693 break;
694 }
696 {
697 TRACE_(I8042PRT,
"IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_KEYBOARD_QUERY_INDICATORS\n");
698
700 {
702 }
703 else
704 {
706 Irp->AssociatedIrp.SystemBuffer,
711 }
712 break;
713 }
715 {
716 TRACE_(I8042PRT,
"IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_KEYBOARD_SET_INDICATORS\n");
717
719 {
721 }
722 else
723 {
726 Irp->AssociatedIrp.SystemBuffer,
731 }
732 break;
733 }
734 default:
735 {
736 ERR_(I8042PRT,
"IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
737 Stack->Parameters.DeviceIoControl.IoControlCode);
740 }
741 }
742
744 {
747 }
749}
static void cleanup(void)
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KEYBOARD_CONNECTED
IO_WORKITEM_ROUTINE i8042SendHookWorkItem
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
struct _CONNECT_DATA * PCONNECT_DATA
#define IOCTL_INTERNAL_KEYBOARD_CONNECT
#define IOCTL_INTERNAL_KEYBOARD_DISCONNECT
#define ExFreePoolWithTag(_P, _T)
#define IOCTL_INTERNAL_I8042_HOOK_KEYBOARD
struct _KEYBOARD_INPUT_DATA KEYBOARD_INPUT_DATA
#define IOCTL_KEYBOARD_QUERY_TYPEMATIC
#define IOCTL_KEYBOARD_QUERY_INDICATORS
#define IOCTL_KEYBOARD_SET_INDICATORS
#define IOCTL_KEYBOARD_QUERY_ATTRIBUTES
#define IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION
#define IOCTL_KEYBOARD_SET_TYPEMATIC
struct _KEYBOARD_ATTRIBUTES KEYBOARD_ATTRIBUTES
struct _KEYBOARD_INDICATOR_PARAMETERS KEYBOARD_INDICATOR_PARAMETERS
VOID NTAPI IoStartPacket(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PULONG Key, IN PDRIVER_CANCEL CancelFunction)
#define STATUS_NOT_IMPLEMENTED
#define STATUS_BUFFER_TOO_SMALL
PIO_WORKITEM DebugWorkItem
INTERNAL_I8042_HOOK_KEYBOARD KeyboardHook
KEYBOARD_INDICATOR_PARAMETERS KeyboardIndicators
PIO_WORKITEM PowerWorkItem
ULONG KeyboardDataQueueSize
IN PI8042_QUEUE_PACKET QueueKeyboardPacket
PI8042_KEYBOARD_EXTENSION KeyboardExtension
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem