Hello, I am currently writing a keyboard filter driver, and I am having
a problem. I wrote the keyboard filter to be independent of the
underlying bus driver whether it be for PS/2 or USB. The problem I am
having is that when I install this filter driver for PS/2, it works
great. I am able to install it and uninstall it, and it functions
fine. When I install it for a USB keyboard filter driver, my driver
crashes. I looked at the crash dump, and it crashed at the PAGED_CODE
call below in my unload routine. my unload routine looks like this:
--------------------------------------------------------------------
KbFilter_Unload( __in PDRIVER_OBJECT Driver ){
PDEVICE_EXTENSION devExt;
PAGED_CODE();
devExt = (PDEVICE_EXTENSION) Driver->DeviceObject->DeviceExtension;
DbgPrint("Driver Unload Called...\n");
devExt->bThreadTerminate = TRUE;
KeReleaseSemaphore(&devExt->semQueue, 0, 1, TRUE);
KeWaitForSingleObject( devExt->pThreadObj, Executive, KernelMode,
FALSE, NULL);
ZwClose(devExt->hLogFile);
IoDeleteDevice(Driver->DeviceObject);
Driver->DeviceObject = NULL;
}
--------------------------------------------------------------------
As I said before, for a PS/2 keyboard, it works fine, but for USB, it
bug checks.
any ideas?