Stop the service if the user quits via the tray icon
This commit is contained in:
parent
dd6fcbd7b8
commit
f51876893e
5 changed files with 56 additions and 13 deletions
|
|
@ -301,9 +301,16 @@ ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv) {
|
|||
}
|
||||
break;
|
||||
|
||||
case WAIT_OBJECT_0 + 1:
|
||||
case WAIT_OBJECT_0 + 1: {
|
||||
// Sunshine terminated itself.
|
||||
|
||||
DWORD exit_code;
|
||||
if (GetExitCodeProcess(process_info.hProcess, &exit_code) && exit_code == ERROR_SHUTDOWN_IN_PROGRESS) {
|
||||
// Sunshine is asking for us to shut down, so gracefully stop ourselves.
|
||||
SetEvent(stop_event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(process_info.hThread);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue