Phase 8B: RioGamepadXP.sys — WDM HID minidriver for Windows XP
The XP flavor of our own virtual joystick (no third-party driver), built with WDK 7.1.0 to x86/subsystem-5.01. Exposes the identical Public.h contract as the modern KMDF+VHF driver — same GUID, IOCTL_RIO_SUBMIT_REPORT, 25-byte report, VID/PID — so HidFeederJoystickSink drives both. Design (driver/RioGamepadXP/rioxp.c): - WDM HID minidriver via HidRegisterMinidriver presenting the 6-axis/hat/ 96-button joystick. POLLED mode (DevicesArePolled=TRUE): hidclass paces IOCTL_HID_READ_REPORT and we complete each synchronously from a cached report — no pending-IRP or cancel-routine machinery (the usual crash surface in a virtual HID driver). - Named sideband control device (\Device\RioGamepadXP + \DosDevices symlink) takes IOCTL_RIO_SUBMIT_REPORT and updates the cache under a spinlock. - hidclass overwrites our CREATE/CLOSE/DEVICE_CONTROL during registration; we save its pointers and reinstall wrappers that route the control device's IRPs to us and forward the HID FDO's to hidclass. Packaging/install: - Root-enumerated, so install uses devcon (built from the same WDK) — InstallHinfSection can't create the devnode. install-core.bat runs "devcon install RioGamepadXP.inf root\RioGamepadXP"; unsigned is fine (XP x86 enforces no kernel signing). Bundled into vendor\xp\. - net40 feeder opens the driver by name (\.\RioGamepadXP); XP can't put a device interface on a bare control device (no PDO) — the one nuance. Static build only: compiles clean but runtime bring-up (joy.cpl enumeration, report flow) needs a real XP target — that's 8E. 275 tests still green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,15 @@ public sealed class HidFeederJoystickSink : IJoystickSink, IDisposable
|
||||
public static bool TryCreate(out HidFeederJoystickSink? sink)
|
||||
{
|
||||
sink = null;
|
||||
#if NET40
|
||||
// Windows XP: RioGamepadXP is a HID minidriver whose sideband control
|
||||
// device can't carry a device interface (no PDO), so it's opened by its
|
||||
// fixed symbolic-link name rather than via SetupDi + interface GUID.
|
||||
// Contract is otherwise identical (see driver/RioGamepadXP/Public.h).
|
||||
string? path = @"\\.\RioGamepadXP";
|
||||
#else
|
||||
string? path = FindDevicePath();
|
||||
#endif
|
||||
if (path is null)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user