29#define WIN32_NO_STATUS
43#define PROCESS_ALL_ACCESS_NT4 (PROCESS_ALL_ACCESS & ~0xf000)
45#define THREAD_ALL_ACCESS_NT4 (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3ff)
47#define expect_eq_d(expected, actual) \
49 int value = (actual); \
50 ok((expected) == value, "Expected " #actual " to be %d (" #expected ") is %d\n", \
53#define expect_eq_s(expected, actual) \
55 LPCSTR value = (actual); \
56 ok(lstrcmpA((expected), value) == 0, "Expected " #actual " to be L\"%s\" (" #expected ") is L\"%s\"\n", \
59#define expect_eq_ws_i(expected, actual) \
61 LPCWSTR value = (actual); \
62 ok(lstrcmpiW((expected), value) == 0, "Expected " #actual " to be L\"%s\" (" #expected ") is L\"%s\"\n", \
63 wine_dbgstr_w(expected), wine_dbgstr_w(value)); \
112#define MAX_LISTED_ENV_VAR 128
167 if (
c >=
'0' &&
c <=
'9')
return c -
'0';
168 if (
c >=
'a' &&
c <=
'f')
return c -
'a' + 10;
312 char *ptrA, *ptrA_save;
313 WCHAR *ptrW, *ptrW_save;
326 "[StartupInfoA]\ncb=%08u\nlpDesktop=%s\nlpTitle=%s\n"
327 "dwX=%u\ndwY=%u\ndwXSize=%u\ndwYSize=%u\n"
328 "dwXCountChars=%u\ndwYCountChars=%u\ndwFillAttribute=%u\n"
329 "dwFlags=%u\nwShowWindow=%u\n"
330 "hStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n",
338 childPrintf(
hFile,
"[TEB]\nhStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n",
345 memset(&siW, 0,
sizeof(siW));
348 "[StartupInfoW]\ncb=%08u\nlpDesktop=%s\nlpTitle=%s\n"
349 "dwX=%u\ndwY=%u\ndwXSize=%u\ndwYSize=%u\n"
350 "dwXCountChars=%u\ndwYCountChars=%u\ndwFillAttribute=%u\n"
351 "dwFlags=%u\nwShowWindow=%u\n"
352 "hStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n",
360 childPrintf(
hFile,
"[Arguments]\nargcA=%d\n",
myARGC);
371 memset(&pe, 0,
sizeof(pe));
376 if (!pProcess32Next(
snapshot, &pe))
break;
381 "[Toolhelp]\ncntUsage=%u\nth32DefaultHeapID=%lu\n"
382 "th32ModuleID=%u\ncntThreads=%u\nth32ParentProcessID=%u\n"
383 "pcPriClassBase=%u\ndwFlags=%u\nszExeFile=%s\n\n",
394 childPrintf(
hFile,
"[EnvironmentA]\n");
403 childPrintf(
hFile,
"len=%d\n\n",
i);
413 childPrintf(
hFile,
"[EnvironmentW]\n");
423 childPrintf(
hFile,
"len=%d\n\n",
i);
427 childPrintf(
hFile,
"[Misc]\n");
432 childPrintf(
hFile,
"\n");
439 DWORD modeIn, modeOut;
441 childPrintf(
hFile,
"[Console]\n");
444 childPrintf(
hFile,
"SizeX=%d\nSizeY=%d\nCursorX=%d\nCursorY=%d\nAttributes=%d\n",
446 childPrintf(
hFile,
"winLeft=%d\nwinTop=%d\nwinRight=%d\nwinBottom=%d\n",
448 childPrintf(
hFile,
"maxWinWidth=%d\nmaxWinHeight=%d\n",
451 childPrintf(
hFile,
"InputCP=%d\nOutputCP=%d\n",
454 childPrintf(
hFile,
"InputMode=%u\n", modeIn);
456 childPrintf(
hFile,
"OutputMode=%u\n", modeOut);
463 win_skip(
"Setting the codepage is not implemented\n");
467 ok(
ret,
"Setting CP\n");
498 childPrintf(
hFile,
"[ExitCode]\nvalue=%d\n\n", 123);
512 if (
buf[0] ==
'\0' || (
buf[0] ==
'-' &&
buf[1] ==
'\0'))
return NULL;
524 if (
buf[0] ==
'\0' || (
buf[0] ==
'-' &&
buf[1] ==
'\0'))
return NULL;
538 while (c1 == c2 && c1)
540 c1 = *p1++; c2 = *p2++;
551 if (!
s1 && !
s2)
return 0;
558 const char *
expect,
int sensitive )
566 const char *
expect,
int sensitive )
597#define okChildString(sect, key, expect) ok_child_string(__LINE__, (sect), (key), (expect), 1 )
598#define okChildIString(sect, key, expect) ok_child_string(__LINE__, (sect), (key), (expect), 0 )
599#define okChildStringWA(sect, key, expect) ok_child_stringWA(__LINE__, (sect), (key), (expect), 1 )
600#define okChildInt(sect, key, expect) ok_child_int(__LINE__, (sect), (key), (expect))
608 static CHAR title[] =
"I'm the title string",
609 desktop[] =
"winsta0\\default",
620 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
650 startup.dwXCountChars = 0x12121212;
651 startup.dwYCountChars = 0x23232323;
656 startup.dwFillAttribute = 0xA55A;
660 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
690 startup.dwXCountChars = 0x12121212;
691 startup.dwYCountChars = 0x23232323;
696 startup.dwFillAttribute = 0xA55A;
700 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
730 startup.dwXCountChars = 0x12121212;
731 startup.dwYCountChars = 0x23232323;
736 startup.dwFillAttribute = 0xA55A;
740 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
770 startup.dwXCountChars = 0x12121212;
771 startup.dwYCountChars = 0x23232323;
776 startup.dwFillAttribute = 0xA55A;
780 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
812 startup.dwXCountChars = 0x12121212;
813 startup.dwYCountChars = 0x23232323;
818 startup.dwFillAttribute = 0xA55A;
822 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
852 startup.dwXCountChars = 0x12121212;
853 startup.dwYCountChars = 0x23232323;
858 startup.dwFillAttribute = 0xA55A;
862 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
904 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
913 okChildString(
"Arguments",
"argvA4",
"C:\\Program Files\\my nice app.exe");
927 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
1011 sprintf(buffer2,
"dummy tests/process.c dump \"%s\" \"a\\\"b\\\\\" c\\\" d",
resfile);
1033 ok(!
ret,
"CreateProcessA unexpectedly succeeded\n");
1035 "Expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
1043 ok(!
ret,
"CreateProcessA unexpectedly succeeded\n");
1047 "Expected ERROR_PATH_NOT_FOUND, got %d\n",
GetLastError());
1054 ok(!
ret,
"CreateProcessA unexpectedly succeeded\n");
1058 "Expected ERROR_PATH_NOT_FOUND, got %d\n",
GetLastError());
1063 ok(!
ret,
"CreateProcessA unexpectedly succeeded\n");
1068 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
1071 strcpy(buffer2,
"does not exist.exe");
1076 ok(!
ret,
"CreateProcessA unexpectedly succeeded\n");
1081 ok(!
ret,
"CreateProcessA unexpectedly succeeded\n");
1087 ok(!
ret,
"CreateProcessA unexpectedly succeeded\n");
1092 ok(!
ret,
"CreateProcessA unexpectedly succeeded\n");
1113 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL, windir, &
startup, &
info),
"CreateProcess\n");
1126 ok(
CreateProcessA(
NULL,
cmdline,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
1135 NULL,
"non\\existent\\directory", &
startup, &
info),
"CreateProcess\n");
1151#if defined(__REACTOS__) && defined(_M_AMD64)
1154 skip(
"ROSTESTS-372: Skipping test in kernel32_winetest:process test_Toolhelp because it leaves a process behind on Windows Server 2003 x64-Testbot. Set winetest_interactive to run it anyway.\n");
1166 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess failed\n");
1173 okChildInt(
"Toolhelp",
"th32DefaultHeapID", 0);
1182#if defined(__REACTOS__) && defined(_M_AMD64)
1185 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");
1193 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess failed\n");
1202#if defined(__REACTOS__) && defined(_M_AMD64)
1206 for (
i = 0;
i < 20;
i++)
1216 ok(
i < 20 ||
broken(
i == 20),
"process object not released\n");
1220 memset(&pe, 0,
sizeof(pe));
1222 if (pProcess32First(
snapshot, &pe))
1225 if (!pProcess32Next(
snapshot, &pe))
break;
1235 memset(&te, 0,
sizeof(te));
1240 if (!pThread32Next(
snapshot, &te))
break;
1248 ok(
ret == 1,
"expected 1, got %u\n",
ret);
1256 okChildInt(
"Toolhelp",
"th32DefaultHeapID", 0);
1268 return str[0] ==
'=' &&
str[1] >=
'A' &&
str[1] <=
'Z' &&
str[2] ==
':' &&
1286 if ((ptrA = gesA) !=
NULL)
1290 for (
i = 0;
i < clen;
i++)
1298 ok(found,
"Parent-env string %s isn't in child process\n", ptrA);
1300 ptrA +=
strlen(ptrA) + 1;
1305 for (
i = 0;
i < clen;
i++)
1309 if ((ptrA = gesA) !=
NULL)
1315 ptrA +=
strlen(ptrA) + 1;
1317 if (!*ptrA) ptrA =
NULL;
1322 found = ptrA !=
NULL;
1323 ok(found,
"Child-env string %s isn't in parent process\n",
res);
1349 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
1374 child_env_len += slen;
1378 child_env_len += 256;
1382 sprintf(
ptr,
"=%c:=%s",
'C',
"C:\\FOO\\BAR");
1384 strcpy(
ptr,
"PATH=C:\\WINDOWS;C:\\WINDOWS\\SYSTEM;C:\\MY\\OWN\\DIR");
1395 for (ptr2 =
env; *ptr2; ptr2 +=
strlen(ptr2) + 1)
1397 if (
strncmp(ptr2,
"PATH=", 5) != 0 &&
1398 strncmp(ptr2,
"WINELOADER=", 11) != 0 &&
1406 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0
L, child_env,
NULL, &
startup, &
info),
"CreateProcess\n");
1436 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE,
CREATE_SUSPENDED,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
1471 void *processbase =
NULL;
1486 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE,
DEBUG_PROCESS,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
1504 ok(dbg,
"I have seen a debug event\n");
1542 DWORD modeIn, modeOut, modeInC, modeOutC;
1543 DWORD cpIn, cpOut, cpInC, cpOutC;
1545 HANDLE hChildIn, hChildInInh, hChildOut, hChildOutInh, hParentIn, hParentOut;
1546 const char*
msg =
"This is a std-handle inheritance test.";
1556 sa.nLength =
sizeof(
sa);
1557 sa.lpSecurityDescriptor =
NULL;
1558 sa.bInheritHandle =
TRUE;
1584 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
TRUE, 0,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
1607 "GetLastError: expecting %u got %u\n",
1617 "GetLastError: expecting %u got %u\n",
1658 okChildInt(
"Console",
"OutputMode", modeOut);
1662 ok(cpInC == 1252,
"Wrong console CP (expected 1252 got %d/%d)\n", cpInC, cpIn);
1663 ok(cpOutC == 1252,
"Wrong console-SB CP (expected 1252 got %d/%d)\n", cpOutC, cpOut);
1666 win_skip(
"Setting the codepage is not implemented\n");
1668 ok(modeInC == (modeIn ^ 1),
"Wrong console mode\n");
1669 ok(modeOutC == (modeOut ^ 1),
"Wrong console-SB mode\n");
1676 ok(
CreatePipe(&hParentIn, &hChildOut,
NULL, 0),
"Creating parent-input pipe\n");
1679 "Duplicating as inheritable child-output pipe\n");
1682 ok(
CreatePipe(&hChildIn, &hParentOut,
NULL, 0),
"Creating parent-output pipe\n");
1685 "Duplicating as inheritable child-input pipe\n");
1692 startup.hStdInput = hChildInInh;
1693 startup.hStdOutput = hChildOutInh;
1694 startup.hStdError = hChildOutInh;
1698 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
TRUE,
DETACHED_PROCESS,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
1704 ok(
w == msg_len,
"Should have written %u bytes, actually wrote %u\n", msg_len,
w);
1738 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE, 0,
NULL,
NULL, &
startup, &
info),
"CreateProcess\n");
1761 if ((!pVirtualAllocEx) || (!pVirtualFreeEx)) {
1762 win_skip(
"VirtualAllocEx not found\n");
1772 ok(!addr1,
"VirtualAllocEx should fail\n");
1776 win_skip(
"VirtualAllocEx not implemented\n");
1798 "VirtualQueryEx without PROCESS_QUERY_INFORMATION rights should fail\n");
1805 "ReadProcessMemory without PROCESS_VM_READ rights should fail\n");
1817 ok(
info.BaseAddress == addr1,
"%p != %p\n",
info.BaseAddress, addr1);
1818 ok(
info.AllocationBase == addr1,
"%p != %p\n",
info.AllocationBase, addr1);
1820 ok(
info.RegionSize == 0x10000,
"%lx != 0x10000\n",
info.RegionSize);
1825 "%x != PAGE_NOACCESS\n",
info.Protect);
1830 "VirtualFreeEx without PROCESS_VM_OPERATION rights should fail\n");
1844 ok(
info.BaseAddress == addr1,
"%p != %p\n",
info.BaseAddress, addr1);
1845 ok(
info.AllocationBase == addr1,
"%p != %p\n",
info.AllocationBase, addr1);
1847 ok(
info.RegionSize == 0x10000,
"%lx != 0x10000\n",
info.RegionSize);
1849 ok(
info.Protect == 0,
"%x != PAGE_NOACCESS\n",
info.Protect);
1857 "VirtualFreeEx without PROCESS_VM_OPERATION rights should fail\n");
1868 static char cmdline[] =
"winver.exe";
1881 memset(&si, 0,
sizeof(si));
1905 static const char harddisk[] =
"\\Device\\HarddiskVolume";
1907 if (!pK32GetProcessImageFileNameA)
1909 win_skip(
"K32GetProcessImageFileNameA is unavailable\n");
1917 "K32GetProcessImageFileNameA(no buffer): returned %u, le=%u\n", rc,
GetLastError());
1928 if (!pQueryFullProcessImageNameA)
1929 win_skip(
"QueryFullProcessImageNameA unavailable (added in Windows Vista)\n");
1944#define INIT_STR "Just some words"
1948 if (!pQueryFullProcessImageNameA)
1950 win_skip(
"QueryFullProcessImageNameA unavailable (added in Windows Vista)\n");
1963 ok((
buf[0] ==
'\\' &&
buf[1] ==
'\\') ||
2005 if (!pQueryFullProcessImageNameW)
2007 win_skip(
"QueryFullProcessImageNameW unavailable (added in Windows Vista)\n");
2062 ok(
buf[0] ==
'\\',
"NT path should begin with '\\'\n");
2096 "invalid current process handle %p\n",
handle );
2104 ok( !
ret,
"GetExitCodeProcess succeeded for %p\n",
handle );
2115 ok( !
ret,
"GetExitCodeProcess succeeded for %p\n",
handle );
2129 "wrong handle %p/%p\n", h2, h3 );
2139 static char cmdline[] =
"C:\\Program Files\\Internet Explorer\\iexplore.exe";
2140 static char cmdline_wow64[] =
"C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe";
2142 if (!pIsWow64Process)
2144 skip(
"IsWow64Process is not available\n");
2148 memset(&si, 0,
sizeof(si));
2155 trace(
"Created process %s\n", cmdline_wow64);
2158 ok(
ret,
"IsWow64Process failed.\n");
2162 ok(
ret,
"TerminateProcess error\n");
2168 memset(&si, 0,
sizeof(si));
2178 ok(
ret,
"IsWow64Process failed.\n");
2182 ok(
ret,
"TerminateProcess error\n");
2194 if (!pGetNativeSystemInfo)
2196 win_skip(
"GetNativeSystemInfo is not available\n");
2203 pGetNativeSystemInfo(&nsi);
2209 "Expected PROCESSOR_ARCHITECTURE_AMD64, got %d\n",
2210 S(
U(nsi)).wProcessorArchitecture);
2212 "Expected PROCESSOR_AMD_X8664, got %d\n",
2218 ok(
S(
U(si)).wProcessorArchitecture ==
S(
U(nsi)).wProcessorArchitecture,
2219 "Expected no difference for wProcessorArchitecture, got %d and %d\n",
2220 S(
U(si)).wProcessorArchitecture,
S(
U(nsi)).wProcessorArchitecture);
2222 "Expected no difference for dwProcessorType, got %d and %d\n",
2230 DWORD max_quota, used_quota;
2232 if (!pGetSystemRegistryQuota)
2234 win_skip(
"GetSystemRegistryQuota is not available\n");
2240 "Expected GetSystemRegistryQuota to return TRUE, got %d\n",
ret);
2242 ret = pGetSystemRegistryQuota(&max_quota,
NULL);
2244 "Expected GetSystemRegistryQuota to return TRUE, got %d\n",
ret);
2246 ret = pGetSystemRegistryQuota(
NULL, &used_quota);
2248 "Expected GetSystemRegistryQuota to return TRUE, got %d\n",
ret);
2250 ret = pGetSystemRegistryQuota(&max_quota, &used_quota);
2252 "Expected GetSystemRegistryQuota to return TRUE, got %d\n",
ret);
2257 static char cmdline[] =
"winver.exe";
2263 memset(&si, 0,
sizeof(si));
2331 ok(
f ==
out,
"f != out\n");
2339 ok(
f ==
out,
"f != out\n");
2349 ok(
f !=
out,
"f == out\n");
2370 ok(
f ==
out,
"f != out\n");
2377 skip(
"DuplicateHandle on console handle\n");
2389#define test_completion(a, b, c, d, e) _test_completion(__LINE__, a, b, c, d, e)
2402 ok_(__FILE__,
line)(
key == ekey,
"unexpected key %x\n",
key);
2408#define create_process(cmd, pi) _create_process(__LINE__, cmd, pi)
2421#define test_assigned_proc(job, ...) _test_assigned_proc(__LINE__, job, __VA_ARGS__)
2438 "Expected NumberOfAssignedProcesses to be %d (expected_count) is %d\n",
2442 "Expected NumberOfProcessIdsInList to be %d (expected_count) is %d\n",
2450 "Expected pid_list->ProcessIdList[%d] to be %x is %lx\n",
2457#define test_accounting(job, total_proc, active_proc, terminated_proc) _test_accounting(__LINE__, job, total_proc, active_proc, terminated_proc)
2464 memset(&basic_accounting, 0,
sizeof(basic_accounting));
2473 "Expected basic_accounting.TotalProcesses to be %d (total_proc) is %d\n",
2477 "Expected basic_accounting.ActiveProcesses to be %d (active_proc) is %d\n",
2480 "Expected basic_accounting.TotalTerminatedProcesses to be %d (terminated_proc) is %d\n",
2492 if (!pIsProcessInJob)
2494 win_skip(
"IsProcessInJob not available.\n");
2501 job2 = pCreateJobObjectW(
NULL,
NULL);
2509 ok(!
out,
"IsProcessInJob returned out=%u\n",
out);
2514 ret = pIsProcessInJob(
pi.hProcess, job2, &
out);
2516 ok(!
out,
"IsProcessInJob returned out=%u\n",
out);
2523 ok(!
out,
"IsProcessInJob returned out=%u\n",
out);
2525 ret = pAssignProcessToJobObject(
job,
pi.hProcess);
2531 ok(
out,
"IsProcessInJob returned out=%u\n",
out);
2536 ret = pIsProcessInJob(
pi.hProcess, job2, &
out);
2538 ok(!
out,
"IsProcessInJob returned out=%u\n",
out);
2545 ok(
out,
"IsProcessInJob returned out=%u\n",
out);
2550 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2555 ok(
out,
"IsProcessInJob returned out=%u\n",
out);
2579 ret = pAssignProcessToJobObject(
job,
pi.hProcess);
2584 ret = pTerminateJobObject(
job, 123);
2588 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2596 "wrong exitcode %u\n", dwret);
2605 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2608 ret = pAssignProcessToJobObject(
job,
pi.hProcess);
2609 ok(!
ret,
"AssignProcessToJobObject unexpectedly succeeded\n");
2639 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2655 ok(!
ret,
"QueryInformationJobObject expected failure\n");
2665 ok(!
ret,
"QueryInformationJobObject expected failure\n");
2682 win_skip(
"Number of assigned processes broken on Win 8\n");
2689 "QueryInformationJobObject returned ret_len=%u\n",
ret_len);
2704 sizeof(*basic_limit_info) - 1, &
ret_len);
2705 ok(!
ret,
"QueryInformationJobObject expected failure\n");
2709 memset(basic_limit_info, 0x11,
sizeof(*basic_limit_info));
2711 sizeof(*basic_limit_info), &
ret_len);
2713 ok(
ret_len ==
sizeof(*basic_limit_info),
"QueryInformationJobObject returned ret_len=%u\n",
ret_len);
2718 sizeof(ext_limit_info) - 1, &
ret_len);
2719 ok(!
ret,
"QueryInformationJobObject expected failure\n");
2723 memset(&ext_limit_info, 0x11,
sizeof(ext_limit_info));
2725 sizeof(ext_limit_info), &
ret_len);
2727 ok(
ret_len ==
sizeof(ext_limit_info),
"QueryInformationJobObject returned ret_len=%u\n",
ret_len);
2762 ret = pAssignProcessToJobObject(
job,
pi.hProcess);
2769 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2795 win_skip(
"Kill on job close limit not available\n");
2804 ret = pAssignProcessToJobObject(
job,
pi.hProcess);
2812 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2831 ok(dwret ==
WAIT_TIMEOUT,
"WaitForSingleObject returned %u\n", dwret);
2835 ret = pAssignProcessToJobObject(
job,
pi.hProcess);
2839 ok(dwret ==
WAIT_TIMEOUT,
"WaitForSingleObject returned %u\n", dwret);
2841 ret = pTerminateJobObject(
job, 123);
2846 "WaitForSingleObject returned %u\n", dwret);
2853 ok(0,
"HACK: Killing process to speed up the test\n");
2860 win_skip(
"TerminateJobObject doesn't signal job, skipping tests\n");
2866 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2874 ret = pAssignProcessToJobObject(
job,
pi.hProcess);
2878 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2880 ret = pTerminateJobObject(
job, 123);
2893 ok(dwret ==
WAIT_TIMEOUT,
"WaitForSingleObject returned %u\n", dwret);
2897 ret = pAssignProcessToJobObject(
job,
pi.hProcess);
2901 ok(dwret ==
WAIT_TIMEOUT,
"WaitForSingleObject returned %u\n", dwret);
2932 if (!pIsProcessInJob)
2934 win_skip(
"IsProcessInJob not available.\n");
2946 ok(
out,
"IsProcessInJob returned out=%u\n",
out);
2951 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
2966 if (!pIsProcessInJob)
2968 win_skip(
"IsProcessInJob not available.\n");
2975 ok(!
ret,
"CreateProcessA expected failure\n");
2985 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
3000 ok(!
out,
"IsProcessInJob returned out=%u\n",
out);
3005 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
3019 ok(!
out,
"IsProcessInJob returned out=%u\n",
out);
3024 ok(dwret ==
WAIT_OBJECT_0,
"WaitForSingleObject returned %u\n", dwret);
3049 &
info),
"CreateProcess\n");
3081 &
info),
"CreateProcess\n");
3103#if defined(__i386__) || defined(__x86_64__)
3135 read_nt_header(process_handle, &mbi,
nt_header) &&
3149 ULONG_PTR orig_iat_entry_value, iat_entry_value;
3161 &iid,
sizeof(iid),
NULL);
3166 ok(iid.
Name,
"Module first IID does not have a Name\n");
3167 ok(iid.
FirstThunk,
"Module first IID does not have a FirstThunk\n");
3168 ok(!iid.
TimeDateStamp,
"Module first IID is a bound import (UNSUPPORTED for current test)\n");
3169 ok(iid.
OriginalFirstThunk,
"Module first IID does not have an OriginalFirstThunk (UNSUPPORTED for current test)\n");
3173 &iat_entry_value,
sizeof(iat_entry_value),
NULL);
3175 ok(iat_entry_value,
"IAT entry in FirstThunk is NULL\n");
3179 &orig_iat_entry_value,
sizeof(orig_iat_entry_value),
NULL);
3180 ok(
ret,
"Failed to read IAT entry from OriginalFirstThunk (%d)\n",
GetLastError());
3181 ok(orig_iat_entry_value,
"IAT entry in OriginalFirstThunk is NULL\n");
3183 return iat_entry_value != orig_iat_entry_value;
3191 PVOID exe_base, exit_thread_ptr;
3198 ok(exit_thread_ptr !=
NULL,
"GetProcAddress ExitThread failed\n");
3204 exe_base = get_process_exe(
pi.hProcess, &
nt_header);
3205 ok(exe_base !=
NULL,
"Could not find EXE in remote process\n");
3208 ok(!
ret,
"IAT entry resolved prematurely\n");
3216 ok(!
ret,
"IAT entry resolved prematurely\n");
3223 ok( !
ctx.Rax,
"rax is not zero %lx\n",
ctx.Rax );
3224 ok( !
ctx.Rbx,
"rbx is not zero %lx\n",
ctx.Rbx );
3225 ok(
ctx.Rcx == (
ULONG_PTR)exit_thread_ptr,
"wrong rcx %lx/%p\n",
ctx.Rcx, exit_thread_ptr );
3226 ok(
ctx.Rdx == 0x1234,
"wrong rdx %lx\n",
ctx.Rdx );
3227 ok( !
ctx.Rsi,
"rsi is not zero %lx\n",
ctx.Rsi );
3228 ok( !
ctx.Rdi,
"rdi is not zero %lx\n",
ctx.Rdi );
3229 ok( !
ctx.Rbp,
"rbp is not zero %lx\n",
ctx.Rbp );
3230 ok( !
ctx.R8,
"r8 is not zero %lx\n",
ctx.R8 );
3231 ok( !
ctx.R9,
"r9 is not zero %lx\n",
ctx.R9 );
3232 ok( !
ctx.R10,
"r10 is not zero %lx\n",
ctx.R10 );
3233 ok( !
ctx.R11,
"r11 is not zero %lx\n",
ctx.R11 );
3234 ok( !
ctx.R12,
"r12 is not zero %lx\n",
ctx.R12 );
3235 ok( !
ctx.R13,
"r13 is not zero %lx\n",
ctx.R13 );
3236 ok( !
ctx.R14,
"r14 is not zero %lx\n",
ctx.R14 );
3237 ok( !
ctx.R15,
"r15 is not zero %lx\n",
ctx.R15 );
3238 ok( !((
ctx.Rsp + 0x28) & 0xfff),
"rsp is not at top of stack page %lx\n",
ctx.Rsp );
3239 ok(
ctx.EFlags == 0x200,
"wrong flags %08x\n",
ctx.EFlags );
3240 ok(
ctx.MxCsr == 0x1f80,
"wrong mxcsr %08x\n",
ctx.MxCsr );
3241 ok(
ctx.FltSave.ControlWord == 0x27f,
"wrong control %08x\n",
ctx.FltSave.ControlWord );
3246 ok( !
ctx.Ecx,
"ecx is not zero %08x\n",
ctx.Ecx );
3247 ok( !
ctx.Edx,
"edx is not zero %08x\n",
ctx.Edx );
3248 ok( !
ctx.Esi,
"esi is not zero %08x\n",
ctx.Esi );
3249 ok( !
ctx.Edi,
"edi is not zero %08x\n",
ctx.Edi );
3251 ok(
ctx.Eax == (
ULONG_PTR)exit_thread_ptr,
"wrong eax %08x/%p\n",
ctx.Eax, exit_thread_ptr );
3252 ok(
ctx.Ebx == 0x1234,
"wrong ebx %08x\n",
ctx.Ebx );
3253 ok( !((
ctx.Esp + 0x10) & 0xfff) ||
broken( !((
ctx.Esp + 4) & 0xfff) ),
3254 "esp is not at top of stack page or properly aligned: %08x\n",
ctx.Esp );
3255 ok( (
ctx.EFlags & ~2) == 0x200,
"wrong flags %08x\n",
ctx.EFlags );
3256 ok( (
WORD)
ctx.FloatSave.ControlWord == 0x27f,
"wrong control %08x\n",
ctx.FloatSave.ControlWord );
3257 ok( *(
WORD *)
ctx.ExtendedRegisters == 0x27f,
"wrong control %08x\n", *(
WORD *)
ctx.ExtendedRegisters );
3265 ok(
exit_code == 0x1234,
"Invalid remote thread exit code\n");
3268 ok(
ret,
"EXE IAT entry not resolved\n");
3283 ULONG pipe_write_buf;
3284 ULONG pipe_read_buf;
3285 ULONG bytes_returned;
3290 struct remote_rop_chain
3292 void *exit_process_ptr;
3302 struct remote_rop_chain
3304 void *exit_process_ptr;
3312 void *unreached_ret;
3317 static const char pipe_name[] =
"\\\\.\\pipe\\TestPipe";
3318 static const ULONG pipe_write_magic = 0x454e4957;
3321 PVOID exe_base, remote_pipe_params, exit_process_ptr,
3324 struct pipe_params pipe_params;
3325 struct remote_rop_chain rop_chain;
3327 HANDLE server_pipe_handle;
3328 BOOL pipe_connected;
3329 ULONG pipe_magic, numb;
3331 void *entry_ptr, *peb_ptr;
3335 ok(exit_process_ptr !=
NULL,
"GetProcAddress ExitProcess failed\n");
3338 ok(call_named_pipe_a !=
NULL,
"GetProcAddress CallNamedPipeA failed\n");
3344 exe_base = get_process_exe(
pi.hProcess, &
nt_header);
3346 ok(exe_base !=
NULL,
"Could not find EXE in remote process\n");
3349 ok(!
ret,
"IAT entry resolved prematurely\n");
3363 ok(remote_pipe_params !=
NULL,
"Failed allocating memory in remote process (%d)\n",
GetLastError());
3365 pipe_params.pipe_write_buf = pipe_write_magic;
3366 pipe_params.pipe_read_buf = 0;
3367 pipe_params.bytes_returned = 0;
3368 strcpy(pipe_params.pipe_name, pipe_name);
3371 &pipe_params,
sizeof(pipe_params),
NULL);
3375 ok( !
ctx.Rax,
"rax is not zero %lx\n",
ctx.Rax );
3376 ok( !
ctx.Rbx,
"rbx is not zero %lx\n",
ctx.Rbx );
3377 ok( !
ctx.Rsi,
"rsi is not zero %lx\n",
ctx.Rsi );
3378 ok( !
ctx.Rdi,
"rdi is not zero %lx\n",
ctx.Rdi );
3379 ok( !
ctx.Rbp,
"rbp is not zero %lx\n",
ctx.Rbp );
3380 ok( !
ctx.R8,
"r8 is not zero %lx\n",
ctx.R8 );
3381 ok( !
ctx.R9,
"r9 is not zero %lx\n",
ctx.R9 );
3382 ok( !
ctx.R10,
"r10 is not zero %lx\n",
ctx.R10 );
3383 ok( !
ctx.R11,
"r11 is not zero %lx\n",
ctx.R11 );
3384 ok( !
ctx.R12,
"r12 is not zero %lx\n",
ctx.R12 );
3385 ok( !
ctx.R13,
"r13 is not zero %lx\n",
ctx.R13 );
3386 ok( !
ctx.R14,
"r14 is not zero %lx\n",
ctx.R14 );
3387 ok( !
ctx.R15,
"r15 is not zero %lx\n",
ctx.R15 );
3388 ok( !((
ctx.Rsp + 0x28) & 0xfff),
"rsp is not at top of stack page %lx\n",
ctx.Rsp );
3389 ok(
ctx.EFlags == 0x200,
"wrong flags %08x\n",
ctx.EFlags );
3390 ok(
ctx.MxCsr == 0x1f80,
"wrong mxcsr %08x\n",
ctx.MxCsr );
3391 ok(
ctx.FltSave.ControlWord == 0x27f,
"wrong control %08x\n",
ctx.FltSave.ControlWord );
3392 entry_ptr = (
void *)
ctx.Rcx;
3393 peb_ptr = (
void *)
ctx.Rdx;
3395 rop_chain.exit_process_ptr = exit_process_ptr;
3398 ctx.R8 =
sizeof(pipe_params.pipe_write_buf);
3400 rop_chain.pipe_read_buf_size =
sizeof(pipe_params.pipe_read_buf);
3401 rop_chain.bytes_returned = (
ULONG_PTR)remote_pipe_params +
offsetof(
struct pipe_params, bytes_returned);
3402 rop_chain.timeout = 10000;
3405 ctx.Rsp -=
sizeof(rop_chain);
3407 ok(
ret,
"Failed to write to remote process thread stack (%d)\n",
GetLastError());
3412 ok( !
ctx.Ecx,
"ecx is not zero %08x\n",
ctx.Ecx );
3413 ok( !
ctx.Edx,
"edx is not zero %08x\n",
ctx.Edx );
3414 ok( !
ctx.Esi,
"esi is not zero %08x\n",
ctx.Esi );
3415 ok( !
ctx.Edi,
"edi is not zero %08x\n",
ctx.Edi );
3417 ok( !((
ctx.Esp + 0x10) & 0xfff) ||
broken( !((
ctx.Esp + 4) & 0xfff) ),
3418 "esp is not at top of stack page or properly aligned: %08x\n",
ctx.Esp );
3419 ok( (
ctx.EFlags & ~2) == 0x200,
"wrong flags %08x\n",
ctx.EFlags );
3420 ok( (
WORD)
ctx.FloatSave.ControlWord == 0x27f,
"wrong control %08x\n",
ctx.FloatSave.ControlWord );
3421 ok( *(
WORD *)
ctx.ExtendedRegisters == 0x27f,
"wrong control %08x\n", *(
WORD *)
ctx.ExtendedRegisters );
3422 entry_ptr = (
void *)
ctx.Eax;
3423 peb_ptr = (
void *)
ctx.Ebx;
3425 rop_chain.exit_process_ptr = exit_process_ptr;
3426 rop_chain.pipe_name = (
ULONG_PTR)remote_pipe_params +
offsetof(
struct pipe_params, pipe_name);
3427 rop_chain.pipe_write_buf = (
ULONG_PTR)remote_pipe_params +
offsetof(
struct pipe_params, pipe_write_buf);
3428 rop_chain.pipe_write_buf_size =
sizeof(pipe_params.pipe_write_buf);
3429 rop_chain.pipe_read_buf = (
ULONG_PTR)remote_pipe_params +
offsetof(
struct pipe_params, pipe_read_buf);
3430 rop_chain.pipe_read_buf_size =
sizeof(pipe_params.pipe_read_buf);
3431 rop_chain.bytes_returned = (
ULONG_PTR)remote_pipe_params +
offsetof(
struct pipe_params, bytes_returned);
3432 rop_chain.timeout = 10000;
3433 rop_chain.exit_code = 0;
3436 ctx.Esp -=
sizeof(rop_chain);
3438 ok(
ret,
"Failed to write to remote process thread stack (%d)\n",
GetLastError());
3446 "wrong entry point %p/%p\n", entry_ptr,
3455 ok(pipe_connected,
"Pipe did not connect\n");
3457 ret =
ReadFile(server_pipe_handle, &pipe_magic,
sizeof(pipe_magic), &numb,
NULL);
3460 ok(pipe_magic == pipe_write_magic,
"Did not get the correct magic from the remote process\n");
3466 ok(
ret,
"EXE IAT is not resolved\n");
3468 ret =
WriteFile(server_pipe_handle, &pipe_magic,
sizeof(pipe_magic), &numb,
NULL);
3492 HANDLE hstdin, hstdout, hstderr, htemp;
3521 ok(
res,
"CreateProcess failed\n");
3545 if (!pGetNumaProcessorNode)
3547 win_skip(
"GetNumaProcessorNode is missing\n");
3552 for (
i = 0;
i < 256;
i++)
3556 ret = pGetNumaProcessorNode(
i, &
node);
3559 ok(
ret,
"GetNumaProcessorNode returned FALSE for processor %d\n",
i);
3560 ok(
node != 0xFF,
"expected node != 0xFF, but got 0xFF\n");
3564 ok(!
ret,
"GetNumaProcessorNode returned TRUE for processor %d\n",
i);
3573 DWORD session_id, active_session;
3576 if (!pProcessIdToSessionId)
3578 win_skip(
"ProcessIdToSessionId is missing\n");
3584 trace(
"session_id = %x\n", session_id);
3586 active_session = pWTSGetActiveConsoleSessionId();
3587 trace(
"active_session = %x\n", active_session);
3593 static const ULONG info_size[] =
3647 sizeof(PROCESS_HANDLE_SNAPSHOT_INFORMATION) ,
3648 sizeof(PROCESS_MITIGATION_POLICY_INFORMATION) ,
3649 sizeof(ProcessDynamicFunctionTableInformation) ,
3651 sizeof(PROCESS_KEEPALIVE_COUNT_INFORMATION) ,
3652 sizeof(PROCESS_REVOKE_FILE_HANDLES_INFORMATION) ,
3653 sizeof(PROCESS_WORKING_SET_CONTROL) ,
3657 sizeof(PS_PROTECTION) ,
3658 sizeof(PROCESS_MEMORY_EXHAUSTION_INFO) ,
3659 sizeof(PROCESS_FAULT_INFORMATION) ,
3660 sizeof(PROCESS_TELEMETRY_ID_INFORMATION) ,
3661 sizeof(PROCESS_COMMIT_RELEASE_INFORMATION) ,
3667 sizeof(PROCESS_JOB_MEMORY_INFO) ,
3673 if (!pNtQueryInformationProcess)
3675 win_skip(
"NtQueryInformationProcess is not available on this platform\n");
3682 win_skip(
"PROCESS_QUERY_LIMITED_INFORMATION is not supported on this platform\n");
3688 size = info_size[
i];
3722 "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n",
i,
status,
ret_len);
3727 "for info %u expected STATUS_ACCESS_DENIED, got %08x (ret_len %u)\n",
i,
status,
ret_len);
3753 if (!pGetLogicalProcessorInformationEx)
3755 win_skip(
"GetLogicalProcessorInformationEx() is not supported\n");
3783 if (!pGetLargePageMinimum) {
3784 skip(
"No GetLargePageMinimum support.\n");
3787 size = pGetLargePageMinimum();
3789 ok((
size == 0) || (
size == 2*1024*1024) || (
size == 4*1024*1024),
"GetLargePageMinimum reports %ld size\n",
size);
3817 if (!pInitializeProcThreadAttributeList)
3819 win_skip(
"No support for ProcThreadAttributeList\n");
3823 for (
i = 0;
i <= 10;
i++)
3826 ret = pInitializeProcThreadAttributeList(
NULL,
i, 0, &
size);
3831 ok(
size == needed,
"%d: got %ld expect %ld\n",
i,
size, needed);
3834 ret = pInitializeProcThreadAttributeList(&
list,
i, 0, &
size);
3836 ok(
list.mask == 0,
"%d: got %08x\n",
i,
list.mask);
3838 ok(
list.count == 0,
"%d: got %08x\n",
i,
list.count);
3839 ok(
list.unk == 0,
"%d: got %08lx\n",
i,
list.unk);
3843 memset(&expect_list, 0xcc,
sizeof(expect_list));
3844 expect_list.
mask = 0;
3845 expect_list.
size =
i - 1;
3846 expect_list.
count = 0;
3847 expect_list.
unk = 0;
3868 expect_list.
count++;
3885 expect_list.
count++;
3900 expect_list.
count++;
3905 pDeleteProcThreadAttributeList(&
list);
3912 if (!pGetActiveProcessorCount)
3914 win_skip(
"GetActiveProcessorCount not available, skipping test\n");
3918 count = pGetActiveProcessorCount(0);
3923 count = pGetActiveProcessorCount(101);
3924 ok(
count == 0,
"Expeced GetActiveProcessorCount to fail\n");
3932 ok(
b,
"Basic init of CreateProcess test\n");
3945 ok(0,
"Child process not killed\n");
3965 ok(
CreateProcessA(
NULL,
buffer,
NULL,
NULL,
FALSE,
CREATE_SUSPENDED,
NULL,
NULL, &
startup, &
info),
"CreateProcess failed\n");
3971 ok(0,
"Unexpected command %s\n",
myARGV[2]);
4014 if (!pCreateJobObjectW)
4016 win_skip(
"No job object support\n");
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static void startup(void)
static struct sockaddr_in sa
BOOL WINAPI SetConsoleOutputCP(IN UINT wCodepage)
BOOL WINAPI SetConsoleCursorPosition(IN HANDLE hConsoleOutput, IN COORD dwCursorPosition)
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BOOL WINAPI AllocConsole(VOID)
BOOL WINAPI GetConsoleScreenBufferInfo(IN HANDLE hConsoleOutput, OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
SIZE_T LPPROCESS_INFORMATION
#define STATUS_NOT_IMPLEMENTED
static LPCWSTR LPCWSTR module_name
static LPCWSTR LPCWSTR LPCWSTR env
#define ERROR_INSUFFICIENT_BUFFER
static const WCHAR deviceW[]
static const WCHAR empty[]
#define ReadProcessMemory(a, b, c, d, e)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define GetCurrentDirectoryW(x, y)
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define GetCurrentProcess()
#define ERROR_NOT_SUPPORTED
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define WideCharToMultiByte
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleOutputCP(VOID)
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCP(UINT wCodePageID)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
BOOL WINAPI DECLSPEC_HOTPATCH SetStdHandle(DWORD nStdHandle, HANDLE hHandle)
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleCP(VOID)
BOOL WINAPI ContinueDebugEvent(IN DWORD dwProcessId, IN DWORD dwThreadId, IN DWORD dwContinueStatus)
BOOL WINAPI WaitForDebugEvent(IN LPDEBUG_EVENT lpDebugEvent, IN DWORD dwMilliseconds)
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
BOOL WINAPI FreeEnvironmentStringsA(IN LPSTR EnvironmentStrings)
BOOL WINAPI FreeEnvironmentStringsW(IN LPWSTR EnvironmentStrings)
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 SetHandleInformation(IN HANDLE hObject, IN DWORD dwMask, IN DWORD dwFlags)
BOOL WINAPI GetHandleInformation(IN HANDLE hObject, OUT LPDWORD lpdwFlags)
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
BOOL WINAPI QueryInformationJobObject(IN HANDLE hJob, IN JOBOBJECTINFOCLASS JobObjectInformationClass, IN LPVOID lpJobObjectInformation, IN DWORD cbJobObjectInformationLength, OUT LPDWORD lpReturnLength)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL NTAPI WriteProcessMemory(IN HANDLE hProcess, IN LPVOID lpBaseAddress, IN LPCVOID lpBuffer, IN SIZE_T nSize, OUT SIZE_T *lpNumberOfBytesWritten)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
VOID WINAPI ExitProcess(IN UINT uExitCode)
DWORD WINAPI GetProcessVersion(IN DWORD ProcessId)
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)
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
LPSTR WINAPI GetCommandLineA(VOID)
LPWSTR WINAPI GetCommandLineW(VOID)
VOID WINAPI GetStartupInfoW(IN LPSTARTUPINFOW lpStartupInfo)
VOID WINAPI GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
DWORD WINAPI ResumeThread(IN HANDLE hThread)
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)
BOOL WINAPI SetThreadContext(IN HANDLE hThread, IN CONST CONTEXT *lpContext)
HANDLE WINAPI OpenThread(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwThreadId)
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
BOOL WINAPI GetThreadContext(IN HANDLE hThread, OUT LPCONTEXT lpContext)
INT WINAPI GetPrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR def_val, LPSTR buffer, UINT len, LPCSTR filename)
UINT WINAPI GetPrivateProfileIntA(LPCSTR section, LPCSTR entry, INT def_val, LPCSTR filename)
BOOL WINAPI DECLSPEC_HOTPATCH WritePrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR string, LPCSTR filename)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
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
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
struct _PROCESS_PRIORITY_CLASS PROCESS_PRIORITY_CLASS
#define PROCESS_QUERY_INFORMATION
#define JOB_OBJECT_LIMIT_BREAKAWAY_OK
struct _JOBOBJECT_BASIC_PROCESS_ID_LIST JOBOBJECT_BASIC_PROCESS_ID_LIST
enum _JOBOBJECTINFOCLASS JOBOBJECTINFOCLASS
#define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
#define PROCESS_VM_OPERATION
@ JobObjectAssociateCompletionPortInformation
@ JobObjectBasicLimitInformation
@ JobObjectBasicAccountingInformation
@ JobObjectExtendedLimitInformation
@ JobObjectBasicProcessIdList
#define JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK
@ ProcessBreakOnTermination
@ ProcessBasicInformation
@ ProcessWow64Information
struct _PROCESS_BASIC_INFORMATION PROCESS_BASIC_INFORMATION
struct _KERNEL_USER_TIMES KERNEL_USER_TIMES
@ ProcessLUIDDeviceMapsEnabled
@ ProcessConsoleHostProcess
@ ProcessImageInformation
@ ProcessImageFileNameWin32
@ ProcessDefaultHardErrorMode
@ ProcessDebugObjectHandle
@ ProcessGroupInformation
struct _IO_COUNTERS IO_COUNTERS
BOOL WINAPI GetQueuedCompletionStatus(IN HANDLE CompletionHandle, IN LPDWORD lpNumberOfBytesTransferred, OUT PULONG_PTR lpCompletionKey, OUT LPOVERLAPPED *lpOverlapped, IN DWORD dwMilliseconds)
int WINAPI lstrlenA(LPCSTR lpString)
_In_ BOOL _In_ HANDLE hProcess
double __cdecl fmin(double, double)
#define ERROR_FILE_NOT_FOUND
#define FILE_FLAG_WRITE_THROUGH
static IMAGE_DOS_HEADER dos_header
static IMAGE_NT_HEADERS32 nt_header
#define sprintf(buf, format,...)
#define PROCESS_QUERY_LIMITED_INFORMATION
static BOOL run_tests(void)
#define expect_eq_ws_i(expected, actual)
static void test_Toolhelp(void)
static void test_StartupNoConsole(void)
#define test_completion(a, b, c, d, e)
static SIZE_T *static DWORD_PTR
static void test_ExitCode(void)
static HANDLE ULONG_PTR key
#define MAX_LISTED_ENV_VAR
static const char * encodeA(const char *str)
static void _test_assigned_proc(int line, HANDLE job, int expected_count,...)
static HINSTANCE hkernel32
static void _test_accounting(int line, HANDLE job, int total_proc, int active_proc, int terminated_proc)
static char * memory_index
static void test_SuspendFlag(void)
static void test_KillOnJobClose(void)
static void ok_child_string(int line, const char *sect, const char *key, const char *expect, int sensitive)
static void _test_completion(int line, HANDLE port, DWORD ekey, ULONG_PTR evalue, ULONG_PTR eoverlapped, DWORD wait)
static void test_CommandLine(void)
#define PROCESS_ALL_ACCESS_NT4
static void test_IsProcessInJob(void)
static void test_SuspendProcessState(void)
static HANDLE test_AddSelfToJob(void)
static int strCmp(const char *s1, const char *s2, BOOL sensitive)
static void doChild(const char *file, const char *option)
#define okChildString(sect, key, expect)
static void test_Directory(void)
#define okChildStringWA(sect, key, expect)
static void test_GetProcessVersion(void)
#define test_assigned_proc(job,...)
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
#define expect_eq_s(expected, actual)
static BOOL is_str_env_drive_dir(const char *str)
#define expect_eq_d(expected, actual)
static unsigned decode_char(char c)
#define okChildIString(sect, key, expect)
static JOBOBJECTINFOCLASS LPVOID info
static DWORD LPSTR PDWORD lpdwSize
static void test_SystemInfo(void)
static HANDLE ULONG_PTR DWORD threads
static void test_DebuggingFlag(void)
static char * decodeA(const char *str)
static void test_WaitForJobObject(void)
static HANDLE existing_port
static void ok_child_int(int line, const char *sect, const char *key, UINT expect)
#define THREAD_ALL_ACCESS_NT4
static HANDLE PBOOL result
static void test_CompletionPort(void)
static void test_BreakawayOk(HANDLE job)
static void ok_child_stringWA(int line, const char *sect, const char *key, const char *expect, int sensitive)
static void test_TerminateProcess(void)
#define create_process(cmd, pi)
static void test_jobInheritance(HANDLE job)
static void test_Handles(void)
static void test_DuplicateHandle(void)
static DWORD LPSTR lpExeName
static void test_DetachConsoleHandles(void)
static BOOL is_console(HANDLE h)
static void test_QueryFullProcessImageNameW(void)
static WCHAR * decodeW(const char *str)
static void test_IsWow64Process(void)
static void test_session_info(void)
static void _create_process(int line, const char *command, LPPROCESS_INFORMATION pi)
static void test_Startup(void)
#define test_accounting(job, total_proc, active_proc, terminated_proc)
static void test_OpenProcess(void)
static void test_largepages(void)
static void test_Console(void)
static void release_memory(void)
static char memory[1024 *256]
static void test_DetachStdHandles(void)
#define okChildInt(sect, key, expect)
static char resfile[MAX_PATH]
static void test_QueryInformationJobObject(void)
static WCHAR * getChildStringW(const char *sect, const char *key)
static void test_QueryFullProcessImageNameA(void)
static void test_SuspendProcessNewThread(void)
static char * grab_memory(size_t len)
static void test_GetProcessImageFileNameA(void)
static void test_ProcThreadAttributeList(void)
static void test_GetActiveProcessorCount(void)
static void test_GetNumaProcessorNode(void)
static void test_RegistryQuota(void)
static void cmpEnvironment(const char *gesA)
static void test_GetLogicalProcessorInformationEx(void)
static void test_TerminateJobObject(void)
static char selfname[MAX_PATH]
static void test_process_info(void)
static void test_Environment(void)
static char * getChildString(const char *sect, const char *key)
static int wtstrcasecmp(const char *p1, const char *p2)
static const char * encodeW(const WCHAR *str)
#define todo_wine_if(is_todo)
#define PROCESSOR_ARCHITECTURE_AMD64
#define PROCESSOR_ARCHITECTURE_INTEL
struct _SECTION_IMAGE_INFORMATION SECTION_IMAGE_INFORMATION
BOOL WINAPI ConnectNamedPipe(IN HANDLE hNamedPipe, IN LPOVERLAPPED lpOverlapped)
HANDLE WINAPI CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize)
#define STATUS_PORT_NOT_SET
#define STATUS_INVALID_INFO_CLASS
static BOOL read_bytes(parse_buffer *buf, LPVOID data, DWORD size)
#define IMAGE_DIRECTORY_ENTRY_IMPORT
#define IMAGE_NT_SIGNATURE
#define IMAGE_DOS_SIGNATURE
#define offsetof(TYPE, MEMBER)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
int winetest_get_mainargs(char ***pargv)
#define WINETEST_PRINTF_ATTR(fmt, args)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED * overlapped
union _DEBUG_EVENT::@3361 u
LOAD_DLL_DEBUG_INFO LoadDll
CREATE_PROCESS_DEBUG_INFO CreateProcessInfo
ULONG NumberOfProcessIdsInList
ULONG NumberOfAssignedProcesses
ULONG_PTR ProcessIdList[1]
struct proc_thread_attr attrs[10]
DWORD dwNumberOfProcessors
COORD dwMaximumWindowSize
DWORD th32ParentProcessID
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define TH32CS_SNAPPROCESS
#define TH32CS_SNAPTHREAD
#define FIELD_OFFSET(t, f)
#define STATUS_ACCESS_DENIED
#define STATUS_INFO_LENGTH_MISMATCH
static EFI_HANDLE * handles
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
LPVOID NTAPI VirtualAllocEx(IN HANDLE hProcess, IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
SIZE_T NTAPI VirtualQueryEx(IN HANDLE hProcess, IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
#define PROCESS_NAME_NATIVE
#define STD_OUTPUT_HANDLE
#define CREATE_BREAKAWAY_FROM_JOB
DWORD WINAPI GetLastError(void)
#define STARTF_USESHOWWINDOW
@ ProcThreadAttributeIdealProcessor
@ ProcThreadAttributeParentProcess
@ ProcThreadAttributeHandleList
#define CREATE_PROCESS_DEBUG_EVENT
#define PIPE_ACCESS_DUPLEX
#define HANDLE_FLAG_PROTECT_FROM_CLOSE
#define LOAD_DLL_DEBUG_EVENT
#define HANDLE_FLAG_INHERIT
DWORD WINAPI GetCurrentProcessId(void)
#define EXIT_PROCESS_DEBUG_EVENT
struct _SYSTEM_INFO * LPSYSTEM_INFO
LPWSTR WINAPI GetEnvironmentStringsW(void)
#define PIPE_READMODE_MESSAGE
#define GetEnvironmentStringsA
#define EXCEPTION_DEBUG_EVENT
_In_ LPCSTR _In_opt_ LPCSTR _In_ DWORD _Out_opt_ LPSTR * lpFilePart
#define PROC_THREAD_ATTRIBUTE_PARENT_PROCESS
#define PROC_THREAD_ATTRIBUTE_HANDLE_LIST
#define PIPE_TYPE_MESSAGE
#define STARTF_USESTDHANDLES
DWORD(WINAPI * LPTHREAD_START_ROUTINE)(LPVOID)
struct _OVERLAPPED * LPOVERLAPPED
#define PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
#define ERROR_OBJECT_NAME_EXISTS
#define ERROR_PATH_NOT_FOUND
#define ERROR_BAD_PATHNAME
#define ERROR_PIPE_CONNECTED
#define JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO
#define PROCESSOR_AMD_X8664
#define JOB_OBJECT_MSG_EXIT_PROCESS
#define JOB_OBJECT_MSG_NEW_PROCESS
enum _LOGICAL_PROCESSOR_RELATIONSHIP LOGICAL_PROCESSOR_RELATIONSHIP
#define DUPLICATE_SAME_ACCESS
#define DUPLICATE_CLOSE_SOURCE