From a59e002ed00b67cea09ffe6b31661e3f0867ba61 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 3 Nov 2025 23:22:29 -0700 Subject: [PATCH] Fix a few compiler regressions --- dll/kernel32/memoryapi.cpp | 1 + dll/kernel32/winnls.cpp | 5 +++-- src/heap.cpp | 2 +- src/modules.cpp | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dll/kernel32/memoryapi.cpp b/dll/kernel32/memoryapi.cpp index e048666..b1d41bf 100644 --- a/dll/kernel32/memoryapi.cpp +++ b/dll/kernel32/memoryapi.cpp @@ -536,6 +536,7 @@ LPVOID WINAPI VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationTy setLastError(err); return nullptr; } + DEBUG_LOG("-> success (base=%p, size=%zu)\n", base, size); return base; } diff --git a/dll/kernel32/winnls.cpp b/dll/kernel32/winnls.cpp index 692e32b..b0324d0 100644 --- a/dll/kernel32/winnls.cpp +++ b/dll/kernel32/winnls.cpp @@ -3,11 +3,12 @@ #include "context.h" #include "errors.h" #include "internal.h" +#include "kernel32.h" +#include "kernel32_trampolines.h" #include "strutil.h" #include #include -#include #include #include #include @@ -236,7 +237,7 @@ BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA lpLocaleEnumProc, DWORD dwFlags) } // Return to guest context before callback char localeId[] = "00000409"; // en-US - return lpLocaleEnumProc(localeId); + return call_LOCALE_ENUMPROCA(lpLocaleEnumProc, localeId); } LCID WINAPI GetUserDefaultLCID() { diff --git a/src/heap.cpp b/src/heap.cpp index af07118..bdc3c33 100644 --- a/src/heap.cpp +++ b/src/heap.cpp @@ -435,7 +435,7 @@ void initializeImpl() { // Map and register guest arena (below 2GB, exclusive) ArenaRange guest; - if (mapArena(kGuestArenaSize, kLowMemoryStart, kTopDownStart, false, "wibo guest arena", guest)) { + if (mapArena(kGuestArenaSize, kLowMemoryStart, kTopDownStart, true, "wibo guest arena", guest)) { bool ok = mi_manage_os_memory_ex(guest.start, guest.size, /*is_committed*/ false, /*is_pinned*/ false, diff --git a/src/modules.cpp b/src/modules.cpp index 8f264bb..df54342 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -7,8 +7,6 @@ #include "files.h" #include "heap.h" #include "kernel32/internal.h" -#include "msvcrt.h" -#include "msvcrt_trampolines.h" #include "strutil.h" #include "tls.h" @@ -1278,6 +1276,7 @@ void *resolveFuncByName(ModuleInfo *info, const char *funcName) { if (it != info->exportNameToOrdinal.end()) { return resolveFuncByOrdinal(info, it->second); } + return nullptr; } return reinterpret_cast(resolveMissingFuncName(info->originalName.c_str(), funcName)); } @@ -1303,6 +1302,7 @@ void *resolveFuncByOrdinal(ModuleInfo *info, uint16_t ordinal) { } } } + return nullptr; } return reinterpret_cast(resolveMissingFuncOrdinal(info->originalName.c_str(), ordinal)); }