Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/dlls/advapi32/tests/perf.c
4389 views
1
/*
2
* Unit tests for Perflib functions
3
*
4
* Copyright (c) 2021 Paul Gofman for CodeWeavers
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19
*/
20
21
#include <stdarg.h>
22
23
#include "windef.h"
24
#include "winbase.h"
25
#include "winerror.h"
26
#include "perflib.h"
27
#include "winperf.h"
28
#include "winternl.h"
29
30
#include "wine/test.h"
31
32
#include "initguid.h"
33
34
ULONG (WINAPI *pPerfCloseQueryHandle)(HANDLE);
35
ULONG (WINAPI *pPerfOpenQueryHandle)(const WCHAR*, HANDLE*);
36
ULONG (WINAPI *pPerfAddCounters)(HANDLE, PERF_COUNTER_IDENTIFIER*, DWORD);
37
ULONG (WINAPI *pPerfQueryCounterData)(HANDLE, PERF_DATA_HEADER*, DWORD, DWORD*);
38
39
static void init_functions(void)
40
{
41
HANDLE hadvapi = GetModuleHandleA("advapi32.dll");
42
43
#define GET_FUNCTION(name) p##name = (void *)GetProcAddress(hadvapi, #name)
44
GET_FUNCTION(PerfCloseQueryHandle);
45
GET_FUNCTION(PerfOpenQueryHandle);
46
GET_FUNCTION(PerfAddCounters);
47
GET_FUNCTION(PerfQueryCounterData);
48
#undef GET_FUNCTION
49
}
50
51
static ULONG WINAPI test_provider_callback(ULONG code, void *buffer, ULONG size)
52
{
53
ok(0, "Provider callback called.\n");
54
return ERROR_SUCCESS;
55
}
56
57
struct template
58
{
59
PERF_COUNTERSET_INFO counterset;
60
PERF_COUNTER_INFO counter[2];
61
};
62
63
void test_provider_init(void)
64
{
65
static GUID test_set_guid = {0xdeadbeef, 0x0002, 0x0003, {0x0f, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00 ,0x0a}};
66
static GUID test_set_guid2 = {0xdeadbeef, 0x0003, 0x0003, {0x0f, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00 ,0x0a}};
67
static GUID test_guid = {0xdeadbeef, 0x0001, 0x0002, {0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00 ,0x0a}};
68
struct template pc_template =
69
{
70
{{0}},
71
{
72
{1, PERF_COUNTER_COUNTER, PERF_ATTRIB_BY_REFERENCE, sizeof(PERF_COUNTER_INFO),
73
PERF_DETAIL_NOVICE, 0, 0xdeadbeef},
74
{2, PERF_COUNTER_COUNTER, PERF_ATTRIB_BY_REFERENCE, sizeof(PERF_COUNTER_INFO),
75
PERF_DETAIL_NOVICE, 0, 0xdeadbeef},
76
},
77
};
78
struct template pc_template_val =
79
{
80
{{0}},
81
{
82
{1, PERF_COUNTER_COUNTER, 0, sizeof(PERF_COUNTER_INFO),
83
PERF_DETAIL_NOVICE, 0, 0xdeadbeef},
84
{2, PERF_COUNTER_COUNTER, 0, sizeof(PERF_COUNTER_INFO),
85
PERF_DETAIL_NOVICE, 0, 0xdeadbeef},
86
},
87
};
88
struct template pc_template_val_long =
89
{
90
{{0}},
91
{
92
{1, (PERF_COUNTER_COUNTER & ~PERF_SIZE_DWORD) | PERF_SIZE_LARGE, 0, sizeof(PERF_COUNTER_INFO),
93
PERF_DETAIL_NOVICE, 0, 0xdeadbeef},
94
{2, (PERF_COUNTER_COUNTER & ~PERF_SIZE_DWORD) | PERF_SIZE_LARGE, 0, sizeof(PERF_COUNTER_INFO),
95
PERF_DETAIL_NOVICE, 0, 0xdeadbeef},
96
},
97
};
98
99
PERF_COUNTERSET_INSTANCE *instance;
100
PERF_PROVIDER_CONTEXT prov_context;
101
UINT64 counter1, counter2;
102
HANDLE prov, prov2;
103
ULONG ret, size;
104
BOOL bret;
105
106
prov = (HANDLE)0xdeadbeef;
107
ret = PerfStartProvider(NULL, test_provider_callback, &prov);
108
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
109
ok(prov == (HANDLE)0xdeadbeef, "Got unexpected prov %p.\n", prov);
110
111
prov = (HANDLE)0xdeadbeef;
112
ret = PerfStartProvider(&test_guid, test_provider_callback, NULL);
113
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
114
ok(prov == (HANDLE)0xdeadbeef, "Got unexpected prov %p.\n", prov);
115
116
prov = (HANDLE)0xdeadbeef;
117
ret = PerfStartProvider(&test_guid, test_provider_callback, &prov);
118
ok(!ret, "Got unexpected ret %lu.\n", ret);
119
ok(prov != (HANDLE)0xdeadbeef, "Provider handle is not set.\n");
120
121
prov2 = prov;
122
ret = PerfStartProvider(&test_guid, test_provider_callback, &prov2);
123
ok(!ret, "Got unexpected ret %lu.\n", ret);
124
ok(prov2 != prov, "Got the same provider handle.\n");
125
126
ret = PerfStopProvider(prov2);
127
ok(!ret, "Got unexpected ret %lu.\n", ret);
128
129
if (0)
130
{
131
/* Access violation on Windows. */
132
PerfStopProvider(prov2);
133
}
134
135
/* Provider handle is a pointer and not a kernel object handle. */
136
bret = DuplicateHandle(GetCurrentProcess(), prov, GetCurrentProcess(), &prov2, 0, FALSE, DUPLICATE_SAME_ACCESS);
137
ok(!bret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected bret %d, err %lu.\n", bret, GetLastError());
138
bret = IsBadWritePtr(prov, 8);
139
ok(!bret, "Handle does not point to the data.\n");
140
141
pc_template.counterset.CounterSetGuid = test_set_guid;
142
pc_template.counterset.ProviderGuid = test_guid;
143
pc_template.counterset.NumCounters = 0;
144
pc_template.counterset.InstanceType = PERF_COUNTERSET_SINGLE_INSTANCE;
145
ret = PerfSetCounterSetInfo(prov, &pc_template.counterset, sizeof(pc_template.counterset));
146
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
147
148
pc_template.counterset.CounterSetGuid = test_set_guid;
149
pc_template.counterset.ProviderGuid = test_guid;
150
pc_template.counterset.NumCounters = 2;
151
pc_template.counterset.InstanceType = PERF_COUNTERSET_SINGLE_INSTANCE;
152
ret = PerfSetCounterSetInfo(prov, &pc_template.counterset, sizeof(pc_template));
153
ok(!ret, "Got unexpected ret %lu.\n", ret);
154
155
pc_template.counterset.CounterSetGuid = test_set_guid2;
156
/* Looks like ProviderGuid doesn't need to match provider. */
157
pc_template.counterset.ProviderGuid = test_set_guid;
158
pc_template.counterset.NumCounters = 1;
159
pc_template.counterset.InstanceType = PERF_COUNTERSET_SINGLE_INSTANCE;
160
ret = PerfSetCounterSetInfo(prov, &pc_template.counterset, sizeof(pc_template));
161
ok(!ret, "Got unexpected ret %lu.\n", ret);
162
163
ret = PerfSetCounterSetInfo(prov, &pc_template.counterset, sizeof(pc_template));
164
ok(ret == ERROR_ALREADY_EXISTS, "Got unexpected ret %lu.\n", ret);
165
166
SetLastError(0xdeadbeef);
167
instance = PerfCreateInstance(prov, NULL, L"1", 1);
168
ok(!instance, "Got unexpected instance %p.\n", instance);
169
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %lu.\n", GetLastError());
170
171
SetLastError(0xdeadbeef);
172
instance = PerfCreateInstance(prov, &test_guid, L"1", 1);
173
ok(!instance, "Got unexpected instance %p.\n", instance);
174
ok(GetLastError() == ERROR_NOT_FOUND, "Got unexpected error %lu.\n", GetLastError());
175
176
SetLastError(0xdeadbeef);
177
instance = PerfCreateInstance(prov, &test_guid, NULL, 1);
178
ok(!instance, "Got unexpected instance %p.\n", instance);
179
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %lu.\n", GetLastError());
180
181
SetLastError(0xdeadbeef);
182
instance = PerfCreateInstance(prov, &test_set_guid, L"11", 1);
183
ok(!!instance, "Got NULL instance.\n");
184
ok(GetLastError() == 0xdeadbeef, "Got unexpected error %lu.\n", GetLastError());
185
ok(instance->InstanceId == 1, "Got unexpected InstanceId %lu.\n", instance->InstanceId);
186
ok(instance->InstanceNameSize == 6, "Got unexpected InstanceNameSize %lu.\n", instance->InstanceNameSize);
187
ok(IsEqualGUID(&instance->CounterSetGuid, &test_set_guid), "Got unexpected guid %s.\n",
188
debugstr_guid(&instance->CounterSetGuid));
189
190
ok(instance->InstanceNameOffset == sizeof(*instance) + sizeof(UINT64) * 2,
191
"Got unexpected InstanceNameOffset %lu.\n", instance->InstanceNameOffset);
192
ok(!lstrcmpW((WCHAR *)((BYTE *)instance + instance->InstanceNameOffset), L"11"),
193
"Got unexpected instance name %s.\n",
194
debugstr_w((WCHAR *)((BYTE *)instance + instance->InstanceNameOffset)));
195
size = ((sizeof(*instance) + sizeof(UINT64) * 2 + instance->InstanceNameSize) + 7) & ~7;
196
ok(size == instance->dwSize, "Got unexpected size %lu, instance->dwSize %lu.\n", size, instance->dwSize);
197
198
ret = PerfSetCounterRefValue(prov, instance, 1, &counter1);
199
ok(!ret, "Got unexpected ret %lu.\n", ret);
200
ret = PerfSetCounterRefValue(prov, instance, 2, &counter2);
201
ok(!ret, "Got unexpected ret %lu.\n", ret);
202
203
ret = PerfSetCounterRefValue(prov, instance, 0, &counter2);
204
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %lu.\n", ret);
205
206
ok(*(void **)(instance + 1) == &counter1, "Got unexpected counter value %p.\n",
207
*(void **)(instance + 1));
208
ok(*(void **)((BYTE *)instance + sizeof(*instance) + sizeof(UINT64)) == &counter2,
209
"Got unexpected counter value %p.\n", *(void **)(instance + 1));
210
211
/*Counter defined as BYREF error if modified with SetValue functions*/
212
ret = PerfSetULongCounterValue(prov, instance, 1, 666L);
213
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
214
ret = PerfSetULongCounterValue(prov, instance, 2, 900000L);
215
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
216
ret = PerfSetULongLongCounterValue(prov, instance, 1, 666L);
217
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
218
ret = PerfSetULongLongCounterValue(prov, instance, 2, 900000L);
219
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
220
221
ret = PerfSetULongCounterValue(prov, instance, 0, 42L);
222
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %lu.\n", ret);
223
ret = PerfSetULongLongCounterValue(prov, instance, 0, 42L);
224
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %lu.\n", ret);
225
226
ret = PerfDeleteInstance(prov, instance);
227
ok(!ret, "Got unexpected ret %lu.\n", ret);
228
ret = PerfStopProvider(prov);
229
ok(!ret, "Got unexpected ret %lu.\n", ret);
230
231
ret = PerfStartProvider(&test_guid, test_provider_callback, &prov);
232
ok(!ret, "Got unexpected ret %lu.\n", ret);
233
234
pc_template_val.counterset.CounterSetGuid = test_set_guid;
235
pc_template_val.counterset.ProviderGuid = test_guid;
236
pc_template_val.counterset.NumCounters = 2;
237
pc_template_val.counterset.InstanceType = PERF_COUNTERSET_SINGLE_INSTANCE;
238
ret = PerfSetCounterSetInfo(prov, &pc_template_val.counterset, sizeof(pc_template_val));
239
ok(!ret, "Got unexpected ret %lu.\n", ret);
240
241
instance = PerfCreateInstance(prov, &test_set_guid, L"11", 1);
242
ok(!!instance, "Got NULL instance.\n");
243
ok(instance->InstanceId == 1, "Got unexpected InstanceId %lu.\n", instance->InstanceId);
244
ok(instance->InstanceNameSize == 6, "Got unexpected InstanceNameSize %lu.\n", instance->InstanceNameSize);
245
ok(IsEqualGUID(&instance->CounterSetGuid, &test_set_guid), "Got unexpected guid %s.\n",
246
debugstr_guid(&instance->CounterSetGuid));
247
248
ret = PerfSetULongCounterValue(prov, instance, 1, 666L);
249
ok(!ret, "Got unexpected ret %lu.\n", ret);
250
ret = PerfSetULongCounterValue(prov, instance, 2, 900000L);
251
ok(!ret, "Got unexpected ret %lu.\n", ret);
252
253
ret = PerfSetULongCounterValue(prov, instance, 0, 42);
254
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %lu.\n", ret);
255
256
ok(*(ULONG *)(instance + 1) == 666L, "Got unexpected counter value %lu.\n",
257
*(ULONG *)(instance + 1));
258
ok(*(ULONG *)((BYTE *)instance + sizeof(*instance) + sizeof(UINT64)) == 900000L,
259
"Got unexpected counter value %lu.\n", *(ULONG *)(instance + 1));
260
261
ret = PerfSetULongCounterValue(prov, instance, 1, 55L);
262
ok(!ret, "Got unexpected ret %lu.\n", ret);
263
ret = PerfSetULongCounterValue(prov, instance, 2, 9000L);
264
ok(!ret, "Got unexpected ret %lu.\n", ret);
265
266
/* Cannot be used with PERF_SIZE_DWORD */
267
ret = PerfSetULongLongCounterValue(prov, instance, 1, 900000L);
268
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
269
ret = PerfSetULongLongCounterValue(prov, instance, 2, 666L);
270
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
271
272
ret = PerfSetULongLongCounterValue(prov, instance, 0, 42);
273
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %lu.\n", ret);
274
275
ret = PerfSetCounterRefValue(prov, instance, 1, &counter1);
276
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
277
ret = PerfSetCounterRefValue(prov, instance, 2, &counter2);
278
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
279
280
ret = PerfDeleteInstance(prov, instance);
281
ok(!ret, "Got unexpected ret %lu.\n", ret);
282
283
ret = PerfStopProvider(prov);
284
ok(!ret, "Got unexpected ret %lu.\n", ret);
285
286
ret = PerfStartProvider(&test_guid, test_provider_callback, &prov);
287
ok(!ret, "Got unexpected ret %lu.\n", ret);
288
289
pc_template_val_long.counterset.CounterSetGuid = test_set_guid;
290
pc_template_val_long.counterset.ProviderGuid = test_guid;
291
pc_template_val_long.counterset.NumCounters = 2;
292
pc_template_val_long.counterset.InstanceType = PERF_COUNTERSET_SINGLE_INSTANCE;
293
ret = PerfSetCounterSetInfo(prov, &pc_template_val_long.counterset, sizeof(pc_template_val_long));
294
ok(!ret, "Got unexpected ret %lu.\n", ret);
295
296
instance = PerfCreateInstance(prov, &test_set_guid, L"11", 1);
297
ok(!!instance, "Got NULL instance.\n");
298
ok(instance->InstanceId == 1, "Got unexpected InstanceId %lu.\n", instance->InstanceId);
299
ok(instance->InstanceNameSize == 6, "Got unexpected InstanceNameSize %lu.\n", instance->InstanceNameSize);
300
ok(IsEqualGUID(&instance->CounterSetGuid, &test_set_guid), "Got unexpected guid %s.\n",
301
debugstr_guid(&instance->CounterSetGuid));
302
303
ret = PerfSetULongLongCounterValue(prov, instance, 1, 900000L);
304
ok(!ret, "Got unexpected ret %lu.\n", ret);
305
ret = PerfSetULongLongCounterValue(prov, instance, 2, 666L);
306
ok(!ret, "Got unexpected ret %lu.\n", ret);
307
308
ret = PerfSetULongLongCounterValue(prov, instance, 0, 42);
309
ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %lu.\n", ret);
310
311
ok(*(ULONGLONG *)(instance + 1) == 900000L, "Got unexpected counter value %I64u.\n",
312
*(ULONGLONG *)(instance + 1));
313
ok(*(ULONGLONG *)((BYTE *)instance + sizeof(*instance) + sizeof(UINT64)) == 666L,
314
"Got unexpected counter value %I64u.\n", *(ULONGLONG *)(instance + 1));
315
316
/* Don't work on PERF_SIZE_LARGE */
317
ret = PerfSetULongCounterValue(prov, instance, 1, 666L);
318
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
319
ret = PerfSetULongCounterValue(prov, instance, 2, 900000L);
320
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
321
322
ret = PerfDeleteInstance(prov, instance);
323
ok(!ret, "Got unexpected ret %lu.\n", ret);
324
325
ret = PerfStopProvider(prov);
326
ok(!ret, "Got unexpected ret %lu.\n", ret);
327
328
memset( &prov_context, 0, sizeof(prov_context) );
329
prov = (HANDLE)0xdeadbeef;
330
ret = PerfStartProviderEx( &test_guid, &prov_context, &prov );
331
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
332
ok(prov == (HANDLE)0xdeadbeef, "Got unexpected prov %p.\n", prov);
333
334
prov_context.ContextSize = sizeof(prov_context) + 1;
335
ret = PerfStartProviderEx( &test_guid, &prov_context, &prov );
336
ok(!ret, "Got unexpected ret %lu.\n", ret);
337
ok(prov != (HANDLE)0xdeadbeef, "Provider handle is not set.\n");
338
339
ret = PerfStopProvider(prov);
340
ok(!ret, "Got unexpected ret %lu.\n", ret);
341
}
342
343
DEFINE_GUID(TestCounterGUID, 0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x33);
344
345
static ULONG64 trunc_nttime_ms(ULONG64 t)
346
{
347
return (t / 10000) * 10000;
348
}
349
350
static void test_perf_counters(void)
351
{
352
LARGE_INTEGER freq, qpc1, qpc2, nttime1, nttime2, systime;
353
char buffer[sizeof(PERF_COUNTER_IDENTIFIER) + 8];
354
PERF_COUNTER_IDENTIFIER *counter_id;
355
PERF_DATA_HEADER dh;
356
HANDLE query;
357
DWORD size;
358
ULONG ret;
359
360
if (!pPerfOpenQueryHandle)
361
{
362
win_skip("PerfOpenQueryHandle not found.\n");
363
return;
364
}
365
366
ret = pPerfOpenQueryHandle(NULL, NULL);
367
ok(ret == ERROR_INVALID_PARAMETER, "got ret %lu.\n", ret);
368
ret = pPerfOpenQueryHandle(NULL, &query);
369
ok(!ret, "got ret %lu.\n", ret);
370
371
counter_id = (PERF_COUNTER_IDENTIFIER *)buffer;
372
memset(buffer, 0, sizeof(buffer));
373
374
counter_id->CounterSetGuid = TestCounterGUID;
375
counter_id->CounterId = PERF_WILDCARD_COUNTER;
376
counter_id->InstanceId = PERF_WILDCARD_COUNTER;
377
378
ret = pPerfAddCounters(query, counter_id, sizeof(*counter_id));
379
ok(ret == ERROR_INVALID_PARAMETER, "got ret %lu.\n", ret);
380
381
counter_id->Size = sizeof(*counter_id);
382
ret = pPerfAddCounters(query, counter_id, 8);
383
ok(ret == ERROR_INVALID_PARAMETER, "got ret %lu.\n", ret);
384
ret = pPerfAddCounters(query, counter_id, sizeof(*counter_id));
385
ok(!ret, "got ret %lu.\n", ret);
386
ok(counter_id->Status == ERROR_WMI_GUID_NOT_FOUND, "got Status %#lx.\n", counter_id->Status);
387
388
ret = pPerfQueryCounterData(query, NULL, 0, NULL);
389
ok(ret == ERROR_INVALID_PARAMETER, "got ret %lu.\n", ret);
390
391
size = 0xdeadbeef;
392
ret = pPerfQueryCounterData(query, NULL, 0, &size);
393
ok(ret == ERROR_NOT_ENOUGH_MEMORY, "got ret %lu.\n", ret);
394
ok(size == sizeof(dh), "got size %lu.\n", size);
395
396
ret = pPerfQueryCounterData(query, &dh, sizeof(dh), NULL);
397
ok(ret == ERROR_INVALID_PARAMETER, "got ret %lu.\n", ret);
398
399
QueryPerformanceFrequency(&freq);
400
QueryPerformanceCounter(&qpc1);
401
NtQuerySystemTime(&nttime1);
402
403
size = 0xdeadbeef;
404
ret = pPerfQueryCounterData(query, &dh, sizeof(dh), &size);
405
QueryPerformanceCounter(&qpc2);
406
NtQuerySystemTime(&nttime2);
407
SystemTimeToFileTime(&dh.SystemTime, (FILETIME *)&systime);
408
ok(!ret, "got ret %lu.\n", ret);
409
ok(size == sizeof(dh), "got size %lu.\n", size);
410
ok(dh.dwTotalSize == sizeof(dh), "got dwTotalSize %lu.\n", dh.dwTotalSize);
411
ok(!dh.dwNumCounters, "got dwNumCounters %lu.\n", dh.dwNumCounters);
412
ok(dh.PerfFreq == freq.QuadPart, "got PerfFreq %I64u.\n", dh.PerfFreq);
413
ok(dh.PerfTimeStamp >= qpc1.QuadPart && dh.PerfTimeStamp <= qpc2.QuadPart,
414
"got PerfTimeStamp %I64u, qpc1 %I64u, qpc2 %I64u.\n",
415
dh.PerfTimeStamp, qpc1.QuadPart, qpc2.QuadPart);
416
ok(dh.PerfTime100NSec >= nttime1.QuadPart && dh.PerfTime100NSec <= nttime2.QuadPart,
417
"got PerfTime100NSec %I64u, nttime1 %I64u, nttime2 %I64u.\n",
418
dh.PerfTime100NSec, nttime1.QuadPart, nttime2.QuadPart);
419
ok(systime.QuadPart >= trunc_nttime_ms(nttime1.QuadPart) && systime.QuadPart <= trunc_nttime_ms(nttime2.QuadPart),
420
"got systime %I64u, nttime1 %I64u, nttime2 %I64u, %d.\n",
421
systime.QuadPart, nttime1.QuadPart, nttime2.QuadPart, dh.SystemTime.wMilliseconds);
422
423
ret = pPerfCloseQueryHandle(query);
424
ok(!ret, "got ret %lu.\n", ret);
425
}
426
427
START_TEST(perf)
428
{
429
init_functions();
430
431
test_provider_init();
432
test_perf_counters();
433
}
434
435