mirror of
https://github.com/RPCS3/libusb.git
synced 2026-07-21 16:45:23 -04:00
added detection of uninitialized devices on open
This commit is contained in:
@@ -1559,6 +1559,12 @@ static int windows_get_active_config_descriptor(struct libusb_device *dev, unsig
|
||||
static int windows_open(struct libusb_device_handle *dev_handle)
|
||||
{
|
||||
struct windows_device_priv *priv = __device_priv(dev_handle->dev);
|
||||
struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
|
||||
|
||||
if (priv->apib == NULL) {
|
||||
usbi_err(ctx, "program assertion failed - device is not initialized");
|
||||
return LIBUSB_ERROR_NO_DEVICE;
|
||||
}
|
||||
|
||||
return priv->apib->open(dev_handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user