You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/win32/dll.cpp

25 lines
552 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