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.

160 lines
2.9 KiB

  1. /*****************************************************************************\
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. \*****************************************************************************/
  4. #ifndef _PLOGMAN_H_04262000_
  5. #define _PLOGMAN_H_04262000_
  6. #include "pdhidef.h"
  7. #define _SECOND ((ULONGLONG) 10000000)
  8. #define _MINUTE (60 * _SECOND)
  9. #define _HOUR (60 * _MINUTE)
  10. #define _DAY (24 * _HOUR)
  11. #define VALIDATE_QUERY( x ) if( NULL == x ){ return PDH_INVALID_ARGUMENT; }
  12. #define PLA_ACCOUNT_BUFFER 256
  13. extern LPCWSTR szCollection;
  14. #define READ_REG_MUI 0x000000001
  15. #define CHECK_STATUS( s ) if( ERROR_SUCCESS != s ){ goto cleanup; }
  16. #define FILE_TICS_PER_DAY ((LONGLONG)((LONGLONG)10000 * (LONGLONG)1000 * (LONGLONG)86400))
  17. #define PLA_ENGLISH (PRIMARYLANGID(GetUserDefaultUILanguage())==LANG_ENGLISH)
  18. #define BYTE_SIZE( s ) (s ? ((DWORD)((BYTE*)&s[wcslen(s)]-(BYTE*)&s[0])) : 0)
  19. #define SEVERITY( s ) ((ULONG)s >> 30)
  20. // Registry
  21. PDH_FUNCTION
  22. PlaiReadRegistryPlaTime (
  23. HKEY hKey,
  24. LPCWSTR cwszValueName,
  25. PPLA_TIME_INFO pstiData
  26. );
  27. PDH_FUNCTION
  28. PlaiWriteRegistryPlaTime (
  29. HKEY hKey,
  30. LPCWSTR cwszValueName,
  31. PPLA_TIME_INFO pstiData
  32. );
  33. PDH_FUNCTION
  34. PlaiReadRegistryDwordValue (
  35. HKEY hKey,
  36. LPCWSTR cwszValueName,
  37. LPDWORD pdwValue
  38. );
  39. PDH_FUNCTION
  40. PlaiWriteRegistryDwordValue (
  41. HKEY hKey,
  42. LPCWSTR cwszValueName,
  43. LPDWORD pdwValue
  44. );
  45. PDH_FUNCTION
  46. PlaiReadRegistryStringValue(
  47. HKEY hKey,
  48. LPCWSTR strKey,
  49. DWORD dwFlags,
  50. LPWSTR* pszBuffer,
  51. DWORD* dwBufLen
  52. );
  53. PDH_FUNCTION
  54. PlaiWriteRegistryStringValue (
  55. HKEY hKey,
  56. LPCWSTR cwszValueName,
  57. DWORD dwType,
  58. LPCWSTR pszBuffer,
  59. DWORD dwBufLen
  60. );
  61. PDH_FUNCTION
  62. PlaiWriteRegistryLastModified(
  63. HKEY hkeyQuery
  64. );
  65. DWORD
  66. PlaiCreateQuery(
  67. HKEY hkeyMachine,
  68. HKEY& rhkeyLogQueries
  69. );
  70. PDH_FUNCTION
  71. PlaiConnectToRegistry(
  72. LPCWSTR szComputerName,
  73. HKEY& rhkeyLogQueries,
  74. BOOL bQueries,
  75. BOOL bWrite = TRUE
  76. );
  77. PDH_FUNCTION
  78. PlaiConnectAndLockQuery (
  79. LPCWSTR szComputerName,
  80. LPCWSTR szQueryName,
  81. HKEY& rhkeyQuery,
  82. BOOL bWrite = TRUE
  83. );
  84. // Wbem Functions
  85. PDH_FUNCTION
  86. PdhPlaWbemSetRunAs(
  87. LPWSTR strName,
  88. LPWSTR strComputer,
  89. LPWSTR strUser,
  90. LPWSTR strPassword
  91. );
  92. // Internal
  93. PDH_FUNCTION
  94. PlaiErrorToPdhStatus(
  95. DWORD dwStatus
  96. );
  97. PDH_FUNCTION
  98. PlaiSetItemList(
  99. HKEY hkeyQuery,
  100. PPDH_PLA_ITEM_W pItems
  101. );
  102. PDH_FUNCTION
  103. PlaiSetRunAs(
  104. HKEY hkeyQuery,
  105. LPWSTR strUser,
  106. LPWSTR strPassword
  107. );
  108. PDH_FUNCTION
  109. PlaiRemoveRepeat(
  110. HKEY hkeyQuery
  111. );
  112. PDH_FUNCTION
  113. PlaiSetInfo(
  114. LPWSTR strComputer,
  115. HKEY hkeyQuery,
  116. PPDH_PLA_INFO_W pInfo
  117. );
  118. PDH_FUNCTION
  119. PlaiScanForInvalidChar(
  120. LPWSTR strScan
  121. );
  122. PDH_FUNCTION
  123. PlaiAddItem(
  124. HKEY hkeyQuery,
  125. PPDH_PLA_ITEM_W pItem
  126. );
  127. #endif //_PLOGMAN_H_04262000_