19#ifndef VFW_E_DEVICE_IN_USE
20#define VFW_E_DEVICE_IN_USE 0x80040228L
50 std::ostringstream
ss;
51 ss <<
"System error 0x" << std::hex << error_code;
62 std::ostringstream
ss;
63 ss <<
"System error " << error_code;
72 std::string description;
74 if (error.ErrorMessage()) {
76 const wchar_t *
wide_msg = error.ErrorMessage();
86 if (description.empty()) {
95 std::ostringstream
ss;
97 ss <<
"HRESULT: 0x" << std::hex << std::uppercase <<
hr << std::dec;
103 ss <<
" (Facility: " <<
facility <<
", Code: " << code <<
")";
114 if (!description.empty()) {
115 ss <<
" - " << description;
150 std::ostringstream
ss;
152 ss <<
"duvc-ctl Diagnostic Information\n";
153 ss <<
"==============================\n";
157 ss <<
"Platform: Windows\n";
163#pragma warning(disable : 4996)
175 const char *
arch =
"Unknown";
176 switch (
sys_info.wProcessorArchitecture) {
190 ss <<
"Architecture: " <<
arch <<
"\n";
195 ss <<
"COM Status: Available\n";
198 ss <<
"COM Status: Already initialized (different mode)\n";
207 reinterpret_cast<void **
>(&
dev_enum));
209 ss <<
"DirectShow: Available\n";
216 ss <<
"Platform: Non-Windows (stub implementation)\n";
Result type that can contain either a value or an error.
EXTERN_C const CLSID CLSID_SystemDeviceEnum
EXTERN_C const IID IID_ICreateDevEnum
#define VFW_E_DEVICE_IN_USE
HRESULT decoder and diagnostics utilities.
bool is_permission_error(HRESULT hr)
Check if HRESULT indicates permission/access error.
bool is_device_error(HRESULT hr)
Check if HRESULT indicates a device-related error.
std::string get_hresult_details(HRESULT hr)
Get detailed HRESULT information.
std::string get_diagnostic_info()
Get diagnostic information for troubleshooting.
std::string decode_hresult(HRESULT hr)
Decode HRESULT to human-readable string.
std::string decode_system_error(unsigned long error_code)
Decode system error code to human-readable string.