* 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:
Corinna Vinschen
2010-08-28 08:51:21 +00:00
parent 657f0e4a14
commit 893a8b78fc
7 changed files with 63 additions and 45 deletions

View File

@@ -36,6 +36,7 @@ details. */
#include "tls_pbuf.h"
#include "exception.h"
#include "cygxdr.h"
#include "ntdll.h"
#define MAX_AT_FILE_LEVEL 10
@@ -679,9 +680,23 @@ disable_dep ()
}
#endif
/* Retrieve and store system directory for later use. Note that the
directory is stored with a trailing backslash! */
static void
init_windows_system_directory ()
{
windows_system_directory_length =
GetSystemDirectoryW (windows_system_directory, MAX_PATH);
if (windows_system_directory_length == 0)
api_fatal ("can't find windows system directory");
windows_system_directory[windows_system_directory_length++] = L'\\';
windows_system_directory[windows_system_directory_length] = L'\0';
}
void __stdcall
dll_crt0_0 ()
{
init_windows_system_directory ();
init_global_security ();
initial_env ();