27 ComPtr<IPropertyStore> props;
28 HRESULT hr = device->OpenPropertyStore(STGM_READ, props.GetAddressOf());
30 return q23::unexpected{ QSystemError::windowsComString(hr) };
32 return PropertyStoreHelper(std::move(props));
38 PropVariantInit(&variant);
40 auto cleanup = qScopeGuard([&] {
41 PropVariantClear(&variant);
44 if (!SUCCEEDED(m_props->GetValue(property, &variant)))
47 QComTaskResource<WCHAR> str;
48 HRESULT hr = PropVariantToStringAlloc(variant, str.address());
50 return QString::fromWCharArray(variant.pwszVal);
52 qWarning() <<
"PropertyStoreHelper::getString: PropVariantToStringAlloc failed"
53 << QSystemError::windowsComString(hr);