| 591 | return status; |
| 592 | } |
| 593 | NTSTATUS SearchKdbServiceCallBack(IN PDRIVER_OBJECT DriverObject) |
| 594 | { |
| 595 | //�����õ���һ��ȫ�ֱ�������Щ����������ǹ���˼��� |
| 596 | NTSTATUS status = STATUS_SUCCESS; |
| 597 | UNICODE_STRING uniNtNameString; |
| 598 | PDEVICE_OBJECT pTargetDeviceObject = NULL; |
| 599 | PDRIVER_OBJECT KbdDriverObject = NULL; |
| 600 | PDRIVER_OBJECT KbdhidDriverObject = NULL; |
| 601 | PDRIVER_OBJECT Kbd8042DriverObject = NULL; |
| 602 | PDRIVER_OBJECT UsingDriverObject = NULL; |
| 603 | PDEVICE_OBJECT UsingDeviceObject = NULL; |
| 604 | |
| 605 | PVOID UsingDeviceExt = NULL; |
| 606 | |
| 607 | //����Ĵ���������USB���̶˿��������������� |
| 608 | RtlInitUnicodeString(&uniNtNameString, L"\\Driver\\kbdhid"); |
| 609 | status = ObReferenceObjectByName(&uniNtNameString, |
| 610 | OBJ_CASE_INSENSITIVE, NULL, 0, |
| 611 | *IoDriverObjectType, |
| 612 | KernelMode, |
| 613 | NULL, |
| 614 | (PVOID*)&KbdhidDriverObject); |
| 615 | if (!NT_SUCCESS(status)) |
| 616 | { |
| 617 | KdPrint(("Couldn't get the USB driver Object\n")); |
| 618 | } |
| 619 | else |
| 620 | { |
| 621 | ObDereferenceObject(KbdhidDriverObject); |
| 622 | KdPrint(("get the USB driver Object\n")); |
| 623 | } |
| 624 | //��PS/2���̵��������� |
| 625 | RtlInitUnicodeString(&uniNtNameString, L"\\Driver\\i8042prt"); |
| 626 | status = ObReferenceObjectByName(&uniNtNameString, |
| 627 | OBJ_CASE_INSENSITIVE, |
| 628 | NULL, 0, |
| 629 | *IoDriverObjectType, |
| 630 | KernelMode, |
| 631 | NULL, |
| 632 | (PVOID*)&Kbd8042DriverObject); |
| 633 | if (!NT_SUCCESS(status)) |
| 634 | { |
| 635 | KdPrint(("Couldn't get the PS/2 driver Object %08x\n", status)); |
| 636 | } |
| 637 | else |
| 638 | { |
| 639 | ObDereferenceObject(Kbd8042DriverObject); |
| 640 | KdPrint(("get the PS/2 driver Object\n")); |
| 641 | } |
| 642 | //��δ��뿼����һ�����������õ���������USB���̺�PS/2����ͬʱ���ڣ���PS/2���� |
| 643 | //��������豸��û���ҵ� |
| 644 | if (!Kbd8042DriverObject && !KbdhidDriverObject) |
| 645 | { |
| 646 | return STATUS_SUCCESS; |
| 647 | } |
| 648 | //�ҵ����ʵ�������������USB����PS/2������һ��Ҫ�ҵ�һ�� |
| 649 | UsingDriverObject = Kbd8042DriverObject ? Kbd8042DriverObject : KbdhidDriverObject; |
| 650 |
no test coverage detected