diff options
Diffstat (limited to 'zencore/zencore.cpp')
| -rw-r--r-- | zencore/zencore.cpp | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/zencore/zencore.cpp b/zencore/zencore.cpp index 1ea8ceb37..0b94f3bea 100644 --- a/zencore/zencore.cpp +++ b/zencore/zencore.cpp @@ -16,6 +16,8 @@ #include <zencore/compactbinarypackage.h> #include <zencore/compositebuffer.h> #include <zencore/compress.h> +#include <zencore/filesystem.h> +#include <zencore/intmath.h> #include <zencore/iobuffer.h> #include <zencore/memory.h> #include <zencore/mpscqueue.h> @@ -67,21 +69,36 @@ IsDebuggerPresent() #endif } +std::optional<bool> InteractiveSessionFlag; + +void +SetIsInteractiveSession(bool Value) +{ + InteractiveSessionFlag = Value; +} + bool IsInteractiveSession() { -#if ZEN_PLATFORM_WINDOWS - DWORD dwSessionId = 0; - if (ProcessIdToSessionId(GetCurrentProcessId(), &dwSessionId)) + if (!InteractiveSessionFlag.has_value()) { - return (dwSessionId != 0); - } - - return false; +#if ZEN_PLATFORM_WINDOWS + DWORD dwSessionId = 0; + if (ProcessIdToSessionId(GetCurrentProcessId(), &dwSessionId)) + { + InteractiveSessionFlag = (dwSessionId != 0); + } + else + { + InteractiveSessionFlag = false; + } #else - // TODO: figure out what makes sense here - return true; + // TODO: figure out what actually makes sense here + InteractiveSessionFlag = true; #endif + } + + return InteractiveSessionFlag.value(); } ////////////////////////////////////////////////////////////////////////// @@ -109,6 +126,7 @@ zencore_forcelinktests() zen::blake3_forcelink(); zen::compositebuffer_forcelink(); zen::compress_forcelink(); + zen::filesystem_forcelink(); zen::intmath_forcelink(); zen::iobuffer_forcelink(); zen::memory_forcelink(); |