Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.9 KiB

  1. // #include "StdAfx.h"
  2. #include "pdhtest.h"
  3. SErrorMessage sErrMsg[] =
  4. {
  5. { ((DWORD)0x00000000L), L"PDH_CSTATUS_VALID_DATA" },
  6. { ((DWORD)0x00000001L), L"PDH_CSTATUS_NEW_DATA" },
  7. { ((DWORD)0x800007D0L), L"PDH_CSTATUS_NO_MACHINE" },
  8. { ((DWORD)0x800007D1L), L"PDH_CSTATUS_NO_INSTANCE" },
  9. { ((DWORD)0x800007D2L), L"PDH_MORE_DATA" },
  10. { ((DWORD)0x800007D3L), L"PDH_CSTATUS_ITEM_NOT_VALIDATED" },
  11. { ((DWORD)0x800007D4L), L"PDH_RETRY" },
  12. { ((DWORD)0x800007D5L), L"PDH_NO_DATA" },
  13. { ((DWORD)0x800007D6L), L"PDH_CALC_NEGATIVE_DENOMINATOR" },
  14. { ((DWORD)0x800007D7L), L"PDH_CALC_NEGATIVE_TIMEBASE" },
  15. { ((DWORD)0x800007D8L), L"PDH_CALC_NEGATIVE_VALUE" },
  16. { ((DWORD)0x800007D9L), L"PDH_DIALOG_CANCELLED" },
  17. { ((DWORD)0x800007DAL), L"PDH_END_OF_LOG_FILE" },
  18. { ((DWORD)0xC0000BB8L), L"PDH_CSTATUS_NO_OBJECT" },
  19. { ((DWORD)0xC0000BB9L), L"PDH_CSTATUS_NO_COUNTER" },
  20. { ((DWORD)0xC0000BBAL), L"PDH_CSTATUS_INVALID_DATA" },
  21. { ((DWORD)0xC0000BBBL), L"PDH_MEMORY_ALLOCATION_FAILURE" },
  22. { ((DWORD)0xC0000BBCL), L"PDH_INVALID_HANDLE" },
  23. { ((DWORD)0xC0000BBDL), L"PDH_INVALID_ARGUMENT" },
  24. { ((DWORD)0xC0000BBEL), L"PDH_FUNCTION_NOT_FOUND" },
  25. { ((DWORD)0xC0000BBFL), L"PDH_CSTATUS_NO_COUNTERNAME" },
  26. { ((DWORD)0xC0000BC0L), L"PDH_CSTATUS_BAD_COUNTERNAME" },
  27. { ((DWORD)0xC0000BC1L), L"PDH_INVALID_BUFFER" },
  28. { ((DWORD)0xC0000BC2L), L"PDH_INSUFFICIENT_BUFFER" },
  29. { ((DWORD)0xC0000BC3L), L"PDH_CANNOT_CONNECT_MACHINE" },
  30. { ((DWORD)0xC0000BC4L), L"PDH_INVALID_PATH" },
  31. { ((DWORD)0xC0000BC5L), L"PDH_INVALID_INSTANCE" },
  32. { ((DWORD)0xC0000BC6L), L"PDH_INVALID_DATA" },
  33. { ((DWORD)0xC0000BC7L), L"PDH_NO_DIALOG_DATA" },
  34. { ((DWORD)0xC0000BC8L), L"PDH_CANNOT_READ_NAME_STRINGS" },
  35. { ((DWORD)0xC0000BC9L), L"PDH_LOG_FILE_CREATE_ERROR" },
  36. { ((DWORD)0xC0000BCAL), L"PDH_LOG_FILE_OPEN_ERROR" },
  37. { ((DWORD)0xC0000BCBL), L"PDH_LOG_TYPE_NOT_FOUND" },
  38. { ((DWORD)0xC0000BCCL), L"PDH_NO_MORE_DATA" },
  39. { ((DWORD)0xC0000BCDL), L"PDH_ENTRY_NOT_IN_LOG_FILE" },
  40. { ((DWORD)0xC0000BCEL), L"PDH_DATA_SOURCE_IS_LOG_FILE" },
  41. { ((DWORD)0xC0000BCFL), L"PDH_DATA_SOURCE_IS_REAL_TIME" },
  42. { ((DWORD)0xC0000BD0L), L"PDH_UNABLE_READ_LOG_HEADER" },
  43. { ((DWORD)0xC0000BD1L), L"PDH_FILE_NOT_FOUND" },
  44. { ((DWORD)0xC0000BD2L), L"PDH_FILE_ALREADY_EXISTS" },
  45. { ((DWORD)0xC0000BD3L), L"PDH_NOT_IMPLEMENTED" },
  46. { ((DWORD)0xC0000BD4L), L"PDH_STRING_NOT_FOUND" },
  47. { ((DWORD)0x80000BD5L), L"PDH_UNABLE_MAP_NAME_FILES" },
  48. { ((DWORD)0xC0000BD6L), L"PDH_UNKNOWN_LOG_FORMAT" },
  49. { ((DWORD)0xC0000BD7L), L"PDH_UNKNOWN_LOGSVC_COMMAND" },
  50. { ((DWORD)0xC0000BD8L), L"PDH_LOGSVC_QUERY_NOT_FOUND" },
  51. { ((DWORD)0xC0000BD9L), L"PDH_LOGSVC_NOT_OPENED" },
  52. { ((DWORD)0xC0000BDAL), L"PDH_WBEM_ERROR" },
  53. { ((DWORD)0xC0000BDBL), L"PDH_ACCESS_DENIED" },
  54. { ((DWORD)0xC0000BDCL), L"PDH_LOG_FILE_TOO_SMALL" }
  55. };
  56. WCHAR * GetPdhErrMsg (DWORD dwCode)
  57. {
  58. int i;
  59. WCHAR * pwcsRet = L"????";
  60. for (i = 0;i < sizeof(sErrMsg)/sizeof(SErrorMessage); i++)
  61. {
  62. if (dwCode == sErrMsg[i].dwCode)
  63. {
  64. pwcsRet = sErrMsg[i].wcsDescr;
  65. break;
  66. }
  67. }
  68. return pwcsRet;
  69. };