diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 714819993ee..679f3d7380e 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -45,9 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(odbc); WINE_DECLARE_DEBUG_CHANNEL(winediag); -static unixlib_handle_t odbc_handle; - -#define ODBC_CALL( func, params ) __wine_unix_call( odbc_handle, unix_ ## func, params ) +#define ODBC_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) /*********************************************************************** * ODBC_ReplicateODBCInstToRegistry @@ -2641,18 +2639,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) switch (reason) { case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); - if (!NtQueryVirtualMemory( GetCurrentProcess(), hinstDLL, MemoryWineUnixFuncs, - &odbc_handle, sizeof(odbc_handle), NULL ) && - !__wine_unix_call( odbc_handle, process_attach, NULL)) + DisableThreadLibraryCalls(hinstDLL); + if (!__wine_init_unix_call() && !WINE_UNIX_CALL( process_attach, NULL )) { ODBC_ReplicateToRegistry(); } - break; + break; case DLL_PROCESS_DETACH: - if (reserved) break; - __wine_unix_call( odbc_handle, process_detach, NULL ); + if (reserved) break; + WINE_UNIX_CALL( process_detach, NULL ); } return TRUE;