* cygheap.cc (cygheap_fixup_in_child): Call set_dll_dir.

(init_cygheap::init_installation_root): Just memmove contents of
	installation_root instead of calling GetModuleFileNameW again.
	Copy installation_root to installation_dir before stripping of
	"bin" dir.  Don't call SetDllDirectory here.  Explain what we do.
	(setup_cygheap): New function taking over initial cygheap setup
	from memory_init.  Additionally call set_dll_dir.
	* cygheap.h (struct init_cygheap): Add installation_dir member.
	(init_cygheap::set_dll_dir): Define.
	(setup_cygheap): Declare.
	* dcrt0.cc: Throughout drop parameter from memory_init call.
	(dll_crt0_0): Call setup_cygheap prior to memory_init.
	* dlfcn.cc (dlopen): Change comment to point to the right function.
	* shared.cc (memory_init): Drop parameter.  Drop cygheap setup.
	* shared_info.h (memory_init): Change declaration accordingly.
This commit is contained in:
Corinna Vinschen
2014-10-17 14:36:59 +00:00
parent 1f0bd6f96f
commit cc5a7d7519
7 changed files with 63 additions and 31 deletions

View File

@@ -166,10 +166,10 @@ dlopen (const char *name, int flags)
{
/* This may indicate that a dependent DLL could not be loaded.
Typically this occurs because we removed the CWD from the
DLL search path via SetDllDirectory
(see init_cygheap::init_installation_root), and the load
mechanism expects that dlopening a DLL from the CWD allows
to load dependent DLLs from the same dir.
DLL search path via SetDllDirectory (see inline function
init_cygheap::set_dll_dir), and the load mechanism expects
that dlopening a DLL from the CWD allows to load dependent
DLLs from the same dir.
To continue supporting this scenario, call LoadLibraryEx
with the LOAD_WITH_ALTERED_SEARCH_PATH flag. This flag