21#define NONAMELESSUNION
22#define NONAMELESSSTRUCT
28#define WIN32_NO_STATUS
37#define PROCESS_ALL_ACCESS_NT4 (PROCESS_ALL_ACCESS & ~0xf000)
39#define ALIGN_SIZE(size, alignment) (((size) + (alignment - 1)) & ~((alignment - 1)))
87 return ((
char*)
module) + rva;
98#elif defined __x86_64__
100#elif defined __powerpc__
104#elif defined __aarch64__
107# error You must specify the machine type
219 section.PointerToRawData = dos_size;
244 file_align = 268 -
size;
299 static BOOL is_winxp;
308 SIZE_T max_stack, commit_stack;
329 ok( info_size ==
sizeof(
image),
"%u: NtQuerySection wrong size %lu\n",
id, info_size );
345 max_stack = 0x100000;
346 commit_stack = 0x10000;
347 entry_point = (
void *)0x81231234;
366 ok( (
char *)
image.TransferAddress == (
char *)entry_point ||
368 "%u: TransferAddress wrong %p / %p (%08x)\n",
id,
370 ok(
image.ZeroBits == 0,
"%u: ZeroBits wrong %08x\n",
id,
image.ZeroBits );
371 ok(
image.MaximumStackSize == max_stack ||
broken(truncated),
372 "%u: MaximumStackSize wrong %lx / %lx\n",
id,
image.MaximumStackSize, max_stack );
373 ok(
image.CommittedStackSize == commit_stack ||
broken(truncated),
374 "%u: CommittedStackSize wrong %lx / %lx\n",
id,
image.CommittedStackSize, commit_stack );
377 "%u: SubSystemType wrong %08x / 00000000\n",
id,
image.SubSystemType );
380 "%u: SubSystemType wrong %08x / %08x\n",
id,
383 "%u: SubsystemVersionLow wrong %04x / %04x\n",
id,
386 "%u: SubsystemVersionHigh wrong %04x / %04x\n",
id,
389 "%u: ImageCharacteristics wrong %04x / %04x\n",
id,
392 "%u: DllCharacteristics wrong %04x / %04x\n",
id,
396 ok(
image.LoaderFlags == (cor_header !=
NULL),
"%u: LoaderFlags wrong %08x\n",
id,
image.LoaderFlags );
398 "%u: ImageFileSize wrong %08x / %08x\n",
id,
image.ImageFileSize,
file_size );
400 "%u: CheckSum wrong %08x / %08x\n",
id,
404 ok(
image.ImageContainsCode ==
TRUE,
"%u: ImageContainsCode wrong %u\n",
id,
405 image.ImageContainsCode );
410 "%u: ImageContainsCode wrong %u\n",
id,
image.ImageContainsCode );
412 ok( !
image.ImageContainsCode,
"%u: ImageContainsCode wrong %u\n",
id,
image.ImageContainsCode );
445 "%u: wrong ImageDynamicallyRelocated flags %02x\n",
id,
U(
image).
ImageFlags );
446 else if (
image.ImageContainsCode && !cor_header)
448 "%u: wrong ImageDynamicallyRelocated flags %02x\n",
id,
U(
image).
ImageFlags );
451 "%u: wrong ImageDynamicallyRelocated flags %02x\n",
id,
U(
image).
ImageFlags );
460 ok(
info.Size.QuadPart == map_size.
QuadPart,
"NtQuerySection wrong size %x%08x / %x%08x\n",
461 info.Size.u.HighPart,
info.Size.u.LowPart, map_size.
u.HighPart, map_size.
u.LowPart );
470 ok(
info.Size.QuadPart == map_size.
QuadPart,
"NtQuerySection wrong size %x%08x / %x%08x\n",
471 info.Size.u.HighPart,
info.Size.u.LowPart, map_size.
u.HighPart, map_size.
u.LowPart );
491 ok(
info.Size.QuadPart == map_size.
QuadPart,
"NtQuerySection wrong size %x%08x / %x%08x\n",
492 info.Size.u.HighPart,
info.Size.u.LowPart, map_size.
u.HighPart, map_size.
u.LowPart );
522 SIZE_T info_size = 0xdeadbeef;
524 ok( !
ret,
"NtQuerySection failed err %x\n",
ret );
525 ok( info_size ==
sizeof(
info),
"NtQuerySection wrong size %lu\n", info_size );
527 ok(
info.BaseAddress ==
NULL,
"NtQuerySection wrong base %p\n",
info.BaseAddress );
528 ok(
info.Size.QuadPart ==
file_size,
"NtQuerySection wrong size %x%08x / %08x\n",
550 ok( !
mod,
"%u: loading succeeded\n",
line );
567 DWORD size_of_dos_header;
568 WORD number_of_sections, size_of_optional_header;
569 DWORD section_alignment, file_alignment;
570 DWORD size_of_image, size_of_headers;
678 1, 0x148, 0x1000, 0x200,
713 HMODULE hlib, hlib_as_data_file;
725 for (
i = 0;
i <
sizeof(td)/
sizeof(td[0]);
i++)
751 ok(
info.BaseAddress == hlib,
"%d: %p != %p\n",
i,
info.BaseAddress, hlib);
752 ok(
info.AllocationBase == hlib,
"%d: %p != %p\n",
i,
info.AllocationBase, hlib);
765 ok(!
ptr,
"%d: VirtualAlloc should fail\n",
i);
777 ok(
info.AllocationBase == 0,
"%d: %p != 0\n",
i,
info.AllocationBase);
778 ok(
info.AllocationProtect == 0,
"%d: %x != 0\n",
i,
info.AllocationProtect);
787 ok(
info.BaseAddress == hlib,
"%d: got %p != expected %p\n",
i,
info.BaseAddress, hlib);
788 ok(
info.AllocationBase == hlib,
"%d: %p != %p\n",
i,
info.AllocationBase, hlib);
815 ok(
info.BaseAddress == hlib,
"%d: got %p != expected %p\n",
i,
info.BaseAddress, hlib);
822 ok(
info.BaseAddress == (
char *)hlib +
section.VirtualAddress,
"%d: got %p != expected %p\n",
i,
info.BaseAddress, (
char *)hlib +
section.VirtualAddress);
827 ok(
info.AllocationBase == hlib,
"%d: %p != %p\n",
i,
info.AllocationBase, hlib);
849 ok(!
ptr,
"%d: VirtualAlloc should fail\n",
i);
851 "%d: expected ERROR_ACCESS_DENIED, got %d\n",
i,
GetLastError());
856 ok(hlib_as_data_file != 0,
"LoadLibraryEx error %u\n",
GetLastError());
857 ok(hlib_as_data_file == hlib,
"hlib_as_file and hlib are different\n");
872 ok(!hlib,
"GetModuleHandle should fail\n");
876 ok(hlib_as_data_file != 0,
"LoadLibraryEx error %u\n",
GetLastError());
877 ok(((
ULONG_PTR)hlib_as_data_file & 3) == 1,
"hlib_as_data_file got %p\n", hlib_as_data_file);
880 ok(!hlib,
"GetModuleHandle should fail\n");
893 if (!((
ULONG_PTR)hlib_as_data_file & 3) ||
896 win_skip(
"LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE not supported\n" );
901 ok(hlib_as_data_file != 0,
"LoadLibraryEx error %u\n",
GetLastError());
921 if (!((
ULONG_PTR)hlib_as_data_file & 3) ||
924 win_skip(
"LOAD_LIBRARY_AS_IMAGE_RESOURCE not supported\n" );
929 ok(hlib_as_data_file != 0,
"LoadLibraryEx error %u\n",
GetLastError());
930 ok(((
ULONG_PTR)hlib_as_data_file & 3) == 2,
"hlib_as_data_file got %p\n",
934 ok(!hlib,
"GetModuleHandle should fail\n");
949 ok(0,
"could not create %s\n", dll_name);
961 for (error_index = 0;
962 ! error_match && error_index <
sizeof(td[
i].errors) /
sizeof(
DWORD);
1026 "NtCreateSection error %08x\n",
status );
1031 "NtCreateSection error %08x\n",
status );
1033 switch (orig_machine)
1043 "NtCreateSection error %08x\n",
status );
1045 switch (orig_machine)
1055 "NtCreateSection error %08x\n",
status );
1061 section.SizeOfRawData =
sizeof(cor_header);
1063 memset( &cor_header, 0,
sizeof(cor_header) );
1064 cor_header.
cb =
sizeof(cor_header);
1068 U(cor_header).EntryPointToken = 0xbeef;
1089 cor_header.
Flags = 0;
1102 memset( &nt64, 0,
sizeof(nt64) );
1127 "NtCreateSection error %08x\n",
status );
1129 switch (orig_machine)
1136 "NtCreateSection error %08x\n",
status );
1141 "NtCreateSection error %08x\n",
status );
1148 "NtCreateSection error %08x\n",
status );
1155 "NtCreateSection error %08x\n",
status );
1163 "NtCreateSection error %08x\n",
status );
1170 "NtCreateSection error %08x\n",
status );
1180 "NtCreateSection error %08x\n",
status );
1185 "NtCreateSection error %08x\n",
status );
1190 "NtCreateSection error %08x\n",
status );
1195 "NtCreateSection error %08x\n",
status );
1200 "NtCreateSection error %08x\n",
status );
1202 cor_header.
Flags = 0;
1205 "NtCreateSection error %08x\n",
status );
1211 "NtCreateSection error %08x\n",
status );
1217 memset( &nt32, 0,
sizeof(nt32) );
1243 switch (orig_machine)
1250 "NtCreateSection error %08x\n",
status );
1306 cor_header.
Flags = 0;
1336 strcpy( long_path, dll_name );
1337 strcpy(
strrchr( long_path,
'\\' ),
"\\this-is-a-long-name.dll" );
1347 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, short_path );
1349 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, long_path );
1352 ok(
mod ==
mod2,
"library loaded twice\n" );
1363 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, short_path );
1365 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, long_path );
1368 ok(
mod ==
mod2,
"library loaded twice\n" );
1374 strcpy( dll_name, long_path );
1375 strcpy(
strrchr( dll_name,
'\\' ),
"\\this-is-another-name.dll" );
1385 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, long_path );
1388 ok(
mod ==
mod2,
"library loaded twice\n" );
1400#if defined(__i386__) || defined(__x86_64__)
1423 ok(
dir !=
NULL,
"RtlImageDirectoryEntryToData failed\n");
1428 ok(
dir->NumberOfNames > 0,
"Could not find any exported functions\n");
1430 for (
i = 0;
i <
dir->NumberOfNames;
i++)
1432 DWORD map_rva, dll_rva, map_offset, dll_offset;
1434 BYTE *dll_func, *map_func;
1441 ok(dll_func !=
NULL,
"%s: GetProcAddress returned NULL\n",
func_name);
1442#if defined(__i386__)
1443 if (dll_func[0] == 0x90 && dll_func[1] == 0x90 &&
1444 dll_func[2] == 0x90 && dll_func[3] == 0x90)
1445#elif defined(__x86_64__)
1446 if (dll_func[0] == 0x48 && dll_func[1] == 0x83 &&
1447 dll_func[2] == 0xec && dll_func[3] == 0x08)
1456 map_rva =
funcs[ordinals[
i]];
1457 ok(map_rva == dll_rva,
"%s: Rva of mapped function (0x%x) does not match dll (0x%x)\n",
1463 ok(map_offset == dll_offset,
"%s: File offset of mapped function (0x%x) does not match dll (0x%x)\n",
1468 ok(!
memcmp(map_func, dll_func, 0x20),
"%s: Function content does not match!\n",
func_name);
1471 pNtSetEvent = (
void *)map_func;
1474 ok(pNtSetEvent !=
NULL,
"Could not find NtSetEvent export\n");
1479 pNtSetEvent(
event, 0);
1481 pNtSetEvent(
event, 0);
1498 DWORD import_dir_size;
1513 if (!import_dir_size)
1515 skip(
"Unable to continue testing due to missing import directory.\n");
1521 import_chunk =
RVAToAddr(dir_offset, kernel32_module);
1522 ok(import_chunk != 0,
"Invalid import_chunk: %p\n", import_chunk);
1523 if (!import_chunk)
return;
1531 for (; import_chunk->
FirstThunk; import_chunk++)
1535 U(*import_chunk).OriginalFirstThunk, kernel32_module);
1540 "Name table for imported module %s should not be NULL\n",
1542 ok(iat !=
NULL,
"IAT for imported module %s should not be NULL\n",
1553 void *addr1, *addr2;
1556 if (!pNtMapViewOfSection)
return;
1574 ok(addr1 != 0,
"mapped address should be valid\n");
1579 ok(
info.BaseAddress == (
char *)addr1 +
section.VirtualAddress,
"got %p != expected %p\n",
info.BaseAddress, (
char *)addr1 +
section.VirtualAddress);
1581 ok(
info.Protect == scn_page_access,
"got %#x != expected %#x\n",
info.Protect, scn_page_access);
1582 ok(
info.AllocationBase == addr1,
"%p != %p\n",
info.AllocationBase, addr1);
1592 ok(addr2 != 0,
"mapped address should be valid\n");
1593 ok(addr2 != addr1,
"mapped addresses should be different\n");
1598 ok(
info.BaseAddress == (
char *)addr2 +
section.VirtualAddress,
"got %p != expected %p\n",
info.BaseAddress, (
char *)addr2 +
section.VirtualAddress);
1600 ok(
info.Protect == scn_page_access,
"got %#x != expected %#x\n",
info.Protect, scn_page_access);
1601 ok(
info.AllocationBase == addr2,
"%p != %p\n",
info.AllocationBase, addr2);
1610 ok(addr2 != 0,
"mapped address should be valid\n");
1611 ok(addr2 != addr1,
"mapped addresses should be different\n");
1616 ok(
info.BaseAddress == (
char *)addr2 +
section.VirtualAddress,
"got %p != expected %p\n",
info.BaseAddress, (
char *)addr2 +
section.VirtualAddress);
1618 ok(
info.Protect == scn_page_access,
"got %#x != expected %#x\n",
info.Protect, scn_page_access);
1619 ok(
info.AllocationBase == addr2,
"%p != %p\n",
info.AllocationBase, addr2);
1630 ok(!addr2,
"LoadLibrary should fail, is_dll %d\n", is_dll);
1636 ok(addr2 != 0,
"LoadLibrary error %d, is_dll %d\n",
GetLastError(), is_dll);
1637 ok(addr2 != addr1,
"mapped addresses should be different\n");
1653 switch (prot & 0xff)
1670 DWORD prot_set, prot_get;
1706 DWORD ret, orig_prot, old_prot, rw_prot, exec_prot,
i,
j;
1713 orig_prot = old_prot;
1715 for (
i = 0;
i <
sizeof(td)/
sizeof(td[0]);
i++)
1728 old_prot = 0xdeadbeef;
1733 ok(
ret,
"%d: VirtualProtect error %d, requested prot %#x\n",
i,
GetLastError(), td[
i].prot_set);
1734 ok(old_prot ==
PAGE_NOACCESS,
"%d: got %#x != expected PAGE_NOACCESS\n",
i, old_prot);
1741 ok(
info.Protect == td[
i].prot_get,
"%d: got %#x != expected %#x\n",
i,
info.Protect, td[
i].prot_get);
1749 ok(!
ret,
"%d: VirtualProtect should fail\n",
i);
1753 old_prot = 0xdeadbeef;
1758 ok(old_prot == td[
i].prot_get,
"%d: got %#x != expected %#x\n",
i, old_prot, td[
i].prot_get);
1760 ok(old_prot ==
PAGE_NOACCESS,
"%d: got %#x != expected PAGE_NOACCESS\n",
i, old_prot);
1765 for (
i = 0;
i <= 4;
i++)
1769 for (
j = 0;
j <= 4;
j++)
1771 DWORD prot = exec_prot | rw_prot;
1775 if ((rw_prot && exec_prot) || (!rw_prot && !exec_prot))
1777 ok(!
ret,
"VirtualProtect(%02x) should fail\n", prot);
1786 exec_prot = 1 << (
i + 4);
1798 DWORD scn_file_access, scn_page_access, scn_page_access_after_write;
1846 for (
i = 0;
i <
sizeof(td)/
sizeof(td[0]);
i++)
1856 ok(0,
"could not create %s\n", dll_name);
1884 section.Characteristics = td[
i].scn_file_access;
1910 ok(
info.BaseAddress == (
char *)hlib +
section.VirtualAddress,
"%d: got %p != expected %p\n",
i,
info.BaseAddress, (
char *)hlib +
section.VirtualAddress);
1912 ok(
info.Protect == td[
i].scn_page_access,
"%d: got %#x != expected %#x\n",
i,
info.Protect, td[
i].scn_page_access);
1913 ok(
info.AllocationBase == hlib,
"%d: %p != %p\n",
i,
info.AllocationBase, hlib);
1925 char *
p =
info.BaseAddress;
1932 ok(
info.Protect == td[
i].scn_page_access_after_write,
"%d: got %#x != expected %#x\n",
i,
info.Protect, td[
i].scn_page_access_after_write);
1960 memset(&sti, 0,
sizeof(sti));
1961 sti.
cb =
sizeof(sti);
1970 ok(
info.BaseAddress == (
char *)hlib +
section.VirtualAddress,
"%d: got %p != expected %p\n",
i,
info.BaseAddress, (
char *)hlib +
section.VirtualAddress);
1972 ok(
info.Protect == td[
i].scn_page_access,
"%d: got %#x != expected %#x\n",
i,
info.Protect, td[
i].scn_page_access);
1973 ok(
info.AllocationBase == hlib,
"%d: %p != %p\n",
i,
info.AllocationBase, hlib);
2029#define DATA_RVA(ptr) (page_size + ((char *)(ptr) - (char *)&data))
2052 strcpy(
data.function.name,
"CreateEventA" );
2054 data.thunks[0].u1.AddressOfData = 0xdeadbeef;
2057 data.tls.EndAddressOfRawData =
data.tls.StartAddressOfRawData +
sizeof(
data.tls_data);
2060 data.tls_index = 9999;
2093 ok( (
void *)
ptr->thunks[0].u1.Function ==
expect,
"thunk %p instead of %p for %s.%s\n",
2096 "wrong tls index %d\n",
ptr->tls_index );
2097 if (
ptr->tls_index != 9999)
2109 ok(
ptr->thunks[0].u1.Function == 0xdeadbeef,
"thunk resolved to %p for %s.%s\n",
2110 (
void *)
ptr->thunks[0].u1.Function,
data.module,
data.function.name );
2111 ok(
ptr->tls_index == 9999,
"wrong tls index %d\n",
ptr->tls_index );
2115 ok(
ptr->thunks[0].u1.Function == 0xdeadbeef,
"thunk resolved to %p for %s.%s\n",
2116 (
void *)
ptr->thunks[0].u1.Function,
data.module,
data.function.name );
2117 ok(
ptr->tls_index == 9999,
"wrong tls index %d\n",
ptr->tls_index );
2126 ok(
ptr->thunks[0].u1.Function == 0xdeadbeef,
"thunk resolved to %p for %s.%s\n",
2127 (
void *)
ptr->thunks[0].u1.Function,
data.module,
data.function.name );
2128 ok(
ptr->tls_index == 9999,
"wrong tls index %d\n",
ptr->tls_index );
2168 ret = pLdrLockLoaderLock(0,
NULL, &loader_lock_magic);
2169 ok(!
ret,
"LdrLockLoaderLock error %#x\n",
ret);
2176 pRtlAcquirePebLock();
2227 ok(lpFlsData == (
void*) 0x31415,
"lpFlsData is %p, expected %p\n", lpFlsData, (
void*) 0x31415);
2233 static LONG noop_thread_started;
2235 static int fls_count = 0;
2236 static int thread_detach_count = 0;
2247 ret = pRtlDllShutdownInProgress();
2248 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2259 value = pFlsGetValue(fls_index);
2260 ok(!
value,
"FlsGetValue returned %p, expected NULL\n",
value);
2262 bret = pFlsSetValue(fls_index, (
void*) 0x31415);
2263 ok(bret,
"FlsSetValue failed\n");
2281 ok(0,
"dll_entry_point(DLL_PROCESS_DETACH) should not be called\n");
2293 ok(0,
"dll_entry_point: process should already deadlock\n");
2308 ret = pRtlDllShutdownInProgress();
2309 ok(
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2313 ret = pRtlDllShutdownInProgress();
2325 if (
param && pFlsGetValue)
2329 value = pFlsGetValue(fls_index);
2333 value ==
NULL,
"FlsGetValue returned %p, expected NULL\n",
value);
2340 "wrong FLS callback count %d, expected %d\n",
fls_callback_count, thread_detach_count + 1);
2347 ret = pFlsFree(fls_index);
2370 trace(
"dll: GetExitCodeThread(%u) => %d,%u\n",
i,
ret,
code);
2371 ok(
ret == 1,
"GetExitCodeThread returned %d, expected 1\n",
ret);
2372 ok(
code == expected_code,
"expected thread exit code %u, got %u\n", expected_code,
code);
2406 noop_thread_started = 0;
2426 ok(!noop_thread_started ||
broken(noop_thread_started) ,
"thread shouldn't start yet\n");
2434 noop_thread_started = 0;
2454 ok(!noop_thread_started ||
broken(noop_thread_started) ,
"thread shouldn't start yet\n");
2476 ok(!
handle,
"winver.exe shouldn't be loaded yet\n");
2485 ok(
handle != 0,
"winver.exe should not be unloaded\n");
2492 ok(!
ret,
"WaitForDebugEvent should fail\n");
2498 ok(!
ret,
"DebugActiveProcess should fail\n");
2503 ok(!
ret,
"WaitForDebugEvent should fail\n");
2508 trace(
"dll: call ExitProcess()\n");
2518 ret = pRtlDllShutdownInProgress();
2519 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2534 value = pFlsGetValue(fls_index);
2535 ok(!
value,
"FlsGetValue returned %p, expected NULL\n",
value);
2538 ret = pFlsSetValue(fls_index, (
void*) 0x31415);
2539 ok(
ret,
"FlsSetValue failed\n");
2546 thread_detach_count++;
2548 ret = pRtlDllShutdownInProgress();
2553 if (noop_thread_started)
2554 ok(
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2556 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2566 value = pFlsGetValue(fls_index);
2570 !
value,
"FlsGetValue returned %p, expected NULL\n",
value);
2628 ok(0,
"could not open %s\n", dll_name);
2667 trace(
"child: GetExitCodeThread(%u) => %d,%u\n",
i,
ret,
code);
2668 ok(
ret == 1,
"GetExitCodeThread returned %d, expected 1\n",
ret);
2684 ret = pRtlDllShutdownInProgress();
2685 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2693 ok(!
ret,
"TerminateProcess(0) should fail\n");
2700 ok(!
ret,
"NtSetInformationProcess error %#x\n",
ret);
2705 ret = pRtlDllShutdownInProgress();
2706 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2708 trace(
"call NtTerminateProcess(0, 195)\n");
2709 ret = pNtTerminateProcess(0, 195);
2710 ok(!
ret,
"NtTerminateProcess error %#x\n",
ret);
2714 ok(!
ret,
"NtQueryInformationProcess error %#x\n",
ret);
2716 "expected STILL_ACTIVE, got %lu\n",
pbi.ExitStatus);
2719 ok(!
ret,
"NtSetInformationProcess error %#x\n",
ret);
2721 ret = pRtlDllShutdownInProgress();
2722 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2725 ok(
hmod != 0,
"DLL should not be unloaded\n");
2739 trace(
"call LdrShutdownProcess()\n");
2740 pLdrShutdownProcess();
2742 ret = pRtlDllShutdownInProgress();
2743 ok(
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2746 ok(
hmod != 0,
"DLL should not be unloaded\n");
2750 ok(!
ret,
"NtQueryInformationProcess error %#x\n",
ret);
2752 "expected STILL_ACTIVE, got %lu\n",
pbi.ExitStatus);
2755 ok(!
ret,
"NtSetInformationProcess error %#x\n",
ret);
2759 ret = pRtlDllShutdownInProgress();
2760 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2764 ret = pRtlDllShutdownInProgress();
2765 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2772 ok(!
hmod,
"DLL should be unloaded\n");
2775 ok(0,
"FreeLibrary+ExitProcess should never return\n");
2777 ret = pRtlDllShutdownInProgress();
2778 ok(!
ret,
"RtlDllShutdownInProgress returned %d\n",
ret);
2783 trace(
"signalling thread exit\n");
2788 trace(
"setting loader_lock_event\n");
2794 trace(
"call NtTerminateProcess(0, 198)\n");
2795 ret = pNtTerminateProcess(0, 198);
2796 ok(!
ret,
"NtTerminateProcess error %#x\n",
ret);
2804 trace(
"call NtTerminateProcess(GetCurrentProcess(), 198)\n");
2806 ok(0,
"NtTerminateProcess should not return\n");
2810 trace(
"setting peb_lock_event\n");
2818 trace(
"call ExitProcess(198)\n");
2820 ok(0,
"ExitProcess should not return\n");
2824 trace(
"setting heap_lock_event\n");
2832 trace(
"call ExitProcess(1)\n");
2834 ok(0,
"ExitProcess should not return\n");
2865 trace(
"child: GetExitCodeThread(%u) => %d,%u\n",
i,
ret,
code);
2866 ok(
ret == 1,
"GetExitCodeThread returned %d, expected 1\n",
ret);
2867 ok(
code == expected_code,
"expected thread exit code %u, got %u\n", expected_code,
code);
2872 trace(
"call ExitProcess(195)\n");
2878#include "pshpack1.h"
2898 DWORD ret, target_offset, old_prot;