diff options
| -rw-r--r-- | zencore/include/zencore/zencore.h | 2 | ||||
| -rw-r--r-- | zencore/zencore.cpp | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h index 4f9dc6322..310f6c4ed 100644 --- a/zencore/include/zencore/zencore.h +++ b/zencore/include/zencore/zencore.h @@ -188,6 +188,8 @@ ZENCORE_API bool IsPointerToStack(const void* ptr); // Query if pointer is with ZENCORE_API bool IsApplicationExitRequested(); ZENCORE_API void RequestApplicationExit(int ExitCode); ZENCORE_API bool IsDebuggerPresent(); +ZENCORE_API bool IsInteractiveSession(); + ZENCORE_API void zencore_forcelinktests(); } // namespace zen diff --git a/zencore/zencore.cpp b/zencore/zencore.cpp index d0b1135dc..122719d90 100644 --- a/zencore/zencore.cpp +++ b/zencore/zencore.cpp @@ -67,6 +67,23 @@ IsDebuggerPresent() #endif } +bool +IsInteractiveSession() +{ +#if ZEN_PLATFORM_WINDOWS + DWORD dwSessionId = 0; + if (ProcessIdToSessionId(GetCurrentProcessId(), &dwSessionId)) + { + return (dwSessionId != 0); + } + + return false; +#else + // TODO: figure out what makes sense here + return true; +#endif +} + ////////////////////////////////////////////////////////////////////////// static int s_ApplicationExitCode = 0; |