mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 07:44:06 +01:00
Bluetooth (Windows): adds a string variant helper; removes propsys dependency
This commit is contained in:
@@ -6,8 +6,6 @@ extern "C"
|
||||
#include "common/windows/unicode.hpp"
|
||||
#include "common/windows/util.hpp"
|
||||
|
||||
STDAPI InitVariantFromStringArray(_In_reads_(cElems) PCWSTR *prgsz, _In_ ULONG cElems, _Out_ VARIANT *pvar);
|
||||
|
||||
extern "C"
|
||||
const char* ffBluetoothDetectBattery(FFlist* devices)
|
||||
{
|
||||
@@ -27,13 +25,7 @@ const char* ffBluetoothDetectBattery(FFlist* devices)
|
||||
if (FAILED(pnpEntityClass->GetMethod(bstr_t(L"GetDeviceProperties"), 0, &pInParams, NULL)))
|
||||
return "Failed to get GetDeviceProperties method";
|
||||
|
||||
VARIANT devicePropertyKeys;
|
||||
PCWSTR props[] = { L"{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2", L"DEVPKEY_Bluetooth_DeviceAddress" };
|
||||
|
||||
if (FAILED(InitVariantFromStringArray(props, ARRAY_SIZE(props), &devicePropertyKeys)))
|
||||
return "Failed to init variant from string array";
|
||||
on_scope_exit releaseDevicePropertyKeys([&] { VariantClear(&devicePropertyKeys); });
|
||||
|
||||
FFWmiVariant devicePropertyKeys({ L"{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2", L"DEVPKEY_Bluetooth_DeviceAddress" });
|
||||
if (FAILED(pInParams->Put(L"devicePropertyKeys", 0, &devicePropertyKeys, CIM_FLAG_ARRAY | CIM_STRING)))
|
||||
return "Failed to put devicePropertyKeys";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user