lokinet/llarp/win32/dll.cpp
dr7ana 46ad8d4058 Clang format include sorting + CMake
- 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
2023-10-24 12:11:51 -07:00

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