summaryrefslogtreecommitdiff
path: root/shared/dllLoader.h
diff options
context:
space:
mode:
Diffstat (limited to 'shared/dllLoader.h')
-rw-r--r--shared/dllLoader.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/shared/dllLoader.h b/shared/dllLoader.h
index bf62b542..5b561c5a 100644
--- a/shared/dllLoader.h
+++ b/shared/dllLoader.h
@@ -5,10 +5,11 @@
namespace Utility
{
- //load kernel dll functions
-template <typename FunctionType>
-FunctionType loadDllFunKernel(const std::string& functionName);
+//load function from a DLL library, e.g. from kernel32.dll
+//NOTE: you're allowed to take a static reference to the return value to optimize performance! :)
+template <typename FunctionType>
+FunctionType loadDllFunction(const std::wstring& libraryName, const std::string& functionName);
@@ -22,13 +23,13 @@ FunctionType loadDllFunKernel(const std::string& functionName);
//---------------Inline Implementation---------------------------------------------------
-void* loadSymbolKernel(const std::string& functionName);
+void* loadSymbol(const std::wstring& libraryName, const std::string& functionName);
template <typename FunctionType>
inline
-FunctionType loadDllFunKernel(const std::string& functionName)
+FunctionType loadDllFunction(const std::wstring& libraryName, const std::string& functionName)
{
- return reinterpret_cast<FunctionType>(loadSymbolKernel(functionName));
+ return reinterpret_cast<FunctionType>(loadSymbol(libraryName, functionName));
}
#ifndef FFS_WIN
bgstack15