Skip to content

Commit

Permalink
Merge pull request #4277 from bylaws/wine
Browse files Browse the repository at this point in the history
Windows: Fix wine check
  • Loading branch information
lioncash authored Jan 15, 2025
2 parents 8e2b4a3 + f5decb5 commit fd09ded
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/Windows/ARM64EC/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ NTSTATUS ProcessInit() {
Exception::HandlerConfig.emplace();

const auto NtDll = GetModuleHandle("ntdll.dll");
const bool IsWine = !!GetProcAddress(NtDll, "__wine_get_version");
const bool IsWine = !!GetProcAddress(NtDll, "wine_get_version");
OvercommitTracker.emplace(IsWine);

{
Expand Down
2 changes: 1 addition & 1 deletion Source/Windows/Common/OvercommitTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OvercommitTracker {
if (IsWine) {
MEMORY_BASIC_INFORMATION Info;
NtQueryVirtualMemory(NtCurrentProcess(), reinterpret_cast<void*>(FaultAddress), MemoryBasicInformation, &Info, sizeof(Info), nullptr);
const auto CommitSize = reinterpret_cast<SIZE_T>(Info.BaseAddress) + Info.RegionSize - FaultAddress;
const auto CommitSize = reinterpret_cast<SIZE_T>(Info.BaseAddress) + Info.RegionSize - reinterpret_cast<SIZE_T>(Info.AllocationBase);
VirtualAlloc(reinterpret_cast<void*>(Info.AllocationBase), CommitSize, MEM_COMMIT, PAGE_READWRITE);
} else {
static constexpr size_t MaxFaultCommitSize = 1024 * 64;
Expand Down
2 changes: 1 addition & 1 deletion Source/Windows/WOW64/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ void BTCpuProcessInit() {
SyscallHandler = fextl::make_unique<WowSyscallHandler>();
Context::HandlerConfig.emplace();
const auto NtDll = GetModuleHandle("ntdll.dll");
const bool IsWine = !!GetProcAddress(NtDll, "__wine_get_version");
const bool IsWine = !!GetProcAddress(NtDll, "wine_get_version");
OvercommitTracker.emplace(IsWine);

{
Expand Down

0 comments on commit fd09ded

Please sign in to comment.