From 8e1ea856e84d27676427e4c38a452f0365ad3379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 10 Jun 2026 09:22:12 +0800 Subject: [PATCH] usbip: fix VBoxUSB ioctl codes missing the FILE_WRITE_ACCESS bit Every SUPUSB/SUPUSBFLT CTL_CODE was computed with Access = 0 instead of FILE_WRITE_ACCESS (2 << 14), so the driver dispatch rejected each call with STATUS_INVALID_DEVICE_REQUEST and the export host could not even pass monitor GET_VERSION. Values now match usbipd-win's interop definitions (VBoxUsb.cs / VBoxUsbMon.cs). --- common/vboxusb/vboxusb.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/vboxusb/vboxusb.go b/common/vboxusb/vboxusb.go index 64caac670..856ff1007 100644 --- a/common/vboxusb/vboxusb.go +++ b/common/vboxusb/vboxusb.go @@ -53,19 +53,19 @@ const ( // Method = METHOD_BUFFERED (0). const ( // Per-device VBoxUSB.sys (\\?\). - IOCTLSendURB uint32 = 0x0022_181C // function 0x607 - IOCTLUSBSelectInterface uint32 = 0x0022_1824 // function 0x609 - IOCTLUSBSetConfig uint32 = 0x0022_1828 // function 0x60a - IOCTLUSBClaimDevice uint32 = 0x0022_182C // function 0x60b - IOCTLUSBClearEndpoint uint32 = 0x0022_1838 // function 0x60e - IOCTLGetVersion uint32 = 0x0022_183C // function 0x60f - IOCTLUSBAbortEndpoint uint32 = 0x0022_1840 // function 0x610 + IOCTLSendURB uint32 = 0x0022_981C // function 0x607 + IOCTLUSBSelectInterface uint32 = 0x0022_9824 // function 0x609 + IOCTLUSBSetConfig uint32 = 0x0022_9828 // function 0x60a + IOCTLUSBClaimDevice uint32 = 0x0022_982C // function 0x60b + IOCTLUSBClearEndpoint uint32 = 0x0022_9838 // function 0x60e + IOCTLGetVersion uint32 = 0x0022_983C // function 0x60f + IOCTLUSBAbortEndpoint uint32 = 0x0022_9840 // function 0x610 // VBoxUSBMon (\\.\VBoxUSBMon). Note GET_VERSION shares the numeric // code with VBoxUSB's USB_ABORT_ENDPOINT — different handles. - IOCTLMonitorGetVersion uint32 = 0x0022_1840 - IOCTLMonitorAddFilter uint32 = 0x0022_1844 - IOCTLMonitorRemoveFilter uint32 = 0x0022_1848 + IOCTLMonitorGetVersion uint32 = 0x0022_9840 // function 0x610 + IOCTLMonitorAddFilter uint32 = 0x0022_9844 // function 0x611 + IOCTLMonitorRemoveFilter uint32 = 0x0022_9848 // function 0x612 ) // USB/IP-style transfer type enum, matching VirtualBox USBSUP_TRANSFER_TYPE.