Leaked source code of windows server 2003
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.

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