Commit 8cfbb177 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

advapi32: Improve PerfSetCounterRefValue() stub.

parent eec443af
......@@ -155,16 +155,16 @@ void test_provider_init(void)
ok(size == instance->dwSize, "Got unexpected size %u, instance->dwSize %u.\n", size, instance->dwSize);
ret = PerfSetCounterRefValue(prov, instance, 1, &counter1);
todo_wine ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %u.\n", ret);
ret = PerfSetCounterRefValue(prov, instance, 2, &counter2);
todo_wine ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %u.\n", ret);
ret = PerfSetCounterRefValue(prov, instance, 0, &counter2);
todo_wine ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %u.\n", ret);
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %u.\n", ret);
todo_wine ok(*(void **)(instance + 1) == &counter1, "Got unexpected counter value %p.\n",
ok(*(void **)(instance + 1) == &counter1, "Got unexpected counter value %p.\n",
*(void **)(instance + 1));
todo_wine ok(*(void **)((BYTE *)instance + sizeof(*instance) + sizeof(UINT64)) == &counter2,
ok(*(void **)((BYTE *)instance + sizeof(*instance) + sizeof(UINT64)) == &counter2,
"Got unexpected counter value %p.\n", *(void **)(instance + 1));
ret = PerfDeleteInstance(prov, instance);
......
......@@ -312,11 +312,29 @@ ULONG WINAPI PerfSetCounterSetInfo( HANDLE handle, PERF_COUNTERSET_INFO *templat
/***********************************************************************
* PerfSetCounterRefValue (KERNELBASE.@)
*/
ULONG WINAPI PerfSetCounterRefValue(HANDLE provider, PPERF_COUNTERSET_INSTANCE instance,
ULONG WINAPI PerfSetCounterRefValue(HANDLE provider, PERF_COUNTERSET_INSTANCE *instance,
ULONG counterid, void *address)
{
FIXME("%p %p %u %p: stub\n", provider, instance, counterid, address);
return ERROR_CALL_NOT_IMPLEMENTED;
struct perf_provider *prov = perf_provider_from_handle( provider );
struct counterset_template *template;
struct counterset_instance *inst;
unsigned int i;
FIXME( "provider %p, instance %p, counterid %u, address %p semi-stub.\n",
provider, instance, counterid, address );
if (!prov || !instance || !address) return ERROR_INVALID_PARAMETER;
inst = CONTAINING_RECORD(instance, struct counterset_instance, instance);
template = inst->template;
for (i = 0; i < template->counterset.NumCounters; ++i)
if (template->counter[i].CounterId == counterid) break;
if (i == template->counterset.NumCounters) return ERROR_NOT_FOUND;
*(void **)((BYTE *)&inst->instance + sizeof(PERF_COUNTERSET_INSTANCE) + template->counter[i].Offset) = address;
return STATUS_SUCCESS;
}
/***********************************************************************
......
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