Module: check_mk
Branch: master
Commit: 462a58d6b7bca535941badad986869ace9fa9212
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=462a58d6b7bca5…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Nov 20 10:37:22 2015 +0100
windows agent: further work on wmi interface
---
agents/windows/wmiHelper.cc | 9 ++++++++-
agents/windows/wmiHelper.h | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/agents/windows/wmiHelper.cc b/agents/windows/wmiHelper.cc
index 9137e07..aee2f79 100644
--- a/agents/windows/wmiHelper.cc
+++ b/agents/windows/wmiHelper.cc
@@ -309,6 +309,13 @@ template <> string Variant::get()
template <> wstring Variant::get()
{
+ if (_value.vt & VT_ARRAY) {
+ return L"<array>";
+ }
+ if (_value.vt & VT_VECTOR) {
+ return L"<vector>";
+ }
+
switch (_value.vt) {
case VT_BSTR:
return wstring(_value.bstrVal);
@@ -324,7 +331,7 @@ template <> wstring Variant::get()
case VT_BOOL:
return std::to_wstring(get<bool>());
case VT_NULL:
- return L"<null>";
+ return L"";
default:
throw ComTypeException(string("wrong value type requested: ") +
to_string(_value.vt));
}
diff --git a/agents/windows/wmiHelper.h b/agents/windows/wmiHelper.h
index 48ed235..4695bd1 100644
--- a/agents/windows/wmiHelper.h
+++ b/agents/windows/wmiHelper.h
@@ -110,7 +110,6 @@ private:
// not implemented
ObjectWrapper &operator=(const ObjectWrapper &reference);
-
VARIANT getVarByKey(const wchar_t *key) const;
};