Improve the implementation of dladdr on Windows. As the symbols are in the DLL's and as the DLL's are in the bin/

subdirectory, installers must put the eina mempools and evas
modules directories in the bin/ subdirectory

SVN revision: 42734
This commit is contained in:
Vincent Torri 2009-09-26 21:36:01 +00:00
parent 9f26b75b44
commit b25ed5342f
1 changed files with 12 additions and 1 deletions

View File

@ -138,6 +138,7 @@ int
dladdr (const void *addr __UNUSED__, Dl_info *info)
{
TCHAR tpath[PATH_MAX];
MEMORY_BASIC_INFORMATION mbi;
char *path;
char *tmp;
size_t length;
@ -146,7 +147,17 @@ dladdr (const void *addr __UNUSED__, Dl_info *info)
if (!info)
return 0;
ret = GetModuleFileName(GetModuleHandle(NULL), (LPTSTR)&tpath, PATH_MAX);
length = VirtualQuery(addr, &mbi, sizeof(mbi));
if (!length)
return 0;
if (mbi.State != MEM_COMMIT)
return 0;
if (!mbi.AllocationBase)
return 0;
ret = GetModuleFileName((HMODULE)mbi.AllocationBase, (LPTSTR)&tpath, PATH_MAX);
if (!ret)
return 0;