aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/windows/windowsservice.cpp
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2026-01-19 16:29:25 -0800
committerLiam Mitchell <[email protected]>2026-01-19 16:29:25 -0800
commitb380c1bac4b738f49cd412697e0a051402e6d171 (patch)
tree70a5705d53e4e4fb0b8814857ec3c8d0c57ef3b8 /src/zenutil/windows/windowsservice.cpp
parentzenserver API changes, some other minor changes (#720) (diff)
downloadzen-b380c1bac4b738f49cd412697e0a051402e6d171.tar.xz
zen-b380c1bac4b738f49cd412697e0a051402e6d171.zip
Run Windows service as an interactive session, so we correctly respond to RequestApplicationExit when requested to stop by the service manager
Diffstat (limited to 'src/zenutil/windows/windowsservice.cpp')
-rw-r--r--src/zenutil/windows/windowsservice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zenutil/windows/windowsservice.cpp b/src/zenutil/windows/windowsservice.cpp
index ebb88b018..21ee6d153 100644
--- a/src/zenutil/windows/windowsservice.cpp
+++ b/src/zenutil/windows/windowsservice.cpp
@@ -158,6 +158,8 @@ WindowsService::ServiceMain()
// This call returns when the service has stopped.
// The process should simply terminate when the call returns.
+ zen::SetIsInteractiveSession(true);
+
if (!StartServiceCtrlDispatcher(DispatchTable))
{
const DWORD dwError = zen::GetLastError();
@@ -167,8 +169,6 @@ WindowsService::ServiceMain()
// Not actually running as a service
gSvc = nullptr;
- zen::SetIsInteractiveSession(true);
-
return Run();
}
else