aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/windows.cpp
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2026-03-09 19:06:36 -0700
committerLiam Mitchell <[email protected]>2026-03-09 19:06:36 -0700
commitd1abc50ee9d4fb72efc646e17decafea741caa34 (patch)
treee4288e00f2f7ca0391b83d986efcb69d3ba66a83 /src/zencore/windows.cpp
parentAllow requests with invalid content-types unless specified in command line or... (diff)
parentupdated chunk–block analyser (#818) (diff)
downloadzen-d1abc50ee9d4fb72efc646e17decafea741caa34.tar.xz
zen-d1abc50ee9d4fb72efc646e17decafea741caa34.zip
Merge branch 'main' into lm/restrict-content-type
Diffstat (limited to 'src/zencore/windows.cpp')
-rw-r--r--src/zencore/windows.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/zencore/windows.cpp b/src/zencore/windows.cpp
index d02fcd35e..87f854b90 100644
--- a/src/zencore/windows.cpp
+++ b/src/zencore/windows.cpp
@@ -12,14 +12,12 @@ namespace zen::windows {
bool
IsRunningOnWine()
{
- HMODULE NtDll = GetModuleHandleA("ntdll.dll");
+ static bool s_Result = [] {
+ HMODULE NtDll = GetModuleHandleA("ntdll.dll");
+ return NtDll && !!GetProcAddress(NtDll, "wine_get_version");
+ }();
- if (NtDll)
- {
- return !!GetProcAddress(NtDll, "wine_get_version");
- }
-
- return false;
+ return s_Result;
}
FileMapping::FileMapping(_In_ FileMapping& orig)