src


Log

Author Commit Date CI Message
Pali Rohár d1a0d28f 2021-02-03T21:00:28 Fix MSVC 14.00 compile warning: warning C4244: '=' : conversion from 'ULONG_PTR' to 'char', possible loss of data
Pali Rohár 06fea3fe 2021-02-03T20:59:58 Add helper function MyGetModuleHandleFromAddress() This function implements calling GetModuleHandleExA() with correct flags to retrieve hModule from passed address. To allow compilation also with older compilers and environments (like WDK) with any _WIN32_WINNT value, retrieve pointer to this function via GetProcAddress(). And as a fallback implementation use old code via VirtualQuery() which was there prior commit 8ec5ffef2eca.
Pali Rohár 0e9d85a9 2021-02-03T20:59:18 Fix helper function MyEnumProcessModules() Call SetErrorMode(SEM_FAILCRITICALERRORS) prior opening Psapi.dll library to avoid GUI error messages. Close Psapi.dll library via FreeLibrary() if symbol was not retrieved to prevent possible memory leaks. Try to get K32EnumProcessModules symbol from Kernel32.dll library as it is preferred way how to call EnumProcessModules() on Windows 7 and newer versions. If retrieving EnumProcessModules symbol failed with both methods then do not try it again on next MyEnumProcessModules() function call.
Pali Rohár c172ee21 2021-02-03T20:58:39 Avoid calling SetLastError() and GetLastError() internally There is no need for propagating internal errors via SetLastError() and GetLastError() calls. Just use additional argument for save_err_str() function. Also dlfcn API is POSIX and does not use GetLastError().
Pali Rohár b89f8932 2021-02-03T20:58:15 Move hCurrentProc variable to scope where is used
Pali Rohár f7e7a5d7 2021-02-03T20:57:40 Fix some style issues
Pali Rohár b46da884 2021-01-29T14:00:30 Remove duplicate checks for NULL pointers is_valid_address() already rejects NULL addresses, so there is no need to check address for NULL.
Pali Rohár e53ecd53 2021-01-29T13:59:41 Remove code for finding symbol name in import table It is not required as import table can use only symbols which are exported and therefore are in export table. So if symbol is not found in export table it cannot be in import table.
Pali Rohár 86a41b92 2021-01-25T23:27:22 Function dladdr() now retrieve symbol name and symbol address from both export and import tables dladdr tests for Windows now should always pass like on other systems.
Ralf Habacker 0ea2334d 2020-12-11T14:32:52 Add function dladdr() and associated test application test-dladdr
Pali Rohár d230e1ca 2020-12-13T14:48:44 Rewrite function save_err_ptr_str() to not use sprintf() sprintf() is marked by MSVC as unsafe and suppressing compile warning does not work. It is still generated on AppVeyor. So rewrite code for converting pointer number to string via open coded for-loop and do not use unsafe sprintf() function anymore. New code correctly handles both 32bit and 64bit variants and does not use any #ifdef _MSC_VER anymore.
Ralf Habacker f0ac8495 2020-08-25T23:34:19 Move cmake targets into sub directories