- New API added to libusbip
- <usbip/vhci.h> has four new functions
const char* get_state_str(_In_ state state) noexcept;
DWORD get_device_state_size() noexcept;
bool get_device_state(_Out_ device_state &result, _In_ const void *data, _In_ DWORD length);
bool read_device_state(_In_ HANDLE dev, _Out_ device_state &result);
- Applications can read the statuses of virtual USB devices using driver's device handle. The UDE driver issues these statuses as soon as they change.
- Statuses are
- unplugged (USB port is free now)
- connecting (to remove USBIP server)
- connected (connection established)
- plugged (new virtual device appeared on USBIP hub's port)
- disconnected (connection closed)
- unplugging (virtual USB device is removing)
- This let you avoid polling virtual USB devices and complex logic to find out differences between previous and current device states.
- Improved driver uninstallation
- IRP_MN_QUERY_REMOVE_DEVICE handler is used to unplug virtual USB devices and cancel IRP_MJ_READ requests
- EVT_WDF_DEVICE_D0_EXIT(WdfPowerDeviceD3Final) event was used to do this, but it does not happen if there are open driver handles
- "usbip.exe detach --all" command is no longer executed by the uninstaller