odbc32: Use standard dlopen() instead of the libwine wrappers.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Alexandre Julliard 2020-04-06 22:38:38 +02:00
parent f64e34b014
commit 28e2e287d2
1 changed files with 5 additions and 9 deletions

View File

@ -38,7 +38,6 @@
#include "winbase.h" #include "winbase.h"
#include "winreg.h" #include "winreg.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/library.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "sql.h" #include "sql.h"
@ -493,7 +492,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
if (reserved) break; if (reserved) break;
if (dmHandle) wine_dlclose(dmHandle,NULL,0); if (dmHandle) dlclose(dmHandle);
} }
return TRUE; return TRUE;
@ -512,14 +511,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
static BOOL ODBC_LoadDriverManager(void) static BOOL ODBC_LoadDriverManager(void)
{ {
const char *s = getenv("LIB_ODBC_DRIVER_MANAGER"); const char *s = getenv("LIB_ODBC_DRIVER_MANAGER");
char error[256];
#ifdef SONAME_LIBODBC #ifdef SONAME_LIBODBC
if (!s || !s[0]) s = SONAME_LIBODBC; if (!s || !s[0]) s = SONAME_LIBODBC;
#endif #endif
if (!s || !s[0]) goto failed; if (!s || !s[0]) goto failed;
dmHandle = wine_dlopen(s, RTLD_LAZY | RTLD_GLOBAL, error, sizeof(error)); dmHandle = dlopen( s, RTLD_LAZY | RTLD_GLOBAL );
if (dmHandle != NULL) if (dmHandle != NULL)
{ {
@ -528,7 +526,7 @@ static BOOL ODBC_LoadDriverManager(void)
return TRUE; return TRUE;
} }
failed: failed:
ERR_(winediag)("failed to open library %s: %s\n", debugstr_a(s), error); ERR_(winediag)("failed to open library %s: %s\n", debugstr_a(s), dlerror());
nErrorType = ERROR_LIBRARY_NOT_FOUND; nErrorType = ERROR_LIBRARY_NOT_FOUND;
return FALSE; return FALSE;
} }
@ -546,14 +544,12 @@ failed:
static BOOL ODBC_LoadDMFunctions(void) static BOOL ODBC_LoadDMFunctions(void)
{ {
char error[256];
if (dmHandle == NULL) if (dmHandle == NULL)
return FALSE; return FALSE;
#define LOAD_FUNC(name) \ #define LOAD_FUNC(name) \
if ((p##name = wine_dlsym( dmHandle, #name, error, sizeof(error) ))); \ if ((p##name = dlsym( dmHandle, #name ))); \
else WARN( "Failed to load %s: %s\n", #name, error ) else WARN( "Failed to load %s: %s\n", #name, dlerror() )
LOAD_FUNC(SQLAllocConnect); LOAD_FUNC(SQLAllocConnect);
LOAD_FUNC(SQLAllocEnv); LOAD_FUNC(SQLAllocEnv);