Files
fastfetch/src/common/windows/variant.cpp
T
李通洲 e0eba8ce21 Chore: run clang-format
```bash
find . -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) ! -path "src/3rdparty/*" -print0 | xargs -0 clang-format -i
```
2026-03-29 10:03:32 +08:00

21 lines
474 B
C++

#include "variant.hpp"
#include <oleauto.h>
FFWmiVariant::FFWmiVariant(std::initializer_list<PCWSTR> strings) : FFWmiVariant() {
SAFEARRAYBOUND bound = {
.cElements = (ULONG) strings.size(),
.lLbound = 0,
};
SAFEARRAY* psa = SafeArrayCreate(VT_BSTR, 1, &bound);
LONG i = 0;
for (PCWSTR str : strings) {
SafeArrayPutElement(psa, &i, bstr_t(str));
++i;
}
this->vt = VT_ARRAY | VT_BSTR;
this->parray = psa;
}