MCPcopy Create free account
hub / github.com/SOCI/soci / DLOPEN

Function DLOPEN

src/core/backend-loader.cpp:59–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59inline soci_dynlib_handle_t DLOPEN(std::string const& path)
60{
61 // We expect the dependencies of the backend libraries to be in the same
62 // directory as the libraries themselves, so use LOAD_WITH_ALTERED_SEARCH_PATH
63 // to search for them there first, before searching the standard locations.
64 //
65 // However we need an absolute path in order to use this flag, so make sure
66 // this is the case.
67 DWORD flags = 0;
68 char const* realpath = path.c_str();
69 char abspath[_MAX_PATH];
70 if ( _fullpath(abspath, realpath, _MAX_PATH) )
71 {
72 realpath = abspath;
73 flags = LOAD_WITH_ALTERED_SEARCH_PATH;
74 }
75 //else: If the conversion failed, fall back on LoadLibrary() behaviour.
76
77 return LoadLibraryExA(realpath, nullptr, flags);
78}
79
80} // unnamed namespace
81

Callers 1

do_register_backendFunction · 0.85

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected