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.

1349 lines
38 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. PDH.H
  5. Abstract:
  6. Header file for the Performance Data Helper (PDH) DLL functions.
  7. --*/
  8. #ifndef _PDH_H_
  9. #define _PDH_H_
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #if _MSC_VER >= 1200
  14. #pragma warning(push)
  15. #endif
  16. #pragma warning ( disable : 4201)
  17. // system include files required for datatype and constant definitions
  18. #include <windows.h> // necessary for data types used in this file
  19. #include <winperf.h> // necessary for the Detail Level definitions
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. typedef LONG PDH_STATUS;
  24. #define PDH_FUNCTION PDH_STATUS __stdcall
  25. // version info
  26. #define PDH_CVERSION_WIN40 ((DWORD)(0x0400))
  27. #define PDH_CVERSION_WIN50 ((DWORD)(0x0500))
  28. // v1.1 revision of PDH -- basic log functions
  29. // v1.2 of the PDH -- adds variable instance counters
  30. // v1.3 of the PDH -- adds log service control & stubs for NT5/PDH v2 fn's
  31. // v2.0 of the PDH -- is the NT v 5.0 B2 version
  32. #define PDH_VERSION ((DWORD)((PDH_CVERSION_WIN50) + 0x0003))
  33. // define severity masks
  34. #define IsSuccessSeverity(ErrorCode) ((((DWORD)(ErrorCode) & (0xC0000000L)) == 0x00000000L) ? TRUE : FALSE)
  35. #define IsInformationalSeverity(ErrorCode) ((((DWORD)(ErrorCode) & (0xC0000000L)) == 0x40000000L) ? TRUE : FALSE)
  36. #define IsWarningSeverity(ErrorCode) ((((DWORD)(ErrorCode) & (0xC0000000L)) == 0x80000000L) ? TRUE : FALSE)
  37. #define IsErrorSeverity(ErrorCode) ((((DWORD)(ErrorCode) & (0xC0000000L)) == 0xC0000000L) ? TRUE : FALSE)
  38. #define MAX_COUNTER_PATH 256 // Maximum counter path length. This is an obsolute constance.
  39. #define PDH_MAX_COUNTER_NAME 1024 // Maximum counter name length.
  40. #define PDH_MAX_INSTANCE_NAME 1024 // Maximum counter instance name length.
  41. #define PDH_MAX_COUNTER_PATH 2048 // Maximum full counter path length.
  42. #define PDH_MAX_DATASOURCE_PATH 1024 // MAximum full counter log name length.
  43. // data type definitions
  44. typedef HANDLE PDH_HCOUNTER;
  45. typedef HANDLE PDH_HQUERY;
  46. typedef HANDLE PDH_HLOG;
  47. typedef PDH_HCOUNTER HCOUNTER;
  48. typedef PDH_HQUERY HQUERY;
  49. #ifndef _LMHLOGDEFINED_
  50. typedef PDH_HLOG HLOG;
  51. #endif
  52. #ifdef INVALID_HANDLE_VALUE
  53. #undef INVALID_HANDLE_VALUE
  54. #define INVALID_HANDLE_VALUE ((HANDLE)((LONG_PTR)-1))
  55. #endif
  56. #define H_REALTIME_DATASOURCE NULL
  57. #define H_WBEM_DATASOURCE INVALID_HANDLE_VALUE
  58. typedef struct _PDH_RAW_COUNTER {
  59. DWORD CStatus;
  60. FILETIME TimeStamp;
  61. LONGLONG FirstValue;
  62. LONGLONG SecondValue;
  63. DWORD MultiCount;
  64. } PDH_RAW_COUNTER, * PPDH_RAW_COUNTER;
  65. typedef struct _PDH_RAW_COUNTER_ITEM_A {
  66. LPSTR szName;
  67. PDH_RAW_COUNTER RawValue;
  68. } PDH_RAW_COUNTER_ITEM_A, * PPDH_RAW_COUNTER_ITEM_A;
  69. typedef struct _PDH_RAW_COUNTER_ITEM_W {
  70. LPWSTR szName;
  71. PDH_RAW_COUNTER RawValue;
  72. } PDH_RAW_COUNTER_ITEM_W, * PPDH_RAW_COUNTER_ITEM_W;
  73. typedef struct _PDH_FMT_COUNTERVALUE {
  74. DWORD CStatus;
  75. union {
  76. LONG longValue;
  77. double doubleValue;
  78. LONGLONG largeValue;
  79. LPCSTR AnsiStringValue;
  80. LPCWSTR WideStringValue;
  81. };
  82. } PDH_FMT_COUNTERVALUE, * PPDH_FMT_COUNTERVALUE;
  83. typedef struct _PDH_FMT_COUNTERVALUE_ITEM_A {
  84. LPSTR szName;
  85. PDH_FMT_COUNTERVALUE FmtValue;
  86. } PDH_FMT_COUNTERVALUE_ITEM_A, * PPDH_FMT_COUNTERVALUE_ITEM_A;
  87. typedef struct _PDH_FMT_COUNTERVALUE_ITEM_W {
  88. LPWSTR szName;
  89. PDH_FMT_COUNTERVALUE FmtValue;
  90. } PDH_FMT_COUNTERVALUE_ITEM_W, * PPDH_FMT_COUNTERVALUE_ITEM_W;
  91. typedef struct _PDH_STATISTICS {
  92. DWORD dwFormat;
  93. DWORD count;
  94. PDH_FMT_COUNTERVALUE min;
  95. PDH_FMT_COUNTERVALUE max;
  96. PDH_FMT_COUNTERVALUE mean;
  97. } PDH_STATISTICS, * PPDH_STATISTICS;
  98. typedef struct _PDH_COUNTER_PATH_ELEMENTS_A {
  99. LPSTR szMachineName;
  100. LPSTR szObjectName;
  101. LPSTR szInstanceName;
  102. LPSTR szParentInstance;
  103. DWORD dwInstanceIndex;
  104. LPSTR szCounterName;
  105. } PDH_COUNTER_PATH_ELEMENTS_A, * PPDH_COUNTER_PATH_ELEMENTS_A;
  106. typedef struct _PDH_COUNTER_PATH_ELEMENTS_W {
  107. LPWSTR szMachineName;
  108. LPWSTR szObjectName;
  109. LPWSTR szInstanceName;
  110. LPWSTR szParentInstance;
  111. DWORD dwInstanceIndex;
  112. LPWSTR szCounterName;
  113. } PDH_COUNTER_PATH_ELEMENTS_W, * PPDH_COUNTER_PATH_ELEMENTS_W;
  114. typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A {
  115. LPSTR szMachineName;
  116. GUID ObjectGUID;
  117. DWORD dwItemId;
  118. LPSTR szInstanceName;
  119. } PDH_DATA_ITEM_PATH_ELEMENTS_A, * PPDH_DATA_ITEM_PATH_ELEMENTS_A;
  120. typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W {
  121. LPWSTR szMachineName;
  122. GUID ObjectGUID;
  123. DWORD dwItemId;
  124. LPWSTR szInstanceName;
  125. } PDH_DATA_ITEM_PATH_ELEMENTS_W, * PPDH_DATA_ITEM_PATH_ELEMENTS_W;
  126. typedef struct _PDH_COUNTER_INFO_A {
  127. DWORD dwLength;
  128. DWORD dwType;
  129. DWORD CVersion;
  130. DWORD CStatus;
  131. LONG lScale;
  132. LONG lDefaultScale;
  133. DWORD_PTR dwUserData;
  134. DWORD_PTR dwQueryUserData;
  135. LPSTR szFullPath;
  136. union {
  137. PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath;
  138. PDH_COUNTER_PATH_ELEMENTS_A CounterPath;
  139. struct {
  140. LPSTR szMachineName;
  141. LPSTR szObjectName;
  142. LPSTR szInstanceName;
  143. LPSTR szParentInstance;
  144. DWORD dwInstanceIndex;
  145. LPSTR szCounterName;
  146. };
  147. };
  148. LPSTR szExplainText;
  149. DWORD DataBuffer[1];
  150. } PDH_COUNTER_INFO_A, * PPDH_COUNTER_INFO_A;
  151. typedef struct _PDH_COUNTER_INFO_W {
  152. DWORD dwLength;
  153. DWORD dwType;
  154. DWORD CVersion;
  155. DWORD CStatus;
  156. LONG lScale;
  157. LONG lDefaultScale;
  158. DWORD_PTR dwUserData;
  159. DWORD_PTR dwQueryUserData;
  160. LPWSTR szFullPath;
  161. union {
  162. PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath;
  163. PDH_COUNTER_PATH_ELEMENTS_W CounterPath;
  164. struct {
  165. LPWSTR szMachineName;
  166. LPWSTR szObjectName;
  167. LPWSTR szInstanceName;
  168. LPWSTR szParentInstance;
  169. DWORD dwInstanceIndex;
  170. LPWSTR szCounterName;
  171. };
  172. };
  173. LPWSTR szExplainText;
  174. DWORD DataBuffer[1];
  175. } PDH_COUNTER_INFO_W, * PPDH_COUNTER_INFO_W;
  176. typedef struct _PDH_TIME_INFO {
  177. LONGLONG StartTime;
  178. LONGLONG EndTime;
  179. DWORD SampleCount;
  180. } PDH_TIME_INFO, * PPDH_TIME_INFO;
  181. typedef struct _PDH_RAW_LOG_RECORD {
  182. DWORD dwStructureSize;
  183. DWORD dwRecordType;
  184. DWORD dwItems;
  185. UCHAR RawBytes[1];
  186. } PDH_RAW_LOG_RECORD, * PPDH_RAW_LOG_RECORD;
  187. typedef struct _PDH_LOG_SERVICE_QUERY_INFO_A {
  188. DWORD dwSize;
  189. DWORD dwFlags;
  190. DWORD dwLogQuota;
  191. LPSTR szLogFileCaption;
  192. LPSTR szDefaultDir;
  193. LPSTR szBaseFileName;
  194. DWORD dwFileType;
  195. DWORD dwReserved;
  196. union {
  197. struct {
  198. DWORD PdlAutoNameInterval;
  199. DWORD PdlAutoNameUnits;
  200. LPSTR PdlCommandFilename;
  201. LPSTR PdlCounterList;
  202. DWORD PdlAutoNameFormat;
  203. DWORD PdlSampleInterval;
  204. FILETIME PdlLogStartTime;
  205. FILETIME PdlLogEndTime;
  206. };
  207. struct {
  208. DWORD TlNumberOfBuffers;
  209. DWORD TlMinimumBuffers;
  210. DWORD TlMaximumBuffers;
  211. DWORD TlFreeBuffers;
  212. DWORD TlBufferSize;
  213. DWORD TlEventsLost;
  214. DWORD TlLoggerThreadId;
  215. DWORD TlBuffersWritten;
  216. DWORD TlLogHandle;
  217. LPSTR TlLogFileName;
  218. };
  219. };
  220. } PDH_LOG_SERVICE_QUERY_INFO_A, * PPDH_LOG_SERVICE_QUERY_INFO_A;
  221. typedef struct _PDH_LOG_SERVICE_QUERY_INFO_W {
  222. DWORD dwSize;
  223. DWORD dwFlags;
  224. DWORD dwLogQuota;
  225. LPWSTR szLogFileCaption;
  226. LPWSTR szDefaultDir;
  227. LPWSTR szBaseFileName;
  228. DWORD dwFileType;
  229. DWORD dwReserved;
  230. union {
  231. struct {
  232. DWORD PdlAutoNameInterval;
  233. DWORD PdlAutoNameUnits;
  234. LPWSTR PdlCommandFilename;
  235. LPWSTR PdlCounterList;
  236. DWORD PdlAutoNameFormat;
  237. DWORD PdlSampleInterval;
  238. FILETIME PdlLogStartTime;
  239. FILETIME PdlLogEndTime;
  240. };
  241. struct {
  242. DWORD TlNumberOfBuffers;
  243. DWORD TlMinimumBuffers;
  244. DWORD TlMaximumBuffers;
  245. DWORD TlFreeBuffers;
  246. DWORD TlBufferSize;
  247. DWORD TlEventsLost;
  248. DWORD TlLoggerThreadId;
  249. DWORD TlBuffersWritten;
  250. DWORD TlLogHandle;
  251. LPWSTR TlLogFileName;
  252. };
  253. };
  254. } PDH_LOG_SERVICE_QUERY_INFO_W, * PPDH_LOG_SERVICE_QUERY_INFO_W;
  255. //
  256. // Time value constants
  257. //
  258. #define MAX_TIME_VALUE ((LONGLONG) 0x7FFFFFFFFFFFFFFF)
  259. #define MIN_TIME_VALUE ((LONGLONG) 0)
  260. // function definitions
  261. PDH_FUNCTION
  262. PdhGetDllVersion(
  263. IN LPDWORD lpdwVersion
  264. );
  265. //
  266. // Query Functions
  267. //
  268. PDH_FUNCTION
  269. PdhOpenQueryW(
  270. IN LPCWSTR szDataSource,
  271. IN DWORD_PTR dwUserData,
  272. IN PDH_HQUERY * phQuery
  273. );
  274. PDH_FUNCTION
  275. PdhOpenQueryA(
  276. IN LPCSTR szDataSource,
  277. IN DWORD_PTR dwUserData,
  278. IN PDH_HQUERY * phQuery
  279. );
  280. PDH_FUNCTION
  281. PdhAddCounterW(
  282. IN PDH_HQUERY hQuery,
  283. IN LPCWSTR szFullCounterPath,
  284. IN DWORD_PTR dwUserData,
  285. IN PDH_HCOUNTER * phCounter
  286. );
  287. PDH_FUNCTION
  288. PdhAddCounterA(
  289. IN PDH_HQUERY hQuery,
  290. IN LPCSTR szFullCounterPath,
  291. IN DWORD_PTR dwUserData,
  292. IN PDH_HCOUNTER * phCounter
  293. );
  294. PDH_FUNCTION
  295. PdhRemoveCounter(
  296. IN PDH_HCOUNTER hCounter
  297. );
  298. PDH_FUNCTION
  299. PdhCollectQueryData(
  300. IN PDH_HQUERY hQuery
  301. );
  302. PDH_FUNCTION
  303. PdhCloseQuery(
  304. IN PDH_HQUERY hQuery
  305. );
  306. //
  307. // Counter Functions
  308. //
  309. PDH_FUNCTION
  310. PdhGetFormattedCounterValue(
  311. IN PDH_HCOUNTER hCounter,
  312. IN DWORD dwFormat,
  313. IN LPDWORD lpdwType,
  314. IN PPDH_FMT_COUNTERVALUE pValue
  315. );
  316. PDH_FUNCTION
  317. PdhGetFormattedCounterArrayA(
  318. IN PDH_HCOUNTER hCounter,
  319. IN DWORD dwFormat,
  320. IN LPDWORD lpdwBufferSize,
  321. IN LPDWORD lpdwItemCount,
  322. IN PPDH_FMT_COUNTERVALUE_ITEM_A ItemBuffer
  323. );
  324. PDH_FUNCTION
  325. PdhGetFormattedCounterArrayW(
  326. IN PDH_HCOUNTER hCounter,
  327. IN DWORD dwFormat,
  328. IN LPDWORD lpdwBufferSize,
  329. IN LPDWORD lpdwItemCount,
  330. IN PPDH_FMT_COUNTERVALUE_ITEM_W ItemBuffer
  331. );
  332. // dwFormat flag values
  333. //
  334. #define PDH_FMT_RAW ((DWORD) 0x00000010)
  335. #define PDH_FMT_ANSI ((DWORD) 0x00000020)
  336. #define PDH_FMT_UNICODE ((DWORD) 0x00000040)
  337. #define PDH_FMT_LONG ((DWORD) 0x00000100)
  338. #define PDH_FMT_DOUBLE ((DWORD) 0x00000200)
  339. #define PDH_FMT_LARGE ((DWORD) 0x00000400)
  340. #define PDH_FMT_NOSCALE ((DWORD) 0x00001000)
  341. #define PDH_FMT_1000 ((DWORD) 0x00002000)
  342. #define PDH_FMT_NODATA ((DWORD) 0x00004000)
  343. #define PDH_FMT_NOCAP100 ((DWORD) 0x00008000)
  344. #define PERF_DETAIL_COSTLY ((DWORD) 0x00010000)
  345. #define PERF_DETAIL_STANDARD ((DWORD) 0x0000FFFF)
  346. PDH_FUNCTION
  347. PdhGetRawCounterValue(
  348. IN PDH_HCOUNTER hCounter,
  349. IN LPDWORD lpdwType,
  350. IN PPDH_RAW_COUNTER pValue
  351. );
  352. PDH_FUNCTION
  353. PdhGetRawCounterArrayA(
  354. IN PDH_HCOUNTER hCounter,
  355. IN LPDWORD lpdwBufferSize,
  356. IN LPDWORD lpdwItemCount,
  357. IN PPDH_RAW_COUNTER_ITEM_A ItemBuffer
  358. );
  359. PDH_FUNCTION
  360. PdhGetRawCounterArrayW(
  361. IN PDH_HCOUNTER hCounter,
  362. IN LPDWORD lpdwBufferSize,
  363. IN LPDWORD lpdwItemCount,
  364. IN PPDH_RAW_COUNTER_ITEM_W ItemBuffer
  365. );
  366. PDH_FUNCTION
  367. PdhCalculateCounterFromRawValue(
  368. IN PDH_HCOUNTER hCounter,
  369. IN DWORD dwFormat,
  370. IN PPDH_RAW_COUNTER rawValue1,
  371. IN PPDH_RAW_COUNTER rawValue2,
  372. IN PPDH_FMT_COUNTERVALUE fmtValue
  373. );
  374. PDH_FUNCTION
  375. PdhComputeCounterStatistics(
  376. IN PDH_HCOUNTER hCounter,
  377. IN DWORD dwFormat,
  378. IN DWORD dwFirstEntry,
  379. IN DWORD dwNumEntries,
  380. IN PPDH_RAW_COUNTER lpRawValueArray,
  381. IN PPDH_STATISTICS data
  382. );
  383. PDH_FUNCTION
  384. PdhGetCounterInfoW(
  385. IN PDH_HCOUNTER hCounter,
  386. IN BOOLEAN bRetrieveExplainText,
  387. IN LPDWORD pdwBufferSize,
  388. IN PPDH_COUNTER_INFO_W lpBuffer
  389. );
  390. PDH_FUNCTION
  391. PdhGetCounterInfoA(
  392. IN PDH_HCOUNTER hCounter,
  393. IN BOOLEAN bRetrieveExplainText,
  394. IN LPDWORD pdwBufferSize,
  395. IN PPDH_COUNTER_INFO_A lpBuffer
  396. );
  397. #define PDH_MAX_SCALE (7L)
  398. #define PDH_MIN_SCALE (-7L)
  399. PDH_FUNCTION
  400. PdhSetCounterScaleFactor(
  401. IN PDH_HCOUNTER hCounter,
  402. IN LONG lFactor
  403. );
  404. //
  405. // Browsing and enumeration functions
  406. //
  407. PDH_FUNCTION
  408. PdhConnectMachineW(
  409. IN LPCWSTR szMachineName
  410. );
  411. PDH_FUNCTION
  412. PdhConnectMachineA(
  413. IN LPCSTR szMachineName
  414. );
  415. PDH_FUNCTION
  416. PdhEnumMachinesW(
  417. IN LPCWSTR szDataSource,
  418. IN LPWSTR mszMachineList,
  419. IN LPDWORD pcchBufferSize
  420. );
  421. PDH_FUNCTION
  422. PdhEnumMachinesA(
  423. IN LPCSTR szDataSource,
  424. IN LPSTR mszMachineList,
  425. IN LPDWORD pcchBufferSize
  426. );
  427. PDH_FUNCTION
  428. PdhEnumObjectsW(
  429. IN LPCWSTR szDataSource,
  430. IN LPCWSTR szMachineName,
  431. IN LPWSTR mszObjectList,
  432. IN LPDWORD pcchBufferSize,
  433. IN DWORD dwDetailLevel,
  434. IN BOOL bRefresh
  435. );
  436. PDH_FUNCTION
  437. PdhEnumObjectsA(
  438. IN LPCSTR szDataSource,
  439. IN LPCSTR szMachineName,
  440. IN LPSTR mszObjectList,
  441. IN LPDWORD pcchBufferSize,
  442. IN DWORD dwDetailLevel,
  443. IN BOOL bRefresh
  444. );
  445. PDH_FUNCTION
  446. PdhEnumObjectItemsW(
  447. IN LPCWSTR szDataSource,
  448. IN LPCWSTR szMachineName,
  449. IN LPCWSTR szObjectName,
  450. IN LPWSTR mszCounterList,
  451. IN LPDWORD pcchCounterListLength,
  452. IN LPWSTR mszInstanceList,
  453. IN LPDWORD pcchInstanceListLength,
  454. IN DWORD dwDetailLevel,
  455. IN DWORD dwFlags
  456. );
  457. PDH_FUNCTION
  458. PdhEnumObjectItemsA(
  459. IN LPCSTR szDataSource,
  460. IN LPCSTR szMachineName,
  461. IN LPCSTR szObjectName,
  462. IN LPSTR mszCounterList,
  463. IN LPDWORD pcchCounterListLength,
  464. IN LPSTR mszInstanceList,
  465. IN LPDWORD pcchInstanceListLength,
  466. IN DWORD dwDetailLevel,
  467. IN DWORD dwFlags
  468. );
  469. #define PDH_OBJECT_HAS_INSTANCES ((DWORD) 0x00000001)
  470. PDH_FUNCTION
  471. PdhMakeCounterPathW(
  472. IN PPDH_COUNTER_PATH_ELEMENTS_W pCounterPathElements,
  473. IN LPWSTR szFullPathBuffer,
  474. IN LPDWORD pcchBufferSize,
  475. IN DWORD dwFlags
  476. );
  477. PDH_FUNCTION
  478. PdhMakeCounterPathA(
  479. IN PPDH_COUNTER_PATH_ELEMENTS_A pCounterPathElements,
  480. IN LPSTR szFullPathBuffer,
  481. IN LPDWORD pcchBufferSize,
  482. IN DWORD dwFlags
  483. );
  484. PDH_FUNCTION
  485. PdhParseCounterPathW(
  486. IN LPCWSTR szFullPathBuffer,
  487. IN PPDH_COUNTER_PATH_ELEMENTS_W pCounterPathElements,
  488. IN LPDWORD pdwBufferSize,
  489. IN DWORD dwFlags
  490. );
  491. PDH_FUNCTION
  492. PdhParseCounterPathA(
  493. IN LPCSTR szFullPathBuffer,
  494. IN PPDH_COUNTER_PATH_ELEMENTS_A pCounterPathElements,
  495. IN LPDWORD pdwBufferSize,
  496. IN DWORD dwFlags
  497. );
  498. #define PDH_PATH_WBEM_RESULT ((DWORD) 0x00000001)
  499. #define PDH_PATH_WBEM_INPUT ((DWORD) 0x00000002)
  500. #define PDH_PATH_LANG_FLAGS(LangId, Flags) ((DWORD)(((LangId & 0x0000FFFF) << 16) | (Flags & 0x0000FFFF)))
  501. PDH_FUNCTION
  502. PdhParseInstanceNameW(
  503. IN LPCWSTR szInstanceString,
  504. IN LPWSTR szInstanceName,
  505. IN LPDWORD pcchInstanceNameLength,
  506. IN LPWSTR szParentName,
  507. IN LPDWORD pcchParentNameLength,
  508. IN LPDWORD lpIndex
  509. );
  510. PDH_FUNCTION
  511. PdhParseInstanceNameA(
  512. IN LPCSTR szInstanceString,
  513. IN LPSTR szInstanceName,
  514. IN LPDWORD pcchInstanceNameLength,
  515. IN LPSTR szParentName,
  516. IN LPDWORD pcchParentNameLength,
  517. IN LPDWORD lpIndex
  518. );
  519. PDH_FUNCTION
  520. PdhValidatePathW(
  521. IN LPCWSTR szFullPathBuffer
  522. );
  523. PDH_FUNCTION
  524. PdhValidatePathA(
  525. IN LPCSTR szFullPathBuffer
  526. );
  527. PDH_FUNCTION
  528. PdhGetDefaultPerfObjectW(
  529. IN LPCWSTR szDataSource,
  530. IN LPCWSTR szMachineName,
  531. IN LPWSTR szDefaultObjectName,
  532. IN LPDWORD pcchBufferSize
  533. );
  534. PDH_FUNCTION
  535. PdhGetDefaultPerfObjectA(
  536. IN LPCSTR szDataSource,
  537. IN LPCSTR szMachineName,
  538. IN LPSTR szDefaultObjectName,
  539. IN LPDWORD pcchBufferSize
  540. );
  541. PDH_FUNCTION
  542. PdhGetDefaultPerfCounterW(
  543. IN LPCWSTR szDataSource,
  544. IN LPCWSTR szMachineName,
  545. IN LPCWSTR szObjectName,
  546. IN LPWSTR szDefaultCounterName,
  547. IN LPDWORD pcchBufferSize
  548. );
  549. PDH_FUNCTION
  550. PdhGetDefaultPerfCounterA(
  551. IN LPCSTR szDataSource,
  552. IN LPCSTR szMachineName,
  553. IN LPCSTR szObjectName,
  554. IN LPSTR szDefaultCounterName,
  555. IN LPDWORD pcchBufferSize
  556. );
  557. typedef PDH_STATUS (__stdcall * CounterPathCallBack)(DWORD_PTR);
  558. #if _MSC_VER >= 1200
  559. #pragma warning(push)
  560. #endif
  561. #pragma warning ( disable : 4214 ) // Disable warning messages
  562. typedef struct _BrowseDlgConfig_HW {
  563. // Configuration flags
  564. DWORD bIncludeInstanceIndex:1,
  565. bSingleCounterPerAdd:1,
  566. bSingleCounterPerDialog:1,
  567. bLocalCountersOnly:1,
  568. bWildCardInstances:1,
  569. bHideDetailBox:1,
  570. bInitializePath:1,
  571. bDisableMachineSelection:1,
  572. bIncludeCostlyObjects:1,
  573. bShowObjectBrowser:1,
  574. bReserved:22;
  575. HWND hWndOwner;
  576. PDH_HLOG hDataSource;
  577. LPWSTR szReturnPathBuffer;
  578. DWORD cchReturnPathLength;
  579. CounterPathCallBack pCallBack;
  580. DWORD_PTR dwCallBackArg;
  581. PDH_STATUS CallBackStatus;
  582. DWORD dwDefaultDetailLevel;
  583. LPWSTR szDialogBoxCaption;
  584. } PDH_BROWSE_DLG_CONFIG_HW, * PPDH_BROWSE_DLG_CONFIG_HW;
  585. typedef struct _BrowseDlgConfig_HA {
  586. // Configuration flags
  587. DWORD bIncludeInstanceIndex:1,
  588. bSingleCounterPerAdd:1,
  589. bSingleCounterPerDialog:1,
  590. bLocalCountersOnly:1,
  591. bWildCardInstances:1,
  592. bHideDetailBox:1,
  593. bInitializePath:1,
  594. bDisableMachineSelection:1,
  595. bIncludeCostlyObjects:1,
  596. bShowObjectBrowser:1,
  597. bReserved:22;
  598. HWND hWndOwner;
  599. PDH_HLOG hDataSource;
  600. LPSTR szReturnPathBuffer;
  601. DWORD cchReturnPathLength;
  602. CounterPathCallBack pCallBack;
  603. DWORD_PTR dwCallBackArg;
  604. PDH_STATUS CallBackStatus;
  605. DWORD dwDefaultDetailLevel;
  606. LPSTR szDialogBoxCaption;
  607. } PDH_BROWSE_DLG_CONFIG_HA, * PPDH_BROWSE_DLG_CONFIG_HA;
  608. typedef struct _BrowseDlgConfig_W {
  609. // Configuration flags
  610. DWORD bIncludeInstanceIndex:1,
  611. bSingleCounterPerAdd:1,
  612. bSingleCounterPerDialog:1,
  613. bLocalCountersOnly:1,
  614. bWildCardInstances:1,
  615. bHideDetailBox:1,
  616. bInitializePath:1,
  617. bDisableMachineSelection:1,
  618. bIncludeCostlyObjects:1,
  619. bShowObjectBrowser:1,
  620. bReserved:22;
  621. HWND hWndOwner;
  622. LPWSTR szDataSource;
  623. LPWSTR szReturnPathBuffer;
  624. DWORD cchReturnPathLength;
  625. CounterPathCallBack pCallBack;
  626. DWORD_PTR dwCallBackArg;
  627. PDH_STATUS CallBackStatus;
  628. DWORD dwDefaultDetailLevel;
  629. LPWSTR szDialogBoxCaption;
  630. } PDH_BROWSE_DLG_CONFIG_W, * PPDH_BROWSE_DLG_CONFIG_W;
  631. typedef struct _BrowseDlgConfig_A {
  632. // Configuration flags
  633. DWORD bIncludeInstanceIndex:1,
  634. bSingleCounterPerAdd:1,
  635. bSingleCounterPerDialog:1,
  636. bLocalCountersOnly:1,
  637. bWildCardInstances:1,
  638. bHideDetailBox:1,
  639. bInitializePath:1,
  640. bDisableMachineSelection:1,
  641. bIncludeCostlyObjects:1,
  642. bShowObjectBrowser:1,
  643. bReserved:22;
  644. HWND hWndOwner;
  645. LPSTR szDataSource;
  646. LPSTR szReturnPathBuffer;
  647. DWORD cchReturnPathLength;
  648. CounterPathCallBack pCallBack;
  649. DWORD_PTR dwCallBackArg;
  650. PDH_STATUS CallBackStatus;
  651. DWORD dwDefaultDetailLevel;
  652. LPSTR szDialogBoxCaption;
  653. } PDH_BROWSE_DLG_CONFIG_A, * PPDH_BROWSE_DLG_CONFIG_A;
  654. #if _MSC_VER >= 1200
  655. #pragma warning(pop)
  656. #else
  657. #pragma warning ( default : 4214 )
  658. #endif
  659. PDH_FUNCTION
  660. PdhBrowseCountersW(
  661. IN PPDH_BROWSE_DLG_CONFIG_W pBrowseDlgData
  662. );
  663. PDH_FUNCTION
  664. PdhBrowseCountersA(
  665. IN PPDH_BROWSE_DLG_CONFIG_A pBrowseDlgData
  666. );
  667. PDH_FUNCTION
  668. PdhExpandCounterPathW(
  669. IN LPCWSTR szWildCardPath,
  670. IN LPWSTR mszExpandedPathList,
  671. IN LPDWORD pcchPathListLength
  672. );
  673. PDH_FUNCTION
  674. PdhExpandCounterPathA(
  675. IN LPCSTR szWildCardPath,
  676. IN LPSTR mszExpandedPathList,
  677. IN LPDWORD pcchPathListLength
  678. );
  679. //
  680. // v2.0 functions
  681. //
  682. PDH_FUNCTION
  683. PdhLookupPerfNameByIndexW(
  684. IN LPCWSTR szMachineName,
  685. IN DWORD dwNameIndex,
  686. IN LPWSTR szNameBuffer,
  687. IN LPDWORD pcchNameBufferSize
  688. );
  689. PDH_FUNCTION
  690. PdhLookupPerfNameByIndexA(
  691. IN LPCSTR szMachineName,
  692. IN DWORD dwNameIndex,
  693. IN LPSTR szNameBuffer,
  694. IN LPDWORD pcchNameBufferSize
  695. );
  696. PDH_FUNCTION
  697. PdhLookupPerfIndexByNameW(
  698. IN LPCWSTR szMachineName,
  699. IN LPCWSTR szNameBuffer,
  700. IN LPDWORD pdwIndex
  701. );
  702. PDH_FUNCTION
  703. PdhLookupPerfIndexByNameA(
  704. IN LPCSTR szMachineName,
  705. IN LPCSTR szNameBuffer,
  706. IN LPDWORD pdwIndex
  707. );
  708. #define PDH_NOEXPANDCOUNTERS 1
  709. #define PDH_NOEXPANDINSTANCES 2
  710. #define PDH_REFRESHCOUNTERS 4
  711. PDH_FUNCTION
  712. PdhExpandWildCardPathA(
  713. IN LPCSTR szDataSource,
  714. IN LPCSTR szWildCardPath,
  715. IN LPSTR mszExpandedPathList,
  716. IN LPDWORD pcchPathListLength,
  717. IN DWORD dwFlags
  718. );
  719. PDH_FUNCTION
  720. PdhExpandWildCardPathW(
  721. IN LPCWSTR szDataSource,
  722. IN LPCWSTR szWildCardPath,
  723. IN LPWSTR mszExpandedPathList,
  724. IN LPDWORD pcchPathListLength,
  725. IN DWORD dwFlags
  726. );
  727. //
  728. // Logging Functions
  729. //
  730. #define PDH_LOG_READ_ACCESS ((DWORD) 0x00010000)
  731. #define PDH_LOG_WRITE_ACCESS ((DWORD) 0x00020000)
  732. #define PDH_LOG_UPDATE_ACCESS ((DWORD) 0x00040000)
  733. #define PDH_LOG_ACCESS_MASK ((DWORD) 0x000F0000)
  734. #define PDH_LOG_CREATE_NEW ((DWORD) 0x00000001)
  735. #define PDH_LOG_CREATE_ALWAYS ((DWORD) 0x00000002)
  736. #define PDH_LOG_OPEN_ALWAYS ((DWORD) 0x00000003)
  737. #define PDH_LOG_OPEN_EXISTING ((DWORD) 0x00000004)
  738. #define PDH_LOG_CREATE_MASK ((DWORD) 0x0000000F)
  739. #define PDH_LOG_OPT_USER_STRING ((DWORD) 0x01000000)
  740. #define PDH_LOG_OPT_CIRCULAR ((DWORD) 0x02000000)
  741. #define PDH_LOG_OPT_MAX_IS_BYTES ((DWORD) 0x04000000)
  742. #define PDH_LOG_OPT_APPEND ((DWORD) 0x08000000)
  743. #define PDH_LOG_OPT_MASK ((DWORD) 0x0F000000)
  744. #define PDH_LOG_TYPE_UNDEFINED 0
  745. #define PDH_LOG_TYPE_CSV 1
  746. #define PDH_LOG_TYPE_TSV 2
  747. //#define PDH_LOG_TYPE_BINARY 3 // this is the retired binary format
  748. #define PDH_LOG_TYPE_TRACE_KERNEL 4
  749. #define PDH_LOG_TYPE_TRACE_GENERIC 5
  750. #define PDH_LOG_TYPE_PERFMON 6
  751. #define PDH_LOG_TYPE_SQL 7
  752. #define PDH_LOG_TYPE_BINARY 8
  753. PDH_FUNCTION
  754. PdhOpenLogW(
  755. IN LPCWSTR szLogFileName,
  756. IN DWORD dwAccessFlags,
  757. IN LPDWORD lpdwLogType,
  758. IN PDH_HQUERY hQuery,
  759. IN DWORD dwMaxSize,
  760. IN LPCWSTR szUserCaption,
  761. IN PDH_HLOG * phLog
  762. );
  763. PDH_FUNCTION
  764. PdhOpenLogA(
  765. IN LPCSTR szLogFileName,
  766. IN DWORD dwAccessFlags,
  767. IN LPDWORD lpdwLogType,
  768. IN PDH_HQUERY hQuery,
  769. IN DWORD dwMaxSize,
  770. IN LPCSTR szUserCaption,
  771. IN PDH_HLOG * phLog
  772. );
  773. PDH_FUNCTION
  774. PdhUpdateLogW(
  775. IN PDH_HLOG hLog,
  776. IN LPCWSTR szUserString
  777. );
  778. PDH_FUNCTION
  779. PdhUpdateLogA(
  780. IN PDH_HLOG hLog,
  781. IN LPCSTR szUserString
  782. );
  783. PDH_FUNCTION
  784. PdhUpdateLogFileCatalog(
  785. IN PDH_HLOG hLog
  786. );
  787. PDH_FUNCTION
  788. PdhGetLogFileSize(
  789. IN PDH_HLOG hLog,
  790. IN LONGLONG * llSize
  791. );
  792. PDH_FUNCTION
  793. PdhCloseLog(
  794. IN PDH_HLOG hLog,
  795. IN DWORD dwFlags
  796. );
  797. #define PDH_FLAGS_CLOSE_QUERY ((DWORD) 0x00000001)
  798. //
  799. // Data source selection dialog
  800. //
  801. #define PDH_FLAGS_FILE_BROWSER_ONLY ((DWORD) 0x00000001)
  802. PDH_FUNCTION
  803. PdhSelectDataSourceW(
  804. IN HWND hWndOwner,
  805. IN DWORD dwFlags,
  806. IN LPWSTR szDataSource,
  807. IN LPDWORD pcchBufferLength
  808. );
  809. PDH_FUNCTION
  810. PdhSelectDataSourceA(
  811. IN HWND hWndOwner,
  812. IN DWORD dwFlags,
  813. IN LPSTR szDataSource,
  814. IN LPDWORD pcchBufferLength
  815. );
  816. BOOL
  817. PdhIsRealTimeQuery(
  818. IN PDH_HQUERY hQuery
  819. );
  820. PDH_FUNCTION
  821. PdhSetQueryTimeRange(
  822. IN PDH_HQUERY hQuery,
  823. IN PPDH_TIME_INFO pInfo
  824. );
  825. PDH_FUNCTION
  826. PdhGetDataSourceTimeRangeW(
  827. IN LPCWSTR szDataSource,
  828. IN LPDWORD pdwNumEntries,
  829. IN PPDH_TIME_INFO pInfo,
  830. IN LPDWORD pdwBufferSize
  831. );
  832. PDH_FUNCTION
  833. PdhGetDataSourceTimeRangeA(
  834. IN LPCSTR szDataSource,
  835. IN LPDWORD pdwNumEntries,
  836. IN PPDH_TIME_INFO pInfo,
  837. IN LPDWORD dwBufferSize
  838. );
  839. PDH_FUNCTION
  840. PdhCollectQueryDataEx(
  841. IN PDH_HQUERY hQuery,
  842. IN DWORD dwIntervalTime,
  843. IN HANDLE hNewDataEvent
  844. );
  845. PDH_FUNCTION
  846. PdhFormatFromRawValue(
  847. IN DWORD dwCounterType,
  848. IN DWORD dwFormat,
  849. IN LONGLONG * pTimeBase,
  850. IN PPDH_RAW_COUNTER pRawValue1,
  851. IN PPDH_RAW_COUNTER pRawValue2,
  852. IN PPDH_FMT_COUNTERVALUE pFmtValue
  853. );
  854. PDH_FUNCTION
  855. PdhGetCounterTimeBase(
  856. IN PDH_HCOUNTER hCounter,
  857. IN LONGLONG * pTimeBase
  858. );
  859. PDH_FUNCTION
  860. PdhReadRawLogRecord(
  861. IN PDH_HLOG hLog,
  862. IN FILETIME ftRecord,
  863. IN PPDH_RAW_LOG_RECORD pRawLogRecord,
  864. IN LPDWORD pdwBufferLength
  865. );
  866. #define DATA_SOURCE_REGISTRY ((DWORD) 0x00000001)
  867. #define DATA_SOURCE_LOGFILE ((DWORD) 0x00000002)
  868. #define DATA_SOURCE_WBEM ((DWORD) 0x00000004)
  869. PDH_FUNCTION
  870. PdhSetDefaultRealTimeDataSource(
  871. IN DWORD dwDataSourceId
  872. );
  873. // Extended API for WMI event trace logfile format
  874. //
  875. PDH_FUNCTION
  876. PdhBindInputDataSourceW(
  877. IN PDH_HLOG * phDataSource,
  878. IN LPCWSTR LogFileNameList
  879. );
  880. PDH_FUNCTION
  881. PdhBindInputDataSourceA(
  882. IN PDH_HLOG * phDataSource,
  883. IN LPCSTR LogFileNameList
  884. );
  885. PDH_FUNCTION
  886. PdhOpenQueryH(
  887. IN PDH_HLOG hDataSource,
  888. IN DWORD_PTR dwUserData,
  889. IN PDH_HQUERY * phQuery
  890. );
  891. PDH_FUNCTION
  892. PdhEnumMachinesHW(
  893. IN PDH_HLOG hDataSource,
  894. IN LPWSTR mszMachineList,
  895. IN LPDWORD pcchBufferSize
  896. );
  897. PDH_FUNCTION
  898. PdhEnumMachinesHA(
  899. IN PDH_HLOG hDataSource,
  900. IN LPSTR mszMachineList,
  901. IN LPDWORD pcchBufferSize
  902. );
  903. PDH_FUNCTION
  904. PdhEnumObjectsHW(
  905. IN PDH_HLOG hDataSource,
  906. IN LPCWSTR szMachineName,
  907. IN LPWSTR mszObjectList,
  908. IN LPDWORD pcchBufferSize,
  909. IN DWORD dwDetailLevel,
  910. IN BOOL bRefresh
  911. ) ;
  912. PDH_FUNCTION
  913. PdhEnumObjectsHA(
  914. IN PDH_HLOG hDataSource,
  915. IN LPCSTR szMachineName,
  916. IN LPSTR mszObjectList,
  917. IN LPDWORD pcchBufferSize,
  918. IN DWORD dwDetailLevel,
  919. IN BOOL bRefresh
  920. );
  921. PDH_FUNCTION
  922. PdhEnumObjectItemsHW(
  923. IN PDH_HLOG hDataSource,
  924. IN LPCWSTR szMachineName,
  925. IN LPCWSTR szObjectName,
  926. IN LPWSTR mszCounterList,
  927. IN LPDWORD pcchCounterListLength,
  928. IN LPWSTR mszInstanceList,
  929. IN LPDWORD pcchInstanceListLength,
  930. IN DWORD dwDetailLevel,
  931. IN DWORD dwFlags
  932. );
  933. PDH_FUNCTION
  934. PdhEnumObjectItemsHA(
  935. IN PDH_HLOG hDataSource,
  936. IN LPCSTR szMachineName,
  937. IN LPCSTR szObjectName,
  938. IN LPSTR mszCounterList,
  939. IN LPDWORD pcchCounterListLength,
  940. IN LPSTR mszInstanceList,
  941. IN LPDWORD pcchInstanceListLength,
  942. IN DWORD dwDetailLevel,
  943. IN DWORD dwFlags
  944. );
  945. PDH_FUNCTION
  946. PdhExpandWildCardPathHW(
  947. IN PDH_HLOG hDataSource,
  948. IN LPCWSTR szWildCardPath,
  949. IN LPWSTR mszExpandedPathList,
  950. IN LPDWORD pcchPathListLength,
  951. IN DWORD dwFlags
  952. );
  953. PDH_FUNCTION
  954. PdhExpandWildCardPathHA(
  955. IN PDH_HLOG hDataSource,
  956. IN LPCSTR szWildCardPath,
  957. IN LPSTR mszExpandedPathList,
  958. IN LPDWORD pcchPathListLength,
  959. IN DWORD dwFlags
  960. );
  961. PDH_FUNCTION
  962. PdhGetDataSourceTimeRangeH(
  963. IN PDH_HLOG hDataSource,
  964. IN LPDWORD pdwNumEntries,
  965. IN PPDH_TIME_INFO pInfo,
  966. IN LPDWORD pdwBufferSize
  967. );
  968. PDH_FUNCTION
  969. PdhGetDefaultPerfObjectHW(
  970. IN PDH_HLOG hDataSource,
  971. IN LPCWSTR szMachineName,
  972. IN LPWSTR szDefaultObjectName,
  973. IN LPDWORD pcchBufferSize
  974. );
  975. PDH_FUNCTION
  976. PdhGetDefaultPerfObjectHA(
  977. IN PDH_HLOG hDataSource,
  978. IN LPCSTR szMachineName,
  979. IN LPSTR szDefaultObjectName,
  980. IN LPDWORD pcchBufferSize
  981. );
  982. PDH_FUNCTION
  983. PdhGetDefaultPerfCounterHW(
  984. IN PDH_HLOG hDataSource,
  985. IN LPCWSTR szMachineName,
  986. IN LPCWSTR szObjectName,
  987. IN LPWSTR szDefaultCounterName,
  988. IN LPDWORD pcchBufferSize
  989. );
  990. PDH_FUNCTION
  991. PdhGetDefaultPerfCounterHA(
  992. IN PDH_HLOG hDataSource,
  993. IN LPCSTR szMachineName,
  994. IN LPCSTR szObjectName,
  995. IN LPSTR szDefaultCounterName,
  996. IN LPDWORD pcchBufferSize
  997. );
  998. PDH_FUNCTION
  999. PdhBrowseCountersHW(
  1000. IN PPDH_BROWSE_DLG_CONFIG_HW pBrowseDlgData
  1001. );
  1002. PDH_FUNCTION
  1003. PdhBrowseCountersHA(
  1004. IN PPDH_BROWSE_DLG_CONFIG_HA pBrowseDlgData
  1005. );
  1006. //Check that a DSN points to a database that contains the correct Perfmon tables.
  1007. PDH_FUNCTION
  1008. PdhVerifySQLDBW(
  1009. IN LPCWSTR szDataSource
  1010. );
  1011. PDH_FUNCTION
  1012. PdhVerifySQLDBA(
  1013. IN LPCSTR szDataSource
  1014. );
  1015. //Create the correct perfmon tables in the database pointed to by a DSN.
  1016. PDH_FUNCTION
  1017. PdhCreateSQLTablesW(
  1018. IN LPCWSTR szDataSource
  1019. );
  1020. PDH_FUNCTION
  1021. PdhCreateSQLTablesA(
  1022. IN LPCSTR szDataSource
  1023. );
  1024. //Return the list of Log set names in the database pointed to by the DSN.
  1025. PDH_FUNCTION
  1026. PdhEnumLogSetNamesW(
  1027. IN LPCWSTR szDataSource,
  1028. IN LPWSTR mszDataSetNameList,
  1029. IN LPDWORD pcchBufferLength
  1030. );
  1031. PDH_FUNCTION
  1032. PdhEnumLogSetNamesA(
  1033. IN LPCSTR szDataSource,
  1034. IN LPSTR mszDataSetNameList,
  1035. IN LPDWORD pcchBufferLength
  1036. );
  1037. //Retrieve the GUID for an open Log Set
  1038. PDH_FUNCTION
  1039. PdhGetLogSetGUID(
  1040. IN PDH_HLOG hLog,
  1041. IN GUID * pGuid,
  1042. IN int * pRunId
  1043. );
  1044. //Set the RunID for an open Log Set
  1045. PDH_FUNCTION
  1046. PdhSetLogSetRunID(
  1047. IN PDH_HLOG hLog,
  1048. IN int RunId
  1049. );
  1050. //
  1051. // Unicode/ANSI compatibility section
  1052. //
  1053. #ifdef UNICODE
  1054. #ifndef _UNICODE
  1055. #define _UNICODE
  1056. #endif
  1057. #endif
  1058. #ifdef _UNICODE
  1059. #ifndef UNICODE
  1060. #define UNICODE
  1061. #endif
  1062. #endif
  1063. #ifdef UNICODE
  1064. // start of UNICODE definitions
  1065. #define PdhOpenQuery PdhOpenQueryW
  1066. #define PdhAddCounter PdhAddCounterW
  1067. #define PdhGetCounterInfo PdhGetCounterInfoW
  1068. #define PDH_COUNTER_INFO PDH_COUNTER_INFO_W
  1069. #define PPDH_COUNTER_INFO PPDH_COUNTER_INFO_W
  1070. #define PdhConnectMachine PdhConnectMachineW
  1071. #define PdhEnumMachines PdhEnumMachinesW
  1072. #define PdhEnumObjects PdhEnumObjectsW
  1073. #define PdhEnumObjectItems PdhEnumObjectItemsW
  1074. #define PdhMakeCounterPath PdhMakeCounterPathW
  1075. #define PDH_COUNTER_PATH_ELEMENTS PDH_COUNTER_PATH_ELEMENTS_W
  1076. #define PPDH_COUNTER_PATH_ELEMENTS PPDH_COUNTER_PATH_ELEMENTS_W
  1077. #define PdhParseCounterPath PdhParseCounterPathW
  1078. #define PdhParseInstanceName PdhParseInstanceNameW
  1079. #define PdhValidatePath PdhValidatePathW
  1080. #define PdhGetDefaultPerfObject PdhGetDefaultPerfObjectW
  1081. #define PdhGetDefaultPerfCounter PdhGetDefaultPerfCounterW
  1082. #define PdhBrowseCounters PdhBrowseCountersW
  1083. #define PdhBrowseCountersH PdhBrowseCountersHW
  1084. #define PDH_BROWSE_DLG_CONFIG PDH_BROWSE_DLG_CONFIG_W
  1085. #define PPDH_BROWSE_DLG_CONFIG PPDH_BROWSE_DLG_CONFIG_W
  1086. #define PDH_BROWSE_DLG_CONFIG_H PDH_BROWSE_DLG_CONFIG_HW
  1087. #define PPDH_BROWSE_DLG_CONFIG_H PPDH_BROWSE_DLG_CONFIG_HW
  1088. #define PdhExpandCounterPath PdhExpandCounterPathW
  1089. // v2.0 functions
  1090. #define PDH_FMT_COUNTERVALUE_ITEM PDH_FMT_COUNTERVALUE_ITEM_W
  1091. #define PPDH_FMT_COUNTERVALUE_ITEM PPDH_FMT_COUNTERVALUE_ITEM_W
  1092. #define PDH_RAW_COUNTER_ITEM PDH_RAW_COUNTER_ITEM_W
  1093. #define PPDH_RAW_COUNTER_ITEM PPDH_RAW_COUNTER_ITEM_W
  1094. #define PdhGetFormattedCounterArray PdhGetFormattedCounterArrayW
  1095. #define PdhGetRawCounterArray PdhGetRawCounterArrayW
  1096. #define PdhLookupPerfNameByIndex PdhLookupPerfNameByIndexW
  1097. #define PdhLookupPerfIndexByName PdhLookupPerfIndexByNameW
  1098. #define PdhOpenLog PdhOpenLogW
  1099. #define PdhUpdateLog PdhUpdateLogW
  1100. #define PdhSelectDataSource PdhSelectDataSourceW
  1101. #define PdhGetDataSourceTimeRange PdhGetDataSourceTimeRangeW
  1102. #define PDH_LOG_SERVICE_QUERY_INFO PDH_LOG_SERVICE_QUERY_INFO_W
  1103. #define PPDH_LOG_SERVICE_QUERY_INFO PPDH_LOG_SERVICE_QUERY_INFO_W
  1104. #define PdhLogServiceControl PdhLogServiceControlW
  1105. #define PdhLogServiceQuery PdhLogServiceQueryW
  1106. #define PdhExpandWildCardPath PdhExpandWildCardPathW
  1107. #define PdhBindInputDataSource PdhBindInputDataSourceW
  1108. #define PdhEnumMachinesH PdhEnumMachinesHW
  1109. #define PdhEnumObjectsH PdhEnumObjectsHW
  1110. #define PdhEnumObjectItemsH PdhEnumObjectItemsHW
  1111. #define PdhExpandWildCardPathH PdhExpandWildCardPathHW
  1112. #define PdhGetDefaultPerfObjectH PdhGetDefaultPerfObjectHW
  1113. #define PdhGetDefaultPerfCounterH PdhGetDefaultPerfCounterHW
  1114. #define PdhEnumLogSetNames PdhEnumLogSetNamesW
  1115. #define PdhCreateSQLTables PdhCreateSQLTablesW
  1116. #define PdhVerifySQLDB PdhVerifySQLDBW
  1117. // end of UNICODE definitions
  1118. #else
  1119. // start of ANSI definitions
  1120. #define PdhOpenQuery PdhOpenQueryA
  1121. #define PdhAddCounter PdhAddCounterA
  1122. #define PdhGetCounterInfo PdhGetCounterInfoA
  1123. #define PDH_COUNTER_INFO PDH_COUNTER_INFO_A
  1124. #define PPDH_COUNTER_INFO PPDH_COUNTER_INFO_A
  1125. #define PdhConnectMachine PdhConnectMachineA
  1126. #define PdhEnumMachines PdhEnumMachinesA
  1127. #define PdhEnumObjects PdhEnumObjectsA
  1128. #define PdhEnumObjectItems PdhEnumObjectItemsA
  1129. #define PdhMakeCounterPath PdhMakeCounterPathA
  1130. #define PDH_COUNTER_PATH_ELEMENTS PDH_COUNTER_PATH_ELEMENTS_A
  1131. #define PPDH_COUNTER_PATH_ELEMENTS PPDH_COUNTER_PATH_ELEMENTS_A
  1132. #define PdhParseCounterPath PdhParseCounterPathA
  1133. #define PdhParseInstanceName PdhParseInstanceNameA
  1134. #define PdhValidatePath PdhValidatePathA
  1135. #define PdhGetDefaultPerfObject PdhGetDefaultPerfObjectA
  1136. #define PdhGetDefaultPerfCounter PdhGetDefaultPerfCounterA
  1137. #define PdhBrowseCounters PdhBrowseCountersA
  1138. #define PdhBrowseCountersH PdhBrowseCountersHA
  1139. #define PDH_BROWSE_DLG_CONFIG PDH_BROWSE_DLG_CONFIG_A
  1140. #define PPDH_BROWSE_DLG_CONFIG PPDH_BROWSE_DLG_CONFIG_A
  1141. #define PDH_BROWSE_DLG_CONFIG_H PDH_BROWSE_DLG_CONFIG_HA
  1142. #define PPDH_BROWSE_DLG_CONFIG_H PPDH_BROWSE_DLG_CONFIG_HA
  1143. #define PdhExpandCounterPath PdhExpandCounterPathA
  1144. // v2.0 functions
  1145. #define PDH_FMT_COUNTERVALUE_ITEM PDH_FMT_COUNTERVALUE_ITEM_A
  1146. #define PPDH_FMT_COUNTERVALUE_ITEM PPDH_FMT_COUNTERVALUE_ITEM_A
  1147. #define PDH_RAW_COUNTER_ITEM PDH_RAW_COUNTER_ITEM_A
  1148. #define PPDH_RAW_COUNTER_ITEM PPDH_RAW_COUNTER_ITEM_A
  1149. #define PdhGetFormattedCounterArray PdhGetFormattedCounterArrayA
  1150. #define PdhGetRawCounterArray PdhGetRawCounterArrayA
  1151. #define PdhLookupPerfNameByIndex PdhLookupPerfNameByIndexA
  1152. #define PdhLookupPerfIndexByName PdhLookupPerfIndexByNameA
  1153. #define PdhOpenLog PdhOpenLogA
  1154. #define PdhUpdateLog PdhUpdateLogA
  1155. #define PdhSelectDataSource PdhSelectDataSourceA
  1156. #define PdhGetDataSourceTimeRange PdhGetDataSourceTimeRangeA
  1157. #define PDH_LOG_SERVICE_QUERY_INFO PDH_LOG_SERVICE_QUERY_INFO_A
  1158. #define PPDH_LOG_SERVICE_QUERY_INFO PPDH_LOG_SERVICE_QUERY_INFO_A
  1159. #define PdhLogServiceControl PdhLogServiceControlA
  1160. #define PdhLogServiceQuery PdhLogServiceQueryA
  1161. #define PdhExpandWildCardPath PdhExpandWildCardPathA
  1162. #define PdhBindInputDataSource PdhBindInputDataSourceA
  1163. #define PdhEnumMachinesH PdhEnumMachinesHA
  1164. #define PdhEnumObjectsH PdhEnumObjectsHA
  1165. #define PdhEnumObjectItemsH PdhEnumObjectItemsHA
  1166. #define PdhExpandWildCardPathH PdhExpandWildCardPathHA
  1167. #define PdhGetDefaultPerfObjectH PdhGetDefaultPerfObjectHA
  1168. #define PdhGetDefaultPerfCounterH PdhGetDefaultPerfCounterHA
  1169. #define PdhEnumLogSetNames PdhEnumLogSetNamesA
  1170. #define PdhCreateSQLTables PdhCreateSQLTablesA
  1171. #define PdhVerifySQLDB PdhVerifySQLDBA
  1172. // end of ANSI definitions
  1173. #endif // UNICODE
  1174. #if _MSC_VER >= 1200
  1175. #pragma warning(pop)
  1176. #else
  1177. #pragma warning ( default : 4201 )
  1178. #endif
  1179. #ifdef __cplusplus
  1180. }
  1181. #endif
  1182. #endif //_PDH_H_