Commit 339f4a3a authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

advapi32/tests: Enable compilation with long types.

parent 63bcb0f6
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = advapi32.dll
IMPORTS = ole32 advapi32
......
......@@ -64,26 +64,26 @@ void test_provider_init(void)
prov = (HANDLE)0xdeadbeef;
ret = PerfStartProvider(NULL, test_provider_callback, &prov);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
ok(prov == (HANDLE)0xdeadbeef, "Got unexpected prov %p.\n", prov);
prov = (HANDLE)0xdeadbeef;
ret = PerfStartProvider(&test_guid, test_provider_callback, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
ok(prov == (HANDLE)0xdeadbeef, "Got unexpected prov %p.\n", prov);
prov = (HANDLE)0xdeadbeef;
ret = PerfStartProvider(&test_guid, test_provider_callback, &prov);
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
ok(prov != (HANDLE)0xdeadbeef, "Provider handle is not set.\n");
prov2 = prov;
ret = PerfStartProvider(&test_guid, test_provider_callback, &prov2);
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
ok(prov2 != prov, "Got the same provider handle.\n");
ret = PerfStopProvider(prov2);
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
if (0)
{
......@@ -93,7 +93,7 @@ void test_provider_init(void)
/* Provider handle is a pointer and not a kernel object handle. */
bret = DuplicateHandle(GetCurrentProcess(), prov, GetCurrentProcess(), &prov2, 0, FALSE, DUPLICATE_SAME_ACCESS);
ok(!bret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected bret %d, err %u.\n", bret, GetLastError());
ok(!bret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected bret %d, err %lu.\n", bret, GetLastError());
bret = IsBadWritePtr(prov, 8);
ok(!bret, "Handle does not point to the data.\n");
......@@ -102,14 +102,14 @@ void test_provider_init(void)
pc_template.counterset.NumCounters = 0;
pc_template.counterset.InstanceType = PERF_COUNTERSET_SINGLE_INSTANCE;
ret = PerfSetCounterSetInfo(prov, &pc_template.counterset, sizeof(pc_template.counterset));
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
pc_template.counterset.CounterSetGuid = test_set_guid;
pc_template.counterset.ProviderGuid = test_guid;
pc_template.counterset.NumCounters = 2;
pc_template.counterset.InstanceType = PERF_COUNTERSET_SINGLE_INSTANCE;
ret = PerfSetCounterSetInfo(prov, &pc_template.counterset, sizeof(pc_template));
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
pc_template.counterset.CounterSetGuid = test_set_guid2;
/* Looks like ProviderGuid doesn't need to match provider. */
......@@ -117,50 +117,50 @@ void test_provider_init(void)
pc_template.counterset.NumCounters = 1;
pc_template.counterset.InstanceType = PERF_COUNTERSET_SINGLE_INSTANCE;
ret = PerfSetCounterSetInfo(prov, &pc_template.counterset, sizeof(pc_template));
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
ret = PerfSetCounterSetInfo(prov, &pc_template.counterset, sizeof(pc_template));
ok(ret == ERROR_ALREADY_EXISTS, "Got unexpected ret %u.\n", ret);
ok(ret == ERROR_ALREADY_EXISTS, "Got unexpected ret %lu.\n", ret);
SetLastError(0xdeadbeef);
instance = PerfCreateInstance(prov, NULL, L"1", 1);
ok(!instance, "Got unexpected instance %p.\n", instance);
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %u.\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %lu.\n", GetLastError());
SetLastError(0xdeadbeef);
instance = PerfCreateInstance(prov, &test_guid, L"1", 1);
ok(!instance, "Got unexpected instance %p.\n", instance);
ok(GetLastError() == ERROR_NOT_FOUND, "Got unexpected error %u.\n", GetLastError());
ok(GetLastError() == ERROR_NOT_FOUND, "Got unexpected error %lu.\n", GetLastError());
SetLastError(0xdeadbeef);
instance = PerfCreateInstance(prov, &test_guid, NULL, 1);
ok(!instance, "Got unexpected instance %p.\n", instance);
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %u.\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %lu.\n", GetLastError());
SetLastError(0xdeadbeef);
instance = PerfCreateInstance(prov, &test_set_guid, L"11", 1);
ok(!!instance, "Got NULL instance.\n");
ok(GetLastError() == 0xdeadbeef, "Got unexpected error %u.\n", GetLastError());
ok(instance->InstanceId == 1, "Got unexpected InstanceId %u.\n", instance->InstanceId);
ok(instance->InstanceNameSize == 6, "Got unexpected InstanceNameSize %u.\n", instance->InstanceNameSize);
ok(GetLastError() == 0xdeadbeef, "Got unexpected error %lu.\n", GetLastError());
ok(instance->InstanceId == 1, "Got unexpected InstanceId %lu.\n", instance->InstanceId);
ok(instance->InstanceNameSize == 6, "Got unexpected InstanceNameSize %lu.\n", instance->InstanceNameSize);
ok(IsEqualGUID(&instance->CounterSetGuid, &test_set_guid), "Got unexpected guid %s.\n",
debugstr_guid(&instance->CounterSetGuid));
ok(instance->InstanceNameOffset == sizeof(*instance) + sizeof(UINT64) * 2,
"Got unexpected InstanceNameOffset %u.\n", instance->InstanceNameOffset);
"Got unexpected InstanceNameOffset %lu.\n", instance->InstanceNameOffset);
ok(!lstrcmpW((WCHAR *)((BYTE *)instance + instance->InstanceNameOffset), L"11"),
"Got unexpected instance name %s.\n",
debugstr_w((WCHAR *)((BYTE *)instance + instance->InstanceNameOffset)));
size = ((sizeof(*instance) + sizeof(UINT64) * 2 + instance->InstanceNameSize) + 7) & ~7;
ok(size == instance->dwSize, "Got unexpected size %u, instance->dwSize %u.\n", size, instance->dwSize);
ok(size == instance->dwSize, "Got unexpected size %lu, instance->dwSize %lu.\n", size, instance->dwSize);
ret = PerfSetCounterRefValue(prov, instance, 1, &counter1);
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
ret = PerfSetCounterRefValue(prov, instance, 2, &counter2);
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
ret = PerfSetCounterRefValue(prov, instance, 0, &counter2);
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %u.\n", ret);
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %lu.\n", ret);
ok(*(void **)(instance + 1) == &counter1, "Got unexpected counter value %p.\n",
*(void **)(instance + 1));
......@@ -168,24 +168,24 @@ void test_provider_init(void)
"Got unexpected counter value %p.\n", *(void **)(instance + 1));
ret = PerfDeleteInstance(prov, instance);
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
ret = PerfStopProvider(prov);
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
memset( &prov_context, 0, sizeof(prov_context) );
prov = (HANDLE)0xdeadbeef;
ret = PerfStartProviderEx( &test_guid, &prov_context, &prov );
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
ok(prov == (HANDLE)0xdeadbeef, "Got unexpected prov %p.\n", prov);
prov_context.ContextSize = sizeof(prov_context) + 1;
ret = PerfStartProviderEx( &test_guid, &prov_context, &prov );
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
ok(prov != (HANDLE)0xdeadbeef, "Provider handle is not set.\n");
ret = PerfStopProvider(prov);
ok(!ret, "Got unexpected ret %u.\n", ret);
ok(!ret, "Got unexpected ret %lu.\n", ret);
}
START_TEST(perf)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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