Files
sing-box/service
世界 9f570d7072 usbip: add windows client backend with bundled usbip-win2 VHCI driver
Implement the Windows importer over vadimgrn/usbip-win2's UDE (USB Device
Emulation) driver. The driver does the TCP connect and import handshake
in-kernel via WSK, so it cannot take sing-box's already-dialed (and
possibly proxied) socket. Instead each Attach runs a one-shot loopback
listener, points the driver at it with PLUGIN_HARDWARE_ONCE, answers the
driver's in-kernel OP_REQ_IMPORT from the cached device info, and splices
the loopback stream to the proxied server connection -- so all dialer and
proxy behavior stays in userspace.

The Microsoft-signed driver is bundled and auto-installed like
common/vboxusb: amd64 from usbip-win2 0.9.7.7, arm64 from 0.9.7.5 (the
newest release with an arm64 build; identical ABI). EnsureDriver extracts
the package, registers the upper-filter, and creates the root-enumerated
UDE devnode via SetupAPI.

Also fix the control-channel fallback to treat a standard server's
connection reset (ECONNRESET on Windows) the same as a clean EOF, so the
client falls back to standard usbip discovery instead of retrying forever.

Verified on Win11 x64: self-installs the driver on a clean machine and
imports a device; behaves byte-identically to the official usbip-win2
client.
2026-06-09 23:48:21 +08:00
..
2026-06-08 08:51:48 +08:00
2026-05-13 23:39:27 +08:00
2026-05-13 23:39:27 +08:00
2026-06-08 08:51:48 +08:00
2026-06-08 08:51:46 +08:00
2025-11-04 11:00:43 +08:00