MCPcopy Create free account
hub / github.com/Icinga/icinga2 / printObjects

Function printObjects

plugins/check_perfmon.cpp:202–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202static void printObjects()
203{
204 DWORD dwBufferLength = 0;
205 PDH_STATUS status = PdhEnumObjects(NULL, NULL, NULL,
206 &dwBufferLength, PERF_DETAIL_WIZARD, FALSE);
207 //HEX HEX! Only a Magicians gets all the info he wants, and only Microsoft knows what that means
208
209 if (status != PDH_MORE_DATA) {
210 printPDHError(status);
211 return;
212 }
213
214 std::vector<WCHAR> mszObjectList(dwBufferLength + 2);
215 status = PdhEnumObjects(NULL, NULL, mszObjectList.data(),
216 &dwBufferLength, PERF_DETAIL_WIZARD, FALSE);
217
218 if (FAILED(status)) {
219 printPDHError(status);
220 return;
221 }
222
223 DWORD c = 0;
224
225 while (++c < dwBufferLength) {
226 if (mszObjectList[c] == '\0')
227 std::wcout << '\n';
228 else
229 std::wcout << mszObjectList[c];
230 }
231}
232
233static void printObjectInfo(const printInfoStruct& pI)
234{

Callers 1

wmainFunction · 0.85

Calls 1

printPDHErrorFunction · 0.85

Tested by

no test coverage detected