This is a Rust port of the Jack-R1/SiriRemoteDriver KMDF lower filter driver for Windows.
The original C driver sits below the BTHUSB stack and intercepts URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER URBs to:
- Modify outgoing BLE ATT write requests (replacing handle IDs) to unlock the Siri Remote and subscribe to notifications.
- Modify incoming BLE ATT notifications, rewriting the HID notification handle (0x23) to a Battery service handle (0x2b) so that Windows doesn't drop the packet and user-mode applications can receive it.
This project uses the official windows-drivers crates from Microsoft (wdk, wdk-sys, wdk-build, wdk-alloc).
DriverEntrysets up the driver object and registers theEvtDeviceAddcallback.FilterEvtDeviceAddinitializes the WDF device as a filter (WdfFdoInitSetFilter) and configures a default parallel queue.FilterEvtIoInternalDeviceControlinterceptsIOCTL_INTERNAL_USB_SUBMIT_URB. On outgoing requests (direction OUT), it inspects the transfer buffer and modifies the ATT handles.FilterRequestCompletionRoutineintercepts the responses (direction IN). It rewrites incoming HID notification handles before they reach the Windows Bluetooth stack.
Building Windows Drivers in Rust requires:
- Visual Studio 2022 with the "Desktop development with C++" workload
- Windows 11 SDK (e.g., 10.0.22621.0)
- Windows 11 WDK (Windows Driver Kit)
cargoandrustc(Nightly might be required for somewdkfeatures)
To build the driver:
cargo build --releaseThe resulting .sys file will be in target/release/. You will then need to create an .inf file (you can adapt filter.inx from the original project) and sign the driver or enable test-signing mode on your Windows machine to install it.
MIT, see LICENSE. This driver is a port of Jack-R1/SiriRemoteDriver (MIT, notice kept
in LICENSE-MIT-SiriRemoteDriver), itself based on the Toaster sample of
Windows Driver Samples (MS-PL, see LICENSE-MS-PL-Windows-driver-samples).