summaryrefslogtreecommitdiff
path: root/dbaccess/win32
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-05 13:15:42 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-05 23:13:15 +0200
commit515d2579d305a6127c6c194319a58eac62437e33 (patch)
treee283e99d3ed36c2f3a954df976604c7fea8d29fe /dbaccess/win32
parentedd163b5e148d1c71ff2c3f55455c971513a6f62 (diff)
Replace legacy dynamically-loaded functions with statically linked ones
We don't need the dynamic load complexity for these now with baseline Windows version being Windows 7 SP1. Stuff used only for compatibility with older versions was dumped. Change-Id: I810f271796cfd875cfa18a3081c9ad444fe57b3e Reviewed-on: https://gerrit.libreoffice.org/70321 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dbaccess/win32')
-rw-r--r--dbaccess/win32/source/odbcconfig/odbcconfig.cxx23
1 files changed, 2 insertions, 21 deletions
diff --git a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
index 71cb8286ff86..e9c4091353a5 100644
--- a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
+++ b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
@@ -22,14 +22,7 @@
# define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
-#include <sqlext.h>
-#include <comphelper/scopeguard.hxx>
-
-// the name of the library which contains the SQLManageDataSources function
-#define ODBC_UI_LIB_NAME L"ODBCCP32.DLL"
-
-// the signature of the SQLManageDataSources function
-typedef SQLRETURN (SQL_API* TSQLManageDataSource) (SQLHWND hwndParent);
+#include <odbcinst.h>
// displays the error text for the last error (GetLastError), and returns this error value
static int displayLastError()
@@ -109,19 +102,7 @@ extern "C" int APIENTRY wWinMain( HINSTANCE _hAppInstance, HINSTANCE, LPWSTR, in
if ( !IsWindow( hAppWindow ) )
return displayLastError();
- HMODULE hModule = LoadLibraryW( ODBC_UI_LIB_NAME );
- if ( hModule == nullptr )
- hModule = LoadLibraryExW( ODBC_UI_LIB_NAME, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH );
- if ( hModule == nullptr )
- return displayLastError();
- comphelper::ScopeGuard hModuleReleaser([hModule]() { FreeLibrary(hModule); });
-
- FARPROC pManageDSProc = GetProcAddress( hModule, "SQLManageDataSources" );
- if ( pManageDSProc == nullptr )
- return displayLastError();
-
- TSQLManageDataSource pManageDS = reinterpret_cast<TSQLManageDataSource>(pManageDSProc);
- if ( !( (*pManageDS)( hAppWindow ) ) )
+ if (!SQLManageDataSources(hAppWindow))
return displayLastError();
return 0;