diff --git a/src/calibre/devices/mtp/windows/content_enumeration.cpp b/src/calibre/devices/mtp/windows/content_enumeration.cpp index 584a8ecff5..f1c7233362 100644 --- a/src/calibre/devices/mtp/windows/content_enumeration.cpp +++ b/src/calibre/devices/mtp/windows/content_enumeration.cpp @@ -312,7 +312,7 @@ bulk_get_filesystem( // find_objects_in() {{{ static bool -find_objects_in(CComPtr &content, CComPtr &object_ids, const wchar_t *parent_id) { +find_objects_in(CComPtr &content, CComPtr &object_ids, const wchar_t *parent_id, bool *enum_failed) { /* * Find all children of the object identified by parent_id. * The child ids are put into object_ids. Returns False if any errors @@ -325,7 +325,8 @@ find_objects_in(CComPtr &content, CComPtrEnumObjects(0, parent_id, NULL, &children); Py_END_ALLOW_THREADS; - if (FAILED(hr)) {hresult_set_exc("Failed to get children from device", hr); return false;} + if (FAILED(hr)) {hresult_set_exc("Failed to get children from device", hr); *enum_failed = true; return false;} + *enum_failed = false; hr = S_OK; @@ -449,7 +450,13 @@ get_files_and_folders(unsigned int level, IPortableDevice *device, CComPtr