Skip to content

Driver testing

Fredrik Orderud edited this page Feb 26, 2024 · 41 revisions

Prerequisites

Drivers should be tested on a separate computer, since malfunctioning drivers might crash the system. Driver debugging furthermore require running the debugger on a separate computer, since breaking execution will freeze the tested computer.

The MouseMirror driver will install itself on top of the existing "Microsoft Pro Intellimouse ..." device with HWID HID\VID_045E&PID_082A&MI_00&Col01. The TailLight driver will install itself on top of the existing "HID-compliant vendor-defined device" device with HWID HID\VID_045E&PID_082A&MI_01&Col05: image

Microsoft driver selection documentation.

Target computer configuration

Steps to enable driver loading:

Steps to enable driver debugging (optional)

  • Enable kernel debugging: bcdedit /debug on
  • Either: Configuration of KDNET network kernel debugging with a network cable if you have a supported NIC.
  • Or: Configuration of kernel-mode debugging over a USB 3.0 cable with a USB 3 A/A crossover cable:
    • bcdedit /dbgsettings usb targetname:KernelUSBConn
    • From the host computer, connect with the WinDbg over USB to the KernelUSBConn target.
  • Restart the target computer.
  • Reconnect to the target computer using WinDbg.
  • Break execution and send the following command to enable display of debug messages: kd> ed nt!Kd_DEFAULT_Mask 0xff

Driver Verifier (optional)

Driver verifier is an in-built Widows feature that monitors kernel-mode drivers to detect illegal function calls or actions that might corrupt the system. It can be enabled with the following commands:

  1. Run verifier.exe from an admin command-prompt.
  2. Select "Create standard settings".
  3. Select "Select driver names from a list".
  4. Select MouseMirror.sys and/or taillight.sys and click "Finish".
  5. Reboot to make the changes take effect.

Driver installation

  • Run INSTALL_*.bat from an admin command-prompt to install the driver with associated certificate.

Driver uninstallation:

  • Run UNINSTALL_*.bat from an admin command-prompt.
  • It's also possible to uninstall the driver manually from "Device Manager".

Driver testing (WMI provider)

Example output when running the WMI test scripts:

>powershell -file MouseMirror.ps1
IntelliMouse device:
  InstanceName: HID\VID_045E&PID_082A&MI_00&Col01\7&bb7cab7&0&0000_0
  Active: True
  Flipping: LeftRight=False, UpDown=False
Enabling flipping of mouse movement...
Storing changes...
>powershell -file TailLight.ps1
IntelliMouse device:
  InstanceName: HID\VID_045E&PID_082A&MI_01&Col05\7&181f730b&0&0004_0
  Active: True
  Color: 0
  Changing color to ff0000
Storing changes...

Driver testing (safety control)

From the Microsoft Mouse & Keyboard Center, try to change the tail-light to white: MouseKeyboardCenter

Observe that the tail-light instead becomes red and the following error is added to the Windows Event "System" log: EventViewer IMG_8405

Clone this wiki locally