mirror of
https://github.com/encounter/SDL.git
synced 2025-12-09 13:37:56 +00:00
Added SDL_GetLoadedModule to do the equivalent of GetModuleHandle/dlload(NOLOAD)
CR: Jorgen
This commit is contained in:
@@ -41,6 +41,13 @@ SDL_LoadObject(const char *sofile)
|
||||
return (handle);
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_GetLoadedObject(const char *sofile)
|
||||
{
|
||||
void *handle = dlopen(sofile, RTLD_NOLOAD);
|
||||
return (handle);
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
|
||||
@@ -46,6 +46,22 @@ SDL_LoadObject(const char *sofile)
|
||||
return handle;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_GetLoadedObject(const char *sofile)
|
||||
{
|
||||
LPTSTR tstr = WIN_UTF8ToString(sofile);
|
||||
void *handle = (void *) GetModuleHandle(tstr);
|
||||
|
||||
/* if we got a handle, call LoadLibrary to get
|
||||
* it again with the ref count incremented.
|
||||
* We do this to match the dlopen version of this function */
|
||||
handle = (void *)LoadLibrary( tstr );
|
||||
|
||||
SDL_free(tstr);
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user