1#ifndef LIBFILEZILLA_GLUE_DLL_HEADER
2#define LIBFILEZILLA_GLUE_DLL_HEADER
8#include "./windows.hpp"
17class FZ_PUBLIC_SYMBOL dll final
25 explicit dll(
wchar_t const* name, DWORD flags)
26 : h_{LoadLibraryExW(name, nullptr, flags)}
37 static dll from_address(T
const& t) {
39 if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
reinterpret_cast<char const*
>(t), &d.h_)) {
45 dll(dll
const&) =
delete;
46 dll& operator=(dll
const&) =
delete;
49 dll& operator=(dll && d);
51 explicit operator bool()
const {
61 return h_ ?
reinterpret_cast<void*
>(::GetProcAddress(h_, name)) :
nullptr;
72class FZ_PUBLIC_SYMBOL shdlls final
78 shdlls(shdlls
const&) =
delete;
79 shdlls* operator=(shdlls
const&) =
delete;
115#define FZ_DLL_IMPORT(dll, symbol) \
116 static const auto symbol = reinterpret_cast<decltype(&::symbol)>((dll)[#symbol]) \
120#error This file is for Windows only
Encapsulates a DLL.
Definition dll.hpp:18
~dll()
Closes the library and frees related resources.
Definition dll.hpp:30
dll(wchar_t const *name, DWORD flags)
Open the specified library with the passed in flags.
Definition dll.hpp:25
void * operator[](char const *name) const
Retrieves the address of an exported symbol in the library.
Definition dll.hpp:60
dll shell32_
The Shell32 DLL.
Definition dll.hpp:84
dll ole32_
The Ole32 DLL.
Definition dll.hpp:85
Sets some global macros and further includes string.hpp.
The namespace used by libfilezilla.
Definition apply.hpp:17