28#define WINE_NO_INLINE_STRING
31#define WIN32_NO_STATUS
41#define THREAD_ALL_ACCESS_NT4 (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3ff)
46#define USE_EXTENDED_PRIORITIES 0
59# define __EXCEPT __except
68#elif defined __x86_64__
72#elif defined __aarch64__
162 return sync_id == my_id;
202 ? (obeying_ars = +1) \
203 : ((obeying_ars = -1), \
204 trace("not restricted, assuming consistent behaviour\n"))) \
205 : (obeying_ars < 0) \
206 ? ok(!(x), "access restrictions obeyed\n") \
207 : ok( (x), "access restrictions not obeyed\n"))
220 "TlsSetValue failed\n");
230 ok(tstruct->
threadmem[
i] != 0,
"expected threadmem[%d] != 0\n",
i);
233 ok(
lstrlenA( (
char *)0xdeadbeef ) == 0,
"lstrlenA: unexpected success\n" );
237 "TlsGetValue failed\n");
308 cur = (
void*)0xdeadbeef;
344 skip(
"child process wasn't mapped at same address, so can't do CreateRemoteThread tests.\n");
361 win_skip(
"CreateRemoteThread is not implemented\n");
365 ok(
tid != 0,
"null tid\n");
390 hRemoteEvent, 0, &
tid);
399 hRemoteEvent, 0, &
tid);
409 if (
ret)
ok(exitcode == 0,
"SetEvent succeeded, expected to fail\n");
433 ok(
lstrlenA( (
char *)0xdeadbeef ) == 0,
"lstrlenA: unexpected success\n" );
454 &tstruct[
i],0,&threadid[
i]);
465 ok(exitCode==
i+
NUM_THREADS,
"Thread returned an incorrect exit code\n");
476 if (threadmem[
i]==threadmem[
j]) {
480 ok(!
error && threadmem[
i]==threadid[
i] && threadmem[
i]!=curthreadId,
481 "Thread did not execute successfully\n");
489 "GetLastError: expected 0xCAFEF00D, got %08lx\n",
GetLastError());
495 "GetLastError: expected ERROR_INVALID_PARAMETER, got %08lx\n",
GetLastError());
502 ok(
GLE==0xFACEaBAD,
"CreateThread set last error to %ld, expected 4207848365\n",
GLE);
506 ok(
ret!=0,
"GetExitCodeThread returned %ld (expected nonzero)\n",
ret);
507 ok(exitCode==99,
"threadFunc2 exited with code: %ld (expected 99)\n", exitCode);
534 "ResumeThread should not have actually started the thread\n");
538 "Thread did not resume\n");
544 ok(suspend_count == -1,
"SuspendThread returned %ld, expected -1\n", suspend_count);
547 ok(suspend_count == 0 ||
548 broken(suspend_count == -1),
549 "ResumeThread returned %ld, expected 0\n", suspend_count);
578 ok(
error==1,
"SuspendThread did not work\n");
583 ok(access_thread!=
NULL,
"OpenThread returned an invalid handle\n");
584 if (access_thread!=
NULL) {
592 "Thread did not really suspend\n");
596 "Thread did not resume\n");
613 DWORD threadId,exitCode;
623 "TerminateThread didn't work\n");
628 ok(access_thread!=
NULL,
"OpenThread returned an invalid handle\n");
629 if (access_thread!=
NULL) {
637 "TerminateThread didn't work\n");
639 "TerminateThread should not leave the thread 'STILL_ACTIVE'\n");
640 ok(exitCode==99,
"TerminateThread returned invalid exit code\n");
657 DWORD threadId,exitCode;
662 ok(sysInfo.
dwPageSize>0,
"GetSystemInfo should return a valid page size\n");
664 threadFunc5,&exitCode,
667 "TerminateThread didn't work\n");
668 ok(exitCode==1,
"CreateThread did not obey stack-size-limit\n");
676 HANDLE curthread,access_thread;
677 DWORD curthreadId,exitCode;
678 int min_priority=-2,max_priority=2;
691 "GetThreadPriority Failed\n");
698 ok(access_thread!=
NULL,
"OpenThread returned an invalid handle\n");
699 if (access_thread!=
NULL) {
703 ok(
CloseHandle(access_thread),
"Error Closing thread handle\n");
706#if USE_EXTENDED_PRIORITIES
707 min_priority=-7; max_priority=6;
709 for(
i=min_priority;
i<=max_priority;
i++) {
711 "SetThreadPriority Failed for priority: %d\n",
i);
713 "GetThreadPriority Failed for priority: %d\n",
i);
716 "SetThreadPriority Failed\n");
718 "GetThreadPriority Failed\n");
720 "SetThreadPriority Failed\n");
722 "GetThreadPriority Failed\n");
731 ok(rc ==
FALSE,
"SetThreadPriority passed with a bad argument\n");
734 "SetThreadPriority error %ld, expected ERROR_INVALID_PARAMETER or ERROR_INVALID_PRIORITY\n",
737 "GetThreadPriority didn't return min_priority\n");
743 ok(rc ==
FALSE,
"SetThreadPriority passed with a bad argument\n");
746 "SetThreadPriority error %ld, expected ERROR_INVALID_PARAMETER or ERROR_INVALID_PRIORITY\n",
749 "GetThreadPriority didn't return max_priority\n");
752 if (!pGetThreadPriorityBoost || !pSetThreadPriorityBoost)
756 rc=pGetThreadPriorityBoost(curthread,&disabled);
759 win_skip(
"GetThreadPriorityBoost is not implemented on WinME\n");
770 ok(access_thread!=
NULL,
"OpenThread returned an invalid handle\n");
771 if (access_thread!=
NULL) {
774 ok(
CloseHandle(access_thread),
"Error Closing thread handle\n");
778 rc = pSetThreadPriorityBoost(curthread,1);
781 rc=pGetThreadPriorityBoost(curthread,&disabled);
782 ok(rc!=0 && disabled==1,
783 "rc=%d error=%ld disabled=%d\n",rc,
GetLastError(),disabled);
786 rc = pSetThreadPriorityBoost(curthread,0);
788 rc=pGetThreadPriorityBoost(curthread,&disabled);
789 ok(rc!=0 && disabled==0,
790 "rc=%d error=%ld disabled=%d\n",rc,
GetLastError(),disabled);
797 FILETIME creationTime,exitTime,kernelTime,userTime;
810 "OpenThread returned an invalid handle\n");
814 "ResumeThread didn't work\n");
821 &kernelTime,&userTime);
824 win_skip(
"GetThreadTimes is not implemented\n");
826 ok(
error!=0,
"GetThreadTimes failed\n");
828 "creationTime was invalid\n");
830 "exitTime was invalid\n");
832 "kernelTimewas invalid\n");
834 "userTime was invalid\n");
836 if(access_thread!=
NULL)
839 &kernelTime,&userTime);
843 if(access_thread!=
NULL) {
854 DWORD_PTR processMask,systemMask,retMask;
874 "GetSystemInfo failed to return a valid # of processors\n");
877 ok(curthread!=
NULL,
"GetCurrentThread failed\n");
879 ok(curproc!=
NULL,
"GetCurrentProcess failed\n");
882 "GetProcessAffinityMask failed\n");
884 "SetThreadAffinityMask failed\n");
886 "SetThreadAffinityMask passed for an illegal processor\n");
889 ok(
broken(retMask==0) || retMask==processMask,
890 "SetThreadAffinityMask(thread,-1) failed to request all processors.\n");
892 if (retMask == processMask)
904 ok(retMask == processMask,
"SetThreadAffinityMask failed\n");
906 ok(retMask == processMask,
"SetThreadAffinityMask failed\n");
911 ok(
ret != ~0
u,
"Unexpected return value %lu.\n",
ret);
918 ok(
ret != ~0
u,
"Unexpected return value %lu.\n",
ret);
922 ok(
ret == ~0
u,
"Unexpected return value %lu.\n",
ret);
929#if defined(__REACTOS__) && defined(_WIN64)
933 ok(
ret == ~0
u,
"Unexpected return value %lu.\n",
ret);
939 ok(
ret != ~0
u,
"Unexpected return value %lu.\n",
ret);
941 if (pGetThreadGroupAffinity && pSetThreadGroupAffinity)
947 ok(pGetThreadGroupAffinity(curthread, &
affinity),
"GetThreadGroupAffinity failed\n");
950 ok(!pGetThreadGroupAffinity(curthread,
NULL),
"GetThreadGroupAffinity succeeded\n");
952 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
955 memset(&affinity_new, 0,
sizeof(affinity_new));
956 affinity_new.
Group = 0;
958 ok(pSetThreadGroupAffinity(curthread, &affinity_new, &
affinity),
"SetThreadGroupAffinity failed\n");
959 ok(affinity_new.
Mask ==
affinity.Mask,
"Expected old affinity mask %Ix, got %Ix\n",
965 affinity_new.
Group = 0;
968 ok(!pSetThreadGroupAffinity(curthread, &affinity_new,
NULL),
"SetThreadGroupAffinity succeeded\n");
970 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
973 affinity_new.
Group = 1;
974 affinity_new.
Mask = 0x1;
976 ok(!pSetThreadGroupAffinity(curthread, &affinity_new,
NULL),
"SetThreadGroupAffinity succeeded\n");
978 "Expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
981 ok(!pSetThreadGroupAffinity(curthread,
NULL,
NULL),
"SetThreadGroupAffinity succeeded\n");
988 "Expected STATUS_ACCESS_VIOLATION, got %08lx\n",
status);
991 affinity_new.
Group = 0;
994 ok(pSetThreadGroupAffinity(curthread, &affinity_new, &
affinity),
"SetThreadGroupAffinity failed\n");
995 ok(affinity_new.
Mask ==
affinity.Mask,
"Expected old affinity mask %Ix, got %Ix\n",
999 win_skip(
"Get/SetThreadGroupAffinity not available\n");
1006 if (!pGetCurrentThreadStackLimits)
1008 win_skip(
"GetCurrentThreadStackLimits not available.\n");
1015 pGetCurrentThreadStackLimits(
NULL,
NULL);
1016 pGetCurrentThreadStackLimits(
NULL, &high);
1017 pGetCurrentThreadStackLimits(&low,
NULL);
1020 pGetCurrentThreadStackLimits(&low, &high);
1030 if (!pSetThreadStackGuarantee)
1032 win_skip(
"SetThreadStackGuarantee not available.\n");
1036 ret = pSetThreadStackGuarantee( &
size );
1039 ok(
NtCurrentTeb()->GuaranteedStackBytes == 0,
"wrong teb %lu\n",
1042 ret = pSetThreadStackGuarantee( &
size );
1043 ok( !
ret,
"succeeded\n" );
1047 ok(
NtCurrentTeb()->GuaranteedStackBytes == 0,
"wrong teb %lu\n",
1050 ret = pSetThreadStackGuarantee( &
size );
1053 ok(
NtCurrentTeb()->GuaranteedStackBytes == 4096 *
sizeof(
void *) / 4,
"wrong teb %lu\n",
1056 ret = pSetThreadStackGuarantee( &
size );
1058 ok(
size == 4096 *
sizeof(
void *) / 4,
"wrong size %lu\n",
size );
1059 ok(
NtCurrentTeb()->GuaranteedStackBytes == 8192,
"wrong teb %lu\n",
1062 ret = pSetThreadStackGuarantee( &
size );
1064 ok(
size == 8192,
"wrong size %lu\n",
size );
1065 ok(
NtCurrentTeb()->GuaranteedStackBytes == 8192,
"wrong teb %lu\n",
1068 ret = pSetThreadStackGuarantee( &
size );
1070 ok(
size == 8192,
"wrong size %lu\n",
size );
1071 ok(
NtCurrentTeb()->GuaranteedStackBytes == 12288,
"wrong teb %lu\n",
1073 ret = pSetThreadStackGuarantee( &
size );
1075 ok(
size == 12288,
"wrong size %lu\n",
size );
1076 ok(
NtCurrentTeb()->GuaranteedStackBytes == 12288,
"wrong teb %lu\n",
1082 DWORD exitCode, threadid;
1087 ok(
ret==0,
"GetExitCodeThread returned non zero value: %ld\n",
ret);
1096 "GetExitCodeThread returned %ld (expected 1 or %ld)\n",
ret, exitCode);
1097 ok(exitCode==99,
"threadFunc2 exited with code %ld (expected 99)\n", exitCode);
1106static void WINAPI set_test_val(
int val )
1120static void test_SetThreadContext(
void)
1135 trace(
"Thread creation failed, skipping rest of test\n");
1153 ctx.Esp -= 2 *
sizeof(
int *);
1162 ok ( prevcount == 1,
"Previous suspend count (%ld) instead of 1, last error : (%ld)\n",
1174 "got %d with %lu (expected FALSE with ERROR_GEN_FAILURE or ERROR_ACCESS_DENIED)\n",
1182 "got %d with %lu (expected FALSE with ERROR_GEN_FAILURE or ERROR_ACCESS_DENIED)\n",
1198static void test_GetThreadContext(
void)
1209 ok(!
ctx.Dr0,
"Dr0 = %lx\n",
ctx.Dr0);
1210 ok(!
ctx.Dr1,
"Dr0 = %lx\n",
ctx.Dr0);
1217static void test_GetThreadSelectorEntry(
void)
1229 ok(!
HIWORD(
ctx.SegCs),
"expected HIWORD(SegCs) == 0, got %lu\n",
ctx.SegCs);
1230 ok(!
HIWORD(
ctx.SegDs),
"expected HIWORD(SegDs) == 0, got %lu\n",
ctx.SegDs);
1231 ok(!
HIWORD(
ctx.SegFs),
"expected HIWORD(SegFs) == 0, got %lu\n",
ctx.SegFs);
1245 ok(!
ret,
"GetThreadSelectorEntry(invalid) succeeded\n");
1249 ok(!
ret,
"GetThreadSelectorEntry(invalid) succeeded\n");
1256 entry.HighWord.Bits.Type &= ~1;
1258 base = (
void *)((
entry.HighWord.Bits.BaseHi << 24) | (
entry.HighWord.Bits.BaseMid << 16) |
entry.BaseLow);
1262 ok(
limit == 0x0fff ||
limit == 0x4000,
"expected 0x0fff or 0x4000, got %#lx\n",
limit);
1263 ok(
entry.HighWord.Bits.Type == 0x12,
"expected 0x12, got %#x\n",
entry.HighWord.Bits.Type);
1264 ok(
entry.HighWord.Bits.Dpl == 3,
"expected 3, got %u\n",
entry.HighWord.Bits.Dpl);
1265 ok(
entry.HighWord.Bits.Pres == 1,
"expected 1, got %u\n",
entry.HighWord.Bits.Pres);
1266 ok(
entry.HighWord.Bits.Sys == 0,
"expected 0, got %u\n",
entry.HighWord.Bits.Sys);
1267 ok(
entry.HighWord.Bits.Reserved_0 == 0,
"expected 0, got %u\n",
entry.HighWord.Bits.Reserved_0);
1268 ok(
entry.HighWord.Bits.Default_Big == 1,
"expected 1, got %u\n",
entry.HighWord.Bits.Default_Big);
1269 ok(
entry.HighWord.Bits.Granularity == 0,
"expected 0, got %u\n",
entry.HighWord.Bits.Granularity);
1274 entry.HighWord.Bits.Type &= ~1;
1275 base = (
void *)((
entry.HighWord.Bits.BaseHi << 24) | (
entry.HighWord.Bits.BaseMid << 16) |
entry.BaseLow);
1280 ok(
entry.HighWord.Bits.Type == 0x1a,
"expected 0x12, got %#x\n",
entry.HighWord.Bits.Type);
1281 ok(
entry.HighWord.Bits.Dpl == 3,
"expected 3, got %u\n",
entry.HighWord.Bits.Dpl);
1282 ok(
entry.HighWord.Bits.Pres == 1,
"expected 1, got %u\n",
entry.HighWord.Bits.Pres);
1283 ok(
entry.HighWord.Bits.Sys == 0,
"expected 0, got %u\n",
entry.HighWord.Bits.Sys);
1284 ok(
entry.HighWord.Bits.Reserved_0 == 0,
"expected 0, got %u\n",
entry.HighWord.Bits.Reserved_0);
1285 ok(
entry.HighWord.Bits.Default_Big == 1,
"expected 1, got %u\n",
entry.HighWord.Bits.Default_Big);
1286 ok(
entry.HighWord.Bits.Granularity == 1,
"expected 1, got %u\n",
entry.HighWord.Bits.Granularity);
1291 entry.HighWord.Bits.Type &= ~1;
1292 base = (
void *)((
entry.HighWord.Bits.BaseHi << 24) | (
entry.HighWord.Bits.BaseMid << 16) |
entry.BaseLow);
1297 ok(
entry.HighWord.Bits.Type == 0x12,
"expected 0x12, got %#x\n",
entry.HighWord.Bits.Type);
1298 ok(
entry.HighWord.Bits.Dpl == 3,
"expected 3, got %u\n",
entry.HighWord.Bits.Dpl);
1299 ok(
entry.HighWord.Bits.Pres == 1,
"expected 1, got %u\n",
entry.HighWord.Bits.Pres);
1300 ok(
entry.HighWord.Bits.Sys == 0,
"expected 0, got %u\n",
entry.HighWord.Bits.Sys);
1301 ok(
entry.HighWord.Bits.Reserved_0 == 0,
"expected 0, got %u\n",
entry.HighWord.Bits.Reserved_0);
1302 ok(
entry.HighWord.Bits.Default_Big == 1,
"expected 1, got %u\n",
entry.HighWord.Bits.Default_Big);
1303 ok(
entry.HighWord.Bits.Granularity == 1,
"expected 1, got %u\n",
entry.HighWord.Bits.Granularity);
1315 if (executed == 100)
1327 if (!pQueueUserWorkItem)
return;
1333 for (
i = 0;
i < 100;
i++)
1343 ok(wait_result ==
WAIT_OBJECT_0,
"wait failed with error 0x%lx\n", wait_result);
1352 ok(!TimerOrWaitFired,
"wait shouldn't have timed out\n");
1359 ok(!TimerOrWaitFired,
"wait shouldn't have timed out\n");
1368 ok(TimerOrWaitFired,
"wait should have timed out\n");
1401 ret = pUnregisterWait(
param->wait_handle);
1412 HANDLE waitthread_trigger_event, waitthread_wait_event;
1417 if (!pRegisterWaitForSingleObject || !pUnregisterWait)
1419 win_skip(
"RegisterWaitForSingleObject or UnregisterWait not implemented\n");
1457 ok(!
ret,
"UnregisterWait succeeded\n");
1480 ok(!
ret,
"Expected UnregisterWait to fail\n");
1482 "Expected ERROR_INVALID_HANDLE, got %ld\n",
GetLastError());
1500 for (
i = 0;
i < 100; ++
i)
1520 param.trigger_event = waitthread_trigger_event;
1521 param.wait_event = waitthread_wait_event;
1524 ret = pRegisterWaitForSingleObject(&wait_handle2, waitthread_trigger_event,
signaled_function, waitthread_wait_event,
1538 ret = pUnregisterWait(wait_handle2);
1572 return pFlsAlloc(
NULL);
1622 ok(
val ==
NULL,
"Slot not initialized correctly\n");
1627 ok(
val ==
NULL,
"Slot not initialized correctly\n");
1636 ok(
val ==
NULL,
"Slot not initialized correctly\n");
1641 ok(
val ==
NULL,
"Slot not initialized correctly\n");
1652 ok(
val == (
LPVOID) 1,
"Slot not initialized correctly\n");
1657 ok(
val == (
LPVOID) 2,
"Slot not initialized correctly\n");
1665 ok(
val ==
NULL,
"Slot not initialized correctly\n");
1669 ok(
val ==
NULL,
"Slot not initialized correctly\n");
1679 ok(
val == (
LPVOID) 3,
"Slot not initialized correctly\n");
1683 ok(
val == (
LPVOID) 4,
"Slot not initialized correctly\n");
1694 ok(
val == (
LPVOID) 1,
"Slot not initialized correctly\n");
1698 ok(
val == (
LPVOID) 2,
"Slot not initialized correctly\n");
1736 for (
i = 0;
i < 2; ++
i)
1747 for (
i = 0;
i < 2; ++
i)
1774 if (!pFlsAlloc || !pFlsFree || !pFlsGetValue || !pFlsSetValue)
1776 win_skip(
"Fiber Local Storage not supported\n");
1783 LS_GetValueFunc = pFlsGetValue;
1784 LS_SetValueFunc = pFlsSetValue;
1785 LS_FreeFunc = pFlsFree;
1802 if (!pSetThreadErrorMode || !pGetThreadErrorMode)
1804 win_skip(
"SetThreadErrorMode and/or GetThreadErrorMode unavailable (added in Windows 7)\n");
1808 if (!pRtlGetThreadErrorMode) {
1809 win_skip(
"RtlGetThreadErrorMode not available\n");
1813 oldmode = pGetThreadErrorMode();
1815 ret = pSetThreadErrorMode(0, &
mode);
1816 ok(
ret,
"SetThreadErrorMode failed\n");
1818 "SetThreadErrorMode returned old mode 0x%lx, expected 0x%lx\n",
1820 mode = pGetThreadErrorMode();
1821 ok(
mode == 0,
"GetThreadErrorMode returned mode 0x%lx, expected 0\n",
mode);
1822 rtlmode = pRtlGetThreadErrorMode();
1824 "RtlGetThreadErrorMode returned mode 0x%lx, expected 0\n",
mode);
1827 ok(
ret,
"SetThreadErrorMode failed\n");
1829 "SetThreadErrorMode returned old mode 0x%lx, expected 0\n",
mode);
1830 mode = pGetThreadErrorMode();
1832 "GetThreadErrorMode returned mode 0x%lx, expected SEM_FAILCRITICALERRORS\n",
1834 rtlmode = pRtlGetThreadErrorMode();
1836 "RtlGetThreadErrorMode returned mode 0x%lx, expected 0x10\n",
mode);
1839 ok(
ret,
"SetThreadErrorMode failed\n");
1841 "SetThreadErrorMode returned old mode 0x%lx, expected SEM_FAILCRITICALERRORS\n",
1843 mode = pGetThreadErrorMode();
1845 "GetThreadErrorMode returned mode 0x%lx, expected SEM_NOGPFAULTERRORBOX\n",
1847 rtlmode = pRtlGetThreadErrorMode();
1849 "RtlGetThreadErrorMode returned mode 0x%lx, expected 0x20\n",
mode);
1852 ok(
ret,
"SetThreadErrorMode failed\n");
1853 mode = pGetThreadErrorMode();
1855 "GetThreadErrorMode returned mode 0x%lx, expected SEM_NOOPENFILEERRORBOX\n",
1857 rtlmode = pRtlGetThreadErrorMode();
1859 "RtlGetThreadErrorMode returned mode 0x%lx, expected 0x40\n", rtlmode);
1869 "SetThreadErrorMode(0x%lx,NULL) failed with error %ld\n",
1876 "SetThreadErrorMode(0x%lx,NULL) succeeded, expected failure\n",
1879 "SetThreadErrorMode(0x%lx,NULL) failed with %ld, "
1880 "expected ERROR_INVALID_PARAMETER\n",
1885 pSetThreadErrorMode(oldmode,
NULL);
1898 extern NTSTATUS (*__os_arm64x_get_x64_information)(
ULONG,
void*,
void*);
1899 unsigned int cw,
sse;
1900 __os_arm64x_get_x64_information( 0, &
sse,
NULL );
1901 __os_arm64x_get_x64_information( 2, &cw,
NULL );
1903#elif defined(__i386__) || defined(__x86_64__)
1905 unsigned int sse = 0;
1907#if defined(__REACTOS__) && defined (__x86_64__)
1908 extern void get_fpu_cw_raw(
WORD *cw,
unsigned int *
sse);
1909 get_fpu_cw_raw(&cw, &
sse);
1911 __asm { fnstcw [cw] }
1912 __asm { stmxcsr [
sse] }
1915 __asm__ volatile (
"fnstcw %0" :
"=m" (cw));
1916 __asm__ volatile (
"stmxcsr %0" :
"=m" (
sse));
1919#elif defined(__aarch64__)
1921 __asm__ __volatile__(
"mrs %0, fpcr" :
"=r" (cw) );
1932#if defined(__i386__)
1935 __asm { stmxcsr [
sse] }
1937 __asm { ldmxcsr [
sse] }
1939 __asm__ volatile (
"stmxcsr %0" :
"=m" (
sse));
1941 __asm__ volatile (
"ldmxcsr %0" : :
"m" (
sse));
1971 ok(!!
ctx.finished,
"Failed to create event, last error %#lx.\n",
GetLastError());
1989 static const struct {
1990 unsigned int cw;
unsigned long fpu_cw;
unsigned long fpu_cw_broken;
2002#elif defined(__x86_64__)
2011#elif defined(__aarch64__)
2021 { 0xdeadbeef, 0xdeadbeef }
2024 unsigned int initial_cw, cw;
2025 unsigned long fpu_cw;
2029 ok(initial_cw == expected_cw[0].cw,
"expected %#x got %#x\n", expected_cw[0].cw, initial_cw);
2030 ok(fpu_cw == expected_cw[0].fpu_cw,
"expected %#lx got %#lx\n", expected_cw[0].fpu_cw, fpu_cw);
2033 ok(cw == expected_cw[1].cw,
"expected %#x got %#x\n", expected_cw[1].cw, cw);
2034 ok(fpu_cw == expected_cw[1].fpu_cw,
"expected %#lx got %#lx\n", expected_cw[1].fpu_cw, fpu_cw);
2039 ok(cw == expected_cw[2].cw,
"expected %#x got %#x\n", expected_cw[2].cw, cw);
2040 ok(fpu_cw == expected_cw[2].fpu_cw ||
2041 broken(expected_cw[2].fpu_cw_broken && fpu_cw == expected_cw[2].fpu_cw_broken),
2042 "expected %#lx got %#lx\n", expected_cw[2].fpu_cw, fpu_cw);
2045 ok(cw == expected_cw[3].cw,
"expected %#x got %#x\n", expected_cw[3].cw, cw);
2046 ok(fpu_cw == expected_cw[3].fpu_cw,
"expected %#lx got %#lx\n", expected_cw[3].fpu_cw, fpu_cw);
2050 ok(cw == expected_cw[4].cw,
"expected %#x got %#x\n", expected_cw[4].cw, cw);
2051 ok(fpu_cw == expected_cw[4].fpu_cw ||
2052 broken(expected_cw[4].fpu_cw_broken && fpu_cw == expected_cw[4].fpu_cw_broken),
2053 "expected %#lx got %#lx\n", expected_cw[4].fpu_cw, fpu_cw);
2058 ok(cw == expected_cw[5].cw,
"expected %#x got %#x\n", expected_cw[5].cw, cw);
2059 ok(fpu_cw == expected_cw[5].fpu_cw,
"expected %#lx got %#lx\n", expected_cw[5].fpu_cw, fpu_cw);
2064 ok(cw == expected_cw[6].cw,
"expected %#x got %#x\n", expected_cw[6].cw, cw);
2065 ok(fpu_cw == expected_cw[6].fpu_cw,
"expected %#lx got %#lx\n", expected_cw[6].fpu_cw, fpu_cw);
2069 ok(cw == expected_cw[7].cw,
"expected %#x got %#x\n", expected_cw[6].cw, cw);
2070 ok(fpu_cw == expected_cw[7].fpu_cw,
"expected %#lx got %#lx\n", expected_cw[6].fpu_cw, fpu_cw);
2075"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
2076"<assemblyIdentity version=\"1.2.3.4\" name=\"testdep1\" type=\"win32\" processorArchitecture=\"" ARCH "\"/>"
2077" <file name=\"testdep.dll\" />"
2081"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
2082"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\" />"
2084" <dependentAssembly>"
2085" <assemblyIdentity type=\"win32\" name=\"testdep1\" version=\"1.2.3.4\" processorArchitecture=\"" ARCH "\" />"
2086" </dependentAssembly>"
2111 actctx.cbSize =
sizeof(ACTCTXW);
2120 ok(
actctx.wProcessorArchitecture == 0,
"wProcessorArchitecture=%d\n",
actctx.wProcessorArchitecture);
2122 ok(
actctx.lpAssemblyDirectory ==
NULL,
"lpAssemblyDirectory=%p\n",
actctx.lpAssemblyDirectory);
2124 ok(
actctx.lpApplicationName ==
NULL,
"lpApplicationName=%p\n",
actctx.lpApplicationName);
2145 handle = (
void*)0xdeadbeef;
2151 param.thread_context = (
void*)0xdeadbeef;
2158 ok(
param.thread_context ==
NULL,
"got wrong thread context %p\n",
param.thread_context);
2167 ok(
handle != 0,
"no active context\n");
2174 param.thread_context = (
void*)0xdeadbeef;
2185 param.thread_context = (
void*)0xdeadbeef;
2215 if (!pCreateThreadpool) {
2216 win_skip(
"thread pool apis not supported.\n");
2222 pSubmitThreadpoolWork(work);
2223 pWaitForThreadpoolWorkCallbacks(work,
FALSE);
2224 pCloseThreadpoolWork(work);
2226 ok (workcalled == 1,
"expected work to be called once, got %d\n", workcalled);
2229 ok (
pool !=
NULL,
"CreateThreadpool failed\n");
2230 pCloseThreadpool(
pool);
2240 if(!pIsWow64Process) {
2241 win_skip(
"Skipping reserved TLS slot on too old Windows.\n");
2246 ok(!
val,
"TlsGetValue(0) = %p\n",
val);
2254 ok(!
val,
"TlsGetValue(0) = %p\n",
val);
2266 ok(
val == (
void*)1,
"TlsGetValue(0) = %p\n",
val);
2273 static const ULONG info_size[] =
2300 win_skip(
"OpenThread is not available on this platform\n");
2304 if (!pNtQueryInformationThread)
2306 win_skip(
"NtQueryInformationThread is not available on this platform\n");
2313 win_skip(
"THREAD_QUERY_LIMITED_INFORMATION is not supported on this platform\n");
2353 "for info %lu expected STATUS_SUCCESS, got %08lx (ret_len %lu)\n",
i,
status,
ret_len);
2406 PVOID vectored_handler;
2409 if (!pGetThreadDescription)
2411 win_skip(
"Thread description API is not supported.\n");
2428 ok(
len ==
sizeof(*thread_desc),
"Unexpected structure length %lu.\n",
len);
2435 ok(!
status,
"Failed to get thread info, status %#lx.\n",
status);
2436 ok(len2 ==
sizeof(*thread_desc),
"Unexpected structure length %lu.\n",
len);
2439 "Unexpected description string pointer %p, %p.\n", thread_desc->
ThreadName.
Buffer, thread_desc);
2456 ok(
len ==
sizeof(*thread_desc) + desc_len,
"Unexpected structure length %lu.\n",
len);
2460 ok(!
status,
"Failed to get thread info.\n");
2461 ok(
len ==
sizeof(*thread_desc) + desc_len,
"Unexpected structure length %lu.\n",
len);
2466 "Unexpected description string pointer %p, %p.\n", thread_desc->
ThreadName.
Buffer, thread_desc);
2473 ok(
len ==
sizeof(*thread_desc) + desc_len,
"Unexpected structure length %lu.\n",
len);
2477 ok(
len ==
sizeof(*thread_desc) + desc_len,
"Unexpected structure length %lu.\n",
len);
2531 memset(thread_desc, 0,
sizeof(*thread_desc));
2533 ok(!
status,
"Failed to set thread description, status %#lx.\n",
status);
2553 ok(
len ==
sizeof(*thread_desc),
"Unexpected structure length %lu.\n",
len);
2576 ok(vectored_handler != 0,
"RtlAddVectoredExceptionHandler failed\n");
2578 info.dwType = 0x1000;
2579 info.szName =
"123";
2580 info.dwThreadID = -1;
2584 pRtlRemoveVectoredExceptionHandler(vectored_handler);
2601#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f)
2632#define X(f) p##f = (void*)GetProcAddress(ntdll, #f)
2671 "Thread did not exit in time\n");
2693 test_SetThreadContext();
2694 test_GetThreadSelectorEntry();
2695 test_GetThreadContext();
#define InterlockedIncrement
#define InterlockedDecrement
#define STATUS_NOT_IMPLEMENTED
static HINSTANCE instance
#define ERROR_INVALID_ADDRESS
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
struct _THREAD_BASIC_INFORMATION THREAD_BASIC_INFORMATION
#define INVALID_HANDLE_VALUE
@ ThreadDescriptorTableEntry
#define GetCurrentProcess()
#define ERROR_NO_MORE_ITEMS
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
static void cleanup(void)
VOID WINAPI ReleaseActCtx(IN HANDLE hActCtx)
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
BOOL WINAPI GetCurrentActCtx(OUT PHANDLE phActCtx)
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
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)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
BOOL WINAPI GetProcessAffinityMask(IN HANDLE hProcess, OUT PDWORD_PTR lpProcessAffinityMask, OUT PDWORD_PTR lpSystemAffinityMask)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
LPVOID WINAPI TlsGetValue(IN DWORD Index)
DWORD WINAPI ResumeThread(IN HANDLE hThread)
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
HANDLE WINAPI CreateRemoteThread(IN HANDLE hProcess, IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
DWORD_PTR WINAPI SetThreadAffinityMask(IN HANDLE hThread, IN DWORD_PTR dwThreadAffinityMask)
BOOL WINAPI SetThreadContext(IN HANDLE hThread, IN CONST CONTEXT *lpContext)
DWORD WINAPI SuspendThread(IN HANDLE hThread)
BOOL NTAPI GetThreadTimes(IN HANDLE hThread, OUT LPFILETIME lpCreationTime, OUT LPFILETIME lpExitTime, OUT LPFILETIME lpKernelTime, OUT LPFILETIME lpUserTime)
VOID WINAPI ExitThread(IN DWORD uExitCode)
HANDLE WINAPI OpenThread(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwThreadId)
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
BOOL WINAPI GetThreadSelectorEntry(IN HANDLE hThread, IN DWORD dwSelector, OUT LPLDT_ENTRY lpSelectorEntry)
DWORD WINAPI SetThreadIdealProcessor(IN HANDLE hThread, IN DWORD dwIdealProcessor)
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)
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
BOOL WINAPI TlsFree(IN DWORD Index)
BOOL WINAPI SetThreadStackGuarantee(IN OUT PULONG StackSizeInBytes)
BOOL WINAPI GetThreadPriorityBoost(IN HANDLE hThread, OUT PBOOL pDisablePriorityBoost)
BOOL NTAPI SetThreadPriorityBoost(IN HANDLE hThread, IN BOOL bDisablePriorityBoost)
int WINAPI GetThreadPriority(IN HANDLE hThread)
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
BOOL WINAPI GetThreadContext(IN HANDLE hThread, OUT LPCONTEXT lpContext)
HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
BOOL WINAPI DECLSPEC_HOTPATCH GetThreadGroupAffinity(HANDLE thread, GROUP_AFFINITY *affinity)
PTP_POOL WINAPI DECLSPEC_HOTPATCH CreateThreadpool(void *reserved)
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
void WINAPI DECLSPEC_HOTPATCH GetCurrentThreadStackLimits(ULONG_PTR *low, ULONG_PTR *high)
DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc(PFLS_CALLBACK_FUNCTION callback)
DWORD WINAPI DECLSPEC_HOTPATCH GetThreadErrorMode(void)
BOOL WINAPI DECLSPEC_HOTPATCH FlsSetValue(DWORD index, PVOID data)
HRESULT WINAPI DECLSPEC_HOTPATCH GetThreadDescription(HANDLE thread, WCHAR **description)
HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription(HANDLE thread, PCWSTR description)
BOOL WINAPI SetThreadErrorMode(DWORD mode, DWORD *old)
PTP_WORK WINAPI DECLSPEC_HOTPATCH CreateThreadpoolWork(PTP_WORK_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
BOOL WINAPI DECLSPEC_HOTPATCH SetThreadGroupAffinity(HANDLE thread, const GROUP_AFFINITY *new, GROUP_AFFINITY *old)
PVOID WINAPI DECLSPEC_HOTPATCH FlsGetValue(DWORD index)
BOOL WINAPI DECLSPEC_HOTPATCH FlsFree(DWORD index)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP unsigned int __cdecl _statusfp(void)
_ACRTIMP unsigned int __cdecl _clearfp(void)
_ACRTIMP unsigned int __cdecl _control87(unsigned int, unsigned int)
_ACRTIMP int __cdecl _isnan(double)
_ACRTIMP double __cdecl acos(double)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static unsigned char buff[32768]
#define MAXIMUM_PROCESSORS
#define STATUS_ACCESS_VIOLATION
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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 * u
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 GLint GLint j
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define THREAD_QUERY_INFORMATION
#define EXCEPTION_CONTINUE_SEARCH
#define EXCEPTION_CONTINUE_EXECUTION
NTSYSAPI ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID)
NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void)
struct _THREAD_DESCRIPTOR_INFORMATION THREAD_DESCRIPTOR_INFORMATION
NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG, PVECTORED_EXCEPTION_HANDLER)
#define THREAD_SUSPEND_RESUME
int WINAPI lstrlenA(LPCSTR lpString)
_In_ BOOL _In_ HANDLE hProcess
#define todo_wine_if(is_todo)
PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE
#define THREAD_QUERY_LIMITED_INFORMATION
#define THREAD_SET_LIMITED_INFORMATION
static void test_create(void)
D3D11_SHADER_VARIABLE_DESC desc
static PROCESS_INFORMATION pi
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
static HANDLE ULONG_PTR DWORD threads
static const char * LS_SetValueFuncName
static DWORD WINAPI threadFunc1(LPVOID p)
static const char * LS_AllocFuncName
static DWORD CALLBACK work_function(void *p)
static VOID test_GetThreadTimes(void)
static WAITORTIMERCALLBACK
static unsigned int get_thread_fpu_cw(unsigned long *fpu_cw)
static void test_thread_actctx(void)
static VOID test_CreateThread_stack(void)
static void test_threadpool(void)
static VOID test_SuspendThread(void)
static const char manifest_dep[]
static void create_function_addr_events(HANDLE events[2])
static DWORD WINAPI threadFunc3(LPVOID p)
static const char * LS_FreeFuncName
static void CALLBACK wait_complete_function(PVOID p, BOOLEAN TimerOrWaitFired)
static void cleanup_thread_sync_helpers(void)
static void CALLBACK timeout_function(PVOID p, BOOLEAN TimerOrWaitFired)
static const WCHAR *static WCHAR **static PVECTORED_EXCEPTION_HANDLER
static DWORD WINAPI LS_InheritanceProc(LPVOID p)
static unsigned long get_fpu_cw(void)
static VOID test_CreateThread_basic(void)
static DWORD WINAPI threadFunc_SetEvent(LPVOID p)
static VOID test_CreateThread_suspended(void)
static void test_RegisterWaitForSingleObject(void)
static void create_manifest_file(const char *filename, const char *manifest)
static HANDLE finish_event
static void test_SetThreadStackGuarantee(void)
static DWORD WINAPI threadFunc_CloseHandle(LPVOID p)
static HANDLE create_target_process(const char *arg)
#define THREAD_ALL_ACCESS_NT4
static void fpu_invalid_operation(void)
static VOID test_thread_processor(void)
static VOID test_thread_priority(void)
static VOID test_CreateRemoteThread(void)
static DWORD WINAPI threadFunc4(LPVOID p)
static void test_reserved_tls(void)
static void WINAPI threadpool_workcallback(PTP_CALLBACK_INSTANCE instance, void *context, PTP_WORK work)
static void CALLBACK signaled_function(PVOID p, BOOLEAN TimerOrWaitFired)
static void test_thread_description(void)
struct tagTHREADNAME_INFO THREADNAME_INFO
static VOID test_GetCurrentThreadStackLimits(void)
static DWORD WINAPI threadFunc2(LPVOID p)
static DWORD WINAPI thread_actctx_func(void *p)
static void resync_after_run(void)
static GROUP_AFFINITY *static const GROUP_AFFINITY GROUP_AFFINITY *static LPCVOID
static void test_FLS(void)
static DWORD WINAPI fpu_thread(void *param)
static void run_LS_tests(void)
static HANDLE start_event
static LONG CALLBACK msvc_threadname_vec_handler(EXCEPTION_POINTERS *ExceptionInfo)
static void test_thread_fpu_cw(void)
static DWORD WINAPI LS_ThreadProc(LPVOID p)
static VOID test_TerminateThread(void)
static BOOL sync_threads_and_run_one(DWORD sync_id, DWORD my_id)
static void init_funcs(void)
static void test_QueueUserWorkItem(void)
static DWORD WINAPI FLS_AllocFuncThunk(void)
static void CALLBACK unregister_function(PVOID p, BOOLEAN TimerOrWaitFired)
static PTP_CALLBACK_ENVIRON
static void init_thread_sync_helpers(void)
static void CALLBACK waitthread_test_function(PVOID p, BOOLEAN TimerOrWaitFired)
static void test_TLS(void)
static LONG times_executed
static void test_thread_info(void)
static void test_ThreadErrorMode(void)
static const char * LS_GetValueFuncName
static VOID test_GetThreadExitCode(void)
static DWORD LS_OutOfIndexesValue
static const char manifest_main[]
static HANDLE complete_event
#define SEM_FAILCRITICALERRORS
#define SEM_NOGPFAULTERRORBOX
#define SEM_NOOPENFILEERRORBOX
#define CONTEXT_DEBUG_REGISTERS
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define THREAD_SET_INFORMATION
NTSTATUS NTAPI NtQueryInformationThread(_In_ HANDLE ThreadHandle, _In_ THREADINFOCLASS ThreadInformationClass, _Out_writes_bytes_to_opt_(ThreadInformationLength, *ReturnLength) PVOID ThreadInformation, _In_ ULONG ThreadInformationLength, _Out_opt_ PULONG ReturnLength)
NTSTATUS NTAPI NtSetInformationThread(_In_ HANDLE ThreadHandle, _In_ THREADINFOCLASS ThreadInformationClass, _In_reads_bytes_(ThreadInformationLength) PVOID ThreadInformation, _In_ ULONG ThreadInformationLength)
#define STATUS_INVALID_INFO_CLASS
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
int winetest_get_mainargs(char ***pargv)
#define STATUS_BUFFER_TOO_SMALL
PEXCEPTION_RECORD ExceptionRecord
DWORD dwNumberOfProcessors
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
BOOL WINAPI RegisterWaitForSingleObject(OUT PHANDLE phNewWaitObject, IN HANDLE hObject, IN WAITORTIMERCALLBACK Callback, IN PVOID Context, IN ULONG dwMilliseconds, IN ULONG dwFlags)
BOOL WINAPI UnregisterWait(IN HANDLE WaitHandle)
__inline int before(__u32 seq1, __u32 seq2)
__inline int after(__u32 seq1, __u32 seq2)
WINBASEAPI VOID WINAPI CloseThreadpoolWork(_Inout_ PTP_WORK pwk)
WINBASEAPI VOID WINAPI WaitForThreadpoolWorkCallbacks(_Inout_ PTP_WORK pwk, _In_ BOOL fCancelPendingCallbacks)
WINBASEAPI VOID WINAPI SubmitThreadpoolWork(_Inout_ PTP_WORK pwk)
WINBASEAPI VOID WINAPI CloseThreadpool(_Inout_ PTP_POOL ptpp)
union _LARGE_INTEGER LARGE_INTEGER
#define STATUS_ACCESS_DENIED
#define STATUS_UNSUCCESSFUL
#define STATUS_INFO_LENGTH_MISMATCH
static const CHAR manifest[]
DWORD WINAPI GetLastError(void)
HANDLE WINAPI GetCurrentThread(void)
#define FLS_OUT_OF_INDEXES
DWORD WINAPI GetCurrentThreadId(void)
VOID(WINAPI * PFLS_CALLBACK_FUNCTION)(PVOID)
#define TLS_OUT_OF_INDEXES
#define THREAD_PRIORITY_TIME_CRITICAL
#define THREAD_PRIORITY_ERROR_RETURN
#define THREAD_PRIORITY_NORMAL
#define THREAD_PRIORITY_IDLE
#define HRESULT_FROM_NT(x)
#define ERROR_INVALID_PRIORITY
#define ERROR_INVALID_THREAD_ID
#define ERROR_GEN_FAILURE
struct _TP_CALLBACK_INSTANCE * PTP_CALLBACK_INSTANCE
#define WT_EXECUTEONLYONCE
struct _TP_WORK * PTP_WORK
#define WT_EXECUTEINWAITTHREAD
VOID(NTAPI * PTP_WORK_CALLBACK)(_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Context, _Inout_ PTP_WORK Work)
struct _TP_POOL * PTP_POOL
#define WT_EXECUTEDEFAULT
#define DUPLICATE_SAME_ACCESS