23#define WIN32_NO_STATUS
72 {
IMAGE_DOS_SIGNATURE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 }, 0, 0, { 0 },
79#elif defined __x86_64__
83#elif defined __aarch64__
86# error You must specify the machine type
130 {
".rodata", { 0 }, 0x1000, 0x1000, 0, 0, 0, 0, 0,
159 ok( !!hexe,
"Got NULL exe handle.\n" );
162 if (!(ddag_node =
mod->DdagNode))
164 win_skip(
"DdagNode is NULL, skipping tests.\n" );
172 win_skip(
"Old LDR_DATA_TABLE_ENTRY structure, skipping tests.\n" );
183 DWORD len1A, len1W = 0, len2A, len2W = 0;
188 memset(bufA,
'-',
sizeof(bufA));
194 ok(len1A > 0,
"Getting module filename for handle %p\n", hMod);
198 memset(bufW,
'-',
sizeof(bufW));
204 ok(len1W > 0,
"Getting module filename for handle %p\n", hMod);
207 ok(len1A ==
strlen(bufA),
"Unexpected length of GetModuleFilenameA (%ld/%d)\n", len1A,
lstrlenA(bufA));
211 ok(len1W ==
lstrlenW(bufW),
"Unexpected length of GetModuleFilenameW (%ld/%d)\n", len1W,
lstrlenW(bufW));
212 ok(
cmpStrAW(bufA, bufW, len1A, len1W),
"Comparing GetModuleFilenameAW results\n");
216 memset(bufA,
'-',
sizeof(bufA));
218 ok(len2A > 0,
"Getting module filename for handle %p\n", hMod);
222 memset(bufW,
'-',
sizeof(bufW));
224 ok(len2W > 0,
"Getting module filename for handle %p\n", hMod);
225 ok(
cmpStrAW(bufA, bufW, len2A, len2W),
"Comparing GetModuleFilenameAW results with buffer too small\n" );
226 ok(len1W / 2 == len2W,
"Correct length in GetModuleFilenameW with buffer too small (%ld/%ld)\n", len1W / 2, len2W);
229 ok(len1A / 2 == len2A,
230 "Correct length in GetModuleFilenameA with buffer too small (%ld/%ld)\n", len1A / 2, len2A);
233 ok(len1A > 0,
"Getting module filename for handle %p\n", hMod);
235 ok(len1W > 0,
"Getting module filename for handle %p\n", hMod);
248 "Unexpected success in module handle\n");
249 ok(bufW[0] ==
'*',
"When failing, buffer shouldn't be written to\n");
253 ok(
GetModuleFileNameA((
void*)0xffffffff, bufA,
sizeof(bufA)) == 0,
"Unexpected success in module handle\n");
254 ok(bufA[0] ==
'*',
"When failing, buffer shouldn't be written to\n");
268 ok( fp !=
NULL,
"CreateFileA should be there\n");
273 ok( hModule1 !=
NULL,
"\"kernel32 \" should be loadable\n" );
275 ok(
hModule == hModule1,
"Loaded wrong module\n" );
282 static const char dllname[] =
"shell32.dll";
284 HMODULE hModule1, hModule2, hModule3;
309 ok(hModule2 !=
NULL,
"LoadLibrary(%s) failed\n",
path2);
316 ok(hModule3 !=
NULL,
"LoadLibrary(%s) failed\n",
path1);
326 ok(hModule1 !=
NULL,
"LoadLibrary(%s) failed\n",
path1);
327 if (hModule1 !=
NULL)
338 ok( !
hModule,
"non_ex_pv.dll should be not loadable\n");
351 ok( !fp,
"non_ex_call should not be found\n");
356 ok( !fp,
"non_ex_call should not be found\n");
378 "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
386 "Expected ERROR_MOD_NOT_FOUND or ERROR_DLL_NOT_FOUND, got %ld\n",
GetLastError());
408 "Expected ERROR_SHARING_VIOLATION, got %ld\n",
GetLastError());
418 "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %ld\n",
GetLastError());
439 ok(
hmodule != 0,
"Expected valid module handle\n");
442 "Expected 0xdeadbeef or ERROR_SUCCESS, got %ld\n",
GetLastError());
455 ok(
hmodule != 0,
"Expected valid module handle\n");
470 "Expected ERROR_FILE_NOT_FOUND, got %ld\n",
GetLastError());
476 ok(
hmodule != 0,
"Expected valid module handle\n");
480 ok(!
ret,
"Free succeeded on wrong handle\n");
485 ok(
ret,
"Expected to be able to free the module, failed with %ld\n",
GetLastError());
488 ok(!
ret,
"Unexpected ability to free the module, failed with %ld\n",
GetLastError());
507 static const char apiset_dll[] =
"api-ms-win-shcore-obsolete-l1-1-0.dll";
515 { { 1, 2, 3 }, 4, 3 },
516 { { 1, 3, 2 }, 4, 2 },
523 { { 1, 1, 2 }, 0, 2 },
528 unsigned int i,
j,
k;
538 for (
i = 1;
i <= 6;
i++)
543 if (
i >= 5)
continue;
544 sprintf(
p,
"\\%u\\winetestdll.dll",
i );
563 if (pAddDllDirectory)
567 ok( !
mod,
"LoadLibrary succeeded\n" );
598 if (pAddDllDirectory)
602 ok( !
mod,
"LoadLibrary succeeded\n" );
618 ok( !
mod,
"LoadLibrary succeeded\n" );
623 ok( !
mod,
"LoadLibrary succeeded\n" );
628 ok( !
mod,
"LoadLibrary succeeded\n" );
633 ok( !
mod,
"LoadLibrary succeeded\n" );
638 ok( !
mod,
"LoadLibrary succeeded\n" );
644 if (!pAddDllDirectory || !pSetDllDirectoryA)
goto done;
648 ok( !
mod,
"LoadLibrary succeeded\n" );
655 ok( !
mod,
"LoadLibrary succeeded\n" );
662 ok( !
mod,
"LoadLibrary succeeded\n" );
667 ok( !
mod,
"LoadLibrary succeeded\n" );
672 ok( !
mod,
"LoadLibrary succeeded\n" );
677 ok( !
mod,
"LoadLibrary succeeded\n" );
682 ok( !
mod,
"LoadLibrary succeeded\n" );
687 ok( !
mod,
"LoadLibrary succeeded\n" );
696 cookies[
k] = pAddDllDirectory( bufW );
702 pSetDllDirectoryA(
buf );
704 else pSetDllDirectoryA(
NULL );
717 ok( !
mod,
"%u: LoadLibrary succeeded\n",
j );
729 win_skip(
"%s already referenced, skipping test.\n", apiset_dll );
745 ok(
mod == shcore,
"wrong module %p/%p\n",
mod, shcore );
749 ok( !shcore,
"shcore not unloaded\n" );
758 ok(
mod == shcore,
"wrong module %p/%p\n",
mod, shcore );
762 ok( !shcore,
"shcore not unloaded\n" );
773 ok(
mod == shcore,
"wrong module %p/%p\n",
mod, shcore );
778 ok( !shcore,
"shcore not unloaded\n" );
795 win_skip(
"%s not found, skipping test.\n", apiset_dll );
800 ok( !
mod,
"rasapi32 already loaded\n" );
806 ok( !
mod,
"rasapi32 loaded\n" );
811 ok( !
mod,
"rasapi32 loaded\n" );
818 ok( !
mod,
"rasapi32 still loaded\n" );
821 for (
i = 1;
i <= 6;
i++)
823 sprintf(
p,
"\\%u\\winetestdll.dll",
i );
838 static const char *dll_directories[] =
843 "Q:\\A\\Long\\Path with spaces that\\probably\\doesn't exist!",
847 if (!pGetDllDirectoryA || !pGetDllDirectoryW)
849 win_skip(
"GetDllDirectory not available\n");
852 if (!pSetDllDirectoryA)
854 win_skip(
"SetDllDirectoryA not available\n");
861 if (!pSetDllDirectoryA(dll_directories[
i]))
863 skip(
"i=%d, SetDllDirectoryA failed\n",
i);
868 ret = pGetDllDirectoryA(0,
NULL);
871 ret = pGetDllDirectoryW(0,
NULL);
876 bufferA[
length + 1] =
'A';
877 ret = pGetDllDirectoryA(
length + 1, bufferA);
879 "i=%d, Expected %lu(+1), got %lu\n",
i,
length,
ret);
880 ok(bufferA[
length + 1] ==
'A',
"i=%d, Buffer overflow\n",
i);
881 ok(
strcmp(bufferA, dll_directories[
i]) == 0,
"i=%d, Wrong path returned: '%s'\n",
i, bufferA);
884 bufferW[
length + 1] =
'A';
885 ret = pGetDllDirectoryW(
length + 1, bufferW);
887 ok(bufferW[
length + 1] ==
'A',
"i=%d, Buffer overflow\n",
i);
894 ret = pGetDllDirectoryA(0, bufferA);
898 ret = pGetDllDirectoryW(0, bufferW);
900 ok(bufferW[0] ==
'A' ||
broken(bufferW[0] == 0),
901 "i=%d, Buffer overflow\n",
i);
905 ret = pGetDllDirectoryA(
length, bufferA);
908 ok(bufferA[0] == 0,
"i=%d, Buffer not null terminated\n",
i);
911 ret = pGetDllDirectoryW(
length, bufferW);
914 ok(bufferW[0] == 0,
"i=%d, Buffer overflow\n",
i);
927 if (pLdrGetDllDirectory)
931 str.Buffer = bufferW;
932 str.MaximumLength =
sizeof(bufferW);
936 str.Length /
sizeof(
WCHAR) ),
"%u: got %s instead of %s\n",
938 if (dll_directories[
i][0])
940 memset( bufferW, 0xcc,
sizeof(bufferW) );
941 str.MaximumLength = (
strlen( dll_directories[
i] ) - 1) *
sizeof(
WCHAR);
944 ok( bufferW[0] == 0 && bufferW[1] == 0xcccc,
945 "%u: buffer %x %x\n",
i, bufferW[0], bufferW[1] );
953 pSetDllDirectoryA(
NULL);
960#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(mod, #f))
982 if (!pK32GetModuleInformation)
991 static const char longname[] =
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
992 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
993 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
994 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
995 static const WCHAR kernel32W[] = {
'k',
'e',
'r',
'n',
'e',
'l',
'3',
'2',0};
996 static const WCHAR nosuchmodW[] = {
'n',
'o',
's',
'u',
'c',
'h',
'm',
'o',
'd',0};
1004 ok( !
ret,
"unexpected success\n" );
1010 ok( !
ret,
"unexpected success\n" );
1024 ok( !
ret,
"unexpected success\n" );
1031 ok( !
ret,
"unexpected success\n" );
1038 ok( !
ret,
"unexpected success\n" );
1049 ok( !
ret,
"unexpected success\n" );
1055 ok( !
ret,
"unexpected success\n" );
1069 ok( !
ret,
"unexpected success\n" );
1076 ok( !
ret,
"unexpected success\n" );
1082 ok( !
ret,
"unexpected success\n" );
1095 ok( !
ret,
"unexpected success\n" );
1102 ok( !
ret,
"unexpected success\n" );
1108 ok( !
ret,
"unexpected success\n" );
1121 ok( !
ret,
"unexpected success\n" );
1130 ok( !
ret,
"unexpected success\n" );
1136 ok( !
ret,
"unexpected success\n" );
1143 ok(
mod == mod_kernel32,
"got %p\n",
mod );
1150 ok( !
ret,
"unexpected success\n" );
1157 ok( !
ret,
"unexpected success\n" );
1163 ok( !
ret,
"unexpected success\n" );
1170 ok(
mod == mod_kernel32,
"got %p\n",
mod );
1177 ok( !
ret,
"unexpected success\n" );
1183 ret =
GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
1184 | GET_MODULE_HANDLE_EX_FLAG_PIN, (
LPCWSTR)mod_kernel32, &
mod );
1186 ok( !
ret,
"unexpected success\n" );
1194 ok( !
ret,
"unexpected success\n" );
1210 ok(
ret,
"K32GetModuleInformation failed for main module\n");
1211 ok(
info.lpBaseOfDll ==
mod,
"Wrong info.lpBaseOfDll = %p, expected %p\n",
info.lpBaseOfDll,
mod);
1212 ok(
info.EntryPoint !=
NULL,
"Expected nonzero entrypoint\n");
1217 ok(
ret,
"K32GetModuleInformation failed for kernel32 module\n");
1218 ok(
info.lpBaseOfDll ==
mod,
"Wrong info.lpBaseOfDll = %p, expected %p\n",
info.lpBaseOfDll,
mod);
1219 ok(
info.EntryPoint !=
NULL,
"Expected nonzero entrypoint\n");
1224 static const WCHAR tmpW[] = {
't',
'm',
'p',0};
1225 static const WCHAR dotW[] = {
'.',
'\\',
'.',0};
1231 if (!pAddDllDirectory || !pRemoveDllDirectory)
1233 win_skip(
"AddDllDirectory not available\n" );
1251 ok( !
cookie,
"AddDllDirectory succeeded\n" );
1254 ok( !
cookie,
"AddDllDirectory succeeded\n" );
1264 ok( !
cookie,
"AddDllDirectory succeeded\n" );
1273 if (!pSetDefaultDllDirectories)
1275 win_skip(
"SetDefaultDllDirectories not available\n" );
1280 ok(
mod !=
NULL,
"loading authz failed\n" );
1285 ok( !
mod,
"loading authz succeeded\n" );
1290 ok(
mod !=
NULL,
"loading authz failed\n" );
1293 ok( !
mod,
"loading authz succeeded\n" );
1298 ok( !
mod,
"loading authz succeeded\n" );
1303 ok(
mod !=
NULL,
"loading authz failed\n" );
1307 ret = pSetDefaultDllDirectories( 0 );
1308 ok( !
ret,
"SetDefaultDllDirectories succeeded\n" );
1312 ret = pSetDefaultDllDirectories( 3 );
1313 ok( !
ret,
"SetDefaultDllDirectories succeeded\n" );
1318 ok( !
ret,
"SetDefaultDllDirectories succeeded\n" );
1323 ok( !
ret ||
broken(
ret) ,
"SetDefaultDllDirectories succeeded\n" );
1328 ok( !
ret ||
broken(
ret) ,
"SetDefaultDllDirectories succeeded\n" );
1340 for (
i = 0;
i <
min( refcount, 10 ); ++
i)
1348 "Refcount test failed, i %u, error %lu.\n",
i,
GetLastError(), refcount );
1351 if (refcount != ~0
u)
1368 if (!pLdrGetDllHandleEx)
1370 win_skip(
"LdrGetDllHandleEx is not available.\n" );
1380 ok( !!loaded_mod,
"Failed to load module.\n" );
1383 ok(
mod == loaded_mod,
"got %p\n",
mod );
1389 ok( !!loaded_mod,
"Failed to load module.\n" );
1393 ok(
mod == loaded_mod,
"got %p\n",
mod );
1399 ok( !!loaded_mod,
"Failed to load module.\n" );
1402 ok(
mod == loaded_mod,
"got %p\n",
mod );
1408 ok( !!loaded_mod,
"Failed to load module.\n" );
1415 ok(
mod == loaded_mod,
"got %p\n",
mod );
1421 for (
i = 3;
i < 32; ++
i)
1424 ok( !!loaded_mod,
"Failed to load module.\n" );
1437 ok( !!loaded_mod,
"Failed to load module.\n" );
1441 ok(
mod == loaded_mod,
"got %p\n",
mod );
1447 if (pAddDllDirectory) pAddDllDirectory(
path );
1461 bret =
MoveFileA(
"d01.dll",
"d02.dll" );
1467 bret =
MoveFileA(
"d02.dll",
"testdir\\d02.dll" );
1472 ok( loaded_mod ==
mod,
"got %p, %p.\n", loaded_mod,
mod );
1485 WCHAR expected_terminator;
1489 if (!pLdrGetDllFullName)
1491 win_skip(
"LdrGetDllFullName not available.\n" );
1500 memset( path_buffer, 0x23,
sizeof(path_buffer) );
1504 ok(
path.Length == 0,
"Expected length 0, got %d.\n",
path.Length );
1505 ok( path_buffer[0] == 0x2323,
"Expected 0x2323, got 0x%x.\n", path_buffer[0] );
1508 path.MaximumLength = 5;
1512 ok(
path.Length ==
path.MaximumLength,
"Expected length %u, got %u.\n",
path.MaximumLength,
path.Length );
1513 expected_terminator = 0x2300 | (expected_path[
path.MaximumLength /
sizeof(
WCHAR)] & 0xFF);
1514 ok( path_buffer[
path.MaximumLength /
sizeof(
WCHAR)] == expected_terminator,
1515 "Expected 0x%x, got 0x%x.\n", expected_terminator, path_buffer[
path.MaximumLength / 2] );
1516 path_buffer[
path.MaximumLength /
sizeof(
WCHAR)] = 0;
1517 expected_path[
path.MaximumLength /
sizeof(
WCHAR)] = 0;
1518 ok(
lstrcmpW(path_buffer, expected_path) == 0,
"Expected %s, got %s.\n",
1522 lstrcatW( expected_path,
L"\\ntdll.dll" );
1523 path.MaximumLength =
sizeof(path_buffer);
1527 ok( !
lstrcmpiW(path_buffer, expected_path),
"Expected %s, got %s\n",
1533 ok( !
lstrcmpiW(path_buffer, expected_path),
"Expected %s, got %s.\n",
1568 if (!pApiSetQueryApiSetPresence)
1570 win_skip(
"ApiSetQueryApiSetPresence not implemented\n" );
1573 if (!pApiSetQueryApiSetPresenceEx)
win_skip(
"ApiSetQueryApiSetPresenceEx not implemented\n" );
1574 if (!pIsApiSetImplemented)
win_skip(
"IsApiSetImplemented not implemented\n" );
1582 status = pApiSetQueryApiSetPresence( &
name, &present );
1585 "wrong present %u\n", present );
1586 if (pApiSetQueryApiSetPresenceEx)
1588 present = in_schema = 0xff;
1589 status = pApiSetQueryApiSetPresenceEx( &
name, &in_schema, &present );
1593 ok( in_schema ==
tests[
i].in_schema,
"wrong in_schema %u\n", in_schema );
1594 ok( present ==
tests[
i].present_ex,
"wrong present %u\n", present );
1598 ok( in_schema == 0xff,
"wrong in_schema %u\n", in_schema );
1599 ok( present == 0xff,
"wrong present %u\n", present );
1602 if (pIsApiSetImplemented)
1614#if defined(__REACTOS__) && defined(_MSC_VER)
1615 struct dll_dependency {
1616 const WCHAR *dllname;
1620 static struct dll_dependency expected_exe_dependencies_Old[] = {
1621 {
L"advapi32.dll" },
1622 {
L"msvcrt.dll",
TRUE },
1623 {
L"user32.dll",
TRUE },
1626 static struct dll_dependency expected_exe_dependencies_Win8[] = {
1628 {
L"advapi32.dll",
TRUE },
1629 {
L"msvcrt.dll",
TRUE },
1632 static struct dll_dependency* expected_exe_dependencies;
1633 static int expected_exe_dependencies_size;
1637 const WCHAR *dllname;
1640 expected_exe_dependencies[] =
1642 {
L"advapi32.dll" },
1643 {
L"msvcrt.dll",
TRUE },
1644 {
L"user32.dll",
TRUE },
1657 skip(
"test_ddag_node() crashes on WS03.\n");
1662 ok( !!hexe,
"Got NULL exe handle.\n" );
1669 win_skip(
"DdagNode is NULL, skipping tests.\n" );
1673 ok( !!
node->Modules.Flink,
"Got NULL module link.\n" );
1675 ok(
mod2 ==
mod ||
broken( (
void **)
mod2 == (
void **)
mod - 1 ),
"Got unexpected mod2 %p, expected %p.\n",
1679 win_skip(
"Old LDR_DATA_TABLE_ENTRY structure, skipping tests.\n" );
1682 ok(
node->Modules.Flink->Flink == &
node->Modules,
"Expected one element in list.\n" );
1684 ok( !
node->IncomingDependencies.Tail,
"Expected empty incoming dependencies list.\n" );
1687 ok( !!
node->Dependencies.Tail ||
broken(
sizeof(
void *) == 4 && !
node->Dependencies.Tail ),
1688 "Expected nonempty dependencies list.\n" );
1689 if (!
node->Dependencies.Tail)
1691 win_skip(
"Empty dependencies list.\n" );
1694 todo_wine ok(
node->LoadCount == -1,
"Got unexpected LoadCount %ld.\n",
node->LoadCount );
1697 se =
node->Dependencies.Tail;
1698#if defined(__REACTOS__) && defined(_MSC_VER)
1700 expected_exe_dependencies = expected_exe_dependencies_Win8;
1701 expected_exe_dependencies_size =
ARRAY_SIZE(expected_exe_dependencies_Win8);
1703 expected_exe_dependencies = expected_exe_dependencies_Old;
1704 expected_exe_dependencies_size =
ARRAY_SIZE(expected_exe_dependencies_Old);
1706 for (
i = 0;
i < expected_exe_dependencies_size; ++
i)
1715 ok( !!se,
"Got NULL list element.\n" );
1720 ok( !!dep_node,
"Got NULL dep_node.\n" );
1722 if (dep_node == prev_node && expected_exe_dependencies[
i].
optional)
1724 win_skip(
"Module is not directly referenced.\n" );
1726 prev_node = dep_node;
1731 ok( !
lstrcmpW(
mod2->BaseDllName.Buffer, expected_exe_dependencies[
i].dllname ),
1732 "Got unexpected module %s.\n",
debugstr_w(
mod2->BaseDllName.Buffer));
1735 ok( !!se2,
"Got empty incoming dependencies list.\n" );
1742 ok( dep2 == dep,
"Dependency not found in incoming deps list.\n" );
1745 "Got unexpected LoadCount %ld.\n", dep_node->
LoadCount );
1748 prev_node = dep_node;
1750 ok( se ==
node->Dependencies.Tail,
"Expected end of the list.\n" );
1783 ok(!thread_teb->ThreadLocalStoragePointer,
"got %p.\n", thread_teb->ThreadLocalStoragePointer);
1787 ok(!!thread_teb->ThreadLocalStoragePointer,
"got NULL.\n");
1790 ok(!thread_teb->TlsLinks.Flink,
"got %p.\n", thread_teb->TlsLinks.Flink);
1791 ok(!thread_teb->TlsLinks.Blink,
"got %p.\n", thread_teb->TlsLinks.Blink);
1812 if (!
node)
return 0;
1814 node->ParentValue );
1821 ok( (
char *)
mod->DllBase <
base,
"wrong ordering.\n" );
1826 ok( (
char *)
mod->DllBase >
base,
"wrong ordering.\n" );
1845 ok(
mod->BaseAddressIndexNode.ParentValue ||
mod->BaseAddressIndexNode.Left ||
mod->BaseAddressIndexNode.Right,
1846 "got zero BaseAddressIndexNode.\n" );
1847 root = &
mod->BaseAddressIndexNode;
1860 ok( !!
node,
"got NULL.\n" );
1863 if (
base == (
char *)
mod2->DllBase)
break;
1886 const WCHAR *modname;
1899 modname =
module->BaseDllName.Buffer;
1902 for (entry2 = mark->
Flink; entry2 != mark; entry2 = entry2->
Flink)
1905 if ((found = !
lstrcmpiW(
module->BaseDllName.Buffer, modname )))
break;
1907 ok( found,
"Could not find %s.\n",
debugstr_w(modname) );
1921 win_skip(
"GetModuleFileNameW not existing on this platform, skipping W-calls\n");
std::map< E_MODULE, HMODULE > mod
#define ERROR_NOT_ENOUGH_MEMORY
static const WCHAR rootW[]
#define IMAGE_FILE_MACHINE_ARMNT
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define ERROR_MOD_NOT_FOUND
#define GetCurrentDirectoryW(x, y)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define GetCurrentProcess()
#define IMAGE_FILE_MACHINE_ARM64
#define FILE_ATTRIBUTE_NORMAL
#define MultiByteToWideChar
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI SetEndOfFile(HANDLE hFile)
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)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
BOOL WINAPI GetModuleHandleExW(IN DWORD dwFlags, IN LPCWSTR lpwModuleName OPTIONAL, OUT HMODULE *phModule)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
BOOL WINAPI GetModuleHandleExA(IN DWORD dwFlags, IN LPCSTR lpModuleName OPTIONAL, OUT HMODULE *phModule)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
DWORD WINAPI GetDllDirectoryW(IN DWORD nBufferLength, OUT LPWSTR lpBuffer)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
BOOL WINAPI SetDllDirectoryA(IN LPCSTR lpPathName)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetDllDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI ResumeThread(IN HANDLE hThread)
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)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
BOOL WINAPI DECLSPEC_HOTPATCH AreFileApisANSI(void)
DLL_DIRECTORY_COOKIE WINAPI DECLSPEC_HOTPATCH AddDllDirectory(const WCHAR *dir)
BOOL WINAPI DECLSPEC_HOTPATCH SetDefaultDllDirectories(DWORD flags)
BOOL WINAPI IsApiSetImplemented(LPCSTR name)
BOOL WINAPI DECLSPEC_HOTPATCH RemoveDllDirectory(DLL_DIRECTORY_COOKIE cookie)
static void basename(LPCWSTR path, LPWSTR name)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
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_DOS_HEADER IMAGE_DOS_HEADER
GLuint GLuint GLsizei count
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
NTSYSAPI NTSTATUS WINAPI ApiSetQueryApiSetPresenceEx(const UNICODE_STRING *, BOOLEAN *, BOOLEAN *)
NTSYSAPI NTSTATUS WINAPI ApiSetQueryApiSetPresence(const UNICODE_STRING *, BOOLEAN *)
#define LDR_GET_DLL_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
#define LDR_GET_DLL_HANDLE_EX_FLAG_PIN
NTSYSAPI NTSTATUS WINAPI LdrSetDllDirectory(const UNICODE_STRING *)
NTSYSAPI NTSTATUS WINAPI LdrGetDllFullName(HMODULE, UNICODE_STRING *)
NTSYSAPI NTSTATUS WINAPI LdrGetDllDirectory(UNICODE_STRING *)
#define HASH_STRING_ALGORITHM_DEFAULT
NTSTATUS NTAPI LdrGetDllHandle(_In_opt_ PWSTR DllPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_ PVOID *DllHandle)
NTSTATUS NTAPI LdrGetDllHandleEx(_In_ ULONG Flags, _In_opt_ PWSTR DllPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_opt_ PVOID *DllHandle)
NTSTATUS NTAPI LdrFindEntryForAddress(_In_ PVOID Address, _Out_ PLDR_DATA_TABLE_ENTRY *Module)
void * DLL_DIRECTORY_COOKIE
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
#define ERROR_FILE_NOT_FOUND
static struct test_info tests[]
static const WCHAR filenameW[]
static HANDLE test_tls_links_done
IMAGE_SECTION_HEADER section
static void test_LdrGetDllFullName(void)
static ULONG *static BOOL is_unicode_enabled
static BOOL cmpStrAW(const char *a, const WCHAR *b, DWORD lenA, DWORD lenB)
static void test_tls_links(void)
static void testGetModuleHandleEx(void)
static void testLoadLibraryA(void)
static BOOL is_old_loader_struct(void)
static void test_hash_links(void)
static ULONG hash_basename(const UNICODE_STRING *basename)
static void create_test_dll(const char *name)
static void test_LoadLibraryEx_search_flags(void)
static void testGetDllDirectory(void)
static void testGetModuleFileName_Wrong(void)
static LPCWSTR ULONG * dll_characteristics
static void testGetProcAddress_Wrong(void)
static void test_ddag_node(void)
static void check_refcount(HMODULE mod, unsigned int refcount)
static void test_AddDllDirectory(void)
static RTL_BALANCED_NODE * rtl_node_parent(RTL_BALANCED_NODE *node)
static void testGetModuleFileName(const char *name)
static HMODULE MODULEINFO DWORD cb
static void test_base_address_index_tree(void)
static void init_pointers(void)
static DWORD WINAPI test_tls_links_thread(void *tlsidx_v)
static void testLoadLibraryA_Wrong(void)
static void testLoadLibraryEx(void)
static ULONG const UNICODE_STRING HMODULE * base
static const struct @1821 dll_image
static HANDLE test_tls_links_started
static void test_SetDefaultDllDirectories(void)
static void test_apisets(void)
static void testNestedLoadLibraryA(void)
static unsigned int check_address_index_tree(RTL_BALANCED_NODE *node)
static void test_LdrGetDllHandleEx(void)
static void testK32GetModuleInformation(void)
static HMODULE MODULEINFO * modinfo
static const WCHAR dotW[]
static const WCHAR path1[]
static const WCHAR path2[]
static CookieInternal * cookies
NTSYSAPI NTSTATUS NTAPI RtlHashUnicodeString(_In_ CONST UNICODE_STRING *String, _In_ BOOLEAN CaseInSensitive, _In_ ULONG HashAlgorithm, _Out_ PULONG HashValue)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define RTL_BALANCED_NODE_RESERVED_PARENT_MASK
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT
#define IMAGE_SCN_CNT_INITIALIZED_DATA
#define IMAGE_FILE_MACHINE_AMD64
#define IMAGE_SCN_MEM_READ
#define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
#define IMAGE_NT_OPTIONAL_HDR_MAGIC
NTSTATUS NTAPI NtQueryInformationThread(_In_ HANDLE ThreadHandle, _In_ THREADINFOCLASS ThreadInformationClass, _Out_writes_bytes_to_opt_(ThreadInformationLength, *ReturnLength) PVOID ThreadInformation, _In_ ULONG ThreadInformationLength, _Out_opt_ PULONG ReturnLength)
#define STATUS_DLL_NOT_FOUND
#define IMAGE_FILE_EXECUTABLE_IMAGE
#define IMAGE_FILE_MACHINE_I386
struct _IMAGE_OPTIONAL_HEADER IMAGE_OPTIONAL_HEADER
#define IMAGE_NT_SIGNATURE
#define IMAGE_DOS_SIGNATURE
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
#define _WIN32_WINNT_WIN8
#define _WIN32_WINNT_VISTA
#define STATUS_BUFFER_TOO_SMALL
LDRP_CSLIST IncomingDependencies
struct _LDR_DDAG_NODE * dependency_from
struct _LDR_DDAG_NODE * dependency_to
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
struct _SINGLE_LIST_ENTRY * Next
PVOID ThreadLocalStoragePointer
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
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)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
DWORD WINAPI GetLastError(void)
#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
#define LOAD_LIBRARY_AS_DATAFILE
#define LOAD_LIBRARY_SEARCH_SYSTEM32
#define LOAD_WITH_ALTERED_SEARCH_PATH
#define LOAD_LIBRARY_SEARCH_USER_DIRS
#define LOAD_LIBRARY_SEARCH_APPLICATION_DIR
#define ERROR_SHARING_VIOLATION
#define ERROR_BAD_EXE_FORMAT
#define ERROR_FILE_INVALID
#define ERROR_FILENAME_EXCED_RANGE
#define ERROR_PROC_NOT_FOUND