Commit a5921e71 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

advapi32: Add stub for PerfOpenQueryHandle().

parent f8318158
...@@ -321,3 +321,13 @@ ULONG WINAPI PerfCloseQueryHandle( HANDLE query ) ...@@ -321,3 +321,13 @@ ULONG WINAPI PerfCloseQueryHandle( HANDLE query )
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
ULONG WINAPI PerfOpenQueryHandle( const WCHAR *machine, HANDLE *query )
{
FIXME( "machine %s, query %p.\n", debugstr_w(machine), query );
if (!query) return ERROR_INVALID_PARAMETER;
*query = (HANDLE)0xdeadbeef;
return ERROR_SUCCESS;
}
...@@ -564,7 +564,7 @@ ...@@ -564,7 +564,7 @@
# @ stub PerfEnumerateCounterSetInstances # @ stub PerfEnumerateCounterSetInstances
# @ stub PerfIncrementULongCounterValue # @ stub PerfIncrementULongCounterValue
# @ stub PerfIncrementULongLongCounterValue # @ stub PerfIncrementULongLongCounterValue
# @ stub PerfOpenQueryHandle @ stdcall PerfOpenQueryHandle(wstr ptr)
# @ stub PerfQueryCounterData # @ stub PerfQueryCounterData
# @ stub PerfQueryCounterInfo # @ stub PerfQueryCounterInfo
# @ stub PerfQueryCounterSetRegistrationInfo # @ stub PerfQueryCounterSetRegistrationInfo
......
...@@ -28,6 +28,21 @@ ...@@ -28,6 +28,21 @@
#include "wine/test.h" #include "wine/test.h"
#define DEFINE_FUNCTION(name) static typeof(name) *p##name;
DEFINE_FUNCTION(PerfCloseQueryHandle);
DEFINE_FUNCTION(PerfOpenQueryHandle);
#undef DEFINE_FUNCTION
static void init_functions(void)
{
HANDLE hadvapi = GetModuleHandleA("advapi32.dll");
#define GET_FUNCTION(name) p##name = (void *)GetProcAddress(hadvapi, #name)
GET_FUNCTION(PerfCloseQueryHandle);
GET_FUNCTION(PerfOpenQueryHandle);
#undef GET_FUNCTION
}
static ULONG WINAPI test_provider_callback(ULONG code, void *buffer, ULONG size) static ULONG WINAPI test_provider_callback(ULONG code, void *buffer, ULONG size)
{ {
ok(0, "Provider callback called.\n"); ok(0, "Provider callback called.\n");
...@@ -188,7 +203,30 @@ void test_provider_init(void) ...@@ -188,7 +203,30 @@ void test_provider_init(void)
ok(!ret, "Got unexpected ret %lu.\n", ret); ok(!ret, "Got unexpected ret %lu.\n", ret);
} }
static void test_perf_counters(void)
{
HANDLE query;
ULONG ret;
if (!pPerfOpenQueryHandle)
{
win_skip("PerfOpenQueryHandle not found.\n");
return;
}
ret = pPerfOpenQueryHandle(NULL, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "got ret %lu.\n", ret);
ret = pPerfOpenQueryHandle(NULL, &query);
ok(!ret, "got ret %lu.\n", ret);
ret = pPerfCloseQueryHandle(query);
ok(!ret, "got ret %lu.\n", ret);
}
START_TEST(perf) START_TEST(perf)
{ {
init_functions();
test_provider_init(); test_provider_init();
test_perf_counters();
} }
...@@ -90,6 +90,7 @@ ULONG WINAPI PerfStartProviderEx(GUID *, PERF_PROVIDER_CONTEXT *, HANDLE *); ...@@ -90,6 +90,7 @@ ULONG WINAPI PerfStartProviderEx(GUID *, PERF_PROVIDER_CONTEXT *, HANDLE *);
ULONG WINAPI PerfStopProvider(HANDLE); ULONG WINAPI PerfStopProvider(HANDLE);
ULONG WINAPI PerfCloseQueryHandle(HANDLE); ULONG WINAPI PerfCloseQueryHandle(HANDLE);
ULONG WINAPI PerfOpenQueryHandle(const WCHAR *, HANDLE *);
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment