Merging in default w/ ENGINE-305 test_diphoton
authorKrista Bennett <krista@pep-project.org>
Tue, 31 Oct 2017 12:41:40 +0100
branchtest_diphoton
changeset 2225d3bcab0ee729
parent 2221 07ce59b5c058
parent 2224 e1529b69bab3
child 2232 aa9de9c080b2
Merging in default w/ ENGINE-305
src/platform_windows.cpp
     1.1 --- a/src/platform_windows.cpp	Mon Oct 30 17:35:33 2017 +0100
     1.2 +++ b/src/platform_windows.cpp	Tue Oct 31 12:41:40 2017 +0100
     1.3 @@ -18,6 +18,7 @@
     1.4  #include <stdexcept>
     1.5  #include "platform_windows.h"
     1.6  #include <fcntl.h>
     1.7 +#include <tchar.h>
     1.8  #include <sys\stat.h>
     1.9  
    1.10  #ifndef WC_ERR_INVALID_CHARS
    1.11 @@ -159,6 +160,21 @@
    1.12          return NULL;
    1.13  
    1.14  	HMODULE module = LoadLibrary(utf16_string(filename).c_str());
    1.15 +
    1.16 +    if (module == NULL) {
    1.17 +        SetDllDirectory(NULL);
    1.18 +                    
    1.19 +		_tcscat_s(path, TEXT("\\bin"));
    1.20 +        
    1.21 +        SetDllDirectory(TEXT(""));
    1.22 +        _result = SetDllDirectory(path);
    1.23 +        assert(_result != 0);
    1.24 +        if (_result == 0)
    1.25 +            return NULL;
    1.26 +
    1.27 +    	module = LoadLibrary(utf16_string(filename).c_str());
    1.28 +    }
    1.29 +    
    1.30      SetDllDirectory(NULL);
    1.31  	if (module == NULL)
    1.32  		return NULL;