38#define GETFUNCPTR(func) p##func = (void *)GetProcAddress( pdh, #func );
56 if (pGetThreadUILanguage)
58 if (pGetUserDefaultUILanguage)
75 {
'%',
' ',
'P',
'r',
'o',
'c',
'e',
's',
's',
'o',
'r',
' ',
'T',
'i',
'm',
'e',0};
77 {
'S',
'y',
's',
't',
'e',
'm',
' ',
'U',
'p',
' ',
'T',
'i',
'm',
'e',0};
80 {
'\\',
'S',
'y',
's',
't',
'e',
'm',
'\\',
'S',
'y',
's',
't',
'e',
'm',
' ',
'U',
'p',
' ',
'T',
'i',
'm',
'e',0};
82 {
'\\',
'S',
'y',
's',
't',
'e',
'm',
'\\',
'S',
'y',
's',
't',
'e',
'm',
' ',
'D',
'o',
'w',
'n',
' ',
'T',
'i',
'm',
'e',0};
84 {
'\\',
'P',
'r',
'o',
'c',
'e',
's',
's',
'o',
'r',
'(',
'_',
'T',
'o',
't',
'a',
'l',
')',
85 '\\',
'%',
' ',
'P',
'r',
'o',
'c',
'e',
's',
's',
'o',
'r',
' ',
'T',
'i',
'm',
'e',0};
159 "PdhAddCounterA failed 0x%08x\n",
ret);
208 "PdhAddCounterW failed 0x%08x\n",
ret);
245 ret = pPdhAddEnglishCounterA(
NULL,
"\\System\\System Up Time", 0,
NULL );
248 ret = pPdhAddEnglishCounterA(
NULL,
"\\System\\System Up Time", 0, &
counter );
254 ret = pPdhAddEnglishCounterA(
query,
"\\System\\System Up Time", 0,
NULL );
257 ret = pPdhAddEnglishCounterA(
query,
"\\System\\System Down Time", 0, &
counter );
261 ret = pPdhAddEnglishCounterA(
query,
"\\System\\System Up Time", 0, &
counter );
528 ok(
info.lScale == 0,
"lScale %d\n",
info.lScale);
535 ok(
info.lScale == 0,
"lScale %d\n",
info.lScale);
542 ok(
info.lScale == -5,
"lScale %d\n",
info.lScale);
582 ok(
info.lScale == 0,
"lScale %d\n",
info.lScale);
589 ok(
info.lScale == 0,
"lScale %d\n",
info.lScale);
596 ok(
info.lScale == -5,
"lScale %d\n",
info.lScale);
621 ok(
index == 6,
"PdhLookupPerfIndexByNameA failed %d\n",
index);
625 ok(
index == 674,
"PdhLookupPerfIndexByNameA failed %d\n",
index);
633 static const WCHAR no_counter[] = {
'N',
'o',
' ',
'C',
'o',
'u',
'n',
't',
'e',
'r',0};
649 ok(
index == 6,
"PdhLookupPerfIndexByNameW failed %d\n",
index);
653 ok(
index == 674,
"PdhLookupPerfIndexByNameW failed %d\n",
index);
673 "PdhLookupPerfNameByIndexA failed, got %s expected \'%% Processor Time\'\n",
buffer);
674 ok(
size ==
sizeof(
"% Processor Time"),
"PdhLookupPerfNameByIndexA failed %d\n",
size);
680 "PdhLookupPerfNameByIndexA failed, got %s expected \'Processor\'\n",
buffer);
681 ok(
size ==
sizeof(
"Processor"),
"PdhLookupPerfNameByIndexA failed %d\n",
size);
687 "PdhLookupPerfNameByIndexA failed 0x%08x\n",
ret);
693 "PdhLookupPerfNameByIndexA failed, got %s expected \'System Up Time\'\n",
buffer);
694 ok(
size ==
sizeof(
"System Up Time"),
"PdhLookupPerfNameByIndexA failed %d\n",
size);
719 "PdhLookupPerfNameByIndexW failed 0x%08x\n",
ret);
755 static const WCHAR system[] = {
'\\',
'S',
'y',
's',
't',
'e',
'm',0};
783 ret = pPdhValidatePathExA(
NULL,
"" );
786 ret = pPdhValidatePathExA(
NULL,
"\\System" );
789 ret = pPdhValidatePathExA(
NULL,
"System Up Time" );
792 ret = pPdhValidatePathExA(
NULL,
"\\System\\System Down Time" );
795 ret = pPdhValidatePathExA(
NULL,
"\\System\\System Up Time" );
804 static const WCHAR system[] = {
'\\',
'S',
'y',
's',
't',
'e',
'm',0};
855 for (
i = 0;
i < 3;
i++)
869 ok(
ret,
"CloseHandle failed\n");
900 e.szMachineName = (
char *)
"machine";
907 e.szObjectName = (
char *)
"object";
914 e.szInstanceName = (
char *)
"instance";
921 e.szParentInstance = (
char *)
"parent";
928 e.dwInstanceIndex = 1;
935 e.szCounterName = (
char *)
"counter";
938 ok(!
strcmp(
buffer,
"\\\\machine\\object(parent/instance#1)\\counter"),
939 "expected \"\\\\machine\\object(parent/instance#1)\\counter\" got %s\n",
buffer);
943 e.szParentInstance =
NULL;
947 "expected \"\\\\machine\\object(instance#1)\\counter\" got %s\n",
buffer);
951 e.szInstanceName =
NULL;
955 "expected \"\\\\machine\\object\\counter\" got %s\n",
buffer);
959 e.szMachineName =
NULL;
963 "expected \"\\object\\counter\" got %s\n",
buffer);
967 e.szObjectName =
NULL;
980 "Expected PdhGetDllVersion to return PDH_INVALID_ARGUMENT, got %d\n",
ret);
984 "Expected PdhGetDllVersion to return ERROR_SUCCESS, got %d\n",
ret);
990 "Expected version number to be PDH_CVERSION_WIN50 or PDH_VERSION, got %u\n",
version);
998 skip(
"An English UI is needed for the pdh tests\n");
int strcmp(const char *String1, const char *String2)
static const WCHAR empty[]
#define GetProcAddress(x, y)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
static const WCHAR version[]
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
LANGID WINAPI GetUserDefaultLangID(void)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static HINSTANCE hkernel32
static void test_PdhSetCounterScaleFactor(void)
static void test_PdhAddEnglishCounterA(void)
static void test_PdhCollectQueryDataWithTime(void)
static void test_PdhGetFormattedCounterValue(void)
static void test_PdhCollectQueryDataEx(void)
static void test_PdhOpenQueryW(void)
static void test_PdhValidatePathExA(void)
static void test_PdhLookupPerfIndexByNameA(void)
static const WCHAR uptime[]
static void test_PdhGetCounterInfoW(void)
static void test_PdhValidatePathA(void)
static const WCHAR system_uptime[]
static BOOL is_lang_english(void)
static void init_function_ptrs(void)
static void test_PdhOpenQueryA(void)
static void test_PdhValidatePathExW(void)
static void test_PdhGetRawCounterValue(void)
static void test_PdhGetDllVersion(void)
static const WCHAR nonexistent_counter[]
static void test_PdhAddCounterA(void)
static const WCHAR processor_time[]
static void test_PdhAddCounterW(void)
static PDH_HCOUNTER *static LPCWSTR
static void test_PdhGetCounterInfoA(void)
static void test_PdhLookupPerfIndexByNameW(void)
static void test_PdhAddEnglishCounterW(void)
static const WCHAR percentage_processor_time[]
static void test_PdhLookupPerfNameByIndexW(void)
static void test_PdhValidatePathW(void)
static void test_PdhMakeCounterPathA(void)
static void test_PdhLookupPerfNameByIndexA(void)
static void test_PdhGetCounterTimeBase(void)
#define PDH_MAX_COUNTER_NAME
#define PDH_CVERSION_WIN50
PDH_STATUS WINAPI PdhCollectQueryDataEx(PDH_HQUERY handle, DWORD interval, HANDLE event)
PDH_STATUS WINAPI PdhValidatePathExW(PDH_HLOG source, LPCWSTR path)
PDH_STATUS WINAPI PdhGetFormattedCounterValue(PDH_HCOUNTER handle, DWORD format, LPDWORD type, PPDH_FMT_COUNTERVALUE value)
PDH_STATUS WINAPI PdhLookupPerfIndexByNameA(LPCSTR machine, LPCSTR name, LPDWORD index)
PDH_STATUS WINAPI PdhRemoveCounter(PDH_HCOUNTER handle)
PDH_STATUS WINAPI PdhGetCounterInfoA(PDH_HCOUNTER handle, BOOLEAN text, LPDWORD size, PPDH_COUNTER_INFO_A info)
PDH_STATUS WINAPI PdhAddEnglishCounterW(PDH_HQUERY query, LPCWSTR path, DWORD_PTR userdata, PDH_HCOUNTER *counter)
PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY query, LPCSTR path, DWORD_PTR userdata, PDH_HCOUNTER *counter)
PDH_STATUS WINAPI PdhSetCounterScaleFactor(PDH_HCOUNTER handle, LONG factor)
PDH_STATUS WINAPI PdhGetCounterInfoW(PDH_HCOUNTER handle, BOOLEAN text, LPDWORD size, PPDH_COUNTER_INFO_W info)
PDH_STATUS WINAPI PdhCollectQueryDataWithTime(PDH_HQUERY handle, LONGLONG *timestamp)
PDH_STATUS WINAPI PdhValidatePathA(LPCSTR path)
PDH_STATUS WINAPI PdhOpenQueryA(LPCSTR source, DWORD_PTR userdata, PDH_HQUERY *query)
PDH_STATUS WINAPI PdhMakeCounterPathA(PDH_COUNTER_PATH_ELEMENTS_A *e, LPSTR buffer, LPDWORD buflen, DWORD flags)
PDH_STATUS WINAPI PdhGetDllVersion(LPDWORD version)
PDH_STATUS WINAPI PdhLookupPerfNameByIndexA(LPCSTR machine, DWORD index, LPSTR buffer, LPDWORD size)
PDH_STATUS WINAPI PdhValidatePathExA(PDH_HLOG source, LPCSTR path)
PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR machine, DWORD index, LPWSTR buffer, LPDWORD size)
PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR machine, LPCWSTR name, LPDWORD index)
PDH_STATUS WINAPI PdhGetRawCounterValue(PDH_HCOUNTER handle, LPDWORD type, PPDH_RAW_COUNTER value)
PDH_STATUS WINAPI PdhGetCounterTimeBase(PDH_HCOUNTER handle, LONGLONG *base)
PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY hquery, LPCWSTR path, DWORD_PTR userdata, PDH_HCOUNTER *hcounter)
PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR source, DWORD_PTR userdata, PDH_HQUERY *handle)
PDH_STATUS WINAPI PdhCollectQueryData(PDH_HQUERY handle)
PDH_STATUS WINAPI PdhAddEnglishCounterA(PDH_HQUERY query, LPCSTR path, DWORD_PTR userdata, PDH_HCOUNTER *counter)
PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR path)
PDH_STATUS WINAPI PdhCloseQuery(PDH_HQUERY handle)
#define PDH_INSUFFICIENT_BUFFER
#define PDH_INVALID_HANDLE
#define PDH_STRING_NOT_FOUND
#define PDH_INVALID_ARGUMENT
#define PDH_CSTATUS_BAD_COUNTERNAME
#define PDH_CSTATUS_NO_COUNTER
int __cdecl system(_In_opt_z_ const char *_Command)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)