ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

pdh.h
Go to the documentation of this file.
00001 /*
00002  * Performance Data Helper
00003  *
00004  * Copyright 2007 Hans Leidekker
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 
00021 #ifndef _PDH_H_
00022 #define _PDH_H_
00023 
00024 #ifdef __WINESRC__
00025 # include <windef.h>
00026 #else
00027 # include <windows.h>
00028 #endif
00029 #include <winperf.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 typedef LONG   PDH_STATUS;
00036 typedef HANDLE PDH_HQUERY;
00037 typedef HANDLE PDH_HCOUNTER;
00038 typedef HANDLE PDH_HLOG;
00039 
00040 #define PDH_CVERSION_WIN40  0x0400
00041 #define PDH_CVERSION_WIN50  0x0500
00042 #define PDH_VERSION         0x0503
00043 
00044 #define PDH_MAX_SCALE 7
00045 #define PDH_MIN_SCALE (-7)
00046 
00047 #define PDH_MAX_COUNTER_NAME    1024
00048 
00049 #define PDH_FMT_LONG        0x00000100
00050 #define PDH_FMT_DOUBLE      0x00000200
00051 #define PDH_FMT_LARGE       0x00000400
00052 #define PDH_FMT_NOSCALE     0x00001000
00053 #define PDH_FMT_1000        0x00002000
00054 #define PDH_FMT_NOCAP100    0x00008000
00055 
00056 #define DATA_SOURCE_REGISTRY    0x00000001
00057 #define DATA_SOURCE_LOGFILE     0x00000002
00058 #define DATA_SOURCE_WBEM        0x00000004
00059 
00060 typedef struct _PDH_FMT_COUNTERVALUE
00061 {
00062     DWORD CStatus;
00063     union
00064     {
00065         LONG     longValue;
00066         double   doubleValue;
00067         LONGLONG largeValue;
00068         LPCSTR   AnsiStringValue;
00069         LPCWSTR  WideStringValue;
00070     } DUMMYUNIONNAME;
00071 } PDH_FMT_COUNTERVALUE, *PPDH_FMT_COUNTERVALUE;
00072 
00073 typedef struct _PDH_RAW_COUNTER
00074 {
00075     DWORD    CStatus;
00076     FILETIME TimeStamp;
00077     LONGLONG FirstValue;
00078     LONGLONG SecondValue;
00079     DWORD    MultiCount;
00080 } PDH_RAW_COUNTER, *PPDH_RAW_COUNTER;
00081 
00082 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
00083 {
00084     LPSTR szMachineName;
00085     LPSTR szObjectName;
00086     LPSTR szInstanceName;
00087     LPSTR szParentInstance;
00088     DWORD dwInstanceIndex;
00089     LPSTR szCounterName;
00090 } PDH_COUNTER_PATH_ELEMENTS_A, *PPDH_COUNTER_PATH_ELEMENTS_A;
00091 
00092 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
00093 {
00094     LPWSTR szMachineName;
00095     LPWSTR szObjectName;
00096     LPWSTR szInstanceName;
00097     LPWSTR szParentInstance;
00098     DWORD  dwInstanceIndex;
00099     LPWSTR szCounterName;
00100 } PDH_COUNTER_PATH_ELEMENTS_W, *PPDH_COUNTER_PATH_ELEMENTS_W;
00101 
00102 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
00103 {
00104     LPSTR szMachineName;
00105     GUID  ObjectGUID;
00106     DWORD dwItemId;
00107     LPSTR szInstanceName;
00108 } PDH_DATA_ITEM_PATH_ELEMENTS_A, *PPDH_DATA_ITEM_PATH_ELEMENTS_A;
00109 
00110 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
00111 {
00112     LPWSTR szMachineName;
00113     GUID   ObjectGUID;
00114     DWORD  dwItemId;
00115     LPWSTR szInstanceName;
00116 } PDH_DATA_ITEM_PATH_ELEMENTS_W, *PPDH_DATA_ITEM_PATH_ELEMENTS_W;
00117 
00118 typedef struct _PDH_COUNTER_INFO_A
00119 {
00120     DWORD     dwLength;
00121     DWORD     dwType;
00122     DWORD     CVersion;
00123     DWORD     CStatus;
00124     LONG      lScale;
00125     LONG      lDefaultScale;
00126     DWORD_PTR dwUserData;
00127     DWORD_PTR dwQueryUserData;
00128     LPSTR     szFullPath;
00129     union
00130     {
00131         PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath;
00132         PDH_COUNTER_PATH_ELEMENTS_A   CounterPath;
00133         struct
00134         {
00135             LPSTR szMachineName;
00136             LPSTR szObjectName;
00137             LPSTR szInstanceName;
00138             LPSTR szParentInstance;
00139             DWORD dwInstanceIndex;
00140             LPSTR szCounterName;
00141         } DUMMYSTRUCTNAME;
00142     } DUMMYUNIONNAME;
00143     LPSTR szExplainText;
00144     DWORD DataBuffer[1];
00145 } PDH_COUNTER_INFO_A, *PPDH_COUNTER_INFO_A;
00146 
00147 typedef struct _PDH_COUNTER_INFO_W
00148 {
00149     DWORD     dwLength;
00150     DWORD     dwType;
00151     DWORD     CVersion;
00152     DWORD     CStatus;
00153     LONG      lScale;
00154     LONG      lDefaultScale;
00155     DWORD_PTR dwUserData;
00156     DWORD_PTR dwQueryUserData;
00157     LPWSTR    szFullPath;
00158     union
00159     {
00160         PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath;
00161         PDH_COUNTER_PATH_ELEMENTS_W   CounterPath;
00162         struct
00163         {
00164             LPWSTR szMachineName;
00165             LPWSTR szObjectName;
00166             LPWSTR szInstanceName;
00167             LPWSTR szParentInstance;
00168             DWORD  dwInstanceIndex;
00169             LPWSTR szCounterName;
00170         } DUMMYSTRUCTNAME;
00171     } DUMMYUNIONNAME;
00172     LPWSTR szExplainText;
00173     DWORD DataBuffer[1];
00174 } PDH_COUNTER_INFO_W, *PPDH_COUNTER_INFO_W;
00175 
00176 PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
00177 PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
00178 #define    PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
00179 PDH_STATUS WINAPI PdhAddEnglishCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
00180 PDH_STATUS WINAPI PdhAddEnglishCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
00181 #define    PdhAddEnglishCounter WINELIB_NAME_AW(PdhAddEnglishCounter)
00182 PDH_STATUS WINAPI PdhCloseQuery(PDH_HQUERY);
00183 PDH_STATUS WINAPI PdhCollectQueryData(PDH_HQUERY);
00184 PDH_STATUS WINAPI PdhCollectQueryDataEx(PDH_HQUERY, DWORD, HANDLE);
00185 PDH_STATUS WINAPI PdhCollectQueryDataWithTime(PDH_HQUERY,LONGLONG *);
00186 PDH_STATUS WINAPI PdhEnumObjectItemsA(LPCSTR, LPCSTR, LPCSTR, LPSTR, LPDWORD, LPSTR, LPDWORD, DWORD, DWORD);
00187 PDH_STATUS WINAPI PdhEnumObjectItemsW(LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, LPDWORD, LPWSTR, LPDWORD, DWORD, DWORD);
00188 #define    PdhEnumObjectItems WINELIB_NAME_AW(PdhEnumObjectItems)
00189 PDH_STATUS WINAPI PdhGetCounterInfoA(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_A);
00190 PDH_STATUS WINAPI PdhGetCounterInfoW(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_W);
00191 #define    PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
00192 PDH_STATUS WINAPI PdhGetCounterTimeBase(PDH_HCOUNTER, LONGLONG *);
00193 PDH_STATUS WINAPI PdhGetDllVersion(LPDWORD);
00194 PDH_STATUS WINAPI PdhGetFormattedCounterValue(PDH_HCOUNTER, DWORD, LPDWORD, PPDH_FMT_COUNTERVALUE);
00195 PDH_STATUS WINAPI PdhGetRawCounterValue(PDH_HCOUNTER, LPDWORD, PPDH_RAW_COUNTER);
00196 PDH_STATUS WINAPI PdhLookupPerfIndexByNameA(LPCSTR, LPCSTR, LPDWORD);
00197 PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR, LPCWSTR, LPDWORD);
00198 #define    PdhLookupPerfIndexByName WINELIB_NAME_AW(PdhLookupPerfIndexByName)
00199 PDH_STATUS WINAPI PdhLookupPerfNameByIndexA(LPCSTR, DWORD, LPSTR, LPDWORD);
00200 PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR, DWORD, LPWSTR, LPDWORD);
00201 #define    PdhLookupPerfNameByIndex WINELIB_NAME_AW(PdhLookupPerfNameByIndex)
00202 PDH_STATUS WINAPI PdhMakeCounterPathA(PDH_COUNTER_PATH_ELEMENTS_A *, LPSTR, LPDWORD, DWORD);
00203 PDH_STATUS WINAPI PdhMakeCounterPathW(PDH_COUNTER_PATH_ELEMENTS_W *, LPWSTR, LPDWORD, DWORD);
00204 #define    PdhMakeCounterPath WINELIB_NAME_AW(PdhMakeCounterPath)
00205 PDH_STATUS WINAPI PdhOpenQueryA(LPCSTR, DWORD_PTR, PDH_HQUERY *);
00206 PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR, DWORD_PTR, PDH_HQUERY *);
00207 #define    PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
00208 PDH_STATUS WINAPI PdhRemoveCounter(PDH_HCOUNTER);
00209 PDH_STATUS WINAPI PdhSetCounterScaleFactor(PDH_HCOUNTER, LONG);
00210 PDH_STATUS WINAPI PdhSetDefaultRealTimeDataSource(DWORD);
00211 PDH_STATUS WINAPI PdhValidatePathA(LPCSTR);
00212 PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR);
00213 #define    PdhValidatePath WINELIB_NAME_AW(PdhValidatePath)
00214 PDH_STATUS WINAPI PdhValidatePathExA(PDH_HLOG, LPCSTR);
00215 PDH_STATUS WINAPI PdhValidatePathExW(PDH_HLOG, LPCWSTR);
00216 #define    PdhValidatePathEx WINELIB_NAME_AW(PdhValidatePathEx)
00217 
00218 #ifdef __cplusplus
00219 }
00220 #endif
00221 
00222 #endif /* _PDH_H_ */

Generated on Sun May 27 2012 04:32:13 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.