26#define WIN32_NO_STATUS
38#define PROCESS_ALL_ACCESS_NT4 (PROCESS_ALL_ACCESS & ~0xf000)
40#define ALIGN_SIZE(size, alignment) (((size) + ((ULONG_PTR)(alignment) - 1)) & ~(((ULONG_PTR)(alignment) - 1)))
90static BOOL (
WINAPI *pWow64DisableWow64FsRedirection)(
void **);
91static BOOL (
WINAPI *pWow64RevertWow64FsRedirection)(
void *);
99 return ((
char*)
module) + rva;
110#elif defined __x86_64__
114#elif defined __aarch64__
117# error You must specify the machine type
185 switch (orig_machine)
198 switch (orig_machine)
257 section.PointerToRawData = dos_size;
282 file_align = 268 -
size;
345 SIZE_T max_stack, commit_stack;
356 ok( !
status,
"%u: NtCreateSection failed err %lx\n",
id,
status );
364 ok( info_size ==
sizeof(
image),
"%u: NtQuerySection wrong size %Iu\n",
id, info_size );
380 max_stack = 0x100000;
381 commit_stack = 0x10000;
382 entry_point = (
void *)0x81231234;
401 ok( (
char *)
image.TransferAddress == (
char *)entry_point ||
403 "%u: TransferAddress wrong %p / %p (%08lx)\n",
id,
405 ok(
image.ZeroBits == 0,
"%u: ZeroBits wrong %08lx\n",
id,
image.ZeroBits );
406 ok(
image.MaximumStackSize == max_stack,
407 "%u: MaximumStackSize wrong %Ix / %Ix\n",
id,
image.MaximumStackSize, max_stack );
408 ok(
image.CommittedStackSize == commit_stack,
409 "%u: CommittedStackSize wrong %Ix / %Ix\n",
id,
image.CommittedStackSize, commit_stack );
411 "%u: SubSystemType wrong %08lx / %08x\n",
id,
414 "%u: MinorSubsystemVersion wrong %04x / %04x\n",
id,
417 "%u: MajorSubsystemVersion wrong %04x / %04x\n",
id,
421 "%u: MajorOperatingSystemVersion wrong %04x / %04x\n",
id,
424 "%u: MinorOperatingSystemVersion wrong %04x / %04x\n",
id,
427 "%u: ImageCharacteristics wrong %04x / %04x\n",
id,
430 "%u: DllCharacteristics wrong %04x / %04x\n",
id,
434 ok(
image.LoaderFlags == (cor_header !=
NULL),
"%u: LoaderFlags wrong %08lx\n",
id,
image.LoaderFlags );
436 "%u: ImageFileSize wrong %08lx / %08lx\n",
id,
image.ImageFileSize,
file_size );
438 "%u: CheckSum wrong %08lx / %08lx\n",
id,
442 ok(
image.ImageContainsCode ==
TRUE,
"%u: ImageContainsCode wrong %u\n",
id,
443 image.ImageContainsCode );
448 "%u: ImageContainsCode wrong %u\n",
id,
image.ImageContainsCode );
450 ok( !
image.ImageContainsCode,
"%u: ImageContainsCode wrong %u\n",
id,
image.ImageContainsCode );
462 "%u: wrong ComPlusILOnly flags %02x\n",
id,
image.ImageFlags );
470 "%u: wrong ComPlusNativeReady flags %02x\n",
id,
image.ImageFlags );
473 "%u: wrong ComPlusNativeReady flags %02x\n",
id,
image.ImageFlags );
476 ok(
image.ComPlusPrefer32bit ||
478 "%u: wrong ComPlusPrefer32bit flags %02x\n",
id,
image.ImageFlags );
480 ok( !
image.ComPlusPrefer32bit,
"%u: wrong ComPlusPrefer32bit flags %02x\n",
id,
image.ImageFlags );
484 ok( !
image.ComPlusILOnly,
"%u: wrong ComPlusILOnly flags %02x\n",
id,
image.ImageFlags );
485 ok( !
image.ComPlusNativeReady,
"%u: wrong ComPlusNativeReady flags %02x\n",
id,
image.ImageFlags );
486 ok( !
image.ComPlusPrefer32bit,
"%u: wrong ComPlusPrefer32bit flags %02x\n",
id,
image.ImageFlags );
489 ok( !
image.ImageMappedFlat,
"%u: wrong ImageMappedFlat flags %02x\n",
id,
image.ImageFlags );
496 "%u: wrong ImageMappedFlat flags %02x\n",
id,
image.ImageFlags );
500 "%u: wrong ImageDynamicallyRelocated flags %02x\n",
id,
image.ImageFlags );
501 else if (
image.ImageContainsCode && !
image.ImageMappedFlat && !cor_header)
505 ok(
image.ImageDynamicallyRelocated,
507 "%u: wrong ImageDynamicallyRelocated flags %02x\n",
id,
image.ImageFlags );
510 "%u: wrong ImageDynamicallyRelocated flags %02x\n",
id,
image.ImageFlags );
511 ok( !
image.BaseBelow4gb,
"%u: wrong BaseBelow4gb flags %02x\n",
id,
image.ImageFlags );
516 ok(
info.Size.QuadPart == map_size.
QuadPart,
"NtQuerySection wrong size %lx%08lx / %lx%08lx\n",
517 info.Size.u.HighPart,
info.Size.u.LowPart, map_size.
u.HighPart, map_size.
u.LowPart );
523 ok( !
status,
"%u: NtCreateSection failed err %lx\n",
id,
status );
526 ok(
info.Size.QuadPart == map_size.
QuadPart,
"NtQuerySection wrong size %lx%08lx / %lx%08lx\n",
527 info.Size.u.HighPart,
info.Size.u.LowPart, map_size.
u.HighPart, map_size.
u.LowPart );
544 ok( !
status,
"%u: NtCreateSection failed err %lx\n",
id,
status );
547 ok(
info.Size.QuadPart == map_size.
QuadPart,
"NtQuerySection wrong size %lx%08lx / %lx%08lx\n",
548 info.Size.u.HighPart,
info.Size.u.LowPart, map_size.
u.HighPart, map_size.
u.LowPart );
555static const WCHAR wldr_nameW[] = {
'w',
'l',
'd',
'r',
't',
'e',
's',
't',
'.',
'd',
'l',
'l',0};
561 static const WCHAR pathW[] = {
'P',
'A',
'T',
'H',0};
562 static const WCHAR ldrW[] = {
'l',
'd',
'r',0};
563 static const WCHAR sepW[] = {
';',0};
564 static const WCHAR bsW[] = {
'\\',0};
646 SIZE_T info_size = 0xdeadbeef;
648 ok( !
ret,
"NtQuerySection failed err %lx\n",
ret );
649 ok( info_size ==
sizeof(
info),
"NtQuerySection wrong size %Iu\n", info_size );
651 ok(
info.BaseAddress ==
NULL,
"NtQuerySection wrong base %p\n",
info.BaseAddress );
652 ok(
info.Size.QuadPart ==
file_size,
"NtQuerySection wrong size %lx%08lx / %08lx\n",
676 ok_(__FILE__,
line)( !
mod,
"loading succeeded\n" );
680 wrong_machine =
TRUE;
694 expect_fallback = !
mod;
709 ok( !expect_fallback,
"%u: got test dll but expected fallback\n",
line );
711 ok( !expect_fallback,
"%u: got test dll but expected failure %lx\n",
line, expect_status );
717 ok( !expect_status ||
broken(
is_win64) ,
"%u: got fallback but expected failure %lx\n",
line, expect_status );
720 ok( !expect_status,
"%u: got fallback but expected failure %lx\n",
line, expect_status );
721 ok( expect_fallback ||
726 "%u: got fallback but expected test dll\n",
line );
729 pLdrUnloadDll( ldr_mod );
739 ok( !expect_fallback,
"%u: got test dll but expected fallback\n",
line );
744 ok( ldr_status == expect_status ||
748 "%u: wrong status %lx/%lx\n",
line, ldr_status, expect_status );
749 ok( !expect_fallback || wrong_machine ||
broken(il_only),
750 "%u: failed with %lx expected fallback\n",
line, ldr_status );
765 DWORD size_of_dos_header;
766 WORD number_of_sections, size_of_optional_header;
767 DWORD section_alignment, file_alignment;
768 DWORD size_of_image, size_of_headers;
876 1, 0x148, 0x1000, 0x200,
914 HMODULE hlib, hlib_as_data_file;
954 ok(
info.BaseAddress == hlib,
"%p != %p\n",
info.BaseAddress, hlib);
955 ok(
info.AllocationBase == hlib,
"%p != %p\n",
info.AllocationBase, hlib);
968 ok(!
ptr,
"VirtualAlloc should fail\n");
979 ok(
info.AllocationBase == 0,
"%p != 0\n",
info.AllocationBase);
980 ok(
info.AllocationProtect == 0,
"%lx != 0\n",
info.AllocationProtect);
989 ok(
info.BaseAddress == hlib,
"got %p != expected %p\n",
info.BaseAddress, hlib);
990 ok(
info.AllocationBase == hlib,
"%p != %p\n",
info.AllocationBase, hlib);
1017 ok(
info.BaseAddress == hlib,
"got %p != expected %p\n",
info.BaseAddress, hlib);
1024 ok(
info.BaseAddress == (
char *)hlib +
section.VirtualAddress,
"got %p != expected %p\n",
info.BaseAddress, (
char *)hlib +
section.VirtualAddress);
1029 ok(
info.AllocationBase == hlib,
"%p != %p\n",
info.AllocationBase, hlib);
1051 ok(!
ptr,
"VirtualAlloc should fail\n");
1053 "expected ERROR_ACCESS_DENIED, got %ld\n",
GetLastError());
1058 ok(hlib_as_data_file != 0,
"LoadLibraryEx error %lu\n",
GetLastError());
1059 ok(hlib_as_data_file == hlib,
"hlib_as_file and hlib are different\n");
1074 ok(!hlib,
"GetModuleHandle should fail\n");
1078 ok(hlib_as_data_file != 0,
"LoadLibraryEx error %lu\n",
GetLastError());
1079 ok(((
ULONG_PTR)hlib_as_data_file & 3) == 1,
"hlib_as_data_file got %p\n", hlib_as_data_file);
1082 ok(!hlib,
"GetModuleHandle should fail\n");
1097 skip(
"LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE not supported\n");
1101 ok(hlib_as_data_file != 0,
"LoadLibraryEx error %lu\n",
GetLastError());
1125 skip(
"LOAD_LIBRARY_AS_IMAGE_RESOURCE not supported\n");
1129 ok(hlib_as_data_file != 0,
"LoadLibraryEx error %lu\n",
GetLastError());
1130 ok(((
ULONG_PTR)hlib_as_data_file & 3) == 2,
"hlib_as_data_file got %p\n",
1134 ok(!hlib,
"GetModuleHandle should fail\n");
1151 ok(0,
"could not create %s\n", dll_name);
1163 error_match =
FALSE;
1164 for (error_index = 0;
1165 ! error_match && error_index <
ARRAY_SIZE(td[
i].errors);
1200 "NtCreateSection error %08lx\n",
status );
1205 "NtCreateSection error %08lx\n",
status );
1210 "NtCreateSection error %08lx\n",
status );
1223 for (
i = 0;
i < 16;
i++)
1273 section.SizeOfRawData =
sizeof(cor_header);
1275 memset( &cor_header, 0,
sizeof(cor_header) );
1276 cor_header.
cb =
sizeof(cor_header);
1301 cor_header.
Flags = 0;
1314 memset( &nt64, 0,
sizeof(nt64) );
1339 "NtCreateSection error %08lx\n",
status );
1341 switch (orig_machine)
1348 "NtCreateSection error %08lx\n",
status );
1353 "NtCreateSection error %08lx\n",
status );
1360 "NtCreateSection error %08lx\n",
status );
1367 "NtCreateSection error %08lx\n",
status );
1375 "NtCreateSection error %08lx\n",
status );
1382 "NtCreateSection error %08lx\n",
status );
1392 "NtCreateSection error %08lx\n",
status );
1397 "NtCreateSection error %08lx\n",
status );
1402 "NtCreateSection error %08lx\n",
status );
1407 "NtCreateSection error %08lx\n",
status );
1412 "NtCreateSection error %08lx\n",
status );
1414 cor_header.
Flags = 0;
1417 "NtCreateSection error %08lx\n",
status );
1423 "NtCreateSection error %08lx\n",
status );
1428 ok(
FALSE,
"FIXME: These tests crash on ReactOS x64!\n");
1437 memset( &nt32, 0,
sizeof(nt32) );
1468 "NtCreateSection error %08lx\n",
status );
1525 cor_header.
Flags = 0;
1556 strcpy( long_path, dll_name );
1557 strcpy(
strrchr( long_path,
'\\' ),
"\\this-is-a-long-name.dll" );
1567 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, short_path );
1569 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, long_path );
1572 ok(
mod ==
mod2,
"library loaded twice\n" );
1583 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, short_path );
1585 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, long_path );
1588 ok(
mod ==
mod2,
"library loaded twice\n" );
1594 strcpy( dll_name, long_path );
1595 strcpy(
strrchr( dll_name,
'\\' ),
"\\this-is-another-name.dll" );
1605 ok(
mod ==
mod2,
"wrong module %p for %s\n",
mod2, long_path );
1608 ok(
mod ==
mod2,
"library loaded twice\n" );
1624 DWORD import_dir_size;
1639 if (!import_dir_size)
1641 skip(
"Unable to continue testing due to missing import directory.\n");
1647 import_chunk =
RVAToAddr(dir_offset, kernel32_module);
1648 ok(import_chunk != 0,
"Invalid import_chunk: %p\n", import_chunk);
1649 if (!import_chunk)
return;
1657 for (; import_chunk->
FirstThunk; import_chunk++)
1666 "Name table for imported module %s should not be NULL\n",
1668 ok(iat !=
NULL,
"IAT for imported module %s should not be NULL\n",
1679 void *addr1, *addr2;
1682 if (!pNtMapViewOfSection)
return;
1700 ok(addr1 != 0,
"mapped address should be valid\n");
1705 ok(
info.BaseAddress == (
char *)addr1 +
section.VirtualAddress,
"got %p != expected %p\n",
info.BaseAddress, (
char *)addr1 +
section.VirtualAddress);
1707 ok(
info.Protect == scn_page_access,
"got %#lx != expected %#lx\n",
info.Protect, scn_page_access);
1708 ok(
info.AllocationBase == addr1,
"%p != %p\n",
info.AllocationBase, addr1);
1718 ok(addr2 != 0,
"mapped address should be valid\n");
1719 ok(addr2 != addr1,
"mapped addresses should be different\n");
1724 ok(
info.BaseAddress == (
char *)addr2 +
section.VirtualAddress,
"got %p != expected %p\n",
info.BaseAddress, (
char *)addr2 +
section.VirtualAddress);
1726 ok(
info.Protect == scn_page_access,
"got %#lx != expected %#lx\n",
info.Protect, scn_page_access);
1727 ok(
info.AllocationBase == addr2,
"%p != %p\n",
info.AllocationBase, addr2);
1736 ok(addr2 != 0,
"mapped address should be valid\n");
1737 ok(addr2 != addr1,
"mapped addresses should be different\n");
1742 ok(
info.BaseAddress == (
char *)addr2 +
section.VirtualAddress,
"got %p != expected %p\n",
info.BaseAddress, (
char *)addr2 +
section.VirtualAddress);
1744 ok(
info.Protect == scn_page_access,
"got %#lx != expected %#lx\n",
info.Protect, scn_page_access);
1745 ok(
info.AllocationBase == addr2,
"%p != %p\n",
info.AllocationBase, addr2);
1756 ok(is_dll,
"LoadLibrary should fail, is_dll %d\n", is_dll);
1762 ok(addr2 != 0,
"LoadLibrary error %ld, is_dll %d\n",
GetLastError(), is_dll);
1763 ok(addr2 != addr1,
"mapped addresses should be different\n");
1779 switch (prot & 0xff)
1796 DWORD prot_set, prot_get;
1832 DWORD ret, orig_prot, old_prot, rw_prot, exec_prot,
i,
j;
1839 orig_prot = old_prot;
1854 old_prot = 0xdeadbeef;
1859 ok(
ret,
"%ld: VirtualProtect error %ld, requested prot %#lx\n",
i,
GetLastError(), td[
i].prot_set);
1860 ok(old_prot ==
PAGE_NOACCESS,
"%ld: got %#lx != expected PAGE_NOACCESS\n",
i, old_prot);
1867 ok(
info.Protect == td[
i].prot_get,
"%ld: got %#lx != expected %#lx\n",
i,
info.Protect, td[
i].prot_get);
1875 ok(!
ret,
"%ld: VirtualProtect should fail\n",
i);
1879 old_prot = 0xdeadbeef;
1884 ok(old_prot == td[
i].prot_get,
"%ld: got %#lx != expected %#lx\n",
i, old_prot, td[
i].prot_get);
1886 ok(old_prot ==
PAGE_NOACCESS,
"%ld: got %#lx != expected PAGE_NOACCESS\n",
i, old_prot);
1891 for (
i = 0;
i <= 4;
i++)
1895 for (
j = 0;
j <= 4;
j++)
1897 DWORD prot = exec_prot | rw_prot;
1901 if ((rw_prot && exec_prot) || (!rw_prot && !exec_prot))
1903 ok(!
ret,
"VirtualProtect(%02lx) should fail\n", prot);
1912 exec_prot = 1 << (
i + 4);
1924 DWORD scn_file_access, scn_page_access, scn_page_access_after_write;
1986 ok(0,
"could not create %s\n", dll_name);
2004 section.Characteristics = td[
i].scn_file_access;
2029 ok(
info.BaseAddress == (
char *)hlib +
section.VirtualAddress,
"%d: got %p != expected %p\n",
i,
info.BaseAddress, (
char *)hlib +
section.VirtualAddress);
2031 ok(
info.Protect == td[
i].scn_page_access,
"%d: got %#lx != expected %#lx\n",
i,
info.Protect, td[
i].scn_page_access);
2032 ok(
info.AllocationBase == hlib,
"%d: %p != %p\n",
i,
info.AllocationBase, hlib);
2044 char *
p =
info.BaseAddress;
2051 ok(
info.Protect == td[
i].scn_page_access_after_write,
"%d: got %#lx != expected %#lx\n",
i,
info.Protect, td[
i].scn_page_access_after_write);
2077 memset(&sti, 0,
sizeof(sti));
2078 sti.
cb =
sizeof(sti);
2093 ok(
info.BaseAddress == (
char *)hlib +
section.VirtualAddress,
"%d: got %p != expected %p\n",
i,
info.BaseAddress, (
char *)hlib +
section.VirtualAddress);
2095 ok(
info.Protect == td[
i].scn_page_access,
"%d: got %#lx != expected %#lx\n",
i,
info.Protect, td[
i].scn_page_access);
2096 ok(
info.AllocationBase == hlib,
"%d: %p != %p\n",
i,
info.AllocationBase, hlib);
2112 &image_info,
sizeof(image_info),
NULL );
2119 &image_info,
sizeof(image_info),
NULL );
2149 if (
wcsicmp(
L"ntdll.dll",
mod->BaseDllName.Buffer) == 0)
2152 ok(
mod->TlsIndex == 0,
"ntdll.dll TlsIndex: %d instead of 0\n",
mod->TlsIndex);
2154 else if (
mod->DllBase == dll)
2162 ok(
mod->TlsIndex == 0 ||
mod->TlsIndex == -1,
"%s TlsIndex: %d\n",
2166 ok(found_dll,
"Couldn't find dll %p in module list\n", dll);
2207 UCHAR tls_init_fn[64];
2208 UCHAR entry_point_fn[16];
2218 int test, tls_index_save, nb_rel;
2219#if defined(__i386__)
2220 static const UCHAR tls_init_code[] = {
2221 0xE8, 0x00, 0x00, 0x00, 0x00,
2224 0x8B, 0x54, 0x24, 0x08,
2226 0xB8, 0x01, 0x00, 0x00, 0x00,
2229 static const UCHAR entry_point_code[] = {
2230 0xB8, 0x01, 0x00, 0x00, 0x00,
2233#elif defined(__x86_64__)
2234 static const UCHAR tls_init_code[] = {
2235 0x48, 0x8B, 0x0D, 0xF1, 0xFF, 0xFF, 0xFF,
2237 0xB8, 0x01, 0x00, 0x00, 0x00,
2240 static const UCHAR entry_point_code[] = {
2241 0xB8, 0x01, 0x00, 0x00, 0x00,
2245 static const UCHAR tls_init_code[] = { 0x00 };
2246 static const UCHAR entry_point_code[] = { 0x00 };
2251#define DATA_RVA(ptr) (page_size + ((char *)(ptr) - (char *)&data))
2253#define ADD_RELOC(field) data.rel.type_off[nb_rel++] = (IMAGE_REL_BASED_DIR64 << 12) + offsetof( struct imports, field )
2255#define ADD_RELOC(field) data.rel.type_off[nb_rel++] = (IMAGE_REL_BASED_HIGHLOW << 12) + offsetof( struct imports, field )
2281 strcpy(
data.function.name,
"CreateEventA" );
2283 data.thunks[0].u1.AddressOfData = 0xdeadbeef;
2288 data.tls.EndAddressOfRawData =
data.tls.StartAddressOfRawData +
sizeof(
data.tls_data);
2293 data.tls_index = 9999;
2294 data.tls_index_hi = 9999;
2296 if (
test == 3 &&
sizeof(tls_init_code) > 1)
2299 assert(
sizeof(tls_init_code) <=
sizeof(
data.tls_init_fn));
2300 assert(
sizeof(entry_point_code) <=
sizeof(
data.entry_point_fn));
2301 memcpy(
data.tls_init_fn, tls_init_code,
sizeof(tls_init_code));
2302 memcpy(
data.entry_point_fn, entry_point_code,
sizeof(entry_point_code));
2312 if (nb_rel % 2) nb_rel++;
2314 data.rel.reloc.SizeOfBlock = (
char *)&
data.rel.type_off[nb_rel] - (
char *)&
data.rel.reloc;
2350 ok( (
void *)
ptr->thunks[0].u1.Function ==
expect,
"thunk %p instead of %p for %s.%s\n",
2353 ok(
ptr->tls_index < 32 ||
broken(
ptr->tls_index == 9999) ,
"wrong tls index %d\n",
ptr->tls_index );
2354 if (
ptr->tls_index != 9999) {
2356 ok(
ptr->tls_index < 32,
"wrong tls index %d\n",
ptr->tls_index );
2360 ok(
ptr->tls_index_hi == 0,
"TLS Index written as a short, high half: %d\n",
ptr->tls_index_hi);
2372 ok(
ptr->thunks[0].u1.Function == 0xdeadbeef,
"thunk resolved to %p for %s.%s\n",
2373 (
void *)
ptr->thunks[0].u1.Function,
data.module,
data.function.name );
2374 ok(
ptr->tls_index == 9999,
"wrong tls index %d\n",
ptr->tls_index );
2378 ok(
ptr->thunks[0].u1.Function == 0xdeadbeef,
"thunk resolved to %p for %s.%s\n",
2379 (
void *)
ptr->thunks[0].u1.Function,
data.module,
data.function.name );
2380 ok(
ptr->tls_index == 9999,
"wrong tls index %d\n",
ptr->tls_index );
2390 ok(
ptr->thunks[0].u1.Function == 0xdeadbeef,
"thunk resolved to %p for %s.%s\n",
2391 (
void *)
ptr->thunks[0].u1.Function,
data.module,
data.function.name );
2392 ok(
ptr->tls_index == 9999,
"wrong tls index %d\n",
ptr->tls_index );
2401 tls_index_save =
ptr->tls_index;
2403 ok(
ptr->tls_index < 32 ||
broken(
ptr->tls_index == 9999) ,
"wrong tls index %d\n",
ptr->tls_index );
2404 if (
sizeof(tls_init_code) > 1 &&
ptr->tls_index != 9999)
2406 ok(
ptr->tls_index < 32,
"wrong tls index %d\n",
ptr->tls_index );
2407 if (
sizeof(tls_init_code) > 1)
2423 if (tls_index_save != 9999 &&
sizeof(tls_init_code) > 1)
2438 ok( !
mapping,
"CreateFileMappingA succeeded\n" );
2447 ok(
test == 6 ? !
image.ImageDynamicallyRelocated :
image.ImageDynamicallyRelocated,
2449 "image flags %x\n",
image.ImageFlags);
2450 ok( !
image.ImageContainsCode,
"contains code %x\n",
image.ImageContainsCode);
2466 "NtMapViewOfSection failed %lx\n",
status );
2468 pnt = pRtlImageNtHeader(
mod );
2474 "tls relocated %p / %p\n", (
void *)
ptr->tls.StartAddressOfRawData,
2485 "tls not relocated %p / %p\n", (
void *)
ptr->tls.StartAddressOfRawData,
2505 DWORD *exp_func_base_rva,
2506 DWORD *imp_thunk_base_rva )
2510 DWORD edata_rva = text_rva + text_size;
2512 DWORD idata_rva = edata_rva + text_size;
2514 DWORD eof_rva = idata_rva + edata_size;
2518 .Misc = { .VirtualSize = text_size },
2519 .VirtualAddress = text_rva,
2520 .SizeOfRawData = text_size,
2521 .PointerToRawData = text_rva,
2526 .Misc = { .VirtualSize = edata_size },
2527 .VirtualAddress = edata_rva,
2528 .SizeOfRawData = edata_size,
2529 .PointerToRawData = edata_rva,
2534 .Misc = { .VirtualSize = edata_size },
2535 .VirtualAddress = idata_rva,
2536 .SizeOfRawData = idata_size,
2537 .PointerToRawData = idata_rva,
2548 const WORD name_ords[2];
2549 const char str_forward_test_func[32];
2550 const char str_forward_test_func2[32];
2556 .Characteristics = 0,
2557 .TimeDateStamp = 0x12345678,
2558 .Name = edata_rva +
offsetof(
struct expdesc, dll_name),
2560 .NumberOfFunctions =
ARRAY_SIZE(expdesc.functions),
2562 .AddressOfFunctions = edata_rva +
offsetof(
struct expdesc, functions),
2563 .AddressOfNames = edata_rva +
offsetof(
struct expdesc,
names),
2564 .AddressOfNameOrdinals = edata_rva +
offsetof(
struct expdesc, name_ords),
2571 edata_rva +
offsetof(
struct expdesc, str_forward_test_func),
2572 edata_rva +
offsetof(
struct expdesc, str_forward_test_func2),
2578 .str_forward_test_func =
"forward_test_func",
2579 .str_forward_test_func2 =
"forward_test_func2",
2586 const struct {
WORD hint;
char name[32]; } impname_forward_test_func;
2592 .OriginalFirstThunk = idata_rva +
offsetof(
struct impdesc, original_thunks),
2594 .ForwarderChain = -1,
2596 .FirstThunk = idata_rva +
offsetof(
struct impdesc, thunks),
2600 .original_thunks = {
2601 {{ idata_rva +
offsetof(
struct impdesc, impname_forward_test_func) }},
2606 {{ idata_rva +
offsetof(
struct impdesc, impname_forward_test_func) }},
2610 .impname_forward_test_func = { 0,
"forward_test_func" },
2622 "ldr%05lx.dll", qpc.
LowPart & 0xfffffUL );
2627 const char *export_names[2] = {
2628 "forward_test_func",
2631 const char *backslash =
strrchr( source_dll,
'\\' );
2632 const char *dllname = backslash ? backslash + 1 : source_dll;
2633 const char *dot =
strrchr( dllname,
'.' );
2634 size_t ext_start = dot ? dot - dllname :
strlen(dllname);
2646 buf = expdesc.strpool[
i];
2649 assert( ext_start < buf_size );
2652 buf_size -= ext_start;
2655 ok(
res > 0 &&
res < buf_size,
"snprintf() failed\n" );
2658 expdesc.functions[
i] = edata_rva + (expdesc.strpool[
i] - (
char *)&expdesc);
2682 "headers (size %#lx) should not overlap with text area (RVA %#lx)\n",
2726 ok(
ret && outlen ==
sizeof(expdesc),
"write expdesc: err=%lu outlen=%lu\n",
GetLastError(), outlen );
2733 ok(
ret && outlen ==
sizeof(impdesc),
"write impdesc: err=%lu outlen=%lu\n",
GetLastError(), outlen );
2744 if (exp_func_base_rva)
2746 *exp_func_base_rva = is_export ? edata_rva + ((
char *)&expdesc.functions - (
char *)&expdesc) : 0;
2749 if (imp_thunk_base_rva)
2751 *imp_thunk_base_rva = is_import ? idata_rva + ((
char *)&impdesc.thunks - (
char *)&impdesc) : 0;
2758 size_t exporter_index,
2759 BOOL test_static_import )
2761 size_t num_modules = num_chained_export_modules + !!test_static_import;
2762 size_t importer_index = test_static_import ? num_modules - 1 : 0;
2763 DWORD imp_thunk_base_rva, exp_func_base_rva;
2764 size_t ultimate_depender_index = 0;
2772 assert(exporter_index < num_chained_export_modules);
2779 trace(
"Generate a chain of test DLL fixtures\n" );
2781 for (
i = 0;
i < num_modules;
i++)
2784 i >= 1 ? temp_paths[
i - 1] :
NULL,
2785 i < num_chained_export_modules,
2786 importer_index &&
i == importer_index,
2787 i == 0 ? &exp_func_base_rva :
NULL,
2788 i == importer_index ? &imp_thunk_base_rva :
NULL );
2792 trace(
"Load the entire test DLL chain\n" );
2794 for (
i = 0;
i < num_modules;
i++)
2802 ok( !!modules[
i],
"LoadLibraryA(temp_paths[%Iu] = %s) err=%lu\n",
2805 if (
i == importer_index)
2808 ultimate_depender_index =
max( ultimate_depender_index, importer_index );
2812 ok(
module == modules[
i],
"modules[%Iu] expected %p, got %p err=%lu\n",
2817 trace(
"Get address of exported functions from the source module\n" );
2821 char *mod_base = (
char *)modules[0];
2822 exports[
i] = (
UINT_PTR)(mod_base + ((
DWORD *)(mod_base + exp_func_base_rva))[
i]);
2826 trace(
"Check import address table of the importer DLL, if any\n" );
2830 UINT_PTR *imp_thunk_base = (
UINT_PTR *)((
char *)modules[importer_index] + imp_thunk_base_rva);
2833 ok( imp_thunk_base[
i] == exports[
i],
"import thunk mismatch [%Iu]: (%#Ix, %#Ix)\n",
2834 i, imp_thunk_base[
i], exports[
i] );
2839 trace(
"Call GetProcAddress() on the exporter DLL, if any\n" );
2846 ok(
proc == exports[0],
"GetProcAddress mismatch [0]: (%#Ix, %#Ix)\n",
proc, exports[0] );
2849 ok(
proc == exports[1],
"GetProcAddress mismatch [1]: (%#Ix, %#Ix)\n",
proc, exports[1] );
2852 ultimate_depender_index =
max( ultimate_depender_index, exporter_index );
2856 trace(
"Unreference modules except the ultimate dependant DLL\n" );
2858 for (
i = 0;
i < ultimate_depender_index;
i++)
2867 todo_wine_if(
i < ultimate_depender_index &&
i + 1 != importer_index)
2868 ok(
module == modules[
i],
"modules[%Iu] expected %p, got %p (unloaded?) err=%lu\n",
2873 trace(
"The ultimate dependant DLL should keep other DLLs from being unloaded\n" );
2875 for (
i = 0;
i < num_modules;
i++)
2879 todo_wine_if(
i < ultimate_depender_index &&
i + 1 != importer_index)
2880 ok(
module == modules[
i],
"modules[%Iu] expected %p, got %p (unloaded?) err=%lu\n",
2885 trace(
"Unreference the remaining modules (including the dependant DLL)\n" );
2887 for (
i = ultimate_depender_index;
i < num_modules;
i++)
2897 trace(
"All modules should be unloaded; the unloading process should not reload any DLL\n" );
2902 for (
i = 0;
i < num_modules;
i++)
2911 trace(
"Close and delete temp files\n" );
2913 for (
i = 0;
i < num_modules;
i++)
2978 ret = pLdrLockLoaderLock(0,
NULL, &loader_lock_magic);
2979 ok(!
ret,
"LdrLockLoaderLock error %#lx\n",
ret);
2986 pRtlAcquirePebLock();
3044 ok(lpFlsData == (
void*) 0x31415,
"lpFlsData is %p, expected %p\n", lpFlsData, (
void*) 0x31415);
3052 unsigned int count = 0;
3059 if (
entry == search_entry)
3061 ok(*index_found == ~0,
"Duplicate list entry.\n");
3062 *index_found =
count;
3071 static LONG noop_thread_started;
3073 static int fls_count = 0;
3074 static int thread_detach_count = 0;
3086 ret = pRtlDllShutdownInProgress();
3087 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3098 value = pFlsGetValue(fls_index);
3099 ok(!
value,
"FlsGetValue returned %p, expected NULL\n",
value);
3101 bret = pFlsSetValue(fls_index, (
void*) 0x31415);
3102 ok(bret,
"FlsSetValue failed\n");
3123 ok(0,
"dll_entry_point(DLL_PROCESS_DETACH) should not be called\n");
3136 ok(0,
"dll_entry_point: process should already deadlock\n");
3154 ret = pRtlDllShutdownInProgress();
3157 ok(
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3166 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3173 if (
param && pFlsGetValue)
3177 value = pFlsGetValue(fls_index);
3186 "wrong FLS callback count %ld, expected %d\n",
fls_callback_count, thread_detach_count + 1);
3189 "wrong FLS callback count %ld, expected %d\n",
fls_callback_count, thread_detach_count + 1);
3196 ret = pFlsFree(fls_index);
3219 trace(
"dll: GetExitCodeThread(%lu) => %ld,%lu\n",
i,
ret,
code);
3220 ok(
ret == 1,
"GetExitCodeThread returned %ld, expected 1\n",
ret);
3221 ok(
code == expected_code,
"expected thread exit code %lu, got %lu\n", expected_code,
code);
3255 noop_thread_started = 0;
3272 ok(!
handle,
"CreateThread should fail\n");
3281 ok(!noop_thread_started,
"thread shouldn't start yet\n");
3289 noop_thread_started = 0;
3306 ok(!
handle,
"CreateRemoteThread should fail\n");
3315 ok(!noop_thread_started,
"thread shouldn't start yet\n");
3337 ok(!
handle,
"winver.exe shouldn't be loaded yet\n");
3346 ok(
handle != 0,
"winver.exe should not be unloaded\n");
3349 ok(!
handle,
"winver.exe should be unloaded\n");
3353 ok(!
ret,
"WaitForDebugEvent should fail\n");
3358 ok(!
ret,
"DebugActiveProcess should fail\n");
3363 ok(!
ret,
"WaitForDebugEvent should fail\n");
3368 trace(
"dll: call ExitProcess()\n");
3380 ret = pRtlDllShutdownInProgress();
3381 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3396 value = pFlsGetValue(fls_index);
3397 ok(!
value,
"FlsGetValue returned %p, expected NULL\n",
value);
3399 ret = pFlsSetValue(fls_index, (
void*) 0x31415);
3400 ok(
ret,
"FlsSetValue failed\n");
3408 thread_detach_count++;
3410 ret = pRtlDllShutdownInProgress();
3415 if (noop_thread_started)
3416 ok(
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3418 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3429 value = pFlsGetValue(fls_index);
3433 ok(!
value,
"FlsGetValue returned %p, expected NULL\n",
value);
3437 bret = pFlsSetValue(fls_index2, (
void*) 0x31415);
3438 ok(bret,
"FlsSetValue failed\n");
3526 ok(0,
"could not open %s\n", dll_name);
3565 trace(
"child: GetExitCodeThread(%lu) => %ld,%lu\n",
i,
ret,
code);
3566 ok(
ret == 1,
"GetExitCodeThread returned %ld, expected 1\n",
ret);
3582 ret = pRtlDllShutdownInProgress();
3583 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3591 ok(!
ret,
"TerminateProcess(0) should fail\n");
3598 ok(!
ret,
"NtSetInformationProcess error %#lx\n",
ret);
3603 ret = pRtlDllShutdownInProgress();
3604 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3606 trace(
"call NtTerminateProcess(0, 195)\n");
3607 ret = pNtTerminateProcess(0, 195);
3608 ok(!
ret,
"NtTerminateProcess error %#lx\n",
ret);
3612 ok(!
ret,
"NtQueryInformationProcess error %#lx\n",
ret);
3614 "expected STILL_ACTIVE, got %lu\n",
pbi.ExitStatus);
3617 ok(!
ret,
"NtSetInformationProcess error %#lx\n",
ret);
3619 ret = pRtlDllShutdownInProgress();
3620 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3623 ok(
hmod != 0,
"DLL should not be unloaded\n");
3630 ok(!
thread,
"CreateThread should fail\n");
3636 trace(
"call LdrShutdownProcess()\n");
3638 pLdrShutdownProcess();
3640 ret = pRtlDllShutdownInProgress();
3641 ok(
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3644 ok(
hmod != 0,
"DLL should not be unloaded\n");
3648 ok(!
ret,
"NtQueryInformationProcess error %#lx\n",
ret);
3650 "expected STILL_ACTIVE, got %lu\n",
pbi.ExitStatus);
3653 ok(!
ret,
"NtSetInformationProcess error %#lx\n",
ret);
3657 ret = pRtlDllShutdownInProgress();
3658 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3662 ret = pRtlDllShutdownInProgress();
3663 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3670 ok(!
hmod,
"DLL should be unloaded\n");
3673 ok(0,
"FreeLibrary+ExitProcess should never return\n");
3675 ret = pRtlDllShutdownInProgress();
3676 ok(!
ret,
"RtlDllShutdownInProgress returned %ld\n",
ret);
3681 trace(
"signalling thread exit\n");
3686 trace(
"setting loader_lock_event\n");
3692 trace(
"call NtTerminateProcess(0, 198)\n");
3693 ret = pNtTerminateProcess(0, 198);
3694 ok(!
ret,
"NtTerminateProcess error %#lx\n",
ret);
3702 trace(
"call NtTerminateProcess(GetCurrentProcess(), 198)\n");
3704 ok(0,
"NtTerminateProcess should not return\n");
3708 trace(
"setting peb_lock_event\n");
3716 trace(
"call ExitProcess(198)\n");
3718 ok(0,
"ExitProcess should not return\n");
3722 trace(
"setting heap_lock_event\n");
3730 trace(
"call ExitProcess(1)\n");
3732 ok(0,
"ExitProcess should not return\n");
3736 trace(
"setting cs_lock_event\n");
3744 trace(
"call ExitProcess(199)\n");
3746 ok(0,
"ExitProcess should not return\n");
3777 trace(
"child: GetExitCodeThread(%lu) => %ld,%lu\n",
i,
ret,
code);
3778 ok(
ret == 1,
"GetExitCodeThread returned %ld, expected 1\n",
ret);
3779 ok(
code == expected_code,
"expected thread exit code %lu, got %lu\n", expected_code,
code);
3784 trace(
"call ExitProcess(195)\n");
3790#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
3791#include "pshpack1.h"
3799#elif defined(__i386__)
3806#elif defined(__aarch64__)
3818 DWORD ret, target_offset, old_prot;
3831 if (!pRtlDllShutdownInProgress)
3833 win_skip(
"RtlDllShutdownInProgress is not available on this platform (XP+)\n");
3836 if (!pNtQueryInformationProcess || !pNtSetInformationProcess)
3838 win_skip(
"NtQueryInformationProcess/NtSetInformationProcess are not available on this platform\n");
3841 if (!pNtAllocateVirtualMemory || !pNtFreeVirtualMemory)
3843 win_skip(
"NtAllocateVirtualMemory/NtFreeVirtualMemory are not available on this platform\n");
3857 ok(0,
"could not create %s\n", dll_name);
3914 ok(
ret == 195 ||
broken(
ret == 0xc0000005) ,
"expected exit code 195, got %lu\n",
ret);
3916 ok(
ret == 195,
"expected exit code 195, got %lu\n",
ret);
3935 ok(
ret == 195,
"expected exit code 195, got %lu\n",
ret);
3953 ok(
ret == 197,
"expected exit code 197, got %lu\n",
ret);
3971 ok(
ret == 195,
"expected exit code 195, got %lu\n",
ret);
3981 if (pLdrLockLoaderLock && pLdrUnlockLoaderLock)
3991 ok(
ret == 198,
"expected exit code 198, got %lu\n",
ret);
4001 win_skip(
"LdrLockLoaderLock/LdrUnlockLoaderLock are not available on this platform\n");
4004 if (pRtlAcquirePebLock && pRtlReleasePebLock)
4014 trace(
"terminating child process\n");
4020 ok(
ret == 199,
"expected exit code 199, got %lu\n",
ret);
4030 win_skip(
"RtlAcquirePebLock/RtlReleasePebLock are not available on this platform\n");
4046 trace(
"terminating child process\n");
4056 ok(
ret == 201,
"expected exit code 201, got %lu\n",
ret);
4075 trace(
"terminating child process\n");
4081 ok(
ret == 199,
"expected exit code 199, got %lu\n",
ret);
4101 ok(old_prot ==
PAGE_READWRITE,
"expected PAGE_READWRITE, got %#lx\n", old_prot);
4109 ok(
size == 4,
"expected 4, got %Iu\n",
size);
4126 ok(!
ret,
"NtMapViewOfSection error %#lx\n",
ret);
4128 ok(!
ret,
"NtUnmapViewOfSection error %#lx\n",
ret);
4154 ok(
ret == 199,
"expected exit code 199, got %lu\n",
ret);
4172 ok(!
ret,
"NtQueryInformationProcess error %#lx\n",
ret);
4173 ok(
pbi.ExitStatus == 198,
"expected 198, got %lu\n",
pbi.ExitStatus);
4181 ok(!
ret,
"GetThreadContext should fail\n");
4186 "expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4190 ok(!
ret,
"SetThreadContext should fail\n");
4194 "expected ERROR_ACCESS_DENIED, got %ld\n",
GetLastError());
4205 ok(!
ret,
"GetThreadContext should fail\n");
4210 "expected ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
4214 ok(!
ret,
"SetThreadContext should fail\n");
4218 "expected ERROR_ACCESS_DENIED, got %ld\n",
GetLastError());
4221 ok(!
ret,
"VirtualProtectEx should fail\n");
4226 ok(!
ret,
"ReadProcessMemory should fail\n");
4228 "expected ERROR_PARTIAL_COPY, got %ld\n",
GetLastError());
4232 ok(!
ret,
"VirtualFreeEx should fail\n");
4236 ok(!
addr,
"VirtualAllocEx should fail\n");
4240 ok(!
size,
"VirtualQueryEx should fail\n");
4250 ok(
ret,
"CloseHandle should not fail\n");
4256 ok(!
ret,
"DuplicateHandle should fail\n");
4269 ok(!
thread,
"CreateRemoteThread should fail\n");
4274 ok(!
ret,
"DebugActiveProcess should fail\n");
4279 ok(
ret == 198,
"expected exit code 198, got %lu\n",
ret);
4286 skip(
"x86 specific ExitProcess test\n");
4292 ok(ul == 4,
"expected 4, got %lu\n", ul);
4293 ok(!!pd,
"no delayload info supplied\n");
4296 ok(pd->
Size ==
sizeof(*pd),
"got %lu\n", pd->
Size);
4327 "expected \"secur32.dll\", got \"%s\"\n", pd->
TargetDllName);
4340 return (
void*)0xdeadbeef;
4345 ok(!
strcmp(dll,
"secur32.dll"),
"wrong dll: %s\n", dll);
4346 ok(!((
ULONG_PTR)function >> 16),
"expected ordinal, got %p\n", function);
4348 return (
void*)0x12345678;
4353 static const char test_dll[] =
"secur32.dll";
4354 static const char test_func[] =
"SealMessage";
4390 if (!pResolveDelayLoadedAPI)
4392 win_skip(
"ResolveDelayLoadedAPI is not available\n");
4400 "ResolveDelayLoadedAPI succeeded\n");
4406 "ResolveDelayLoadedAPI succeeded\n");
4413 trace(
"creating %s\n", dll_name);
4417 ok(0,
"could not create %s\n", dll_name);
4448 section.Misc.VirtualSize = 0x1000;
4449 section.SizeOfRawData = 2 *
sizeof(idd);
4455 section.PointerToRawData = 0x2000;
4456 section.VirtualAddress = 0x2000;
4460 ok(
section.SizeOfRawData <= 0x1000,
"Too much tests, add a new section!\n");
4461 section.Misc.VirtualSize = 0x1000;
4546 skip(
"couldn't load %s.\n", dll_name);
4554 skip(
"haven't found section for delay import directory.\n");
4593 ok(
ret !=
NULL,
"Test %lu: ResolveDelayLoadedAPI failed\n",
i);
4602 ok(
ret == (
void*)0x12345678,
"Test %lu: ResolveDelayLoadedAPI succeeded with %p\n",
i,
ret);
4612 ok(
ret !=
NULL,
"Test %lu: ResolveDelayLoadedAPI failed\n",
i);
4621 if (
ret == (
void*)0x12345678)
4627 else if (
ret == (
void*)0xdeadbeef)
4633 ok(0,
"Test %lu: ResolveDelayLoadedAPI succeeded with %p\n",
i,
ret);
4640 trace(
"deleting %s\n", dll_name);
4653 for (entry1 = mark1->
Flink, entry2 = mark2->
Flink;
4654 entry1 != mark1 && entry2 != mark2;
4655 entry1 = entry1->
Flink, entry2 = entry2->
Flink)
4659 ok(module1 == module2,
"expected module1 == module2, got %p and %p\n", module1, module2);
4661 ok(entry1 == mark1,
"expected entry1 == mark1, got %p and %p\n", entry1, mark1);
4662 ok(entry2 == mark2,
"expected entry2 == mark2, got %p and %p\n", entry2, mark2);
4676 const char *modname;
4681 ok(lib !=
NULL,
"Loading %s should succeed with WOW64 redirection disabled\n", libname);
4686 ok(lib !=
NULL,
"Loading %s from full path should succeed with WOW64 redirection disabled\n", libname);
4689 modname =
strrchr(libname,
'\\');
4690 modname = modname ? modname + 1 : libname;
4694 "Unexpected loaded DLL name %s for %s\n",
buf, libname);
4698 skip(
"%s was already loaded in the process\n", libname);
4706 static const char *dlls[] = {
"wlanapi.dll",
"dxgi.dll",
"dwrite.dll"};
4715 ok(pWow64DisableWow64FsRedirection(&OldValue),
"Disabling FS redirection failed\n");
4724 ok(pWow64RevertWow64FsRedirection(OldValue),
"Re-enabling FS redirection failed\n");
4756 nt_file = pRtlImageNtHeader(
ptr );
4757 ok( nt_file !=
NULL,
"%s: invalid header\n",
path );
4758#define OK_FIELD(x, f) ok( nt->x == nt_file->x, "%s:%u: wrong " #x " " f " / " f "\n", name, i, nt->x, nt_file->x )
4759 OK_FIELD( FileHeader.NumberOfSections,
"%x" );
4760 OK_FIELD( OptionalHeader.AddressOfEntryPoint,
"%lx" );
4761 OK_FIELD( OptionalHeader.NumberOfRvaAndSizes,
"%lx" );
4764 OK_FIELD( OptionalHeader.DataDirectory[
i].VirtualAddress,
"%lx" );
4765 OK_FIELD( OptionalHeader.DataDirectory[
i].Size,
"%lx" );
4770 ok( !
memcmp( sec +
i, sec_file +
i,
sizeof(*sec) ),
"%s: wrong section %d\n",
name,
i );
4779 if (!pLoadPackagedLibrary)
4781 win_skip(
"LoadPackagedLibrary is not available.\n");
4786 h = pLoadPackagedLibrary(
L"kernel32.dll", 0);
4795 const WCHAR *filepart;
4796 void **pWow64Transition;
4801 skip(
"Wow64Transition is not present\n");
4806 skip(
"Wow64Transition is not patched\n");
4813 filepart =
name->SectionFileName.Buffer +
name->SectionFileName.Length /
sizeof(
WCHAR);
4814 while (*filepart !=
'\\') --filepart;
4815 ok(!
wcsnicmp(filepart,
L"\\wow64cpu.dll",
wcslen(
L"\\wow64cpu.dll")),
"got file name %s\n",
4847 pRtlImageDirectoryEntryToData = (
void *)
GetProcAddress(
ntdll,
"RtlImageDirectoryEntryToData");
4849 pLdrRegisterDllNotification = (
void *)
GetProcAddress(
ntdll,
"LdrRegisterDllNotification");
4854 pIsWow64Process = (
void *)
GetProcAddress(kernel32,
"IsWow64Process");
4855 pWow64DisableWow64FsRedirection = (
void *)
GetProcAddress(kernel32,
"Wow64DisableWow64FsRedirection");
4856 pWow64RevertWow64FsRedirection = (
void *)
GetProcAddress(kernel32,
"Wow64RevertWow64FsRedirection");
4857 pResolveDelayLoadedAPI = (
void *)
GetProcAddress(kernel32,
"ResolveDelayLoadedAPI");
4858 pLoadPackagedLibrary = (
void *)
GetProcAddress(kernel32,
"LoadPackagedLibrary");
4867 ok(
mapping != 0,
"CreateFileMapping failed\n");
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
std::map< E_MODULE, HMODULE > mod
#define InterlockedIncrement
@ ProcessBasicInformation
#define STATUS_ILLEGAL_INSTRUCTION
static LPCWSTR LPCWSTR module_name
#define ERROR_INVALID_FUNCTION
#define NT_SUCCESS(StatCode)
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 GetEnvironmentVariableW(x, y, z)
#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 ERROR_NOT_SUPPORTED
#define ERROR_INVALID_HANDLE
#define IMAGE_FILE_MACHINE_ARM64
#define FILE_ATTRIBUTE_NORMAL
#define DLL_THREAD_ATTACH
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
BOOL WINAPI DebugActiveProcess(IN DWORD dwProcessId)
BOOL WINAPI WaitForDebugEvent(IN LPDEBUG_EVENT lpDebugEvent, IN DWORD dwMilliseconds)
UINT WINAPI SetErrorMode(IN UINT uMode)
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
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 MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR 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)
UINT WINAPI GetSystemWow64DirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetShortPathNameA(IN LPCSTR lpszLongPath, OUT LPSTR lpszShortPath, IN DWORD cchBuffer)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
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)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP __msvcrt_long __cdecl atol(const char *)
_ACRTIMP int __cdecl atoi(const char *)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
_ACRTIMP char *__cdecl strrchr(const char *, int)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
UNICODE_STRING * PUNICODE_STRING
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
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
#define STATUS_ACCESS_VIOLATION
GLuint GLuint GLsizei count
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)
@ MemoryMappedFilenameInformation
@ ProcessImageInformation
#define LDR_DLL_NOTIFICATION_REASON_LOADED
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
LONG winetest_get_failures(void)
#define todo_wine_if(is_todo)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void winetest_add_failures(LONG new_failures)
#define memcpy(s1, s2, n)
#define FILE_FLAG_DELETE_ON_CLOSE
static IMAGE_NT_HEADERS32 nt_header
static PEXPLICIT_ACCESSW *static HMODULE hmod
static PROCESS_INFORMATION pi
static int inside_loader_lock
static IMAGE_SECTION_HEADER section
static UINT get_com_dir_size(const IMAGE_NT_HEADERS *nt)
static PVOID WINAPI failuresyshook(const char *dll, const char *function)
static void void **static PVOID RVAToAddr(DWORD_PTR rva, HMODULE module)
static int test_dll_phase
static const OBJECT_ATTRIBUTES const LARGE_INTEGER HANDLE
static void test_LoadPackagedLibrary(void)
static HANDLE peb_lock_event
static void test_ImportDescriptors(void)
static const WCHAR wldr_nameW[]
static PLDR_DLL_NOTIFICATION_FUNCTION
static void test_export_forwarder_dep_chain(void)
static DWORD WINAPI noop_thread_proc(void *param)
static char system_dir[MAX_PATH]
static VOID WINAPI fls_callback(PVOID lpFlsData)
static LONG * child_failures
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 int inside_cs_lock
static BOOL query_image_section(int id, const char *dll_name, const IMAGE_NT_HEADERS *nt_header, const void *section_data)
static BOOL is_path_made_of(const char *filename, const char *pfx, const char *sfx)
static HANDLE heap_lock_event
static char syswow_dir[MAX_PATH]
static IMAGE_DOS_HEADER dos_header
static PDELAYLOAD_FAILURE_SYSTEM_ROUTINE
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 HANDLE loader_lock_event
static WCHAR load_path[MAX_PATH]
static void subtest_export_forwarder_dep_chain(size_t num_chained_export_modules, size_t exporter_index, BOOL test_static_import)
static LIST_ENTRY * fls_list_head
static void test_dll_file(const char *name)
static PIMAGE_THUNK_DATA ThunkAddress
static WORD get_alt_bitness_machine(WORD orig_machine)
static int inside_heap_lock
static int inside_peb_lock
static PDELAYLOAD_FAILURE_DLL_CALLBACK
static HANDLE gen_forward_chain_testdll(char testdll_path[MAX_PATH], const char source_dll[MAX_PATH], BOOL is_export, BOOL is_import, DWORD *exp_func_base_rva, DWORD *imp_thunk_base_rva)
static SECTION_INFORMATION_CLASS
static void test_ExitProcess(void)
static void delete_load_path(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_wow64_redirection_for_dll(const char *libname, BOOL will_fail)
static CRITICAL_SECTION cs_lock
static void test_Loader(void)
static void test_section_access(void)
static void test_InMemoryOrderModuleList(void)
static int tls_init_fn_output
static void check_tls_index(HANDLE dll, BOOL tls_initialized)
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 WCHAR load_fallback_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 HANDLE cs_lock_event
static void init_load_path(const char *fallback_dll)
static LONG fls_callback_count
static WCHAR load_test_name[MAX_PATH]
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 unsigned int check_linked_list(const LIST_ENTRY *le, const LIST_ENTRY *search_entry, unsigned int *index_found)
static DWORD WINAPI mutex_thread_proc(void *param)
static void CALLBACK ldr_notify_callback(ULONG reason, LDR_DLL_NOTIFICATION_DATA *data, void *context)
static BOOL is_mem_writable(DWORD prot)
static void test_wow64_redirection(void)
static DWORD WINAPI tls_thread_fn(void *tlsidx_v)
static void test_Wow64Transition(void)
static WORD get_alt_machine(WORD orig_machine)
static const char section_data[0x10]
static const WCHAR pathW[]
static void test_VirtualProtect(void)
static void test_func(IDispatchEx *obj)
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_FIRST_SECTION(NtHeader)
#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
NTSTATUS NTAPI NtQueryVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN MEMORY_INFORMATION_CLASS MemoryInformationClass, OUT PVOID MemoryInformation, IN SIZE_T MemoryInformationLength, OUT PSIZE_T ReturnLength)
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_writes_bytes_to_opt_(ProcessInformationLength, *ReturnLength) PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
#define STATUS_INVALID_IMAGE_WIN_64
#define STATUS_INVALID_IMAGE_WIN_16
#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_DLL_INIT_FAILED
#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_DIRECTORY_ENTRY_BASERELOC
#define IMAGE_NT_SIGNATURE
#define IMAGE_OS2_SIGNATURE
#define IMAGE_DIRECTORY_ENTRY_TLS
#define IMAGE_DOS_SIGNATURE
#define IMAGE_ORDINAL(Ordinal)
struct _IMAGE_SECTION_HEADER IMAGE_SECTION_HEADER
static uint32_t thread_count(IN pnfs_layout_state *state, IN enum pnfs_iomode iomode, IN uint64_t offset, IN uint64_t length)
static unsigned int file_size
#define offsetof(TYPE, MEMBER)
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
int winetest_get_mainargs(char ***pargv)
#define _WIN32_WINNT_WIN8
#define _WIN32_WINNT_VISTA
PCIMAGE_DELAYLOAD_DESCRIPTOR DelayloadDescriptor
DELAYLOAD_PROC_DESCRIPTOR TargetApiDescriptor
PIMAGE_THUNK_DATA ThunkAddress
ULONG ImportDescribedByName
union _DELAYLOAD_PROC_DESCRIPTOR::@3113 Description
DWORD ImportAddressTableRVA
DWORD UnloadInformationTableRVA
union _IMAGE_DELAYLOAD_DESCRIPTOR::@4531 Attributes
DWORD BoundImportAddressTableRVA
union _IMAGE_THUNK_DATA32::@2337 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)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR 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::@2502 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)
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)
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)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define DONT_RESOLVE_DLL_REFERENCES
_Inout_ PERBANDINFO * pbi
#define ERROR_PARTIAL_COPY
#define ERROR_SEM_TIMEOUT
#define ERROR_SHARING_VIOLATION
#define APPMODEL_ERROR_NO_PACKAGE
#define ERROR_GEN_FAILURE
#define ERROR_BAD_EXE_FORMAT
@ COMIMAGE_FLAGS_32BITREQUIRED
@ COMIMAGE_FLAGS_32BITPREFERRED
_Must_inspect_result_ _In_ ULONG Flags
#define DUPLICATE_SAME_ACCESS