ReactOS  0.4.13-dev-242-g611e6d7
pdh.h
Go to the documentation of this file.
1 /*
2  * Performance Data Helper
3  *
4  * Copyright 2007 Hans Leidekker
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #ifndef _PDH_H_
22 #define _PDH_H_
23 
24 #ifdef __WINESRC__
25 # include <windef.h>
26 #else
27 # include <windows.h>
28 #endif
29 #include <winperf.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 typedef LONG PDH_STATUS;
38 typedef HANDLE PDH_HLOG;
39 
40 #define PDH_CVERSION_WIN40 0x0400
41 #define PDH_CVERSION_WIN50 0x0500
42 #define PDH_VERSION 0x0503
43 
44 #define PDH_MAX_SCALE 7
45 #define PDH_MIN_SCALE (-7)
46 
47 #define PDH_MAX_COUNTER_NAME 1024
48 
49 #define PDH_FMT_LONG 0x00000100
50 #define PDH_FMT_DOUBLE 0x00000200
51 #define PDH_FMT_LARGE 0x00000400
52 #define PDH_FMT_NOSCALE 0x00001000
53 #define PDH_FMT_1000 0x00002000
54 #define PDH_FMT_NOCAP100 0x00008000
55 
56 #define DATA_SOURCE_REGISTRY 0x00000001
57 #define DATA_SOURCE_LOGFILE 0x00000002
58 #define DATA_SOURCE_WBEM 0x00000004
59 
60 typedef struct _PDH_FMT_COUNTERVALUE
61 {
63  union
64  {
66  double doubleValue;
72 
73 typedef struct _PDH_RAW_COUNTER
74 {
81 
83 {
91 
93 {
101 
103 {
109 
111 {
117 
118 typedef struct _PDH_COUNTER_INFO_A
119 {
129  union
130  {
133  struct
134  {
141  } DUMMYSTRUCTNAME;
142  } DUMMYUNIONNAME;
146 
147 typedef struct _PDH_COUNTER_INFO_W
148 {
158  union
159  {
162  struct
163  {
170  } DUMMYSTRUCTNAME;
171  } DUMMYUNIONNAME;
175 
178 #define PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
181 #define PdhAddEnglishCounter WINELIB_NAME_AW(PdhAddEnglishCounter)
188 #define PdhEnumObjectItems WINELIB_NAME_AW(PdhEnumObjectItems)
191 #define PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
198 #define PdhLookupPerfIndexByName WINELIB_NAME_AW(PdhLookupPerfIndexByName)
201 #define PdhLookupPerfNameByIndex WINELIB_NAME_AW(PdhLookupPerfNameByIndex)
204 #define PdhMakeCounterPath WINELIB_NAME_AW(PdhMakeCounterPath)
207 #define PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
213 #define PdhValidatePath WINELIB_NAME_AW(PdhValidatePath)
216 #define PdhValidatePathEx WINELIB_NAME_AW(PdhValidatePathEx)
217 
218 #ifdef __cplusplus
219 }
220 #endif
221 
222 #endif /* _PDH_H_ */
LPWSTR szFullPath
Definition: pdh.h:157
LPSTR szExplainText
Definition: pdh.h:143
struct _PDH_COUNTER_INFO_W::@3054::@3055 DUMMYSTRUCTNAME
struct _PDH_COUNTER_INFO_A::@3052::@3053 DUMMYSTRUCTNAME
union _PDH_COUNTER_INFO_W::@3054 DUMMYUNIONNAME
LPSTR szObjectName
Definition: pdh.h:136
HANDLE PDH_HLOG
Definition: pdh.h:38
DWORD_PTR dwUserData
Definition: pdh.h:126
PDH_STATUS WINAPI PdhAddEnglishCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *)
Definition: pdh_main.c:308
DWORD dwInstanceIndex
Definition: pdh.h:168
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
DWORD CVersion
Definition: pdh.h:122
LPSTR szParentInstance
Definition: pdh.h:138
DWORD CVersion
Definition: pdh.h:151
struct _PDH_COUNTER_INFO_A PDH_COUNTER_INFO_A
PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath
Definition: pdh.h:160
LPWSTR szInstanceName
Definition: pdh.h:166
FILETIME TimeStamp
Definition: pdh.h:76
PDH_STATUS WINAPI PdhValidatePathExA(PDH_HLOG, LPCSTR)
Definition: pdh_main.c:1101
LONG lDefaultScale
Definition: pdh.h:154
PDH_STATUS WINAPI PdhCollectQueryDataEx(PDH_HQUERY, DWORD, HANDLE)
Definition: pdh_main.c:514
DWORD DataBuffer[1]
Definition: pdh.h:173
PDH_STATUS WINAPI PdhMakeCounterPathA(PDH_COUNTER_PATH_ELEMENTS_A *, LPSTR, LPDWORD, DWORD)
Definition: pdh_main.c:1131
PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath
Definition: pdh.h:131
PDH_STATUS WINAPI PdhGetRawCounterValue(PDH_HCOUNTER, LPDWORD, PPDH_RAW_COUNTER)
Definition: pdh_main.c:800
PDH_STATUS WINAPI PdhSetDefaultRealTimeDataSource(DWORD)
Definition: pdh_main.c:1265
PDH_STATUS WINAPI PdhCloseQuery(PDH_HQUERY)
Definition: pdh_main.c:391
struct _PDH_COUNTER_PATH_ELEMENTS_W * PPDH_COUNTER_PATH_ELEMENTS_W
char * LPSTR
Definition: xmlstorage.h:182
struct _PDH_COUNTER_INFO_W * PPDH_COUNTER_INFO_W
LONG lDefaultScale
Definition: pdh.h:125
DWORD_PTR dwUserData
Definition: pdh.h:155
PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR, DWORD, LPWSTR, LPDWORD)
Definition: pdh_main.c:912
LPSTR szInstanceName
Definition: pdh.h:137
long LONG
Definition: pedump.c:60
union _PDH_FMT_COUNTERVALUE::@3051 DUMMYUNIONNAME
PDH_STATUS WINAPI PdhSetCounterScaleFactor(PDH_HCOUNTER, LONG)
Definition: pdh_main.c:1018
PDH_STATUS WINAPI PdhMakeCounterPathW(PDH_COUNTER_PATH_ELEMENTS_W *, LPWSTR, LPDWORD, DWORD)
Definition: pdh_main.c:1182
HANDLE PDH_HQUERY
Definition: pdh.h:36
LPWSTR szParentInstance
Definition: pdh.h:167
unsigned char BOOLEAN
LPCWSTR WideStringValue
Definition: pdh.h:69
struct _PDH_FMT_COUNTERVALUE * PPDH_FMT_COUNTERVALUE
DWORD_PTR dwQueryUserData
Definition: pdh.h:127
LPSTR szCounterName
Definition: pdh.h:140
LPCSTR AnsiStringValue
Definition: pdh.h:68
const char * LPCSTR
Definition: xmlstorage.h:183
struct _PDH_FMT_COUNTERVALUE PDH_FMT_COUNTERVALUE
struct _PDH_RAW_COUNTER * PPDH_RAW_COUNTER
int64_t LONGLONG
Definition: typedefs.h:66
DWORD_PTR dwQueryUserData
Definition: pdh.h:156
struct _PDH_COUNTER_INFO_A * PPDH_COUNTER_INFO_A
struct _PDH_COUNTER_PATH_ELEMENTS_A PDH_COUNTER_PATH_ELEMENTS_A
LPSTR szFullPath
Definition: pdh.h:128
HANDLE PDH_HCOUNTER
Definition: pdh.h:37
LONG PDH_STATUS
Definition: pdh.h:35
LONGLONG SecondValue
Definition: pdh.h:78
DWORD DataBuffer[1]
Definition: pdh.h:144
struct _PDH_DATA_ITEM_PATH_ELEMENTS_A * PPDH_DATA_ITEM_PATH_ELEMENTS_A
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
PDH_STATUS WINAPI PdhGetDllVersion(LPDWORD)
Definition: pdh_main.c:753
PDH_STATUS WINAPI PdhValidatePathA(LPCSTR)
Definition: pdh_main.c:1045
double doubleValue
Definition: pdh.h:66
struct _PDH_DATA_ITEM_PATH_ELEMENTS_W * PPDH_DATA_ITEM_PATH_ELEMENTS_W
DWORD dwLength
Definition: pdh.h:120
struct _PDH_RAW_COUNTER PDH_RAW_COUNTER
PDH_STATUS WINAPI PdhGetCounterTimeBase(PDH_HCOUNTER, LONGLONG *)
Definition: pdh_main.c:729
struct _PDH_DATA_ITEM_PATH_ELEMENTS_W PDH_DATA_ITEM_PATH_ELEMENTS_W
PDH_COUNTER_PATH_ELEMENTS_W CounterPath
Definition: pdh.h:161
uint32_t DWORD_PTR
Definition: typedefs.h:63
LONGLONG FirstValue
Definition: pdh.h:77
PDH_STATUS WINAPI PdhEnumObjectItemsW(LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, LPDWORD, LPWSTR, LPDWORD, DWORD, DWORD)
Definition: pdh_main.c:1251
PDH_STATUS WINAPI PdhGetCounterInfoA(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_A)
Definition: pdh_main.c:645
LPWSTR szObjectName
Definition: pdh.h:165
LPWSTR szCounterName
Definition: pdh.h:169
PDH_STATUS WINAPI PdhEnumObjectItemsA(LPCSTR, LPCSTR, LPCSTR, LPSTR, LPDWORD, LPSTR, LPDWORD, DWORD, DWORD)
Definition: pdh_main.c:1237
union _PDH_COUNTER_INFO_A::@3052 DUMMYUNIONNAME
PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR)
Definition: pdh_main.c:1071
PDH_STATUS WINAPI PdhValidatePathExW(PDH_HLOG, LPCWSTR)
Definition: pdh_main.c:1116
PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR, DWORD_PTR, PDH_HQUERY *)
Definition: pdh_main.c:969
PDH_STATUS WINAPI PdhRemoveCounter(PDH_HCOUNTER)
Definition: pdh_main.c:995
LPSTR szMachineName
Definition: pdh.h:135
LPWSTR szMachineName
Definition: pdh.h:164
struct _PDH_COUNTER_PATH_ELEMENTS_W PDH_COUNTER_PATH_ELEMENTS_W
PDH_STATUS WINAPI PdhCollectQueryDataWithTime(PDH_HQUERY, LONGLONG *)
Definition: pdh_main.c:573
DWORD dwLength
Definition: pdh.h:149
PDH_STATUS WINAPI PdhOpenQueryA(LPCSTR, DWORD_PTR, PDH_HQUERY *)
Definition: pdh_main.c:951
DWORD dwType
Definition: pdh.h:150
PDH_STATUS WINAPI PdhLookupPerfIndexByNameA(LPCSTR, LPCSTR, LPDWORD)
Definition: pdh_main.c:832
struct _PDH_COUNTER_INFO_W PDH_COUNTER_INFO_W
DWORD CStatus
Definition: pdh.h:75
PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *)
Definition: pdh_main.c:236
PDH_STATUS WINAPI PdhGetCounterInfoW(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_W)
Definition: pdh_main.c:687
DWORD MultiCount
Definition: pdh.h:79
uint32_t * LPDWORD
Definition: typedefs.h:57
PDH_STATUS WINAPI PdhGetFormattedCounterValue(PDH_HCOUNTER, DWORD, LPDWORD, PPDH_FMT_COUNTERVALUE)
Definition: pdh_main.c:766
struct _PDH_COUNTER_PATH_ELEMENTS_A * PPDH_COUNTER_PATH_ELEMENTS_A
DWORD CStatus
Definition: pdh.h:152
DWORD dwType
Definition: pdh.h:121
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DWORD dwInstanceIndex
Definition: pdh.h:139
struct _PDH_DATA_ITEM_PATH_ELEMENTS_A PDH_DATA_ITEM_PATH_ELEMENTS_A
LPWSTR szExplainText
Definition: pdh.h:172
PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *)
Definition: pdh_main.c:258
PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR, LPCWSTR, LPDWORD)
Definition: pdh_main.c:857
LONGLONG largeValue
Definition: pdh.h:67
PDH_STATUS WINAPI PdhAddEnglishCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *)
Definition: pdh_main.c:320
PDH_COUNTER_PATH_ELEMENTS_A CounterPath
Definition: pdh.h:132
PDH_STATUS WINAPI PdhCollectQueryData(PDH_HQUERY)
Definition: pdh_main.c:458
PDH_STATUS WINAPI PdhLookupPerfNameByIndexA(LPCSTR, DWORD, LPSTR, LPDWORD)
Definition: pdh_main.c:884
DWORD CStatus
Definition: pdh.h:123