DLL working under mingw
This commit is contained in:
@@ -270,17 +270,11 @@ static void ssl_load_certificate_authorities(SSL_CTX *ctx) {
|
||||
CertCloseStore(hStore, 0);
|
||||
}
|
||||
|
||||
// Load the DLL if it's not already loaded. Stores
|
||||
// the handle in a global variable.
|
||||
static void load_engine_dll() {
|
||||
// Not actually implemented yet. Currently, the engine
|
||||
// is linked right into the executable.
|
||||
}
|
||||
|
||||
static void call_init_engine_wrapper(EngineWrapper *w) {
|
||||
load_engine_dll();
|
||||
HMODULE dll = LoadLibraryA(".\\luprex.dll");
|
||||
assert(dll != nullptr);
|
||||
using InitFn = void (*)(EngineWrapper *);
|
||||
InitFn initfn = (InitFn)GetProcAddress(GetModuleHandle(NULL), "init_engine_wrapper");
|
||||
InitFn initfn = (InitFn)GetProcAddress(dll, "init_engine_wrapper");
|
||||
assert(initfn != nullptr);
|
||||
initfn(w);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user