mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-13 15:49:33 +00:00
Add Process::LoadLibrary OS-specific function
This commit is contained in:
1 parent
fb496db764
commit
3d47587957
3 files changed
+15
No files matched your search
@@ -396,6 +396,11 @@ void Process::StartGlobalHook(const char *pathmatch, const char *logfile, const
|
||||
RDCUNIMPLEMENTED("Global hooking of all processes on linux");
|
||||
}
|
||||
|
||||
bool Process::LoadLibrary(const char *module)
|
||||
{
|
||||
return dlopen(module, RTLD_NOW) != NULL;
|
||||
}
|
||||
|
||||
void *Process::GetFunctionAddress(const char *module, const char *function)
|
||||
{
|
||||
void *handle = dlopen(module, RTLD_NOW);
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace Process
|
||||
uint32_t LaunchProcess(const char *app, const char *workingDir, const char *cmdLine);
|
||||
uint32_t LaunchAndInjectIntoProcess(const char *app, const char *workingDir, const char *cmdLine,
|
||||
const char *logfile, const CaptureOptions *opts, bool waitForExit);
|
||||
bool LoadLibrary(const char *module);
|
||||
void *GetFunctionAddress(const char *module, const char *function);
|
||||
uint32_t GetCurrentPID();
|
||||
};
|
||||
|
||||
@@ -553,6 +553,15 @@ void Process::StartGlobalHook(const char *pathmatch, const char *logfile, const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool LoadLibrary(const char *module)
|
||||
{
|
||||
HMODULE mod = GetModuleHandleA(module);
|
||||
if(mod != NULL)
|
||||
return true;
|
||||
|
||||
return LoadLibraryA(module) != NULL;
|
||||
}
|
||||
|
||||
void *Process::GetFunctionAddress(const char *module, const char *function)
|
||||
{
|
||||
HMODULE mod = GetModuleHandleA(module);
|
||||
|
||||
Reference in new issue
Block a user