Module: check_mk
Branch: master
Commit: 1e06de2dd024c0e6ea85d6796db3509dccba06fa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1e06de2dd024c0…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Thu Jan 11 09:39:12 2018 +0100
Windows agent: remove unused SysAllocString
Change-Id: Iec99568db80d768ce5389e6c42279bc5edf5a974
---
agents/windows/WinApi.cc | 4 ----
agents/windows/WinApi.h | 1 -
agents/windows/WinApiAdaptor.h | 1 -
agents/windows/build_version | 2 +-
agents/windows/test/MockWinApi.h | 1 -
agents/windows/wmiHelper.cc | 25 -------------------------
agents/windows/wmiHelper.h | 2 --
7 files changed, 1 insertion(+), 35 deletions(-)
diff --git a/agents/windows/WinApi.cc b/agents/windows/WinApi.cc
index eb3f477..88cc47e 100644
--- a/agents/windows/WinApi.cc
+++ b/agents/windows/WinApi.cc
@@ -713,10 +713,6 @@ HRESULT WinApi::SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim,
return ::SafeArrayGetUBound(psa, nDim, plUbound);
}
-BSTR WinApi::SysAllocString(const OLECHAR *ptr) const {
- return ::SysAllocString(ptr);
-}
-
void WinApi::SysFreeString(BSTR str) const { return ::SysFreeString(str); }
HRESULT WinApi::VariantClear(VARIANTARG *pvarg) const {
diff --git a/agents/windows/WinApi.h b/agents/windows/WinApi.h
index 3678aee..2df151e 100644
--- a/agents/windows/WinApi.h
+++ b/agents/windows/WinApi.h
@@ -346,7 +346,6 @@ public:
LONG *plLbound) const override;
virtual HRESULT SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim,
LONG *plUbound) const override;
- virtual BSTR SysAllocString(const OLECHAR *) const override;
virtual void SysFreeString(BSTR) const override;
virtual HRESULT VariantClear(VARIANTARG *pvarg) const override;
diff --git a/agents/windows/WinApiAdaptor.h b/agents/windows/WinApiAdaptor.h
index 77a1154..11407cd 100644
--- a/agents/windows/WinApiAdaptor.h
+++ b/agents/windows/WinApiAdaptor.h
@@ -382,7 +382,6 @@ public:
LONG *plLbound) const = 0;
virtual HRESULT SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim,
LONG *plUbound) const = 0;
- virtual BSTR SysAllocString(const OLECHAR *) const = 0;
virtual void SysFreeString(BSTR) const = 0;
virtual HRESULT VariantClear(VARIANTARG *pvarg) const = 0;
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 9bcc9f4..398a74e 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-3058
+3060
diff --git a/agents/windows/test/MockWinApi.h b/agents/windows/test/MockWinApi.h
index e19a164..82f165b 100644
--- a/agents/windows/test/MockWinApi.h
+++ b/agents/windows/test/MockWinApi.h
@@ -379,7 +379,6 @@ public:
HRESULT(SAFEARRAY *psa, UINT nDim, LONG *plLbound));
MOCK_CONST_METHOD3(SafeArrayGetUBound,
HRESULT(SAFEARRAY *psa, UINT nDim, LONG *plUbound));
- MOCK_CONST_METHOD1(SysAllocString, BSTR(const OLECHAR *));
MOCK_CONST_METHOD1(SysFreeString, void(BSTR));
MOCK_CONST_METHOD1(VariantClear, HRESULT(VARIANTARG *pvarg));
diff --git a/agents/windows/wmiHelper.cc b/agents/windows/wmiHelper.cc
index ececad6..cb33a3f 100644
--- a/agents/windows/wmiHelper.cc
+++ b/agents/windows/wmiHelper.cc
@@ -496,28 +496,3 @@ Result Helper::getClass(LPCWSTR className) {
}
return Result(enumerator, _logger, _winapi);
}
-
-ObjectWrapper Helper::call(ObjectWrapper &result, LPCWSTR method) {
- // NOTE: currently broken and unused, only here as a starting point for
- // future implementation
- IWbemClassObject *outParams = nullptr;
-
- BSTR className;
- HRESULT res = result._current->GetMethodOrigin(method, &className);
- if (FAILED(res)) {
- throw ComException(
- string("Failed to determine method origin: ") + to_utf8(method),
- res, _winapi);
- }
-
- // please don't ask me why ExecMethod needs the method name in a writable
- // buffer...
- BSTR methodName = _winapi.SysAllocString(method);
-
- res = _services->ExecMethod(className, methodName, 0, nullptr,
- result._current.get(), &outParams, nullptr);
-
- _winapi.SysFreeString(methodName);
-
- return ObjectWrapper(outParams, _logger, _winapi);
-}
diff --git a/agents/windows/wmiHelper.h b/agents/windows/wmiHelper.h
index ca6aa2f..76c53d4 100644
--- a/agents/windows/wmiHelper.h
+++ b/agents/windows/wmiHelper.h
@@ -185,8 +185,6 @@ public:
Result query(LPCWSTR query);
Result getClass(LPCWSTR className);
- ObjectWrapper call(ObjectWrapper &result, LPCWSTR method);
-
private:
// get a locator that is used to look up WMI namespaces
IWbemLocator *getWBEMLocator();