ENGINE-305: attempt to get GnuPG paths for Gpg4Win 3.x correct

ENGINE-305
Krista Bennett 5 years ago
parent 4108b6372a
commit 9ec0b1d6b5

@ -159,6 +159,26 @@ void *dlopen(const char *filename, int flag) {
return NULL;
HMODULE module = LoadLibrary(utf16_string(filename).c_str());
if (module == NULL) {
SetDllDirectory(NULL);
int chars_remaining = PATH_BUF_SIZE - strlen(path) - 1;
int add_len = strlen(TEXT("\\bin");
if (add_len > chars_remaining)
return NULL;
strncat(path, TEXT("\\bin"), add_len);
SetDllDirectory(TEXT(""));
_result = SetDllDirectory(path);
assert(_result != 0);
if (_result == 0)
return NULL;
module = LoadLibrary(utf16_string(filename).c_str());
}
SetDllDirectory(NULL);
if (module == NULL)
return NULL;

Loading…
Cancel
Save