So, I’m developing a device driver which should filter keys(Key scan codes), and my goal is to be able to send all filtered keys to User mode application with the help of IOCTL’s. By the way, I’m able to filter those scan code trough IRP_MJ_READ dispatch routine, and print them out with DbgPrint, but my goal is to send them to the user mode, which in turn will map them to ASCII/Unicode with MapViruralKeyEx, there’s a way to overcome this problem?.
How the driver is actually works:
Create a device(FILE_KEYBORD_DEVICE).
Attach this device to the target Device(KeyboardClass0).
Set a completion(ReadCompletionRoutine) routine by IoSetCompletionRoutineEx.
Filter IRP requests, trough irp->AssociatedIrp.systemBuffer. Which, get converted to KEYBOARD_INPUT_DATA structure. And extract the MakeCode field.
Complete the request, and, forward the IRP to I/O manager.
There is a way to complete the request trough IOCTL, and not trough a Read?
Keyboard device is capable to use METHOD_BUFFRED.