From ce6d045bc3d6f26109f70f8eca0e2b564cc18989 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Mon, 1 Jan 2024 15:36:03 +0100 Subject: Consistently always use GetModuleHandleA() to reduce number of imports --- src/dlfcn.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/dlfcn.c b/src/dlfcn.c index 4b5719f..2bee0fa 100644 --- a/src/dlfcn.c +++ b/src/dlfcn.c @@ -369,13 +369,13 @@ void *dlopen( const char *file, int mode ) * symbol object must be provided. That object must be able to access * all symbols from the original program file, and any objects loaded * with the RTLD_GLOBAL flag. - * The return value from GetModuleHandle( ) allows us to retrieve + * The return value from GetModuleHandleA( ) allows us to retrieve * symbols only from the original program file. EnumProcessModules() is * used to access symbols from other libraries. For objects loaded * with the RTLD_LOCAL flag, we create our own list later on. They are * excluded from EnumProcessModules() iteration. */ - hModule = GetModuleHandle( NULL ); + hModule = GetModuleHandleA( NULL ); if( !hModule ) save_err_str( "(null)", GetLastError( ) ); @@ -468,7 +468,7 @@ int dlclose( void *handle ) error_occurred = FALSE; /* dlopen(NULL, ...) does not call LoadLibrary(), so do not call FreeLibrary(). */ - if( hModule == GetModuleHandle( NULL ) ) + if( hModule == GetModuleHandleA( NULL ) ) return 0; ret = FreeLibrary( hModule ); @@ -500,7 +500,7 @@ void *dlsym( void *handle, const char *name ) symbol = NULL; hCaller = NULL; - hModule = GetModuleHandle( NULL ); + hModule = GetModuleHandleA( NULL ); dwMessageId = 0; if( handle == RTLD_DEFAULT ) @@ -553,7 +553,7 @@ void *dlsym( void *handle, const char *name ) hCurrentProc = GetCurrentProcess( ); - /* GetModuleHandle( NULL ) only returns the current program file. So + /* GetModuleHandleA( NULL ) only returns the current program file. So * if we want to get ALL loaded module including those in linked DLLs, * we have to use EnumProcessModules( ). */ -- cgit v1.2.3-55-g6feb