diff --git a/src/common/utils/nt.cpp b/src/common/utils/nt.cpp index fa890e52..f6b07add 100644 --- a/src/common/utils/nt.cpp +++ b/src/common/utils/nt.cpp @@ -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("wine_get_version"); + }(); + + return has_wine_export; + } + bool is_shutdown_in_progress() { static auto* shutdown_in_progress = [] diff --git a/src/common/utils/nt.hpp b/src/common/utils/nt.hpp index 71222007..962ed6d5 100644 --- a/src/common/utils/nt.hpp +++ b/src/common/utils/nt.hpp @@ -166,6 +166,7 @@ namespace utils::nt HANDLE handle_{InvalidHandle}; }; + bool is_wine(); bool is_shutdown_in_progress(); __declspec(noreturn) void raise_hard_exception();