Add wine detection

This commit is contained in:
Maurice Heumann 2022-12-03 16:05:57 +01:00
parent 73ee55e772
commit 0eb2f07a37
2 changed files with 12 additions and 0 deletions

View File

@ -218,6 +218,17 @@ namespace utils::nt
return nullptr;
}
bool is_wine()
{
static const auto has_wine_export = []() -> bool
{
const library ntdll("ntdll.dll");
return ntdll.get_proc<void*>("wine_get_version");
}();
return has_wine_export;
}
bool is_shutdown_in_progress()
{
static auto* shutdown_in_progress = []

View File

@ -166,6 +166,7 @@ namespace utils::nt
HANDLE handle_{InvalidHandle};
};
bool is_wine();
bool is_shutdown_in_progress();
__declspec(noreturn) void raise_hard_exception();