MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / DynamicLib_Load2

Function DynamicLib_Load2

src/Platform_Windows.c:956–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954static cc_bool loadingPlugin;
955
956void* DynamicLib_Load2(const cc_string* path) {
957 static cc_string plugins_dir = String_FromConst("plugins/");
958 cc_filepath str;
959 void* lib;
960
961 Platform_EncodePath(&str, path);
962 loadingPlugin = String_CaselessStarts(path, &plugins_dir);
963
964 if ((lib = LoadLibraryW(str.uni))) return lib;
965 dynamicErr = GetLastError();
966 if (dynamicErr != ERROR_CALL_NOT_IMPLEMENTED) return NULL;
967
968 /* Windows 9x only supports A variants */
969 lib = LoadLibraryA(str.ansi);
970 if (!lib) dynamicErr = GetLastError();
971 return lib;
972}
973
974void* DynamicLib_Get2(void* lib, const char* name) {
975 void* addr = GetProcAddress((HMODULE)lib, name);

Callers

nothing calls this directly

Calls 2

String_CaselessStartsFunction · 0.85
Platform_EncodePathFunction · 0.70

Tested by

no test coverage detected