18#ifndef WIN32_LEAN_AND_MEAN
19#define WIN32_LEAN_AND_MEAN
40inline void* dl_open(
const char* path,
int ) {
43 DWORD old_error_mode = 0;
44 constexpr DWORD kLoaderProbeMode =
45 SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX;
46 const BOOL changed_error_mode =
47 ::SetThreadErrorMode(kLoaderProbeMode, &old_error_mode);
49 HMODULE module = ::LoadLibraryA(path);
51 if (changed_error_mode) {
52 ::SetThreadErrorMode(old_error_mode,
nullptr);
55 return reinterpret_cast<void*
>(module);
58inline void* dl_sym(
void* handle,
const char* name) {
59 return reinterpret_cast<void*
>(
60 ::GetProcAddress(
reinterpret_cast<HMODULE
>(handle), name));
63inline int dl_close(
void* handle) {
66 return ::FreeLibrary(
reinterpret_cast<HMODULE
>(handle)) ? 0 : -1;
69inline const char* dl_error() {
81inline void* dlopen(
const char* path,
int flags) {
82 return ::pulp::host::detail::dl_open(path, flags);
84inline void* dlsym(
void* handle,
const char* name) {
85 return ::pulp::host::detail::dl_sym(handle, name);
87inline int dlclose(
void* handle) {
88 return ::pulp::host::detail::dl_close(handle);
90inline const char* dlerror() {
91 return ::pulp::host::detail::dl_error();
Definition baked_codec.hpp:158