Пишу драйвер фильтр для клавиатуры на С под Windows 10 x64, в написании драйверов я не бельмеса, но неплохо знаю C++. Я устанавливаю фильтрацию для всех KeyboardClasses. Устанавливаю фильтр с помощью sc create, sc start Драйвер фильтрует и работает нормально но есть проблема, BSOD. Если к ноутбуку подключить дополнительную клавиатуру, установить мой драйвер, зайти в диспетчер задач, удалить подключенную клавиатуру, отказаться от перезагрузки, все работает, но если потом отключить клавиатуру из USB порта я ловлю BSOD. Или BSOD наступает в момент удаления устройства из диспетчера. Как я понимаю у меня проблемы с обработкой IRP_MJ_POWER , IRP_MJ_PNP что я только не пробывал ничего не получается, ловлю BSOD но по дампу он не в моем файле а в HIDCLASS.SYS. filter.c Код (Text): wchar_t* SrcNameF = L"\\??\\MY.KbFilter%lu\0"; wchar_t* DevNameF = L"\\Device\\MY.KbFilter%lu\0"; static VOID _Function_class_(DRIVER_UNLOAD) DriverUnload(PDRIVER_OBJECT DriverObject) { DbgPrint("DriverUnload"); UNREFERENCED_PARAMETER(DriverObject); DECLARE_UNICODE_STRING_SIZE(srcName, 255); LONG SuccessfulDetachments = 0; LARGE_INTEGER WaitInterval; WaitInterval.QuadPart = -10 * 1000 * 1000; PDEVICE_OBJECT KeyboardClassFilterDevice = DriverObject->DeviceObject; while (KeyboardClassFilterDevice != NULL) { const PDEVICE_OBJECT KeyboardClassFilterDeviceNext = KeyboardClassFilterDevice->NextDevice; const PDEVICE_EXTENSION DeviceExtension = KeyboardClassFilterDevice->DeviceExtension; MyIoAcquireRemoveLock(&DeviceExtension->RemoveLock, NULL); if (DeviceExtension->Deleted == FALSE) { IoDetachDevice(DeviceExtension->AttachedDevice); do { KeDelayExecutionThread(KernelMode, FALSE, &WaitInterval); } while (InterlockedCompareExchange(&DeviceExtension->PendingIrp, 0, 0) > 0); IoDeleteDevice(DeviceExtension->ThisDevice); } DbgPrint("[*] Keyboard filter device #%lu has been detached\n", SuccessfulDetachments++); RtlUnicodeStringPrintf(&srcName, SrcNameF, DeviceExtension->DeviceIndex); IoDeleteSymbolicLink(&srcName); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, NULL); KeyboardClassFilterDevice = KeyboardClassFilterDeviceNext; } } static NTSTATUS _Function_class_(DRIVER_DISPATCH) DispatchPassThrough(PDEVICE_OBJECT DeviceObject, PIRP Irp) { PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension; NTSTATUS status = MyIoAcquireRemoveLock(&DeviceExtension->RemoveLock, Irp); if (!NT_SUCCESS(status)) { status = CompleteRequest(Irp, status, 0); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp); if (irpStack->MajorFunction == IRP_MJ_CLOSE) { Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return STATUS_SUCCESS; } IoSkipCurrentIrpStackLocation(Irp); status = IoCallDriver(((PDEVICE_EXTENSION)DeviceObject->DeviceExtension)->AttachedDevice, Irp); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } static NTSTATUS _Function_class_(IO_COMPLETION_ROUTINE) CompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context) { UNREFERENCED_PARAMETER(Context); const PDEVICE_EXTENSION DeviceExtenstion = DeviceObject->DeviceExtension; if (Irp->PendingReturned) { IoMarkIrpPending(Irp); } if (Irp->IoStatus.Status == STATUS_SUCCESS) { const ULONG ScanCodesCount = (ULONG)(Irp->IoStatus.Information / sizeof(KEYBOARD_INPUT_DATA)); const PKEYBOARD_INPUT_DATA KeyboardInputData = Irp->AssociatedIrp.SystemBuffer; for (ULONG I = 0; I < ScanCodesCount; ++I) { const PKEYBOARD_INPUT_DATA ScanCodeInformation = &KeyboardInputData[I]; if (ScanCodeInformation->Flags == PUSH_BUTTON1 || ScanCodeInformation->Flags == PUSH_BUTTON2) { PushButton(ScanCodeInformation->MakeCode); } else if (ScanCodeInformation->Flags == RELEASE_BUTTON1 || ScanCodeInformation->Flags == RELEASE_BUTTON2) { ReleaseButton(ScanCodeInformation->MakeCode); } if (IsCancelCombination() && KeysDisabled == TRUE) { ScanCodeInformation->MakeCode = 0; DbgPrint(("COMBINATION CANCELED\n")); } } } InterlockedDecrement(&DeviceExtenstion->PendingIrp); return STATUS_SUCCESS; } NTSTATUS DispatchPower(IN PDEVICE_OBJECT deviceObject, IN PIRP Irp) { PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION)deviceObject->DeviceExtension; PoStartNextPowerIrp(Irp); NTSTATUS status; status = MyIoAcquireRemoveLock(&DeviceExtension->RemoveLock, Irp); if (!NT_SUCCESS(status)) { status = CompleteRequest(Irp, status, 0); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } IoSkipCurrentIrpStackLocation(Irp); status = PoCallDriver(DeviceExtension->AttachedDevice, Irp); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } NTSTATUS DispatchPNP(IN PDEVICE_OBJECT deviceObject, IN PIRP Irp) { NTSTATUS ntStatus; PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION)deviceObject->DeviceExtension; NTSTATUS status = STATUS_SUCCESS; status = MyIoAcquireRemoveLock(&DeviceExtension->RemoveLock, Irp); if (!NT_SUCCESS(status)) { status = CompleteRequest(Irp, status, 0); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } PIO_STACK_LOCATION stackLOCATE = IoGetCurrentIrpStackLocation(Irp); ULONG function = stackLOCATE->MinorFunction; DbgPrint("DispatchPNP1functio :%lu\n", (LONG)function); if (DeviceExtension == NULL) { DbgPrint("DispatchPNP2"); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return STATUS_DEVICE_REMOVED; } if (DeviceExtension->Deleted == FALSE && (function == IRP_MN_REMOVE_DEVICE || function == IRP_MN_SURPRISE_REMOVAL || function == IRP_MN_CANCEL_REMOVE_DEVICE || function == IRP_MN_QUERY_REMOVE_DEVICE)) { DbgPrint("DispatchPNP3"); IoDetachDevice(DeviceExtension->AttachedDevice); IoDeleteDevice(DeviceExtension->ThisDevice); DECLARE_UNICODE_STRING_SIZE(srcName, 255); RtlUnicodeStringPrintf(&srcName, SrcNameF, DeviceExtension->DeviceIndex); IoDeleteSymbolicLink(&srcName); DeviceExtension->Deleted = TRUE; KeysDisabled = FALSE; Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return STATUS_SUCCESS; } if (DeviceExtension->Deleted == TRUE) { DbgPrint("DispatchPNP4"); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return STATUS_DEVICE_REMOVED; } DbgPrint("DispatchPNP5"); IoSkipCurrentIrpStackLocation(Irp); ntStatus = IoCallDriver(DeviceExtension->AttachedDevice, Irp); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return ntStatus; } static NTSTATUS _Function_class_(DRIVER_DISPATCH) DispatchRead(PDEVICE_OBJECT DeviceObject, PIRP Irp) { DbgPrint("DispatchRead"); const PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension; NTSTATUS status = STATUS_SUCCESS; status = MyIoAcquireRemoveLock(&DeviceExtension->RemoveLock, Irp); if (!NT_SUCCESS(status)) { status = CompleteRequest(Irp, status, 0); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } InterlockedIncrement(&DeviceExtension->PendingIrp); IoCopyCurrentIrpStackLocationToNext(Irp); status = IoSetCompletionRoutineEx(DeviceObject, Irp, CompletionRoutine, NULL, TRUE, TRUE, TRUE); if (!NT_SUCCESS(status)) { MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return IoCallDriver(DeviceExtension->AttachedDevice, Irp); } NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) { DbgPrint("DriverEntry"); UNREFERENCED_PARAMETER(RegistryPath); DriverObject->DriverUnload = DriverUnload; for (ULONG I = 0; I < IRP_MJ_MAXIMUM_FUNCTION; ++I) { DriverObject->MajorFunction[I] = DispatchPassThrough; } DriverObject->MajorFunction[IRP_MJ_READ] = DispatchRead; DriverObject->MajorFunction[IRP_MJ_CREATE] = DispatchCreate; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchDeviceControl; DriverObject->MajorFunction[IRP_MJ_POWER] = DispatchPower; DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPNP; DECLARE_UNICODE_STRING_SIZE(devName, 255); DECLARE_UNICODE_STRING_SIZE(srcName, 255); NTSTATUS Status; LONG SuccessfulAttachments = 0; UNICODE_STRING Unicode; ULONG totalDevices = 0; RtlInitUnicodeString(&Unicode, L"IoDriverObjectType"); const POBJECT_TYPE* IoDriverObjectType = MmGetSystemRoutineAddress(&Unicode); RtlInitUnicodeString(&Unicode, L"IoDeviceObjectType"); const POBJECT_TYPE* IoDeviceObjectType = MmGetSystemRoutineAddress(&Unicode); DbgPrint("DispatchDeviceControl u"); if (IoDriverObjectType != NULL && IoDeviceObjectType != NULL) { RtlInitUnicodeString(&Unicode, L"ObReferenceObjectByName"); const FPN_OB_REFERENCE_OBJECT_BY_NAME ObReferenceObjectByName = (FPN_OB_REFERENCE_OBJECT_BY_NAME)MmGetSystemRoutineAddress(&Unicode); if (ObReferenceObjectByName != NULL) { RtlInitUnicodeString(&Unicode, L"\\Driver\\KbdClass"); PDRIVER_OBJECT KbdClassDriver; Status = ObReferenceObjectByName(&Unicode, OBJ_CASE_INSENSITIVE, 0, 0, *IoDriverObjectType, KernelMode, NULL, (PVOID)&KbdClassDriver); if (NT_SUCCESS(Status)) { PDEVICE_OBJECT KeyboardClassDevice = KbdClassDriver->DeviceObject; while (KeyboardClassDevice != NULL) { Status = ObReferenceObjectByPointer(KeyboardClassDevice, 0, *IoDeviceObjectType, KernelMode); if (NT_SUCCESS(Status)) { RtlUnicodeStringPrintf(&devName, DevNameF, totalDevices); RtlUnicodeStringPrintf(&srcName, SrcNameF, totalDevices); Status = IoCreateSymbolicLink(&srcName, &devName); PDEVICE_OBJECT KeyboardClassFilterDevice; Status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSTION), &devName, FILE_DEVICE_KEYBOARD, 0, TRUE, &KeyboardClassFilterDevice); if (NT_SUCCESS(Status)) { const PDEVICE_EXTENSION DeviceExtenstion = KeyboardClassFilterDevice->DeviceExtension; DeviceExtenstion->PendingIrp = 0; DeviceExtenstion->Deleted = FALSE; DeviceExtenstion->DeviceIndex = totalDevices; DeviceExtenstion->AttachedDevice = IoAttachDeviceToDeviceStack(KeyboardClassFilterDevice, KeyboardClassDevice); MyIoInitializeRemoveLock(&DeviceExtenstion->RemoveLock, 0, 0, 255); if (DeviceExtenstion->AttachedDevice == NULL) { IoDeleteDevice(KeyboardClassFilterDevice); } else { DeviceExtenstion->ThisDevice = KeyboardClassFilterDevice; KeyboardClassFilterDevice->Flags |= DO_BUFFERED_IO; KeyboardClassFilterDevice->Flags &= ~DO_DEVICE_INITIALIZING; ++SuccessfulAttachments; totalDevices++; } } ObDereferenceObject(KeyboardClassDevice); } KeyboardClassDevice = KeyboardClassDevice->NextDevice; } ObDereferenceObject(KbdClassDriver); } } } return SuccessfulAttachments != 0 ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } NTSTATUS DispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp) { DbgPrint("DispatchCreate"); DEVICE_EXTENSTION* DeviceExtension = (DEVICE_EXTENSTION*)DeviceObject->DeviceExtension; NTSTATUS status = STATUS_SUCCESS; status = MyIoAcquireRemoveLock(&DeviceExtension->RemoveLock, Irp); if (!NT_SUCCESS(status)) { status = CompleteRequest(Irp, status, 0); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } PIO_STACK_LOCATION ioStackLocation; ioStackLocation = IoGetCurrentIrpStackLocation(Irp); DbgPrint("DispatchCreate :%lu\n", (LONG)ioStackLocation->MinorFunction); Irp->IoStatus.Status = status; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return(STATUS_SUCCESS); } NTSTATUS DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { DbgPrint("DispatchDeviceControl"); ULONG operation; PIO_STACK_LOCATION ioStack; NTSTATUS status = STATUS_SUCCESS; DEVICE_EXTENSTION* DeviceExtension = (DEVICE_EXTENSTION*)DeviceObject->DeviceExtension; status = MyIoAcquireRemoveLock(&DeviceExtension->RemoveLock, Irp); if (!NT_SUCCESS(status)) { status = CompleteRequest(Irp, status, 0); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return status; } ioStack = IoGetCurrentIrpStackLocation(Irp); operation = ioStack->Parameters.DeviceIoControl.IoControlCode; DbgPrint("DispatchDeviceControl :%lu\n", (LONG)operation); switch (operation) { case IOCTL_NEXT_KBFILTER_ON: { KeysDisabled = TRUE; } break; case IOCTL_NEXT_KBFILTER_OFF: { KeysDisabled = FALSE; } break; default: status = STATUS_INVALID_PARAMETER; break; } Irp->IoStatus.Status = status; IoCompleteRequest(Irp, IO_NO_INCREMENT); MyIoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return(status); } filter.h Код (Text): #pragma once #include <ntddk.h> #define PUSH_BUTTON1 0 #define RELEASE_BUTTON1 1 #define PUSH_BUTTON2 2 #define RELEASE_BUTTON2 3 // // The following value is arbitrarily chosen from the space defined by Microsoft // as being "for non-Microsoft use" // #define FILE_DEVICE_KBFILTER 0xCF52 // // Device control codes - values between 2048 and 4095 arbitrarily chosen // #define IOCTL_NEXT_KBFILTER_ON CTL_CODE(FILE_DEVICE_KBFILTER, 2049, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) #define IOCTL_NEXT_KBFILTER_OFF CTL_CODE(FILE_DEVICE_KBFILTER, 2050, METHOD_BUFFERED, FILE_ANY_ACCESS) volatile LONG KeysDisabled = 0; NTSTATUS DispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp); NTSTATUS DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); typedef struct _MY_IO_REMOVE_LOCK { LONG usage; // reference count BOOLEAN removing; // true if removal is pending KEVENT evRemove; // event to wait on } MY_IO_REMOVE_LOCK, * PMY_IO_REMOVE_LOCK; typedef struct { LONG PendingIrp; PDEVICE_OBJECT AttachedDevice; PDEVICE_OBJECT ThisDevice; LONG DeviceIndex; BOOLEAN Deleted; MY_IO_REMOVE_LOCK RemoveLock; } DEVICE_EXTENSTION, * PDEVICE_EXTENSION; typedef NTSTATUS(NTAPI* FPN_OB_REFERENCE_OBJECT_BY_NAME)(PUNICODE_STRING ObjectName, ULONG Attributes, PACCESS_STATE AccessState, ACCESS_MASK DesiredAccess, POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, PVOID ParseContext, PVOID* Object); typedef struct _KEYBOARD_INPUT_DATA { USHORT UnitId; USHORT MakeCode; USHORT Flags; USHORT Reserved; ULONG ExtraInformation; } KEYBOARD_INPUT_DATA, * PKEYBOARD_INPUT_DATA; VOID MyIoInitializeRemoveLock(PMY_IO_REMOVE_LOCK lock, ULONG tag, ULONG minutes, ULONG maxcount) { KeInitializeEvent(&lock->evRemove, NotificationEvent, FALSE); lock->usage = 1; lock->removing = FALSE; } NTSTATUS MyIoAcquireRemoveLock(PMY_IO_REMOVE_LOCK lock, PVOID tag) { LONG usage = InterlockedIncrement(&lock->usage); if (lock->removing) { // removal in progress if (InterlockedDecrement(&lock->usage) == 0) KeSetEvent(&lock->evRemove, 0, FALSE); return STATUS_DELETE_PENDING; } // removal in progress return STATUS_SUCCESS; } //------------------------------------------------------------------------------- VOID MyIoReleaseRemoveLock(PMY_IO_REMOVE_LOCK lock, PVOID tag) { if (InterlockedDecrement(&lock->usage) == 0) KeSetEvent(&lock->evRemove, 0, FALSE); } VOID MyIoReleaseRemoveLockAndWait(PMY_IO_REMOVE_LOCK lock, PVOID tag) { lock->removing = TRUE; MyIoReleaseRemoveLock(lock, tag); MyIoReleaseRemoveLock(lock, NULL); KeWaitForSingleObject(&lock->evRemove, Executive, KernelMode, FALSE, NULL); } NTSTATUS CompleteRequest(IN PIRP Irp, IN NTSTATUS status, IN ULONG_PTR info) { Irp->IoStatus.Status = status; Irp->IoStatus.Information = info; IoCompleteRequest(Irp, IO_NO_INCREMENT); return status; } Dump Код (Text): KEY_VALUES_STRING: 1 Key : Analysis.CPU.Sec Value: 0 Key : Analysis.DebugAnalysisProvider.CPP Value: Create: 8007007e on DESKTOP Key : Analysis.DebugData Value: CreateObject Key : Analysis.DebugModel Value: CreateObject Key : Analysis.Elapsed.Sec Value: 0 Key : Analysis.Memory.CommitPeak.Mb Value: 59 Key : Analysis.System Value: CreateObject ADDITIONAL_DEBUG_TEXT: You can run '.symfix; .reload' to try to fix the symbol path and load symbols. WRONG_SYMBOLS_TIMESTAMP: b5a82e62 WRONG_SYMBOLS_SIZE: ab5000 FAULTING_MODULE: fffff80239400000 nt BUGCHECK_CODE: a BUGCHECK_P1: 48 BUGCHECK_P2: 2 BUGCHECK_P3: 1 BUGCHECK_P4: fffff80239417bf3 Unable to get size of nt!_MMPTE - probably bad symbols 0000000000000048 STACK_TEXT: ffffa18e`4ca6f148 fffff802`395d5929 : 00000000`0000000a 00000000`00000048 00000000`00000002 00000000`00000001 : nt!KeBugCheckEx ffffa18e`4ca6f150 fffff802`395d1c69 : 00000000`00000000 00000000`00000000 00000000`00000000 fffff802`39452785 : nt!setjmpex+0x81f9 ffffa18e`4ca6f290 fffff802`39417bf3 : 00000000`40420088 00000000`00000000 00000000`00000000 fffff802`394be1c5 : nt!setjmpex+0x4539 ffffa18e`4ca6f420 fffff802`42a353f9 : ffffce0d`36af1650 00000000`00000000 00000000`00000002 00000003`05080e42 : nt!KeAcquireSpinLockRaiseToDpc+0x53 ffffa18e`4ca6f450 fffff802`3951c541 : ffffce0d`35d26010 ffffce0d`3980aab0 fffff802`40628000 fffff802`42a35350 : HIDCLASS+0x53f9 ffffa18e`4ca6f4c0 fffff802`4062c3b8 : ffffce0d`36d664b0 fffff802`40628040 ffffa18e`4ca6f500 ffffce0d`00000000 : nt!IoCancelIrp+0x71 ffffa18e`4ca6f500 fffff802`394467f9 : ffffffff`ffb3b4c0 ffffce0d`36d664b0 ffffce0d`36d66ad8 ffffce0d`35c4ada0 : kbdhid+0xc3b8 ffffa18e`4ca6f570 fffff802`46fc43db : ffffce0d`36d664b0 ffffce0d`35c4ada0 ffffce0d`35c4ada0 00000000`00000670 : nt!IofCallDriver+0x59 ffffa18e`4ca6f5b0 fffff802`394467f9 : 00000000`00000000 00000000`c00000bb ffffce0d`35c4ac50 00000000`69706e00 : kbdclass+0x43db ffffa18e`4ca6f620 fffff802`39a56e0c : ffffa18e`4ca6f6c0 ffffce0d`35c4ac50 ffffa18e`4ca6f720 ffffce0d`36d664b0 : nt!IofCallDriver+0x59 ffffa18e`4ca6f660 fffff802`39b311ca : 00000000`00000002 ffffce0d`38ee2c90 ffffce0d`36af1500 ffffce0d`36af1500 : nt!FsRtlNotifyVolumeEventEx+0x78c ffffa18e`4ca6f6e0 fffff802`39572c70 : ffffa307`4a2103c0 ffffce0d`38ee2c90 00000000`0000000a 00000000`00000000 : nt!IoSetDevicePropertyData+0x2ada ffffa18e`4ca6f7a0 fffff802`39b30b7f : ffffce0d`38ee2c90 ffffa307`00000015 00000000`00000000 cb3a4008`00200001 : nt!RtlCrc64+0x13d0 ffffa18e`4ca6f800 fffff802`39b3081a : ffffce0d`38ee2c90 ffffa18e`4ca6f880 00000000`00000015 ffffce0d`38ee2c90 : nt!IoSetDevicePropertyData+0x248f ffffa18e`4ca6f840 fffff802`39c01b52 : ffffce0d`36af1500 00000000`00000002 ffffce0d`36af1500 00000000`00000001 : nt!IoSetDevicePropertyData+0x212a ffffa18e`4ca6f8c0 fffff802`39aff04e : ffffa18e`4ca6fa10 ffffce0d`38ee2c00 ffffa18e`4ca6fa00 ffffa307`00000001 : nt!FsRtlRegisterFltMgrCalls+0x76722 ffffa18e`4ca6f9b0 fffff802`39a5f9b8 : ffffa307`4a2103c0 ffffa307`49fa2a20 ffffa307`49fa2a20 00000000`00000000 : nt!RtlGetGroupSecurityDescriptor+0x12be ffffa18e`4ca6f9e0 fffff802`394693d5 : ffffce0d`28660cf0 ffffce0d`305e6040 ffffce0d`28660cf0 ffffce0d`00000800 : nt!FsRtlAllocateExtraCreateParameterFromLookasideList+0x10b8 ffffa18e`4ca6fa70 fffff802`39527c35 : ffffce0d`305e6040 00000000`00000080 ffffce0d`2867e040 0000256f`b19bbfff : nt!PsReturnProcessNonPagedPoolQuota+0xcd5 ffffa18e`4ca6fb10 fffff802`395cb0b8 : ffffba81`27c20180 ffffce0d`305e6040 fffff802`39527be0 00000000`00000000 : nt!RtlIsNonEmptyDirectoryReparsePointAllowed+0x415 ffffa18e`4ca6fb60 00000000`00000000 : ffffa18e`4ca70000 ffffa18e`4ca69000 00000000`00000000 00000000`00000000 : nt!KeSynchronizeExecution+0x6408 STACK_COMMAND: .thread ; .cxr ; kb EXCEPTION_CODE_STR: B5A82E62 EXCEPTION_STR: WRONG_SYMBOLS PROCESS_NAME: ntoskrnl.wrong.symbols.exe IMAGE_NAME: ntoskrnl.wrong.symbols.exe MODULE_NAME: nt_wrong_symbols SYMBOL_NAME: nt_wrong_symbols!B5A82E62AB5000 FAILURE_BUCKET_ID: WRONG_SYMBOLS_X64_18362.1.amd64fre.19h1_release.190318-1202_TIMESTAMP_660730-064658_B5A82E62_nt_wrong_symbols!B5A82E62AB5000 OS_VERSION: 10.0.18362.1 BUILDLAB_STR: 19h1_release OSPLATFORM_TYPE: x64 OSNAME: Windows 10 FAILURE_ID_HASH: {bd622a0a-c89a-73d9-3319-bcef0893192c} Followup: MachineOwner ---------
Как не бился ответа не нашел, взял пример из WDK Keyboard_Input_WDF_Filter_Driver__Kbfiltr_ Чуток подправил ini там в устройствах нужно указать HID_DEVICE_SYSTEM_KEYBOARD и легко установил через devcon Код (Text): devcon update KbFilter.inf HID_DEVICE_SYSTEM_KEYBOARD