mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
46ad8d4058
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use - shuffled around some cmake linking to simplify dependency graph - superfluous files removed
26 lines
553 B
C++
26 lines
553 B
C++
#include "dll.hpp"
|
|
|
|
#include <llarp/util/logging.hpp>
|
|
#include <llarp/util/str.hpp>
|
|
|
|
namespace llarp::win32
|
|
{
|
|
namespace
|
|
{
|
|
auto cat = log::Cat("win32-dll");
|
|
}
|
|
|
|
namespace detail
|
|
{
|
|
HMODULE
|
|
load_dll(const std::string& dll)
|
|
{
|
|
auto handle = LoadLibraryExA(dll.c_str(), NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR);
|
|
if (not handle)
|
|
throw win32::error{fmt::format("failed to load '{}'", dll)};
|
|
log::info(cat, "loaded '{}'", dll);
|
|
return handle;
|
|
}
|
|
} // namespace detail
|
|
} // namespace llarp::win32
|