diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-04 23:29:08 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-04 23:29:08 +0200 |
commit | 8970c40ce9a9a4e5f582b48f69b77bd90d8e678e (patch) | |
tree | 4f79981115baee14a25228755cdc81088ade2431 /deimos/core/os_win32.cpp | |
parent | f3ba19b162a89b2081c0598b4a0bf126146e3671 (diff) |
Add DLL API
Diffstat (limited to 'deimos/core/os_win32.cpp')
-rw-r--r-- | deimos/core/os_win32.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/deimos/core/os_win32.cpp b/deimos/core/os_win32.cpp index ca608d8..1c6b664 100644 --- a/deimos/core/os_win32.cpp +++ b/deimos/core/os_win32.cpp @@ -35,14 +35,30 @@ public: }
};
+class Win32OsDllApiImpl : public OsDllApi
+{
+public:
+ OsDll* Open(gsl::czstring name) override
+ {
+ return std::bit_cast<OsDll*>(::LoadLibraryA(name));
+ }
+
+ void* GetSymbol(OsDll* dll, gsl::czstring name) override
+ {
+ return std::bit_cast<void*>(::GetProcAddress(std::bit_cast<HMODULE>(dll), name));
+ }
+};
+
class Win32OsApiImpl : public OsApi
{
Win32OsConsoleApiImpl m_console_api;
+ Win32OsDllApiImpl m_dll_api;
public:
Win32OsApiImpl()
{
console = &m_console_api;
+ dll = &m_dll_api;
}
};
|