33static VOID (
WINAPI *pTpReleaseWait)(TP_WAIT *);
38static VOID (
WINAPI *pTpReleaseTimer)(TP_TIMER *);
48#define NTDLL_GET_PROC(func) \
51 p ## func = (void *)GetProcAddress(hntdll, #func); \
52 if (!p ## func) trace("Failed to get address for %s\n", #func); \
91 win_skip(
"Threadpool functions not supported, skipping tests\n");
104 trace(
"Running rtl_work callback\n");
160 trace(
"Running rtl_wait callback\n");
169 if (
info->semaphore2)
181 trace(
"Running rtl_wait_apc callback\n");
195 ok(semaphores[0] !=
NULL,
"failed to create semaphore\n");
197 ok(semaphores[1] !=
NULL,
"failed to create semaphore\n");
198 info.semaphore1 = semaphores[0];
209 ok(wait1 !=
NULL,
"expected wait1 != NULL\n");
212 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
221 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
225 ok(
info.userdata == 2,
"expected info.userdata = 2, got %u\n",
info.userdata);
239 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
243 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
256 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
259 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
272 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
276 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
291 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
292 ok(
info.threadid != 0,
"expected info.threadid != 0, got %u\n",
info.threadid);
305 ok(
info.userdata == 2,
"expected info.userdata = 2, got %u\n",
info.userdata);
317 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
318 ok(
info.threadid != 0,
"expected info.threadid != 0, got %u\n",
info.threadid);
326 "WaitForSingleObject returned %u\n",
result);
332 ok(
info.userdata == 2,
"expected info.userdata = 2, got %u\n",
info.userdata);
342 ok(!
status,
"RtlDeregisterWaitEx failed with status %x\n",
status);
343 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
349 ok(!
status,
"RtlDeregisterWaitEx failed with status %x\n",
status);
350 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
356 ok(!
status,
"RtlDeregisterWaitEx failed with status %x\n",
status);
357 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
368 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
371 ok(!
status,
"RtlDeregisterWaitEx failed with status %x\n",
status);
372 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
379 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
382 ok(!
status,
"RtlDeregisterWaitEx failed with status %x\n",
status);
383 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
390 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
393 ok(!
status,
"RtlDeregisterWaitEx failed with status %x\n",
status);
394 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
400 info.semaphore2 = semaphores[1];
409 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
422 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
436 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
438 ok(!
status,
"RtlDeregisterWaitEx failed with status %x\n",
status);
449 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
466 trace(
"Running simple callback\n");
472 trace(
"Running simple2 callback\n");
493 memset(&environment, 0,
sizeof(environment));
508 memset(&environment, 0,
sizeof(environment));
517 memset(&environment3, 0,
sizeof(environment3));
521 environment3.
Size =
sizeof(environment3);
528 memset(&environment, 0,
sizeof(environment));
534 "TpSimpleTryPost unexpectedly returned status %x\n",
status);
544 ok(!
status,
"TpAllocCleanupGroup failed with status %x\n",
status);
549 memset(&environment, 0,
sizeof(environment));
560 pTpSetPoolMaxThreads(
pool, 10);
561 memset(&environment, 0,
sizeof(environment));
565 for (
i = 0;
i < 100;
i++)
574 pTpReleaseCleanupGroup(
group);
575 pTpReleasePool(
pool);
581 trace(
"Running work callback\n");
588 trace(
"Running work2 callback\n");
607 pTpSetPoolMaxThreads(
pool, 1);
611 memset(&environment, 0,
sizeof(environment));
616 ok(work !=
NULL,
"expected work != NULL\n");
620 for (
i = 0;
i < 5;
i++)
622 pTpWaitForWork(work,
FALSE);
627 for (
i = 0;
i < 10;
i++)
629 pTpWaitForWork(work,
TRUE);
633 pTpReleaseWork(work);
634 pTpReleasePool(
pool);
652 pTpSetPoolMaxThreads(
pool, 1);
657 ok(!
status,
"TpAllocCleanupGroup failed with status %x\n",
status);
662 memset(&environment, 0,
sizeof(environment));
667 ok(work !=
NULL,
"expected work != NULL\n");
671 memset(&environment, 0,
sizeof(environment));
677 ok(work2 !=
NULL,
"expected work2 != NULL\n");
681 for (
i = 0;
i < 10;
i++)
683 for (
i = 0;
i < 10;
i++)
686 pTpWaitForWork(work,
TRUE);
687 pTpWaitForWork(work2,
TRUE);
688 ok(
userdata & 0xffff,
"expected userdata & 0xffff != 0, got %u\n",
userdata & 0xffff);
693 for (
i = 0;
i < 10;
i++)
695 for (
i = 0;
i < 3;
i++)
698 pTpWaitForWork(work,
TRUE);
699 ok((
userdata & 0xffff) < 10,
"expected userdata & 0xffff < 10, got %u\n",
userdata & 0xffff);
703 pTpReleaseWork(work);
704 pTpReleaseCleanupGroup(
group);
705 pTpReleasePool(
pool);
711 trace(
"Running simple release callback\n");
719 trace(
"Running work release callback\n");
722 pTpReleaseWork(work);
728 trace(
"Running timer release callback\n");
731 pTpReleaseTimer(timer);
735 TP_WAIT *wait, TP_WAIT_RESULT
result)
738 trace(
"Running wait release callback\n");
741 pTpReleaseWait(wait);
769 ok(!
status,
"TpAllocCleanupGroup failed with status %x\n",
status);
774 memset(&environment, 0,
sizeof(environment));
780 ok(work !=
NULL,
"expected work != NULL\n");
788 memset(&environment, 0,
sizeof(environment));
794 ok(timer !=
NULL,
"expected timer != NULL\n");
796 pTpSetTimer(timer, &when, 0, 0);
803 memset(&environment, 0,
sizeof(environment));
809 ok(wait !=
NULL,
"expected wait != NULL\n");
817 pTpReleaseCleanupGroup(
group);
818 pTpReleasePool(
pool);
831 trace(
"Running simple group cancel callback\n");
835 "expected STATUS_TOO_MANY_THREADS, got %08x\n",
status);
838 for (
i = 0;
i < 4;
i++)
851 trace(
"Running work group cancel callback\n");
861 trace(
"Running group cancel cleanup release callback\n");
863 ok(
object == (
void *)0xdeadbeef,
"expected 0xdeadbeef, got %p\n",
object);
870 trace(
"Running group cancel cleanup release2 callback\n");
878 trace(
"Running group cancel cleanup increment callback\n");
885 ok(0,
"Unexpected callback\n");
890 ok(0,
"Unexpected callback\n");
895 ok(0,
"Unexpected callback\n");
899 TP_WAIT *wait, TP_WAIT_RESULT
result)
901 ok(0,
"Unexpected callback\n");
906 ok(0,
"Unexpected callback\n");
933 pTpSetPoolMaxThreads(
pool, 1);
938 ok(!
status,
"TpAllocCleanupGroup failed with status %x\n",
status);
942 memset(&environment, 0,
sizeof(environment));
950 memset(&environment, 0,
sizeof(environment));
961 ok(work !=
NULL,
"expected work != NULL\n");
966 ok(timer !=
NULL,
"expected timer != NULL\n");
971 ok(wait !=
NULL,
"expected wait != NULL\n");
974 pTpReleaseCleanupGroupMembers(
group,
TRUE, semaphores);
982 memset(&environment, 0,
sizeof(environment));
989 ok(work !=
NULL,
"expected work != NULL\n");
997 pTpReleaseCleanupGroupMembers(
group,
TRUE, semaphores);
1005 memset(&environment, 0,
sizeof(environment));
1012 ok(work !=
NULL,
"expected work != NULL\n");
1020 memset(&environment, 0,
sizeof(environment));
1029 pTpReleaseCleanupGroupMembers(
group,
TRUE, semaphores);
1033 memset(&environment, 0,
sizeof(environment));
1040 ok(work !=
NULL,
"expected work != NULL\n");
1044 for (
i = 0;
i < 10;
i++)
1049 pTpReleaseCleanupGroupMembers(
group,
TRUE, &userdata2);
1051 ok(userdata2 == 1,
"expected only one cancellation callback, got %u\n", userdata2);
1056 pTpReleaseCleanupGroup(
group);
1057 pTpReleasePool(
pool);
1065 trace(
"Running instance completion callback\n");
1066 pTpCallbackReleaseSemaphoreOnCompletion(
instance, semaphores[0], 1);
1074 trace(
"Running instance finalization callback\n");
1090 ok(semaphores[0] !=
NULL,
"failed to create semaphore\n");
1092 ok(semaphores[1] !=
NULL,
"failed to create semaphore\n");
1101 memset(&environment, 0,
sizeof(environment));
1110 memset(&environment, 0,
sizeof(environment));
1122 pTpReleasePool(
pool);
1132 trace(
"Running disassociate callback\n");
1145 trace(
"Running disassociate2 callback\n");
1158 trace(
"Running disassociate3 callback\n");
1177 ok(semaphores[0] !=
NULL,
"failed to create semaphore\n");
1179 ok(semaphores[1] !=
NULL,
"failed to create semaphore\n");
1189 ok(!
status,
"TpAllocCleanupGroup failed with status %x\n",
status);
1194 memset(&environment, 0,
sizeof(environment));
1199 ok(work !=
NULL,
"expected work != NULL\n");
1202 pTpWaitForWork(work,
FALSE);
1209 pTpReleaseWork(work);
1213 memset(&environment, 0,
sizeof(environment));
1219 ok(work !=
NULL,
"expected work != NULL\n");
1222 pTpWaitForWork(work,
FALSE);
1233 memset(&environment, 0,
sizeof(environment));
1239 ok(work !=
NULL,
"expected work != NULL\n");
1251 memset(&environment, 0,
sizeof(environment));
1267 pTpReleaseCleanupGroup(
group);
1268 pTpReleasePool(
pool);
1276 trace(
"Running timer callback\n");
1303 memset(&environment, 0,
sizeof(environment));
1308 ok(timer !=
NULL,
"expected timer != NULL\n");
1310 success = pTpIsTimerSet(timer);
1311 ok(!
success,
"TpIsTimerSet returned TRUE\n");
1315 pTpSetTimer(timer, &when, 0, 0);
1316 success = pTpIsTimerSet(timer);
1317 ok(
success,
"TpIsTimerSet returned FALSE\n");
1319 pTpWaitForTimer(timer,
FALSE);
1325 success = pTpIsTimerSet(timer);
1326 ok(
success,
"TpIsTimerSet returned FALSE\n");
1331 pTpSetTimer(timer, &when, 0, 0);
1332 success = pTpIsTimerSet(timer);
1333 ok(
success,
"TpIsTimerSet returned FALSE\n");
1335 pTpWaitForTimer(timer,
FALSE);
1341 success = pTpIsTimerSet(timer);
1342 ok(
success,
"TpIsTimerSet returned FALSE\n");
1346 pTpSetTimer(timer, &when, 0, 0);
1347 success = pTpIsTimerSet(timer);
1348 ok(
success,
"TpIsTimerSet returned FALSE\n");
1350 pTpWaitForTimer(timer,
FALSE);
1354 success = pTpIsTimerSet(timer);
1355 ok(
success,
"TpIsTimerSet returned FALSE\n");
1358 pTpSetTimer(timer,
NULL, 0, 0);
1359 success = pTpIsTimerSet(timer);
1360 ok(!
success,
"TpIsTimerSet returned TRUE\n");
1361 pTpWaitForTimer(timer,
TRUE);
1363 pTpReleaseTimer(timer);
1371 memset(&environment, 0,
sizeof(environment));
1376 ok(timer !=
NULL,
"expected timer != NULL\n");
1380 pTpSetTimer(timer, &when, 200, 0);
1381 success = pTpIsTimerSet(timer);
1382 ok(
success,
"TpIsTimerSet returned FALSE\n");
1386 for (
i = 0;
i < 3;
i++)
1392 ok(ticks >= 500 && (ticks <= 700 ||
broken(ticks <= 750)) ,
1393 "expected approximately 600 ticks, got %u\n", ticks);
1396 pTpSetTimer(timer,
NULL, 0, 0);
1397 success = pTpIsTimerSet(timer);
1398 ok(!
success,
"TpIsTimerSet returned TRUE\n");
1399 pTpWaitForTimer(timer,
TRUE);
1402 pTpReleaseTimer(timer);
1403 pTpReleasePool(
pool);
1416 trace(
"Running window length callback\n");
1425 TP_TIMER *timer1, *timer2;
1443 memset(&environment, 0,
sizeof(environment));
1444 environment.Version = 1;
1445 environment.Pool =
pool;
1451 ok(timer1 !=
NULL,
"expected timer1 != NULL\n");
1457 ok(timer2 !=
NULL,
"expected timer2 != NULL\n");
1465 pTpSetTimer(timer2, &when, 0, 0);
1468 pTpSetTimer(timer1, &when, 0, 75);
1474 ok(info1.
ticks != 0 && info2.
ticks != 0,
"expected that ticks are nonzero\n");
1476 "expected that timers are not merged\n");
1484 pTpSetTimer(timer2, &when, 0, 0);
1487 pTpSetTimer(timer1, &when, 0, 200);
1493 ok(info1.
ticks != 0 && info2.
ticks != 0,
"expected that ticks are nonzero\n");
1495 ok(merged ||
broken(!merged) ,
"expected that timers are merged\n");
1503 pTpSetTimer(timer1, &when, 0, 200);
1506 pTpSetTimer(timer2, &when, 0, 0);
1512 ok(info1.
ticks != 0 && info2.
ticks != 0,
"expected that ticks are nonzero\n");
1515 ok(merged ||
broken(!merged) ,
"expected that timers are merged\n");
1518 pTpReleaseTimer(timer1);
1519 pTpReleaseTimer(timer2);
1520 pTpReleasePool(
pool);
1531 TP_WAIT *wait, TP_WAIT_RESULT
result)
1534 trace(
"Running wait callback\n");
1541 ok(0,
"unexpected result %u\n",
result);
1548 TP_WAIT *wait1, *wait2;
1557 ok(semaphores[0] !=
NULL,
"failed to create semaphore\n");
1559 ok(semaphores[1] !=
NULL,
"failed to create semaphore\n");
1560 info.semaphore = semaphores[0];
1569 memset(&environment, 0,
sizeof(environment));
1576 ok(wait1 !=
NULL,
"expected wait1 != NULL\n");
1581 ok(wait2 !=
NULL,
"expected wait2 != NULL\n");
1585 pTpSetWait(wait1, semaphores[1],
NULL);
1589 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
1596 pTpSetWait(wait1, semaphores[1], &when);
1599 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1602 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
1609 pTpSetWait(wait1, semaphores[1], &when);
1612 pTpWaitForWait(wait1,
TRUE);
1613 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1616 "WaitForSingleObject returned %u\n",
result);
1618 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
1620 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1627 pTpSetWait(wait1, semaphores[1], &when);
1630 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1634 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
1641 pTpSetWait(wait1, semaphores[1], &when);
1644 pTpWaitForWait(wait1,
TRUE);
1645 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1649 "WaitForSingleObject returned %u\n",
result);
1652 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
1658 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1667 pTpSetWait(wait1, semaphores[1], &when);
1670 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1673 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
1681 pTpSetWait(wait1, semaphores[1], &when);
1684 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1688 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
1695 pTpSetWait(wait1, semaphores[1], &when);
1698 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
1705 pTpSetWait(wait1, semaphores[1], &when);
1708 pTpSetWait(wait1,
NULL, (
void *)0xdeadbeef);
1713 ok(
info.userdata == 0,
"expected info.userdata = 0, got %u\n",
info.userdata);
1723 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
1728 pTpSetWait(wait1, semaphores[1], &when);
1737 ok(
info.userdata == 0x10000,
"expected info.userdata = 0x10000, got %u\n",
info.userdata);
1743 ok(semaphores[1] !=
NULL,
"failed to create semaphore\n");
1747 pTpSetWait(wait1, semaphores[1],
NULL);
1748 pTpSetWait(wait2, semaphores[1],
NULL);
1755 ok(
info.userdata == 1,
"expected info.userdata = 1, got %u\n",
info.userdata);
1761 pTpSetWait(wait1, semaphores[1],
NULL);
1762 pTpSetWait(wait2, semaphores[1],
NULL);
1769 ok(
info.userdata == 2,
"expected info.userdata = 2, got %u\n",
info.userdata);
1774 pTpReleaseWait(wait1);
1775 pTpReleaseWait(wait2);
1776 pTpReleasePool(
pool);
1796 ok(0,
"unexpected result %u\n",
result);
1804 TP_WAIT *waits[512];
1822 memset(&environment, 0,
sizeof(environment));
1827 for (
i = 0;
i <
sizeof(semaphores)/
sizeof(semaphores[0]);
i++)
1830 ok(semaphores[
i] !=
NULL,
"failed to create semaphore %i\n",
i);
1835 ok(waits[
i] !=
NULL,
"expected waits[%d] != NULL\n",
i);
1837 pTpSetWait(waits[
i], semaphores[
i],
NULL);
1841 for (
i = 0;
i <
sizeof(semaphores)/
sizeof(semaphores[0]);
i++)
1850 pTpSetWait(waits[
i], semaphores[
i],
NULL);
1854 for (
i =
sizeof(semaphores)/
sizeof(semaphores[0]) - 1;
i >= 0;
i--)
1863 pTpSetWait(waits[
i], semaphores[
i],
NULL);
1868 for (
i = 0;
i <
sizeof(semaphores)/
sizeof(semaphores[0]);
i++)
1871 pTpSetWait(waits[
i], semaphores[
i], &when);
1874 for (
i = 0;
i <
sizeof(semaphores)/
sizeof(semaphores[0]);
i++)
1880 ok(
multi_wait_info.result >> 16,
"expected multi_wait_info.result >> 16 != 0\n");
1883 for (
i = 0;
i <
sizeof(semaphores)/
sizeof(semaphores[0]);
i++)
1885 pTpSetWait(waits[
i], semaphores[
i],
NULL);
1890 for (
i = 0;
i <
sizeof(semaphores)/
sizeof(semaphores[0]);
i++)
1892 pTpReleaseWait(waits[
i]);
1896 pTpReleasePool(
pool);
#define InterlockedIncrement
static HINSTANCE instance
#define INVALID_HANDLE_VALUE
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
HANDLE WINAPI OpenThread(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwThreadId)
DWORD WINAPI GetTickCount(VOID)
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
#define THREAD_SET_CONTEXT
#define InterlockedExchangeAdd
NTSYSAPI NTSTATUS NTAPI RtlQueueWorkItem(_In_ WORKERCALLBACKFUNC Function, _In_opt_ PVOID Context, _In_ ULONG Flags)
NTSYSAPI NTSTATUS NTAPI RtlRegisterWait(_In_ PHANDLE phNewWaitObject, _In_ HANDLE hObject, _In_ WAITORTIMERCALLBACKFUNC Callback, _In_ PVOID pvContext, _In_ ULONG ulMilliseconds, _In_ ULONG ulFlags)
NTSYSAPI NTSTATUS NTAPI RtlDeregisterWaitEx(_In_ HANDLE hWaitHandle, _In_opt_ HANDLE hCompletionEvent)
NTSYSAPI NTSTATUS NTAPI RtlDeregisterWait(_In_ HANDLE hWaitHandle)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
#define STATUS_TOO_MANY_THREADS
PTP_CLEANUP_GROUP CleanupGroup
PTP_SIMPLE_CALLBACK FinalizationCallback
TP_CALLBACK_PRIORITY CallbackPriority
PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCSTR lpName OPTIONAL)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseSemaphore(IN HANDLE hSemaphore, IN LONG lReleaseCount, IN LPLONG lpPreviousCount)
#define NTDLL_GET_PROC(func)
static void CALLBACK unexpected_group_cancel_cleanup_cb(void *object, void *userdata)
static void CALLBACK wait_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WAIT *wait, TP_WAIT_RESULT result)
static void CALLBACK simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static void CALLBACK disassociate2_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work)
static struct @1695 multi_wait_info
static void CALLBACK work_group_cancel_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work)
static void test_tp_work_scheduler(void)
static void CALLBACK wait_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WAIT *wait, TP_WAIT_RESULT result)
static void CALLBACK rtl_wait_apc_cb(ULONG_PTR userdata)
static void test_tp_work(void)
static void CALLBACK work_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work)
static void CALLBACK group_cancel_cleanup_release2_cb(void *object, void *userdata)
static void test_tp_timer(void)
static void CALLBACK instance_semaphore_completion_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static TP_CALLBACK_ENVIRON *static TP_CALLBACK_ENVIRON *static PTP_WORK_CALLBACK
static void CALLBACK disassociate_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work)
static void test_tp_group_cancel(void)
static void test_tp_window_length(void)
static DWORD CALLBACK rtl_work_cb(void *userdata)
static LARGE_INTEGER LONG
static PTP_TIMER_CALLBACK
static void test_tp_wait(void)
static void CALLBACK timer_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_TIMER *timer)
static void test_tp_disassociate(void)
static void CALLBACK work2_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work)
static void CALLBACK simple_group_cancel_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static void CALLBACK rtl_wait_cb(void *userdata, BOOLEAN timeout)
static DWORD group_cancel_tid
static HANDLE rtl_wait_apc_semaphore
static void CALLBACK unexpected_work_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work)
static void test_tp_group_wait(void)
static void test_tp_multi_wait(void)
static void CALLBACK work_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work)
static void CALLBACK unexpected_timer_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_TIMER *timer)
static void CALLBACK disassociate3_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static void test_tp_instance(void)
static TP_CALLBACK_ENVIRON *static PTP_WAIT_CALLBACK
static void CALLBACK group_cancel_cleanup_increment_cb(void *object, void *userdata)
static void CALLBACK instance_finalization_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static void CALLBACK simple2_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static void CALLBACK group_cancel_cleanup_release_cb(void *object, void *userdata)
static void test_RtlRegisterWait(void)
static BOOL init_threadpool(void)
static void CALLBACK multi_wait_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WAIT *wait, TP_WAIT_RESULT result)
static void CALLBACK window_length_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_TIMER *timer)
static void test_RtlQueueWorkItem(void)
static void CALLBACK unexpected_simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static void CALLBACK unexpected_wait_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WAIT *wait, TP_WAIT_RESULT result)
static void CALLBACK timer_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_TIMER *timer)
static void CALLBACK simple_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static void test_tp_simple(void)
#define STATUS_INVALID_PARAMETER
#define success(from, fromstr, to, tostr)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentThreadId(void)
#define WT_TRANSFER_IMPERSONATION
@ TP_CALLBACK_PRIORITY_NORMAL
struct _TP_CLEANUP_GROUP TP_CLEANUP_GROUP
#define WT_EXECUTEINPERSISTENTTHREAD
#define WT_EXECUTEONLYONCE
#define WT_EXECUTEINIOTHREAD
#define WT_EXECUTELONGFUNCTION
VOID(NTAPI * PTP_SIMPLE_CALLBACK)(_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Context)
struct _TP_CALLBACK_INSTANCE TP_CALLBACK_INSTANCE
#define WT_EXECUTEDEFAULT