* src/lib/dlfcn/dlfcn.c:

Fix dladdr() on Windows CE: use the calling process
	address to get the path.



SVN revision: 45325
This commit is contained in:
Vincent Torri 2010-01-19 13:46:45 +00:00
parent fe05034678
commit 3697aa349d
2 changed files with 22 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2010-01-19 Vincent Torri <doursse at users dot sf dot net>
* src/lib/dlfcn/dlfcn.c:
Fix dladdr() on Windows CE: use the calling process
address to get the path.
2009-12-19 Vincent Torri <doursse at users dot sf dot net>
* Makefile.am:

View File

@ -144,22 +144,28 @@ dladdr (const void *addr __UNUSED__, Dl_info *info)
size_t length;
int ret = 0;
if (!info)
return 0;
if (!info)
return 0;
length = VirtualQuery(addr, &mbi, sizeof(mbi));
if (!length)
return 0;
#ifdef _WIN32_WINNT
length = VirtualQuery(addr, &mbi, sizeof(mbi));
if (!length)
return 0;
if (mbi.State != MEM_COMMIT)
return 0;
if (mbi.State != MEM_COMMIT)
return 0;
if (!mbi.AllocationBase)
return 0;
if (!mbi.AllocationBase)
return 0;
ret = GetModuleFileName((HMODULE)mbi.AllocationBase, (LPTSTR)&tpath, PATH_MAX);
ret = GetModuleFileName((HMODULE)mbi.AllocationBase, (LPTSTR)&tpath, PATH_MAX);
if (!ret)
return 0;
#else
ret = GetModuleFileName(NULL, (LPTSTR)&tpath, PATH_MAX);
if (!ret)
return 0;
#endif
#ifdef UNICODE
path = evil_wchar_to_char(tpath);