diff options
| author | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
|---|---|---|
| committer | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
| commit | 76424950e373d3b04ac3dd13019151bfba3e8423 (patch) | |
| tree | 4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/common/windows/variant.cpp | |
Add the files
Diffstat (limited to 'src/common/windows/variant.cpp')
| -rw-r--r-- | src/common/windows/variant.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/windows/variant.cpp b/src/common/windows/variant.cpp new file mode 100644 index 0000000..d5610d3 --- /dev/null +++ b/src/common/windows/variant.cpp @@ -0,0 +1,20 @@ +#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; +} |