31 #define QueryDepthSList(x) RtlQueryDepthSList(x) 32 #define InterlockedPushEntrySList(x,y) RtlInterlockedPushEntrySList(x,y) 33 #define InterlockedPopEntrySList(x) RtlInterlockedPopEntrySList(x) 34 #define InterlockedFlushSList(x) RtlInterlockedFlushSList(x) 38 #define __fastcall __stdcall 40 static HANDLE (
WINAPI *pCreateMemoryResourceNotification)(MEMORY_RESOURCE_NOTIFICATION_TYPE);
47 static VOID (
WINAPI *pInitializeConditionVariable)(PCONDITION_VARIABLE);
50 static VOID (
WINAPI *pWakeAllConditionVariable)(PCONDITION_VARIABLE);
51 static VOID (
WINAPI *pWakeConditionVariable)(PCONDITION_VARIABLE);
83 static void * (
WINAPI *call_fastcall_func4)(
void *
func,
const void *
a,
const void *
b,
const void *
c,
const void *
d);
88 thunk->pop_edx = 0x5a;
89 thunk->pop_eax = 0x58;
90 thunk->pop_ecx = 0x59;
91 thunk->xchg[0] = 0x87;
92 thunk->xchg[1] = 0x14;
93 thunk->xchg[2] = 0x24;
94 thunk->jmp_eax = 0xe0ff;
95 call_fastcall_func4 = (
void *)
thunk;
98 #define call_func4(func, a, b, c, d) call_fastcall_func4(func, (const void *)(a), \ 99 (const void *)(b), (const void *)(c), (const void *)(d)) 103 #define init_fastcall_thunk() do { } while(0) 104 #define call_func4(func, a, b, c, d) func(a, b, c, d) 121 ok(
event[0] &&
event[1],
"failed to create event flags\n");
136 for (
i = 0;
i < 10000;
i++)
172 ok(
r ==
TRUE,
"should succeed\n");
197 ok(hOpened ==
NULL,
"OpenMutex succeeded\n");
207 ok(hOpened ==
NULL,
"OpenMutex succeeded\n");
218 for(
i=0;
i < 31;
i++)
221 ok(wait_ret ==
WAIT_OBJECT_0,
"WaitForSingleObject failed with error 0x%08x\n", wait_ret);
228 ok(wait_ret ==
WAIT_FAILED,
"WaitForSingleObject succeeded\n");
231 for (
i = 0;
i < 32;
i++)
254 ok( failed == 0x0de0fffe,
"open succeeded when it shouldn't: %x\n", failed);
259 "ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %d\n",
GetLastError());
265 ok(!hOpened,
"OpenMutex succeeded\n");
270 ok(!hOpened,
"OpenMutex succeeded\n");
275 ok(!hOpened,
"OpenMutex succeeded\n");
280 ok(!hOpened,
"OpenMutex succeeded\n");
314 memset(&slist_header, 0xff,
sizeof(slist_header));
317 ok(
size == 0,
"Expected size == 0, got %u\n",
size);
323 ok(
size == 1,
"Expected size == 1, got %u\n",
size);
328 ok(
item->value == 1,
"Expected item->value == 1, got %u\n",
item->value);
330 ok(
size == 2,
"Expected size == 2, got %u\n",
size);
335 ok(
item->value == 2,
"Expected item->value == 2, got %u\n",
item->value);
337 ok(
size == 3,
"Expected size == 3, got %u\n",
size);
342 ok(
item->value == 3,
"Expected item->value == 3, got %u\n",
item->value);
344 ok(
size == 2,
"Expected size == 2, got %u\n",
size);
349 ok(
item->value == 2,
"Expected item->value == 2, got %u\n",
item->value);
351 ok(
item->value == 1,
"Expected item->value == 1, got %u\n",
item->value);
353 ok(
size == 0,
"Expected size == 0, got %u\n",
size);
363 ok(
item->value == 3,
"Expected item->value == 3, got %u\n",
item->value);
365 ok(
size == 43,
"Expected size == 43, got %u\n",
size);
370 ok(
item->value == 2,
"Expected item->value == 2, got %u\n",
item->value);
372 ok(
size == 42,
"Expected size == 42, got %u\n",
size);
377 ok(
item->value == 1,
"Expected item->value == 1, got %u\n",
item->value);
379 ok(
size == 41,
"Expected size == 41, got %u\n",
size);
384 ok(
item->value == 3,
"Expected item->value == 3, got %u\n",
item->value);
386 ok(
size == 40,
"Expected size == 40, got %u\n",
size);
391 ok(
size == 40,
"Expected size == 40, got %u\n",
size);
403 ok(
item->value == 1,
"Expected item->value == 1, got %u\n",
item->value);
405 ok(
size == 0,
"Expected size == 0, got %u\n",
size);
408 if (pRtlInterlockedPushListSListEx)
412 entry = pRtlInterlockedPushListSListEx(&slist_header, &
item2.entry, &
item1.entry, 42);
415 ok(
item->value == 3,
"Expected item->value == 3, got %u\n",
item->value);
417 ok(
size == 43,
"Expected size == 43, got %u\n",
size);
422 ok(
item->value == 2,
"Expected item->value == 2, got %u\n",
item->value);
424 ok(
item->value == 1,
"Expected item->value == 1, got %u\n",
item->value);
426 ok(
item->value == 3,
"Expected item->value == 3, got %u\n",
item->value);
428 ok(
size == 0,
"Expected size == 0, got %u\n",
size);
431 win_skip(
"RtlInterlockedPushListSListEx not available, skipping tests\n");
434 for (
i = 0;
i < 65536;
i++)
443 ok(
item->value ==
i,
"Expected item->value == %u, got %u\n",
i,
item->value);
450 ok(
size == ((
i + 1) & 0xffff),
"Expected size == %u, got %u\n", (
i + 1) & 0xffff,
size);
454 for (
i = 65536;
i > 0;
i--)
458 ok(
item->value ==
i,
"Expected item->value == %u, got %u\n",
i,
item->value);
464 ok(
size == 0,
"Expected size == 0, got %u\n",
size);
483 sa.nLength =
sizeof(
sa);
484 sa.lpSecurityDescriptor = &
sd;
533 ok( !handle2,
"OpenEvent succeeded\n");
538 ok( !handle2,
"OpenEvent succeeded\n");
543 ok( !handle2,
"OpenEvent succeeded\n");
550 if (!pCreateMemoryResourceNotification || !pQueryMemoryResourceNotification)
552 trace(
"memory resource notifications not supported\n" );
555 handle = pCreateMemoryResourceNotification( HighMemoryResourceNotification + 1 );
556 ok( !
handle,
"CreateMemoryResourceNotification succeeded\n" );
559 ok( !
ret,
"QueryMemoryResourceNotification succeeded\n" );
562 handle = pCreateMemoryResourceNotification( LowMemoryResourceNotification );
612 ok( !handle2,
"OpenSemaphore succeeded\n");
617 ok( !handle2,
"OpenSemaphore succeeded\n");
622 ok( !handle2,
"OpenSemaphore succeeded\n");
658 ok( !handle2,
"OpenWaitableTimer succeeded\n");
663 ok( !handle2,
"OpenWaitableTimer failed with error %d\n",
GetLastError());
668 ok( !handle2,
"OpenWaitableTimer failed with error %d\n",
GetLastError());
689 static const char prefix[] =
"pfx";
693 const char *
buffer =
"12345678123456781234567812345678";
697 if(!p_BindIoCompletionCallback) {
698 win_skip(
"BindIoCompletionCallback not found in this DLL\n");
717 ok(retb ==
FALSE,
"BindIoCompletionCallback succeeded on a file that wasn't created with FILE_FLAG_OVERLAPPED\n");
730 ok(retb ==
TRUE,
"BindIoCompletionCallback failed\n");
741 ok(retb ==
FALSE,
"BindIoCompletionCallback succeeded when setting the same callback on the file again\n");
743 retb = p_BindIoCompletionCallback(
hFile,
NULL, 0);
744 ok(retb ==
FALSE,
"BindIoCompletionCallback succeeded when setting the callback to NULL\n");
760 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
762 ok(retb ==
TRUE,
"BindIoCompletionCallback failed with Flags != 0\n");
769 ok(retb ==
FALSE,
"BindIoCompletionCallback succeeded on a NULL file\n");
779 ok(timedOut,
"Timer callbacks should always time out\n");
793 ok(timedOut,
"Timer callbacks should always time out\n");
794 if (
d->t && ++
d->num_calls ==
d->max_calls)
801 ok(!
ret,
"DeleteTimerQueueTimer\n");
809 ok(timedOut,
"Timer callbacks should always time out\n");
810 if (
d->t && ++
d->num_calls ==
d->max_calls)
815 ok(
ret,
"ChangeTimerQueueTimer\n");
822 ok(timedOut,
"Timer callbacks should always time out\n");
831 ok(
ret,
"ChangeTimerQueueTimer\n");
839 ok(timedOut,
"Timer callbacks should always time out\n");
847 ok(timedOut,
"Timer callbacks should always time out\n");
850 if (
d->q &&
d->num_calls++ == 0)
863 ok(!
ret,
"DeleteTimerQueueTimer\n");
867 ok(
ret,
"CreateTimerQueueTimer\n");
868 ok(
t !=
NULL,
"CreateTimerQueueTimer\n");
871 ok(
ret,
"DeleteTimerQueueTimer\n");
880 HANDLE q, t0, t1, t2, t3, t4, t5;
888 ok(
q !=
NULL,
"CreateTimerQueue\n");
893 "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n",
898 ok(
q !=
NULL,
"CreateTimerQueue\n");
904 ok(
ret,
"CreateTimerQueueTimer\n");
905 ok(t0 !=
NULL,
"CreateTimerQueueTimer\n");
909 "DeleteTimerQueueTimer ret=%d le=%u\n", ret0,
GetLastError());
915 ok(
ret,
"CreateTimerQueueTimer\n");
916 ok(t1 !=
NULL,
"CreateTimerQueueTimer\n");
922 ok(
ret,
"CreateTimerQueueTimer\n");
923 ok(t2 !=
NULL,
"CreateTimerQueueTimer\n");
929 ok(
ret,
"CreateTimerQueueTimer\n");
930 ok(t3 !=
NULL,
"CreateTimerQueueTimer\n");
936 ok(
ret,
"CreateTimerQueueTimer\n");
937 ok(t4 !=
NULL,
"CreateTimerQueueTimer\n");
943 ok(
ret,
"CreateTimerQueueTimer\n");
944 ok(t5 !=
NULL,
"CreateTimerQueueTimer\n");
951 ok(
ret,
"DeleteTimerQueueTimer\n");
955 ok(
ret,
"DeleteTimerQueueTimer\n");
958 ok(
ret,
"DeleteTimerQueueEx\n");
960 ok(n0 == 1 ||
broken(ret0 && n0 == 0),
"Timer callback 0 expected 1 got %d\n", n0);
961 ok(
n1 == 1,
"Timer callback 1 expected 1 got %d\n",
n1);
962 ok(
n2 <
n3,
"Timer callback 2 & 3 expected %d < %d\n",
n2,
n3);
963 ok(
n4 == 0,
"Timer callback 4 expected 0 got %d\n",
n4);
964 ok(
n5 == 1,
"Timer callback 5 expected 1 got %d\n",
n5);
970 if (!
e || !et1 || !et2)
972 skip(
"Failed to create timer queue descruction event\n");
977 ok(
q !=
NULL,
"CreateTimerQueue\n");
982 ok(
ret,
"CreateTimerQueueTimer\n");
983 ok(t1 !=
NULL,
"CreateTimerQueueTimer\n");
988 ok(
ret,
"CreateTimerQueueTimer\n");
989 ok(t2 !=
NULL,
"CreateTimerQueueTimer\n");
994 ok(
ret,
"CreateTimerQueueTimer\n");
995 ok(t3 !=
NULL,
"CreateTimerQueueTimer\n");
1000 ok(
ret,
"CreateTimerQueueTimer\n");
1001 ok(t4 !=
NULL,
"CreateTimerQueueTimer\n");
1011 "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %d\n",
1016 ok(!
ret,
"DeleteTimerQueueTimer call was expected to fail\n");
1018 "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %d\n",
1023 ok(
ret,
"DeleteTimerQueueTimer call was expected to fail\n");
1025 "DeleteTimerQueueTimer, GetLastError: expected 0xdeadbeef, got %d\n",
1028 "Timer destruction event not triggered\n");
1032 ok(!
ret,
"DeleteTimerQueueTimer call was expected to fail\n");
1034 "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %d\n",
1037 "Timer destruction event not triggered\n");
1042 "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n",
1045 "Queue destruction event not triggered\n");
1050 ok(
q !=
NULL,
"CreateTimerQueue\n");
1056 ok(
ret,
"CreateTimerQueueTimer\n");
1057 ok(t1 !=
NULL,
"CreateTimerQueueTimer\n");
1059 ok(
ret,
"ChangeTimerQueueTimer\n");
1067 ok(
ret,
"CreateTimerQueueTimer\n");
1068 ok(t2 !=
NULL,
"CreateTimerQueueTimer\n");
1076 ok(
ret,
"CreateTimerQueueTimer\n");
1077 ok(t3 !=
NULL,
"CreateTimerQueueTimer\n");
1084 ok(
ret,
"CreateTimerQueueTimer\n");
1085 ok(t4 !=
NULL,
"CreateTimerQueueTimer\n");
1090 ok(
ret,
"DeleteTimerQueueEx\n");
1091 ok(
n1 == 1,
"ChangeTimerQueueTimer\n");
1094 ok(d4.
num_calls == 1,
"Timer flagged for deletion incorrectly\n");
1098 ok(
q !=
NULL,
"CreateTimerQueue\n");
1106 ok(
ret,
"CreateTimerQueueTimer\n");
1107 ok(t1 !=
NULL,
"CreateTimerQueueTimer\n");
1114 "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n",
1122 ok(
ret,
"CreateTimerQueueTimer, default queue\n");
1123 ok(t1 !=
NULL,
"CreateTimerQueueTimer, default queue\n");
1126 ok(
ret,
"ChangeTimerQueueTimer, default queue\n");
1129 ok(
ret,
"DeleteTimerQueueTimer, default queue\n");
1133 ok(
q !=
NULL,
"CreateTimerQueue\n");
1138 ok(
ret,
"CreateTimerQueueTimer\n");
1139 ok(t1 !=
NULL,
"CreateTimerQueueTimer\n");
1144 ok(
ret,
"CreateTimerQueueTimer\n");
1145 ok(t2 !=
NULL,
"CreateTimerQueueTimer\n");
1148 ok(
ret,
"ChangeTimerQueueTimer\n");
1151 ok(
ret,
"ChangeTimerQueueTimer\n");
1154 ok(
ret,
"DeleteTimerQueueTimer\n");
1157 ok(
ret,
"DeleteTimerQueueTimer\n");
1162 ok(!
ret,
"DeleteTimerQueueEx call was expected to fail\n");
1164 "DeleteTimerQueueEx, GetLastError: expected ERROR_INVALID_HANDLE, got %d\n",
1170 "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n",
1287 ok( maxevents[
i] != 0,
"should create enough events\n");
1330 "expected ERROR_INVALID_HANDLE, got %u\n",
GetLastError());
1337 "expected ERROR_INVALID_HANDLE, got %u\n",
GetLastError());
1358 ok(initonce->
Ptr == (
void*)0
x1,
"got %p\n", initonce->
Ptr);
1359 ok(parameter == (
void*)0xdeadbeef,
"got wrong parameter\n");
1368 if (!pInitOnceInitialize || !pInitOnceExecuteOnce)
1370 win_skip(
"one-time initialization API not supported\n");
1375 initonce.
Ptr = (
void*)0xdeadbeef;
1376 pInitOnceInitialize(&initonce);
1384 ok(initonce.
Ptr == (
void*)0
x2,
"got %p\n", initonce.
Ptr);
1393 ok(initonce.
Ptr == (
void*)0
x2,
"got %p\n", initonce.
Ptr);
1397 pInitOnceInitialize(&initonce);
1403 ok(initonce.
Ptr == (
void*)0xFFFFFFF2,
"got %p\n", initonce.
Ptr);
1411 pInitOnceInitialize(&initonce);
1420 pInitOnceInitialize(&initonce);
1423 ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &
g_initctxt);
1425 ok(pending,
"got %d\n", pending);
1426 ok(initonce.
Ptr == (
void*)1,
"got %p\n", initonce.
Ptr);
1435 ok(pending == 0xf,
"got %d\n", pending);
1436 ok(initonce.
Ptr == (
void*)1,
"got %p\n", initonce.
Ptr);
1443 ok(initonce.
Ptr == (
void*)1,
"got %p\n", initonce.
Ptr);
1449 ok(initonce.
Ptr == (
void*)0xdeadbee2,
"got %p\n", initonce.
Ptr);
1451 pInitOnceInitialize(&initonce);
1462 ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &
g_initctxt);
1464 ok(pending,
"got %d\n", pending);
1465 ok(initonce.
Ptr == (
void*)1,
"got %p\n", initonce.
Ptr);
1474 ok(initonce.
Ptr == (
void*)1,
"got %p\n", initonce.
Ptr);
1477 ret = pInitOnceComplete(&initonce, 0, (
void *)0xdeadbeef);
1479 ok(initonce.
Ptr == (
void*)1,
"got %p\n", initonce.
Ptr);
1485 pInitOnceInitialize(&initonce);
1488 ok(pending,
"got %d\n", pending);
1489 ok(initonce.
Ptr == (
void*)3,
"got %p\n", initonce.
Ptr);
1492 ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &
g_initctxt);
1497 ok(pending,
"got %d\n", pending);
1498 ok(initonce.
Ptr == (
void*)3,
"got %p\n", initonce.
Ptr);
1503 ok(initonce.
Ptr == (
void*)3,
"got %p\n", initonce.
Ptr);
1508 ok(initonce.
Ptr == (
void*)3,
"got %p\n", initonce.
Ptr);
1513 ok(initonce.
Ptr == (
void*)3,
"got %p\n", initonce.
Ptr);
1517 ok(initonce.
Ptr == (
void*)0xdeadbee2,
"got %p\n", initonce.
Ptr);
1522 ok(initonce.
Ptr == (
void*)0xdeadbee2,
"got %p\n", initonce.
Ptr);
1524 pInitOnceInitialize(&initonce);
1525 ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &
g_initctxt);
1527 ok(pending,
"got %d\n", pending);
1528 ok(initonce.
Ptr == (
void*)1,
"got %p\n", initonce.
Ptr);
1532 pInitOnceInitialize(&initonce);
1540 ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &
g_initctxt);
1542 ok(pending,
"got %d\n", pending);
1543 ok(initonce.
Ptr == (
void*)1,
"got %p\n", initonce.
Ptr);
1552 ret = pInitOnceComplete(&initonce, 0, (
void *)0xdeadbee0);
1554 ok(initonce.
Ptr == (
void*)0xdeadbee2,
"got %p\n", initonce.
Ptr);
1558 ok(!pending,
"got %d\n", pending);
1559 ok(initonce.
Ptr == (
void*)0xdeadbee2,
"got %p\n", initonce.
Ptr);
1566 pInitOnceInitialize(&initonce);
1569 ok(pending,
"got %d\n", pending);
1570 ok(initonce.
Ptr == (
void*)3,
"got %p\n", initonce.
Ptr);
1581 ok(initonce.
Ptr == (
void*)0xdeadbee2,
"got %p\n", initonce.
Ptr);
1585 ok(!pending,
"got %d\n", pending);
1586 ok(initonce.
Ptr == (
void*)0xdeadbee2,
"got %p\n", initonce.
Ptr);
1601 #define BUFFER_SIZE 5 1604 DWORD sleepinterval = 5;
1607 Sleep(sleepinterval);
1608 if (sleepinterval > 1)
1633 DWORD sleepinterval = 1;
1653 Sleep(sleepinterval);
1654 if (sleepinterval < 5) sleepinterval += 1;
1661 HANDLE hp1,hp2,hp3,hc1,hc2,hc3;
1663 DWORD cnt1,cnt2,cnt3;
1665 if (!pInitializeConditionVariable) {
1667 win_skip(
"no condition variable support.\n");
1776 if (!pInitializeSRWLock)
1812 ok (!
ret,
"SleepConditionVariableCS should return FALSE on out of band wake\n");
1822 ok (!
ret,
"SleepConditionVariableCS should return FALSE on out of band wake\n");
1829 ok (
ret,
"SleepConditionVariableCS should return TRUE on good wake\n");
1835 ok (
ret,
"SleepConditionVariableCS should return TRUE on good wakeall\n");
1841 ok (!
ret,
"SleepConditionVariableCS should return FALSE on out of band wake\n");
1848 ok (
ret,
"SleepConditionVariableCS should still return TRUE on crit unlock delay\n");
1851 if (!pInitializeSRWLock)
1853 win_skip(
"no srw lock support.\n");
1862 ok (
ret,
"pSleepConditionVariableSRW should return TRUE on good wake\n");
1868 ok (
ret,
"pSleepConditionVariableSRW should return TRUE on good wake\n");
1874 ok (
ret,
"pSleepConditionVariableSRW should return TRUE on good wake\n");
1880 ok (
ret,
"pSleepConditionVariableSRW should return TRUE on good wake\n");
1892 if (!pInitializeConditionVariable) {
1894 win_skip(
"no condition variable support.\n");
1900 if (pInitializeSRWLock)
1907 ok (!
ret,
"SleepConditionVariableCS should return FALSE on untriggered condvar\n");
1910 if (pInitializeSRWLock)
1916 ok(!
ret,
"SleepConditionVariableSRW should return FALSE on untriggered condvar\n");
1923 ok(!
ret,
"SleepConditionVariableSRW should return FALSE on untriggered condvar\n");
2078 if (!pTryAcquireSRWLockExclusive)
2219 if (!pTryAcquireSRWLockExclusive)
2311 if (!pTryAcquireSRWLockExclusive)
2314 win_skip(
"no srw trylock support.\n");
2327 if (!pInitializeSRWLock)
2330 win_skip(
"no srw lock support.\n");
2350 "thread commands were executed in the wrong order (occurred %d times).\n",
2354 "AcquireSRWLockExclusive didn't block when called multiple times from the same thread (occurred %d times).\n",
2358 "AcquireSRWLockShared didn't block when the same thread holds an exclusive lock (occurred %d times).\n",
2362 "AcquireSRWLockExclusive didn't block when the same thread holds a shared lock (occurred %d times).\n",
2366 "AcquireSRWLockExclusive didn't block when a second thread holds the exclusive lock (occurred %d times).\n",
2370 "thread waiting for exclusive access to the SHMLock was not preferred (occurred %d times).\n",
2374 "TryAcquireSRWLockExclusive didn't behave as expected (occurred %d times).\n",
2378 "TryAcquireSRWLockShared didn't behave as expected (occurred %d times).\n",
2431 DWORD cnt1, cnt2, cnt3;
2433 if (!pInitializeSRWLock) {
2435 win_skip(
"no srw lock support.\n");
2441 cnt1 = cnt2 = cnt3 = 0;
2461 trace(
"number of shared accesses per thread are c1 %d, c2 %d, c3 %d\n", cnt1, cnt2, cnt3);
2498 HANDLE *semaphores = (
void *)userdata;
2504 HANDLE *semaphores = (
void *)userdata;
2566 while (
info->running)
2599 #if defined(__REACTOS__) && defined(_M_AMD64) 2602 skip(
"ROSTESTS-371: Skipping kernel32_winetest:sync test_apc_deadlock because it fails on Windows Server 2003 x64-Testbot. Set winetest_interactive to run it anyway.\n");
2625 for (
i = 0;
i < 1000;
i++)
2664 pInitializeConditionVariable = (
void *)
GetProcAddress(
hdll,
"InitializeConditionVariable");
2665 pSleepConditionVariableCS = (
void *)
GetProcAddress(
hdll,
"SleepConditionVariableCS");
2666 pSleepConditionVariableSRW = (
void *)
GetProcAddress(
hdll,
"SleepConditionVariableSRW");
2667 pWakeAllConditionVariable = (
void *)
GetProcAddress(
hdll,
"WakeAllConditionVariable");
2674 pTryAcquireSRWLockExclusive = (
void *)
GetProcAddress(
hdll,
"TryAcquireSRWLockExclusive");
2681 pRtlInterlockedPushListSListEx = (
void *)
GetProcAddress(
hntdll,
"RtlInterlockedPushListSListEx");
2684 if (!pInitializeConditionVariable)
2686 pInitializeConditionVariable = (
void *)
GetProcAddress(hdll_vista,
"InitializeConditionVariable");
2687 pSleepConditionVariableCS = (
void *)
GetProcAddress(hdll_vista,
"SleepConditionVariableCS");
2688 pSleepConditionVariableSRW = (
void *)
GetProcAddress(hdll_vista,
"SleepConditionVariableSRW");
2689 pWakeAllConditionVariable = (
void *)
GetProcAddress(hdll_vista,
"WakeAllConditionVariable");
2690 pWakeConditionVariable = (
void *)
GetProcAddress(hdll_vista,
"WakeConditionVariable");
2693 if (!pInitializeSRWLock)
2695 pInitializeSRWLock = (
void *)
GetProcAddress(hdll_vista,
"InitializeSRWLock");
2696 pAcquireSRWLockExclusive = (
void *)
GetProcAddress(hdll_vista,
"AcquireSRWLockExclusive");
2697 pAcquireSRWLockShared = (
void *)
GetProcAddress(hdll_vista,
"AcquireSRWLockShared");
2698 pReleaseSRWLockExclusive = (
void *)
GetProcAddress(hdll_vista,
"ReleaseSRWLockExclusive");
2699 pReleaseSRWLockShared = (
void *)
GetProcAddress(hdll_vista,
"ReleaseSRWLockShared");
2700 pTryAcquireSRWLockExclusive = (
void *)
GetProcAddress(hdll_vista,
"TryAcquireSRWLockExclusive");
2701 pTryAcquireSRWLockShared = (
void *)
GetProcAddress(hdll_vista,
"TryAcquireSRWLockShared");
static void CALLBACK timer_queue_cb3(PVOID p, BOOLEAN timedOut)
#define ERROR_INVALID_PARAMETER
static CRITICAL_SECTION condvar_crit
static const WCHAR invalid[]
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY PSLIST_ENTRY ULONG count
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
static void test_semaphore(void)
static void test_event(void)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
static void test_slist(void)
static DWORD WINAPI alertable_wait_thread(void *param)
static LONG srwlock_example_errors
#define ACCESS_SYSTEM_SECURITY
#define ERROR_PRIVILEGE_NOT_HELD
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCWSTR lpName OPTIONAL)
static BOOL(WINAPI *pQueryMemoryResourceNotification)(HANDLE
static CONDITION_VARIABLE condvar_base
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCSTR lpName OPTIONAL)
static SRWLOCK condvar_srwlock
GLdouble GLdouble GLdouble r
static LONG condvar_consumer_sleepcnt
#define MAXIMUM_WAIT_OBJECTS
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
#define ERROR_INVALID_HANDLE
static void CALLBACK timer_queue_cb1(PVOID p, BOOLEAN timedOut)
static LONG srwlock_inside
static void test_alertable_wait(void)
#define INVALID_HANDLE_VALUE
static HANDLE(WINAPI *pCreateMemoryResourceNotification)(MEMORY_RESOURCE_NOTIFICATION_TYPE)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
DWORD WINAPI GetLastError(VOID)
GLint GLint GLint GLint GLint x
HANDLE WINAPI OpenWaitableTimerW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpTimerName)
static NTSTATUS(WINAPI *pNtAllocateVirtualMemory)(HANDLE
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY PSLIST_ENTRY last
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static void test_signalandwait(void)
HANDLE WINAPI DECLSPEC_HOTPATCH OpenMutexA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName)
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
#define QueryDepthSList(SListHead)
LONG samethread_shared_excl
static LONG totalconsumed
GLbitfield GLuint64 timeout
HANDLE WINAPI OpenWaitableTimerA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpTimerName)
#define STATUS_INVALID_HANDLE
static void test_iocp_callback(void)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
static void test_WaitForMultipleObjects(void)
#define SECURITY_DESCRIPTOR_REVISION
#define sprintf(buf, format,...)
static BOOL CALLBACK initonce_callback(INIT_ONCE *initonce, void *parameter, void **ctxt)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY(__fastcall *pRtlInterlockedPushListSList)(PSLIST_HEADER list
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
static SRWLOCK srwlock_base
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
HANDLE WINAPI GetCurrentThread(VOID)
#define ERROR_ACCESS_DENIED
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY first
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName)
static void CALLBACK timer_queue_cb4(PVOID p, BOOLEAN timedOut)
#define INIT_ONCE_INIT_FAILED
static LONG srwlock_protected_value
static DWORD WINAPI srwlock_base_thread2(LPVOID x)
static void test_condvars_base(void)
HANDLE WINAPI DECLSPEC_HOTPATCH OpenMutexW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
DWORD WINAPI SignalObjectAndWait(IN HANDLE hObjectToSignal, IN HANDLE hObjectToWaitOn, IN DWORD dwMilliseconds, IN BOOL bAlertable)
static DWORD WINAPI condvar_consumer(LPVOID x)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
HANDLE WINAPI CreateTimerQueue(VOID)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
static void CALLBACK alertable_wait_apc2(ULONG_PTR userdata)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
static void test_srwlock_example(void)
static VOID(WINAPI *pInitOnceInitialize)(PINIT_ONCE)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
#define WAIT_IO_COMPLETION
#define ERROR_FILE_NOT_FOUND
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
static void test_initonce(void)
FORCEINLINE VOID InitializeSListHead(_Out_ PSLIST_HEADER SListHead)
static DWORD WINAPI condvar_base_consumer(LPVOID x)
static BOOL g_initcallback_called
#define call_func4(func, a, b, c, d)
GLboolean GLboolean GLboolean b
#define WT_EXECUTELONGFUNCTION
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
static void test_waitable_timer(void)
#define init_fastcall_thunk()
static void test_WaitForSingleObject(void)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HANDLE WINAPI CreateWaitableTimerA(IN LPSECURITY_ATTRIBUTES lpTimerAttributes OPTIONAL, IN BOOL bManualReset, IN LPCSTR lpTimerName OPTIONAL)
static LPVOID *static BOOL LPVOID *static LPVOID
DWORD WINAPI WaitForMultipleObjectsEx(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds, IN BOOL bAlertable)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
#define InterlockedFlushSList(SListHead)
#define FILE_FLAG_DELETE_ON_CLOSE
BOOL WINAPI ChangeTimerQueueTimer(IN HANDLE TimerQueue, IN HANDLE Timer, IN ULONG DueTime, IN ULONG Period)
#define disable_success_count
#define success(from, fromstr, to, tostr)
GLdouble GLdouble GLdouble GLdouble q
static LPOVERLAPPED_COMPLETION_ROUTINE Function
int winetest_get_mainargs(char ***pargv)
static CONDITION_VARIABLE buffernotfull
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
static HANDLE modify_handle(HANDLE handle, DWORD modify)
static LPVOID *static DWORD
#define FILE_ATTRIBUTE_NORMAL
static LONG condvar_producer_sleepcnt
DWORD WINAPI SuspendThread(IN HANDLE hThread)
static DWORD WINAPI condvar_base_producer(LPVOID x)
#define InterlockedDecrement
static DWORD WINAPI apc_deadlock_thread(void *param)
static void test_timer_queue(void)
#define InterlockedPushEntrySList(SListHead, SListEntry)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
#define GetCurrentProcess()
GLsizei const GLfloat * value
static DWORD WINAPI srwlock_base_thread1(LPVOID x)
static PEXPLICIT_ACCESSW *static HMODULE hmod
void(CALLBACK * LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD, DWORD, LPOVERLAPPED)
GLenum GLsizei GLuint GLint * bytesWritten
LONG wrong_execution_order
#define INIT_ONCE_CHECK_ONLY
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED * overlapped
static BOOL g_initcallback_ret
#define InterlockedIncrement
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
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
static void CALLBACK iocp_callback(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped)
static void test_mutex(void)
BOOL WINAPI DeleteTimerQueueTimer(IN HANDLE TimerQueue, IN HANDLE Timer, IN HANDLE CompletionEvent)
static SRWLOCK srwlock_example
static void test_apc_deadlock(void)
static CONDITION_VARIABLE buffernotempty
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseSemaphore(IN HANDLE hSemaphore, IN LONG lReleaseCount, IN LPLONG lpPreviousCount)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
LONG samethread_excl_shared
#define SLIST_ENTRY(type)
LONG samethread_excl_excl
static DWORD WINAPI condvar_producer(LPVOID x)
static void CALLBACK alertable_wait_apc(ULONG_PTR userdata)
static void CALLBACK timer_queue_cb5(PVOID p, BOOLEAN timedOut)
DWORD WINAPI ResumeThread(IN HANDLE hThread)
HANDLE WINAPI DECLSPEC_HOTPATCH OpenSemaphoreA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName)
static void CALLBACK timer_queue_cb6(PVOID p, BOOLEAN timedOut)
int strcmp(const char *String1, const char *String2)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexA(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCSTR lpName OPTIONAL)
#define GetProcAddress(x, y)
static CRITICAL_SECTION buffercrit
LONG multithread_excl_excl
BOOL WINAPI DeleteTimerQueueEx(IN HANDLE TimerQueue, IN HANDLE CompletionEvent)
#define PAGE_EXECUTE_READWRITE
#define ERROR_ALREADY_EXISTS
BOOL WINAPI CreateTimerQueueTimer(OUT PHANDLE phNewTimer, IN HANDLE TimerQueue, IN WAITORTIMERCALLBACK Callback, IN PVOID Parameter, IN DWORD DueTime, IN DWORD Period, IN ULONG Flags)
#define ERROR_GEN_FAILURE
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL condvar_sleeperr
#define CreateFileA(a, b, c, d, e, f, g)
GLboolean GLboolean GLboolean GLboolean a
static LONG totalproduced
#define InterlockedPopEntrySList(SListHead)
#define FILE_FLAG_OVERLAPPED
static DWORD WINAPI srwlock_base_thread3(LPVOID x)
static SERVICE_STATUS status
#define SEMAPHORE_ALL_ACCESS
static DWORD WINAPI srwlock_example_thread(LPVOID x)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
#define HeapFree(x, y, z)
static void CALLBACK timer_queue_cb2(PVOID p, BOOLEAN timedOut)
static void test_srwlock_base(void)
static struct sockaddr_in sa
HANDLE WINAPI DECLSPEC_HOTPATCH OpenSemaphoreW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
static struct @1631 srwlock_base_errors
static void test_condvars_consumer_producer(void)
static LPOVERLAPPED_COMPLETION_ROUTINE ULONG Flags
#define FILE_FLAG_RANDOM_ACCESS