mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2465 (Calibre fails after running GlobeTrotter Connect on OS X 10.5)
This commit is contained in:
parent
a3b44b381c
commit
716eb7b890
@ -71,12 +71,16 @@ usbobserver_get_usb_devices(PyObject *self, PyObject *args) {
|
|||||||
plugInInterface = NULL; dev = NULL;
|
plugInInterface = NULL; dev = NULL;
|
||||||
//Create an intermediate plugin
|
//Create an intermediate plugin
|
||||||
kr = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score);
|
kr = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score);
|
||||||
if ((kIOReturnSuccess != kr) || !plugInInterface)
|
if ((kIOReturnSuccess != kr) || !plugInInterface) {
|
||||||
printf("Unable to create a plug-in (%08x)\n", kr);
|
printf("Unable to create a plug-in (%08x)\n", kr); continue;
|
||||||
|
}
|
||||||
//Now create the device interface
|
//Now create the device interface
|
||||||
HRESULT result = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID)&dev);
|
HRESULT result = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID)&dev);
|
||||||
|
|
||||||
if (result || !dev) printf("Couldn't create a device interface (%08x)\n", (int) result);
|
if (result || !dev) {
|
||||||
|
printf("Couldn't create a device interface (%08x)\n", (int) result);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
kr = (*dev)->GetDeviceVendor(dev, &vendor);
|
kr = (*dev)->GetDeviceVendor(dev, &vendor);
|
||||||
kr = (*dev)->GetDeviceProduct(dev, &product);
|
kr = (*dev)->GetDeviceProduct(dev, &product);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user