From 7a829f484afda16992326f3bb7080a8cd6b1d0a9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Jan 2023 13:39:35 +0530 Subject: [PATCH] Windows MTP device driver: Ignore failure to enumerate objects inside non-root folders There are apparently a lot of devices out there that fail in this way. So rather than aborting the scan simply ignore the folder. --- src/calibre/devices/mtp/windows/content_enumeration.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/mtp/windows/content_enumeration.cpp b/src/calibre/devices/mtp/windows/content_enumeration.cpp index 411d5dc210..3c1b8503eb 100644 --- a/src/calibre/devices/mtp/windows/content_enumeration.cpp +++ b/src/calibre/devices/mtp/windows/content_enumeration.cpp @@ -320,6 +320,7 @@ find_objects_in(CComPtr &content, CComPtr children; HRESULT hr = S_OK, hr2 = S_OK; + *enum_failed = false; Py_BEGIN_ALLOW_THREADS; hr = content->EnumObjects(0, parent_id, NULL, &children); @@ -338,7 +339,6 @@ find_objects_in(CComPtr &content, CComPtr