forked from enlightenment/efl
* 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:
parent
fe05034678
commit
3697aa349d
|
@ -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>
|
2009-12-19 Vincent Torri <doursse at users dot sf dot net>
|
||||||
|
|
||||||
* Makefile.am:
|
* Makefile.am:
|
||||||
|
|
|
@ -144,22 +144,28 @@ dladdr (const void *addr __UNUSED__, Dl_info *info)
|
||||||
size_t length;
|
size_t length;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!info)
|
if (!info)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
length = VirtualQuery(addr, &mbi, sizeof(mbi));
|
#ifdef _WIN32_WINNT
|
||||||
if (!length)
|
length = VirtualQuery(addr, &mbi, sizeof(mbi));
|
||||||
return 0;
|
if (!length)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (mbi.State != MEM_COMMIT)
|
if (mbi.State != MEM_COMMIT)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!mbi.AllocationBase)
|
if (!mbi.AllocationBase)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ret = GetModuleFileName((HMODULE)mbi.AllocationBase, (LPTSTR)&tpath, PATH_MAX);
|
ret = GetModuleFileName((HMODULE)mbi.AllocationBase, (LPTSTR)&tpath, PATH_MAX);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return 0;
|
return 0;
|
||||||
|
#else
|
||||||
|
ret = GetModuleFileName(NULL, (LPTSTR)&tpath, PATH_MAX);
|
||||||
|
if (!ret)
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
path = evil_wchar_to_char(tpath);
|
path = evil_wchar_to_char(tpath);
|
||||||
|
|
Loading…
Reference in New Issue