| 57 | } |
| 58 | |
| 59 | inline 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 |
no test coverage detected