* autoload.cc (LoadDLLprime): Change dllname storage to string16.
(struct dll_info): Convert name to WCHAR. (std_dll_init): Load DLLs with full path to windows system directory. Add hint to Microsoft security advisory. * dcrt0.cc (init_windows_system_directory): New function. (dll_crt0_0): Call init_windows_system_directory first. * exceptions.cc (windows_system_directory): Move to globals.cc. (windows_system_directory_length): Ditto. (events_init): Drop code fetching windows_system_directory. * globals.cc (windows_system_directory): New global variable. (windows_system_directory_length): Ditto. * net.cc (load_ipv6_funcs): Use windows_system_directory rather than GetSystemDirectoryW. * netdb.cc (open_system_file): Ditto. Simplify debug output.
This commit is contained in:
@@ -4419,35 +4419,33 @@ static void
|
||||
load_ipv6_funcs ()
|
||||
{
|
||||
tmp_pathbuf tp;
|
||||
PWCHAR lib_name = tp.w_get ();
|
||||
size_t len;
|
||||
PWCHAR lib_path = tp.w_get ();
|
||||
PWCHAR lib_name;
|
||||
HMODULE lib;
|
||||
|
||||
load_ipv6_guard.init ("klog_guard")->acquire ();
|
||||
if (ipv6_inited)
|
||||
goto out;
|
||||
WSAGetLastError (); /* Kludge. Enforce WSAStartup call. */
|
||||
if (GetSystemDirectoryW (lib_name, NT_MAX_PATH))
|
||||
lib_name = wcpcpy (lib_path, windows_system_directory);
|
||||
wcpcpy (lib_name, L"ws2_32.dll");
|
||||
if ((lib = LoadLibraryW (lib_path)))
|
||||
{
|
||||
len = wcslen (lib_name);
|
||||
wcpcpy (lib_name + len, L"\\ws2_32.dll");
|
||||
if ((lib = LoadLibraryW (lib_name)))
|
||||
{
|
||||
if (get_ipv6_funcs (lib))
|
||||
goto out;
|
||||
FreeLibrary (lib);
|
||||
}
|
||||
wcpcpy (lib_name + len, L"\\wship6.dll");
|
||||
if ((lib = LoadLibraryW (lib_name)))
|
||||
{
|
||||
if (get_ipv6_funcs (lib))
|
||||
goto out;
|
||||
FreeLibrary (lib);
|
||||
}
|
||||
freeaddrinfo = NULL;
|
||||
getaddrinfo = NULL;
|
||||
getnameinfo = NULL;
|
||||
if (get_ipv6_funcs (lib))
|
||||
goto out;
|
||||
FreeLibrary (lib);
|
||||
}
|
||||
wcpcpy (lib_name, L"wship6.dll");
|
||||
if ((lib = LoadLibraryW (lib_path)))
|
||||
{
|
||||
if (get_ipv6_funcs (lib))
|
||||
goto out;
|
||||
FreeLibrary (lib);
|
||||
}
|
||||
freeaddrinfo = NULL;
|
||||
getaddrinfo = NULL;
|
||||
getnameinfo = NULL;
|
||||
|
||||
out:
|
||||
ipv6_inited = true;
|
||||
load_ipv6_guard.release ();
|
||||
|
Reference in New Issue
Block a user