WMI (Windows): add --wmi-timeout option

This commit is contained in:
李通洲
2023-06-25 14:33:13 +08:00
parent c4c490663b
commit ab3290d9cb
11 changed files with 44 additions and 7 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ bool FFWmiRecord::getString(const wchar_t* key, FFstrbuf* strbuf)
}
else
{
ffStrbufSetWS(strbuf, SysStringLen(vtProp.bstrVal), vtProp.bstrVal);
ffStrbufSetNWS(strbuf, SysStringLen(vtProp.bstrVal), vtProp.bstrVal);
}
break;
+2 -6
View File
@@ -6,7 +6,7 @@
#ifdef __cplusplus
extern "C" {
#include "util/FFstrbuf.h"
#include "fastfetch.h"
}
#include <initguid.h>
@@ -21,10 +21,6 @@ enum class FFWmiNamespace {
LAST,
};
enum {
FF_WMI_QUERY_TIMEOUT = 5000
};
struct FFWmiVariant: VARIANT {
explicit FFWmiVariant() { VariantInit(this); }
~FFWmiVariant() { VariantClear(this); }
@@ -160,7 +156,7 @@ struct FFWmiRecord
if(!pEnumerator) return;
ULONG ret;
bool ok = SUCCEEDED(pEnumerator->Next(FF_WMI_QUERY_TIMEOUT, 1, &obj, &ret)) && ret;
bool ok = SUCCEEDED(pEnumerator->Next(instance.config.wmiTimeout, 1, &obj, &ret)) && ret;
if(!ok) obj = nullptr;
}
FFWmiRecord(const FFWmiRecord&) = delete;