mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DRYer
This commit is contained in:
parent
bb6d43d7cd
commit
452058a4aa
@ -436,7 +436,7 @@ find_objects_in(CComPtr<IPortableDeviceContent> &content, CComPtr<IPortableDevic
|
||||
Py_END_ALLOW_THREADS;
|
||||
if (FAILED(hr)) {
|
||||
pyobject_raii parent_name(PyUnicode_FromWideChar(parent_id, -1));
|
||||
set_error_from_hresult(wpd::WPDError, __FILE__, __LINE__, hr, "Failed to EnumObjects() of folder from device", parent_name.ptr());
|
||||
hresult_set_exc("Failed to EnumObjects() of folder from device", hr, parent_name.ptr());
|
||||
*enum_failed = true;
|
||||
return false;
|
||||
}
|
||||
@ -463,7 +463,7 @@ find_objects_in(CComPtr<IPortableDeviceContent> &content, CComPtr<IPortableDevic
|
||||
} else {
|
||||
if (hr == S_FALSE && !fetched) break;
|
||||
pyobject_raii parent_name(PyUnicode_FromWideChar(parent_id, -1));
|
||||
set_error_from_hresult(wpd::WPDError, __FILE__, __LINE__, hr, "Failed to EnumObjects()->Next() of folder from device", parent_name.ptr());
|
||||
hresult_set_exc("Failed to EnumObjects()->Next() of folder from device", hr, parent_name.ptr());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -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<IPortableDeviceValues> &client_information);
|
||||
|
Loading…
x
Reference in New Issue
Block a user