Skip to content

Commit

Permalink
Add wine detection
Browse files Browse the repository at this point in the history
  • Loading branch information
momo5502 committed Dec 3, 2022
1 parent 2a4e5c4 commit bec2aac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/common/utils/nt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
1 change: 1 addition & 0 deletions src/common/utils/nt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ namespace utils::nt
HANDLE handle_{InvalidHandle};
};

bool is_wine();
bool is_shutdown_in_progress();

__declspec(noreturn) void raise_hard_exception();
Expand Down

0 comments on commit bec2aac

Please sign in to comment.