| 200 | } |
| 201 | |
| 202 | static 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 | |
| 233 | static void printObjectInfo(const printInfoStruct& pI) |
| 234 | { |
no test coverage detected