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;
2911#if !defined(__i386__) && !defined(__x86_64__)
2912 skip(
"x86 specific ExitProcess test\n");
2916 if (!pRtlDllShutdownInProgress)
2918 win_skip(
"RtlDllShutdownInProgress is not available on this platform (XP+)\n");
2921 if (!pNtQueryInformationProcess || !pNtSetInformationProcess)
2923 win_skip(
"NtQueryInformationProcess/NtSetInformationProcess are not available on this platform\n");
2926 if (!pNtAllocateVirtualMemory || !pNtFreeVirtualMemory)
2928 win_skip(
"NtAllocateVirtualMemory/NtFreeVirtualMemory are not available on this platform\n");
2942 ok(0,
"could not create %s\n", dll_name);
3002 ok(
ret == 195,
"expected exit code 195, got %u\n",
ret);
3020 ok(
ret == 195,
"expected exit code 195, got %u\n",
ret);
3038 ok(
ret == 197,
"expected exit code 197, got %u\n",
ret);
3056 ok(
ret == 195,
"expected exit code 195, got %u\n",
ret);
3066 if (pLdrLockLoaderLock && pLdrUnlockLoaderLock)
3076 ok(
ret == 198,
"expected exit code 198, got %u\n",
ret);
3086 win_skip(
"LdrLockLoaderLock/LdrUnlockLoaderLock are not available on this platform\n");
3089 if (pRtlAcquirePebLock && pRtlReleasePebLock)
3099 trace(
"terminating child process\n");
3105 ok(
ret == 199,
"expected exit code 199, got %u\n",
ret);
3115 win_skip(
"RtlAcquirePebLock/RtlReleasePebLock are not available on this platform\n");
3126 trace(
"terminating child process\n");
3152 ok(old_prot ==
PAGE_READWRITE,
"expected PAGE_READWRITE, got %#x\n", old_prot);
3160 ok(
size == 4,
"expected 4, got %lu\n",
size);
3177 ok(!
ret,
"NtMapViewOfSection error %#x\n",
ret);
3178 ret = pNtUnmapViewOfSection(
pi.hProcess,
addr);
3179 ok(!
ret,
"NtUnmapViewOfSection error %#x\n",
ret);
3205 ok(
ret == 199,
"expected exit code 199, got %u\n",
ret);
3223 ok(!
ret,
"NtQueryInformationProcess error %#x\n",
ret);
3224 ok(
pbi.ExitStatus == 198,
"expected 198, got %lu\n",
pbi.ExitStatus);
3237 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
3246 "expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
3260 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
3269 "expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
3272 ok(!
ret,
"VirtualProtectEx should fail\n");
3277 ok(!
ret,
"ReadProcessMemory should fail\n");
3279 "expected ERROR_PARTIAL_COPY, got %d\n",
GetLastError());
3283 ok(!
ret,
"VirtualFreeEx should fail\n");
3287 ok(!
addr,
"VirtualAllocEx should fail\n");
3291 ok(!
size,
"VirtualQueryEx should fail\n");
3301 ok(
ret,
"CloseHandle should not fail\n");
3307 ok(!
ret,
"DuplicateHandle should fail\n");
3320 ok(!
thread,
"CreateRemoteThread should fail\n");
3325 ok(!
ret,
"DebugActiveProcess should fail\n");
3331 "expected exit code 198, got %u\n",
ret);
3341 ok(ul == 4,
"expected 4, got %u\n", ul);
3342 ok(!!pd,
"no delayload info supplied\n");
3345 ok(pd->
Size ==
sizeof(*pd),
"got %u\n", pd->
Size);
3376 "expected \"secur32.dll\", got \"%s\"\n", pd->
TargetDllName);
3389 return (
void*)0xdeadbeef;
3394 static const char test_dll[] =
"secur32.dll";
3395 static const char test_func[] =
"SealMessage";
3431 if (!pResolveDelayLoadedAPI)
3433 win_skip(
"ResolveDelayLoadedAPI is not available\n");
3441 "ResolveDelayLoadedAPI succeeded\n");
3447 "ResolveDelayLoadedAPI succeeded\n");
3454 trace(
"creating %s\n", dll_name);
3458 ok(0,
"could not create %s\n", dll_name);
3489 section.Misc.VirtualSize = 2 *
sizeof(idd);
3496 section.PointerToRawData = 0x2000;
3497 section.VirtualAddress = 0x2000;
3498 i =
sizeof(td)/
sizeof(td[0]);
3501 ok(
section.Misc.VirtualSize <= 0x1000,
"Too much tests, add a new section!\n");
3547 for (
i = 0;
i <
sizeof(td)/
sizeof(td[0]);
i++)
3561 for (
i = 0;
i <
sizeof(td)/
sizeof(td[0]);
i++)
3587 skip(
"couldn't load %s.\n", dll_name);
3595 skip(
"haven't found section for delay import directory.\n");
3614 for (
i = 0;
i <
sizeof(td)/
sizeof(td[0]);
i++)
3630 ok(
ret !=
NULL,
"Test %u: ResolveDelayLoadedAPI failed\n",
i);
3638 ok(
ret == (
void*)0xdeadbeef,
"Test %u: ResolveDelayLoadedAPI succeeded with %p\n",
i,
ret);
3646 trace(
"deleting %s\n", dll_name);
3659 for (entry1 = mark1->
Flink, entry2 = mark2->
Flink;
3660 entry1 != mark1 && entry2 != mark2;
3661 entry1 = entry1->
Flink, entry2 = entry2->
Flink)
3665 ok(module1 == module2,
"expected module1 == module2, got %p and %p\n", module1, module2);
3667 ok(entry1 == mark1,
"expected entry1 == mark1, got %p and %p\n", entry1, mark1);
3668 ok(entry2 == mark2,
"expected entry2 == mark2, got %p and %p\n", entry2, mark2);
3702 static WCHAR ntdllW[] = {
'n',
't',
'd',
'l',
'l',
'.',
'd',
'l',
'l',0};
3703 static WCHAR kernel32W[] = {
'k',
'e',
'r',
'n',
'e',
'l',
'3',
'2',
'.',
'd',
'l',
'l',0};
3728 ok(found,
"Could not find ntdll\n");
3741 ok(found,
"Could not find kernel32\n");
3753 pNtCreateSection = (
void *)
GetProcAddress(ntdll,
"NtCreateSection");
3754 pNtQuerySection = (
void *)
GetProcAddress(ntdll,
"NtQuerySection");
3755 pNtMapViewOfSection = (
void *)
GetProcAddress(ntdll,
"NtMapViewOfSection");
3756 pNtUnmapViewOfSection = (
void *)
GetProcAddress(ntdll,
"NtUnmapViewOfSection");
3757 pNtTerminateProcess = (
void *)
GetProcAddress(ntdll,
"NtTerminateProcess");
3758 pNtQueryInformationProcess = (
void *)
GetProcAddress(ntdll,
"NtQueryInformationProcess");
3759 pNtSetInformationProcess = (
void *)
GetProcAddress(ntdll,
"NtSetInformationProcess");
3760 pLdrShutdownProcess = (
void *)
GetProcAddress(ntdll,
"LdrShutdownProcess");
3761 pRtlDllShutdownInProgress = (
void *)
GetProcAddress(ntdll,
"RtlDllShutdownInProgress");
3762 pNtAllocateVirtualMemory = (
void *)
GetProcAddress(ntdll,
"NtAllocateVirtualMemory");
3763 pNtFreeVirtualMemory = (
void *)
GetProcAddress(ntdll,
"NtFreeVirtualMemory");
3764 pLdrLockLoaderLock = (
void *)
GetProcAddress(ntdll,
"LdrLockLoaderLock");
3765 pLdrUnlockLoaderLock = (
void *)
GetProcAddress(ntdll,
"LdrUnlockLoaderLock");
3766 pRtlAcquirePebLock = (
void *)
GetProcAddress(ntdll,
"RtlAcquirePebLock");
3767 pRtlReleasePebLock = (
void *)
GetProcAddress(ntdll,
"RtlReleasePebLock");
3768 pRtlImageDirectoryEntryToData = (
void *)
GetProcAddress(ntdll,
"RtlImageDirectoryEntryToData");
3773 pIsWow64Process = (
void *)
GetProcAddress(kernel32,
"IsWow64Process");
3774 pResolveDelayLoadedAPI = (
void *)
GetProcAddress(kernel32,
"ResolveDelayLoadedAPI");
3783 ok(
mapping != 0,
"CreateFileMapping failed\n");
std::map< E_MODULE, HMODULE > mod
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
#define InterlockedIncrement
static LPCWSTR LPCWSTR module_name
#define ERROR_INVALID_FUNCTION
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
#define IMAGE_DIRECTORY_ENTRY_EXPORT
#define ReadProcessMemory(a, b, c, d, e)
#define IMAGE_FILE_MACHINE_ARMNT
#define ERROR_INVALID_ADDRESS
#define ERROR_INVALID_PARAMETER
#define DLL_THREAD_DETACH
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define IMAGE_FILE_MACHINE_POWERPC
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileMappingW(a, b, c, d, e, f)
#define CreateFileA(a, b, c, d, e, f, g)
#define GetCurrentProcess()
#define RtlImageDirectoryEntryToData
#define ERROR_NOT_SUPPORTED
#define ERROR_INVALID_HANDLE
#define IMAGE_FILE_MACHINE_ARM64
#define DLL_THREAD_ATTACH
#define ERROR_ACCESS_DENIED
static const WCHAR version[]
BOOL WINAPI DebugActiveProcess(IN DWORD dwProcessId)
BOOL WINAPI WaitForDebugEvent(IN LPDEBUG_EVENT lpDebugEvent, IN DWORD dwMilliseconds)
UINT WINAPI SetErrorMode(IN UINT uMode)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI SetEndOfFile(HANDLE hFile)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
BOOL WINAPI SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod)
BOOL WINAPI CreateHardLinkA(IN LPCSTR lpFileName, IN LPCSTR lpExistingFileName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI MoveFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName)
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)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
DWORD WINAPI GetShortPathNameA(IN LPCSTR lpszLongPath, OUT LPSTR lpszShortPath, IN DWORD cchBuffer)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
VOID WINAPI ExitProcess(IN UINT uExitCode)
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)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
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)
BOOL WINAPI SetThreadContext(IN HANDLE hThread, IN CONST CONTEXT *lpContext)
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 GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
BOOL WINAPI GetThreadContext(IN HANDLE hThread, OUT LPCONTEXT lpContext)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
static void basename(LPCWSTR path, LPWSTR name)
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
struct _IMAGE_FILE_HEADER IMAGE_FILE_HEADER
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES
PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
struct _IMAGE_OPTIONAL_HEADER IMAGE_OPTIONAL_HEADER32
struct _IMAGE_DOS_HEADER * PIMAGE_DOS_HEADER
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum const GLvoid * addr
GLenum GLenum GLenum GLenum mapping
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 const GLfloat const GLdouble const GLfloat GLint GLint GLint j
BOOL WINAPI HeapLock(HANDLE hHeap)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
@ ProcessBasicInformation
#define memcpy(s1, s2, n)
static IMAGE_NT_HEADERS32 nt_header
#define sprintf(buf, format,...)
static PEXPLICIT_ACCESSW *static HMODULE hmod
static int inside_loader_lock
static IMAGE_SECTION_HEADER section
static ULONG hash_basename(const WCHAR *basename)
static int test_dll_phase
static const OBJECT_ATTRIBUTES const LARGE_INTEGER HANDLE
static void test_HashLinks(void)
static void test_ImportDescriptors(void)
static DWORD WINAPI noop_thread_proc(void *param)
static VOID WINAPI fls_callback(PVOID lpFlsData)
static LONG * child_failures
static ULONG ULONG_PTR *static ULONG_PTR
static PCIMAGE_DELAYLOAD_DESCRIPTOR
static const IMAGE_NT_HEADERS nt_header_template
#define PROCESS_ALL_ACCESS_NT4
static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL is_dll)
static const char filler[0x1000]
static BOOL query_image_section(int id, const char *dll_name, const IMAGE_NT_HEADERS *nt_header, const void *section_data)
static PVOID RVAToAddr(DWORD_PTR rva, HMODULE module)
static IMAGE_DOS_HEADER dos_header
static HANDLE attached_thread[MAX_COUNT]
static PVOID WINAPI failuredllhook(ULONG ul, DELAYLOAD_INFO *pd)
static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
static PIMAGE_THUNK_DATA ThunkAddress
static int inside_heap_lock
static int inside_peb_lock
static PDELAYLOAD_FAILURE_DLL_CALLBACK
static SECTION_INFORMATION_CLASS
static void test_ExitProcess(void)
static void test_ResolveDelayLoadedAPI(void)
static NTSTATUS map_image_section(const IMAGE_NT_HEADERS *nt_header, const IMAGE_SECTION_HEADER *sections, const void *section_data, int line)
static void test_Loader(void)
static void test_section_access(void)
static void test_InMemoryOrderModuleList(void)
static void test_FakeDLL(void)
static void test_filenames(void)
static DWORD create_test_dll_sections(const IMAGE_DOS_HEADER *dos_header, const IMAGE_NT_HEADERS *nt_header, const IMAGE_SECTION_HEADER *sections, const void *section_data, char dll_name[MAX_PATH])
static DWORD create_test_dll(const IMAGE_DOS_HEADER *dos_header, UINT dos_size, const IMAGE_NT_HEADERS *nt_header, char dll_name[MAX_PATH])
static LONG fls_callback_count
static DWORD WINAPI semaphore_thread_proc(void *param)
#define ALIGN_SIZE(size, alignment)
static DWORD attached_thread_count
static void test_import_resolution(void)
static DWORD WINAPI mutex_thread_proc(void *param)
static BOOL is_mem_writable(DWORD prot)
static const char section_data[0x10]
static void test_VirtualProtect(void)
static void test_func(IDispatchEx *obj)
#define todo_wine_if(is_todo)
struct section sections[2]
static HANDLE child_process
unsigned __int3264 UINT_PTR
@ SectionBasicInformation
@ SectionImageInformation
#define SEM_FAILCRITICALERRORS
#define PAGE_EXECUTE_READ
#define FILE_SHARE_DELETE
#define PAGE_EXECUTE_WRITECOPY
#define PAGE_EXECUTE_READWRITE
#define STANDARD_RIGHTS_REQUIRED
#define IMAGE_SCN_MEM_WRITE
#define IMAGE_SNAP_BY_ORDINAL(Ordinal)
struct _IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER64
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT
#define IMAGE_SCN_CNT_INITIALIZED_DATA
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
#define IMAGE_SCN_CNT_CODE
#define IMAGE_SCN_MEM_EXECUTE
#define IMAGE_FILE_MACHINE_AMD64
#define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
#define IMAGE_SCN_MEM_READ
#define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT
#define IMAGE_SCN_CNT_UNINITIALIZED_DATA
#define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
#define IMAGE_NT_OPTIONAL_HDR_MAGIC
#define STATUS_INVALID_IMAGE_WIN_64
#define STATUS_INVALID_IMAGE_NE_FORMAT
#define STATUS_INVALID_IMAGE_FORMAT
#define STATUS_INVALID_IMAGE_NOT_MZ
#define STATUS_INVALID_IMAGE_PROTECT
#define STATUS_PROCESS_IS_TERMINATING
#define STATUS_SECTION_TOO_BIG
#define STATUS_IMAGE_NOT_AT_BASE
#define IMAGE_FILE_EXECUTABLE_IMAGE
#define IMAGE_DIRECTORY_ENTRY_IMPORT
#define IMAGE_FILE_MACHINE_I386
#define IMAGE_ORDINAL_FLAG
#define IMAGE_FILE_MACHINE_UNKNOWN
struct _IMAGE_OPTIONAL_HEADER IMAGE_OPTIONAL_HEADER
#define IMAGE_NT_SIGNATURE
#define IMAGE_OS2_SIGNATURE
#define IMAGE_DIRECTORY_ENTRY_TLS
#define IMAGE_DOS_SIGNATURE
#define IMAGE_FILE_RELOCS_STRIPPED
#define IMAGE_FILE_32BIT_MACHINE
#define IMAGE_ORDINAL(Ordinal)
struct _IMAGE_SECTION_HEADER IMAGE_SECTION_HEADER
static unsigned int file_size
#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)
LONG winetest_get_failures(void)
int winetest_get_mainargs(char ***pargv)
void winetest_add_failures(LONG new_failures)
static struct __wine_debug_functions funcs
PCIMAGE_DELAYLOAD_DESCRIPTOR DelayloadDescriptor
DELAYLOAD_PROC_DESCRIPTOR TargetApiDescriptor
PIMAGE_THUNK_DATA ThunkAddress
union _DELAYLOAD_PROC_DESCRIPTOR::@2896 Description
ULONG ImportDescribedByName
union _IMAGE_DELAYLOAD_DESCRIPTOR::@4202 Attributes
DWORD ImportAddressTableRVA
DWORD UnloadInformationTableRVA
DWORD BoundImportAddressTableRVA
union _IMAGE_THUNK_DATA32::@2138 u1
struct _LIST_ENTRY * Flink
LIST_ENTRY InMemoryOrderModuleList
LIST_ENTRY InLoadOrderModuleList
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 CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
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)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCWSTR lpName OPTIONAL)
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
struct _LARGE_INTEGER::@2299 u
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualProtect(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
LPVOID NTAPI VirtualAllocEx(IN HANDLE hProcess, IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualProtectEx(IN HANDLE hProcess, IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
SIZE_T NTAPI VirtualQueryEx(IN HANDLE hProcess, IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
SIZE_T NTAPI VirtualQuery(IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
BOOL NTAPI VirtualFreeEx(IN HANDLE hProcess, IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
DWORD WINAPI GetLastError(void)
HANDLE WINAPI GetCurrentThread(void)
#define FLS_OUT_OF_INDEXES
#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE
DWORD WINAPI GetCurrentThreadId(void)
#define LOAD_LIBRARY_AS_IMAGE_RESOURCE
#define LOAD_LIBRARY_AS_DATAFILE
DWORD WINAPI GetCurrentProcessId(void)
VOID(WINAPI * PFLS_CALLBACK_FUNCTION)(PVOID)
#define DONT_RESOLVE_DLL_REFERENCES
_Inout_ PERBANDINFO * pbi
#define ERROR_PARTIAL_COPY
#define ERROR_SEM_TIMEOUT
#define ERROR_SHARING_VIOLATION
#define ERROR_GEN_FAILURE
#define ERROR_BAD_EXE_FORMAT
@ COMIMAGE_FLAGS_32BITREQUIRED
@ COMIMAGE_FLAGS_32BITPREFERRED
DWORD WINAPI CharUpperBuffW(_Inout_updates_(cchLength) LPWSTR lpsz, _In_ DWORD cchLength)
#define DUPLICATE_SAME_ACCESS