Visual studio version is working

This commit is contained in:
2023-05-09 22:12:17 -04:00
parent 48628655fc
commit b42393bbac
5 changed files with 138 additions and 95 deletions

View File

@@ -279,10 +279,14 @@ static void ssl_load_certificate_authorities(SSL_CTX *ctx) {
}
static void call_init_engine_wrapper(EngineWrapper *w) {
HMODULE dll = LoadLibraryA(".\\luprex.dll");
assert(dll != nullptr);
HMODULE exe = GetModuleHandleA(NULL);
using InitFn = void (*)(EngineWrapper *);
InitFn initfn = (InitFn)GetProcAddress(dll, "init_engine_wrapper");
InitFn initfn = (InitFn)GetProcAddress(exe, "init_engine_wrapper");
if (initfn == nullptr) {
HMODULE dll = LoadLibraryA(".\\luprexlib.dll");
assert(dll != nullptr);
initfn = (InitFn)GetProcAddress(dll, "init_engine_wrapper");
}
assert(initfn != nullptr);
initfn(w);
}

View File

@@ -10,6 +10,7 @@
#include <iostream>
#if defined(_WIN32)
#include <windows.h>
#include <profileapi.h>
#elif defined(__linux__)
#include <time.h>