From fe9b079286476d436e985902d9e6565a10f08674 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Fri, 16 Sep 2011 01:00:00 +0200 Subject: [PATCH] pdh: Add more Pdh macros and prototypes to the headers. --- include/pdh.h | 28 ++++++++++++++++++ include/pdhmsg.h | 72 +++++++++++++++++++++++++++++++++++++++++++++++ include/winnt.h | 6 ++++ include/winperf.h | 5 ++++ 4 files changed, 111 insertions(+) diff --git a/include/pdh.h b/include/pdh.h index 7f3d3340b21..30591ac19ef 100644 --- a/include/pdh.h +++ b/include/pdh.h @@ -37,6 +37,10 @@ typedef HANDLE PDH_HQUERY; typedef HANDLE PDH_HCOUNTER; typedef HANDLE PDH_HLOG; +typedef PDH_HCOUNTER HCOUNTER; +typedef PDH_HQUERY HQUERY; +typedef PDH_HLOG HLOG; + #define PDH_CVERSION_WIN40 0x0400 #define PDH_CVERSION_WIN50 0x0500 #define PDH_VERSION 0x0503 @@ -57,6 +61,16 @@ typedef HANDLE PDH_HLOG; #define DATA_SOURCE_LOGFILE 0x00000002 #define DATA_SOURCE_WBEM 0x00000004 +#ifdef WINE_NO_UNICODE_MACROS +# define DECL_PDH_TYPE_AW(name) /* nothing */ +#else /* WINE_NO_UNICODE_MACROS */ +# ifdef UNICODE +# define DECL_PDH_TYPE_AW(name) typedef name##_W name; +# else +# define DECL_PDH_TYPE_AW(name) typedef name##_A name; +# endif +#endif /* WINE_NO_UNICODE_MACROS */ + typedef struct _PDH_FMT_COUNTERVALUE { DWORD CStatus; @@ -99,6 +113,9 @@ typedef struct _PDH_COUNTER_PATH_ELEMENTS_W LPWSTR szCounterName; } PDH_COUNTER_PATH_ELEMENTS_W, *PPDH_COUNTER_PATH_ELEMENTS_W; +DECL_PDH_TYPE_AW(PDH_COUNTER_PATH_ELEMENTS) +DECL_PDH_TYPE_AW(PPDH_COUNTER_PATH_ELEMENTS) + typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A { LPSTR szMachineName; @@ -115,6 +132,9 @@ typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W LPWSTR szInstanceName; } PDH_DATA_ITEM_PATH_ELEMENTS_W, *PPDH_DATA_ITEM_PATH_ELEMENTS_W; +DECL_PDH_TYPE_AW(PDH_DATA_ITEM_PATH_ELEMENTS) +DECL_PDH_TYPE_AW(PPDH_DATA_ITEM_PATH_ELEMENTS) + typedef struct _PDH_COUNTER_INFO_A { DWORD dwLength; @@ -173,6 +193,11 @@ typedef struct _PDH_COUNTER_INFO_W DWORD DataBuffer[1]; } PDH_COUNTER_INFO_W, *PPDH_COUNTER_INFO_W; +DECL_PDH_TYPE_AW(PDH_COUNTER_INFO) +DECL_PDH_TYPE_AW(PPDH_COUNTER_INFO) + +#undef DECL_PDH_TYPE_AW + PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *); PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *); #define PdhAddCounter WINELIB_NAME_AW(PdhAddCounter) @@ -183,6 +208,9 @@ PDH_STATUS WINAPI PdhCloseQuery(PDH_HQUERY); PDH_STATUS WINAPI PdhCollectQueryData(PDH_HQUERY); PDH_STATUS WINAPI PdhCollectQueryDataEx(PDH_HQUERY, DWORD, HANDLE); PDH_STATUS WINAPI PdhCollectQueryDataWithTime(PDH_HQUERY,LONGLONG *); +PDH_STATUS WINAPI PdhEnumObjectsA(LPCSTR,LPCSTR,PZZSTR,LPDWORD,DWORD,BOOL); +PDH_STATUS WINAPI PdhEnumObjectsW(LPCWSTR,LPCWSTR,PZZWSTR,LPDWORD,DWORD,BOOL); +#define PdhEnumObjects WINELIB_NAME_AW(PdhEnumObjects) PDH_STATUS WINAPI PdhEnumObjectItemsA(LPCSTR, LPCSTR, LPCSTR, LPSTR, LPDWORD, LPSTR, LPDWORD, DWORD, DWORD); PDH_STATUS WINAPI PdhEnumObjectItemsW(LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, LPDWORD, LPWSTR, LPDWORD, DWORD, DWORD); #define PdhEnumObjectItems WINELIB_NAME_AW(PdhEnumObjectItems) diff --git a/include/pdhmsg.h b/include/pdhmsg.h index f5bcbb38d0a..bb7534a7340 100644 --- a/include/pdhmsg.h +++ b/include/pdhmsg.h @@ -22,18 +22,90 @@ #define _PDH_MSG_H_ #define PDH_CSTATUS_VALID_DATA 0x00000000 +#define PDH_CSTATUS_NEW_DATA 0x00000001 #define PDH_CSTATUS_NO_MACHINE 0x800007d0 +#define PDH_CSTATUS_NO_INSTANCE 0x800007d1 #define PDH_MORE_DATA 0x800007d2 +#define PDH_CSTATUS_ITEM_NOT_VALIDATED 0x800007d3 +#define PDH_RETRY 0x800007d4 #define PDH_NO_DATA 0x800007d5 +#define PDH_CALC_NEGATIVE_DENOMINATOR 0x800007d6 +#define PDH_CALC_NEGATIVE_TIMEBASE 0x800007d7 +#define PDH_CALC_NEGATIVE_VALUE 0x800007d8 +#define PDH_DIALOG_CANCELLED 0x800007d9 +#define PDH_END_OF_LOG_FILE 0x800007da +#define PDH_ASYNC_QUERY_TIMEOUT 0x800007db +#define PDH_CANNOT_SET_DEFAULT_REALTIME_DATASOURCE 0x800007dc +#define PDH_UNABLE_MAP_NAME_FILES 0x80000bd5 +#define PDH_PLA_VALIDATION_WARNING 0x80000bf3 #define PDH_CSTATUS_NO_OBJECT 0xc0000bb8 #define PDH_CSTATUS_NO_COUNTER 0xc0000bb9 +#define PDH_CSTATUS_INVALID_DATA 0xc0000bba #define PDH_MEMORY_ALLOCATION_FAILURE 0xc0000bbb #define PDH_INVALID_HANDLE 0xc0000bbc #define PDH_INVALID_ARGUMENT 0xc0000bbd +#define PDH_FUNCTION_NOT_FOUND 0xc0000bbe +#define PDH_CSTATUS_NO_COUNTERNAME 0xc0000bbf #define PDH_CSTATUS_BAD_COUNTERNAME 0xc0000bc0 +#define PDH_INVALID_BUFFER 0xc0000bc1 #define PDH_INSUFFICIENT_BUFFER 0xc0000bc2 +#define PDH_CANNOT_CONNECT_MACHINE 0xc0000bc3 +#define PDH_INVALID_PATH 0xc0000bc4 +#define PDH_INVALID_INSTANCE 0xc0000bc5 #define PDH_INVALID_DATA 0xc0000bc6 +#define PDH_NO_DIALOG_DATA 0xc0000bc7 +#define PDH_CANNOT_READ_NAME_STRINGS 0xc0000bc8 +#define PDH_LOG_FILE_CREATE_ERROR 0xc0000bc9 +#define PDH_LOG_FILE_OPEN_ERROR 0xc0000bca +#define PDH_LOG_TYPE_NOT_FOUND 0xc0000bcb +#define PDH_NO_MORE_DATA 0xc0000bcc +#define PDH_ENTRY_NOT_IN_LOG_FILE 0xc0000bcd +#define PDH_DATA_SOURCE_IS_LOG_FILE 0xc0000bce +#define PDH_DATA_SOURCE_IS_REAL_TIME 0xc0000bcf +#define PDH_UNABLE_READ_LOG_HEADER 0xc0000bd0 +#define PDH_FILE_NOT_FOUND 0xc0000bd1 +#define PDH_FILE_ALREADY_EXISTS 0xc0000bd2 #define PDH_NOT_IMPLEMENTED 0xc0000bd3 #define PDH_STRING_NOT_FOUND 0xc0000bd4 +#define PDH_UNKNOWN_LOG_FORMAT 0xc0000bd6 +#define PDH_UNKNOWN_LOGSVC_COMMAND 0xc0000bd7 +#define PDH_LOGSVC_QUERY_NOT_FOUND 0xc0000bd8 +#define PDH_LOGSVC_NOT_OPENED 0xc0000bd9 +#define PDH_WBEM_ERROR 0xc0000bda +#define PDH_ACCESS_DENIED 0xc0000bdb +#define PDH_LOG_FILE_TOO_SMALL 0xc0000bdc +#define PDH_INVALID_DATASOURCE 0xc0000bdd +#define PDH_INVALID_SQLDB 0xc0000bde +#define PDH_NO_COUNTERS 0xc0000bdf +#define PDH_SQL_ALLOC_FAILED 0xc0000be0 +#define PDH_SQL_ALLOCCON_FAILED 0xc0000be1 +#define PDH_SQL_EXEC_DIRECT_FAILED 0xc0000be2 +#define PDH_SQL_FETCH_FAILED 0xc0000be3 +#define PDH_SQL_ROWCOUNT_FAILED 0xc0000be4 +#define PDH_SQL_MORE_RESULTS_FAILED 0xc0000be5 +#define PDH_SQL_CONNECT_FAILED 0xc0000be6 +#define PDH_SQL_BIND_FAILED 0xc0000be7 +#define PDH_CANNOT_CONNECT_WMI_SERVER 0xc0000be8 +#define PDH_PLA_COLLECTION_ALREADY_RUNNING 0xc0000be9 +#define PDH_PLA_ERROR_SCHEDULE_OVERLAP 0xc0000bea +#define PDH_PLA_COLLECTION_NOT_FOUND 0xc0000beb +#define PDH_PLA_ERROR_SCHEDULE_ELAPSED 0xc0000bec +#define PDH_PLA_ERROR_NOSTART 0xc0000bed +#define PDH_PLA_ERROR_ALREADY_EXISTS 0xc0000bee +#define PDH_PLA_ERROR_TYPE_MISMATCH 0xc0000bef +#define PDH_PLA_ERROR_FILEPATH 0xc0000bf0 +#define PDH_PLA_SERVICE_ERROR 0xc0000bf1 +#define PDH_PLA_VALIDATION_ERROR 0xc0000bf2 +#define PDH_PLA_ERROR_NAME_TOO_LONG 0xc0000bf4 +#define PDH_INVALID_SQL_LOG_FORMAT 0xc0000bf5 +#define PDH_COUNTER_ALREADY_IN_QUERY 0xc0000bf6 +#define PDH_BINARY_LOG_CORRUPT 0xc0000bf7 +#define PDH_LOG_SAMPLE_TOO_SMALL 0xc0000bf8 +#define PDH_OS_LATER_VERSION 0xc0000bf9 +#define PDH_OS_EARLIER_VERSION 0xc0000bfa +#define PDH_INCORRECT_APPEND_TIME 0xc0000bfb +#define PDH_UNMATCHED_APPEND_COUNTER 0xc0000bfc +#define PDH_SQL_ALTER_DETAIL_FAILED 0xc0000bfd +#define PDH_QUERY_PERF_DATA_TIMEOUT 0xc0000bfe #endif /* _PDH_MSG_H_ */ diff --git a/include/winnt.h b/include/winnt.h index 8ff6a7f2d0a..f8adbcbacf4 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -431,6 +431,8 @@ typedef CHAR *PCH, *LPCH; typedef const CHAR *PCCH, *LPCCH; typedef CHAR *PSTR, *LPSTR, *NPSTR; typedef const CHAR *PCSTR, *LPCSTR; +typedef CHAR *PZZSTR; +typedef const CHAR *PCZZSTR; /* Unicode string types */ typedef WCHAR *PWCH, *LPWCH; @@ -453,6 +455,8 @@ typedef WCHAR TCHAR, *PTCHAR; #endif typedef LPWSTR PTSTR, LPTSTR; typedef LPCWSTR PCTSTR, LPCTSTR; +typedef PZZSTR PZZTSTR; +typedef PCZZSTR PCZZTSTR; # define __TEXT(string) L##string # else /* UNICODE */ # ifndef _TCHAR_DEFINED @@ -461,6 +465,8 @@ typedef CHAR TCHAR, *PTCHAR; # endif typedef LPSTR PTSTR, LPTSTR; typedef LPCSTR PCTSTR, LPCTSTR; +typedef PZZWSTR PZZTSTR; +typedef PCZZWSTR PCZZTSTR; # define __TEXT(string) string # endif /* UNICODE */ # define TEXT(quote) __TEXT(quote) diff --git a/include/winperf.h b/include/winperf.h index eb68ac3404d..b62f24b7087 100644 --- a/include/winperf.h +++ b/include/winperf.h @@ -62,4 +62,9 @@ #define PERF_DISPLAY_SECONDS 0x30000000 #define PERF_DISPLAY_NOSHOW 0x40000000 +#define PERF_DETAIL_NOVICE 100 +#define PERF_DETAIL_ADVANCED 200 +#define PERF_DETAIL_EXPERT 300 +#define PERF_DETAIL_WIZARD 400 + #endif /* _WINPERF_ */