Reorganization

This commit is contained in:
Krzosa Karol
2024-01-06 13:44:50 +01:00
parent 3ed4893ccb
commit f34019efb7
37 changed files with 29 additions and 38 deletions

26
code/load_library.c Normal file
View File

@@ -0,0 +1,26 @@
#include "load_library.h"
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
LIB_Library LIB_LoadLibrary(char *str) {
HMODULE module = LoadLibraryA(str);
return (LIB_Library)module;
}
void *LIB_LoadSymbol(LIB_Library lib, char *symbol) {
void *result = GetProcAddress((HMODULE)lib, symbol);
return result;
}
bool LIB_UnloadLibrary(LIB_Library lib) {
BOOL result = FreeLibrary((HMODULE)lib);
if (result == 0) return false;
return true;
}
#endif // _WIN32