Unset, ScanHostVolumes returns no volume, so nothing is scanned or
exposed and the guest sees no USB storage, as on main. The test checks
that injected volumes are neither listed nor raised by a rescan with the
switch off, and turns it on for the device cases.
libstdc++ on Windows answers create_directory_symlink with
function_not_supported, so the fake sysfs could never be built there and
every device case was skipped. Inject the host volumes directly for the
device, map, getdents and hotplug cases, and keep the fake sysfs only
for the scan of mountinfo and sysfs, which is Linux's.
A requested directory such as C:/Windows or C:Windows carries a root name
on Windows, so appending it to the volume root replaced the root and the
map checked a directory outside the device. Join the validated names one
by one and refuse a name with a root path. The fake sysfs of the test no
longer uses colons, so its device cases can run on Windows too.
List the FAT and exFAT volumes the host has mounted from USB mass-storage
devices (Linux mountinfo and sysfs, Windows volume IOCTLs and SetupAPI),
map each to /mnt/usb<id> and report mounts and unmounts to the registered
callbacks from a service thread that rescans the host once a second.
Device info, map requests and getdents scans follow the recovered records
of SharpProspero and shadPS4; unknown answers keep throwing.
Take main's restored signatures (the firmware-database sweep of 2026-10-21):
the typed UsbStorageCallback across the register/unregister family, the
UsbStorageDeviceInfo-typed device-info query, IsExist's three-argument bool
form (succeeds and reports non-existence with no device attached), and
RequestMap's six parameters with the trailing reserved pair dropped. The
no-device answers and the argument validation are unchanged; the guest test
passes an APS5_VABI callback and pins the exists out-parameter.
Nine of the twenty-one exports implement the no-device path: the lifecycle
pair accepts every call and keeps no state, the device queries answer the
empty list, the not-exists 0 and the device-not-found error, the map
requests answer device-not-found with their outputs untouched, and the
getdents family answers device-not-found on open and not-supported with
zero bytes on the read of a never-opened descriptor. The argument
validation of the register, unregister, unmap and getdents-close exports
is implemented and answers 0x80f40002; past it they keep their markers,
because no reference establishes their success path. The device-info
record and two prototypes follow SharpProspero, the rest shadPS4, each
pinned in the debt entry.