Reorganization
This commit is contained in:
26
standalone_modules/load_library.c
Normal file
26
standalone_modules/load_library.c
Normal 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 = (void *)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
|
||||
Reference in New Issue
Block a user