mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
18222e1ce6
commit
2b32f1fd25
@ -73,7 +73,7 @@ IPortableDevice *open_device(const wchar_t *pnp_id, IPortableDeviceValues *clien
|
|||||||
} // }}}
|
} // }}}
|
||||||
|
|
||||||
PyObject* get_storage_info(IPortableDevice *device) {
|
PyObject* get_storage_info(IPortableDevice *device) {
|
||||||
HRESULT hr;
|
HRESULT hr, hr2;
|
||||||
IPortableDeviceContent *content = NULL;
|
IPortableDeviceContent *content = NULL;
|
||||||
IEnumPortableDeviceObjectIDs *objects = NULL;
|
IEnumPortableDeviceObjectIDs *objects = NULL;
|
||||||
IPortableDeviceProperties *properties = NULL;
|
IPortableDeviceProperties *properties = NULL;
|
||||||
@ -132,7 +132,10 @@ PyObject* get_storage_info(IPortableDevice *device) {
|
|||||||
Py_END_ALLOW_THREADS;
|
Py_END_ALLOW_THREADS;
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
for(i = 0; i < fetched; i++) {
|
for(i = 0; i < fetched; i++) {
|
||||||
if SUCCEEDED(properties->GetValues(object_ids[i], storage_properties, &values)) {
|
Py_BEGIN_ALLOW_THREADS;
|
||||||
|
hr2 = properties->GetValues(object_ids[i], storage_properties, &values);
|
||||||
|
Py_END_ALLOW_THREADS;
|
||||||
|
if SUCCEEDED(hr2) {
|
||||||
if (
|
if (
|
||||||
SUCCEEDED(values->GetGuidValue(WPD_OBJECT_CONTENT_TYPE, &guid)) && IsEqualGUID(guid, WPD_CONTENT_TYPE_FUNCTIONAL_OBJECT) &&
|
SUCCEEDED(values->GetGuidValue(WPD_OBJECT_CONTENT_TYPE, &guid)) && IsEqualGUID(guid, WPD_CONTENT_TYPE_FUNCTIONAL_OBJECT) &&
|
||||||
SUCCEEDED(values->GetGuidValue(WPD_FUNCTIONAL_OBJECT_CATEGORY, &guid)) && IsEqualGUID(guid, WPD_FUNCTIONAL_CATEGORY_STORAGE)
|
SUCCEEDED(values->GetGuidValue(WPD_FUNCTIONAL_OBJECT_CATEGORY, &guid)) && IsEqualGUID(guid, WPD_FUNCTIONAL_CATEGORY_STORAGE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user