| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
Now when dlfcn.c does not call any function from CRT library, it is not
needed to link dlfcn library with some specific CRT library (e.g.
crtdll.dll, msvcrt.dll, msvcr120.dll or api-ms-win-crt-*.dll) and therefore
bound the dlfcn DLL library to specific Visual C++ runtime version.
This makes libdl.dll DLL library CRT-neutral and therefore can be used or
linked into any EXE application using any CRT library of any version,
without any Visual C++ runtime version conflict.
|
| |
|
|
|
|
|
|
|
| |
calling _alloca
Usage of _alloca emits __alloca_probe call by msvc compiler which is
present in msvc LIBC library. So when _alloca is used then force linker to
include LIBC library. Correct name of the LIBC library is determined by
_DLL, _MT and _DEBUG preprocessor macros.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
It breaks memory allocation file name and line number tracking.
Also it breaks detection of the source of memory leaks printed by the
_CrtDumpMemoryLeaks() function.
|
| |\
| |
| | |
Remove use of CRT, fix gcc compilation in C++ mode, fix missing includes and fix warnings
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
After this change there is no usage of of CRT library function. This allows
to build CRT-neutral variant of libdl.dll library, which can be used in any
application.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
in release mode
In debug mode is still used malloc() and free() for as part of memory leak
testing done by _CRTDBG_MAP_ALLOC and _CrtDumpMemoryLeaks() in test.c.
This change allows to wrap CRT's malloc() via dlsym's RTLD_NEXT.
See #112
|
| | |
| |
| |
| |
| |
| | |
* Remove unused include stdio.h
* Add used include string.h
* Add reason comments for includes
|
| | |
| |
| |
| |
| |
| |
| | |
This is undefined in C and also C++. Both gcc and msvc allows to cast
between two incompatible function pointers without triggering warnings
transitionally via void(*)(void) function pointer. Replace transitional
LPVOID cast by void(*)(void) cast.
|
| | |
| |
| |
| | |
signedness: ‘int’ and ‘DWORD’ {aka ‘long unsigned int’}
|
| | |
| |
| |
| | |
loss of data
|
| | |
| |
| |
| |
| | |
For errno usage it is required to include C header file errno.h and do not
depend that some other header file will include it.
|
| | |
| |
| |
| |
| | |
It follows compile warning C4164: '_ReturnAddress' : intrinsic function not declared
Declaration can be included also via intrin.h header file.
|
| | |
| |
| |
| |
| | |
When compiling in C++ mode, it is required to have C declaration for
_alloca. Declaration can be included also via malloc.h header file.
|
| | |
| |
| |
| | |
Add missing casts which are required in C++.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Returned structure is valid only if the function return value is same as
the size of the structure. So check for the correct size, not just for the
non-zero size.
"AllocationProtect" member contains the initial protection, valid at the
time when VirtualAlloc() was called. "Protect" member contains the current
protection of the requested address, valid at the time when VirtualQuery()
was called. So is_valid_address() function has to check "Protect" member,
not the "AllocationProtect".
If "State" member is MEM_FREE or MEM_RESERVE then "Protect" member is
undefined. So check "State" member before "Protect" member.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Do not expect that non-ARM code is automatically X86 code as it does not
have to be. Returns failure (not thunk) in other case.
Make sure that windows test code is not called on non-windows platforms.
Test code tests/test-dladdr.c is written to be validated on any platforms,
including non-windows.
|
| | | |
|
| |/
|
|
|
| |
dlopen(NULL, ...) does not call LoadLibrary(), so do not call FreeLibrary()
in dlclose() for this case.
|
| |\
| |
| | |
Fix compatibility with CMake 4.0 by bumping policy_max in cmake_minimum_required to 3.10
|
| |/ |
|
| |\
| |
| | |
Add some contributors
|
| | | |
|
| |\ \
| |/
|/| |
Add missing check that section index in get_image_section() is valid
|
| |/
|
|
| |
Number is stored in NumberOfRvaAndSizes and it may be less than IMAGE_NUMBEROF_DIRECTORY_ENTRIES.
|
| |\
| |
| | |
Cleanup README and add CODEOWNERS file
|
| |/ |
|
| |\
| |
| | |
Fix compilation with older SDK and older MSVC
|
| | |
| |
| |
| |
| | |
First NT SDK available in the first 32-bit MSVC NT compiler does not
provide some defines. Add them for compatibility.
|
| | |
| |
| |
| |
| | |
Old pre-4.0 MSVC does not support _ReturnAddress() intrinsic. Provide for
it simple implementation via inline assembly.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not use SIZE_T which is not defined in older SDK. There is only size_t
type, so use it instead.
Do not use IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR which is not defined in
older SDK. Use IMAGE_NUMBEROF_DIRECTORY_ENTRIES macro for checking if
directory index is valid. In all SDKs is DataDirectory[] array size defined
from IMAGE_NUMBEROF_DIRECTORY_ENTRIES macro.
Cast members in IMAGE_EXPORT_DIRECTORY and IMAGE_DIRECTORY_ENTRY_IMPORT to
DWORD as in older SDK they are defined as PDWORD and compiler throws error
'cannot add two pointers'.
|
| |\
| |
| | |
Add Windows ARM64 support
|
| |/ |
|
| |\
| |
| | |
Fix CMake include directive when using wrappers like meson.
|
| |/ |
|
| |\
| |
| | |
Replace magic numbers by sdk macros in get_image_section()
|
| |/ |
|
| |\
| |
| | |
Prefer usage of thread-safe function SetThreadErrorMode() instead of process-global function SetErrorMode()
|
| | |
| |
| |
| |
| |
| |
| | |
process-global function SetErrorMode()
Use GetProcAddress() wrapper as SetThreadErrorMode() is not available on
older Windows versions.
|
| |/
|
|
|
|
| |
‘FARPROC’
warning: cast between incompatible function types from ‘FARPROC’ {aka ‘long long int (*)()’} to ‘BOOL (*)(DWORD, const CHAR *, struct HINSTANCE__ **)’ {aka ‘int (*)(long unsigned int, const char *, struct HINSTANCE__ **)’} [-Wcast-function-type]
|
| |\
| |
| | |
cmake: use CROSSCOMPILING_EMULATOR
|
| | | |
|
| |\ \
| |/
|/| |
CMake: Bump version
|
| |/
|
|
| |
Silents warnings, cmake 3.2 is available in distros since many years
|
| |\
| |
| | |
dladdr: const void *addr
|