diff --git a/src/calibre/devices/mtp/windows/content_enumeration.cpp b/src/calibre/devices/mtp/windows/content_enumeration.cpp index 565f209bd1..16d624d1ed 100644 --- a/src/calibre/devices/mtp/windows/content_enumeration.cpp +++ b/src/calibre/devices/mtp/windows/content_enumeration.cpp @@ -436,7 +436,7 @@ find_objects_in(CComPtr &content, CComPtr &content, CComPtrNext() of folder from device", parent_name.ptr()); + hresult_set_exc("Failed to EnumObjects()->Next() of folder from device", hr, parent_name.ptr()); return false; } } diff --git a/src/calibre/devices/mtp/windows/global.h b/src/calibre/devices/mtp/windows/global.h index 2946d18eb5..e4bbb2f196 100644 --- a/src/calibre/devices/mtp/windows/global.h +++ b/src/calibre/devices/mtp/windows/global.h @@ -39,7 +39,7 @@ typedef struct { } Device; extern PyTypeObject DeviceType; -#define hresult_set_exc(msg, hr) set_error_from_hresult(wpd::WPDError, __FILE__, __LINE__, hr, msg) +#define hresult_set_exc(msg, hr, ...) set_error_from_hresult(wpd::WPDError, __FILE__, __LINE__, hr, msg, __VA_ARGS__) extern IPortableDeviceValues* get_client_information(); extern IPortableDevice* open_device(const wchar_t *pnp_id, CComPtr &client_information);