From 419e0146756d50a6053b7f2e01fd4660149b57b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 9 Sep 2018 22:20:38 +0200 Subject: [PATCH] [SERVICES] Only services starting under the LocalSystem account can run interactively. Otherwise ignore the interactive flag. --- base/system/services/database.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/base/system/services/database.c b/base/system/services/database.c index 409fab4c718..c4c372c320e 100644 --- a/base/system/services/database.c +++ b/base/system/services/database.c @@ -1672,14 +1672,6 @@ ScmStartUserModeService(PSERVICE Service, StartupInfo.cb = sizeof(StartupInfo); ZeroMemory(&ProcessInformation, sizeof(ProcessInformation)); - /* Use the interactive desktop if the service is interactive */ - if ((NoInteractiveServices == 0) && - (Service->Status.dwServiceType & SERVICE_INTERACTIVE_PROCESS)) - { - StartupInfo.dwFlags |= STARTF_INHERITDESKTOP; - StartupInfo.lpDesktop = L"WinSta0\\Default"; - } - if (Service->lpImage->hToken) { /* User token: Run the service under the user account */ @@ -1732,6 +1724,14 @@ ScmStartUserModeService(PSERVICE Service, lpEnvironment = NULL; } + /* Use the interactive desktop if the service is interactive */ + if ((NoInteractiveServices == 0) && + (Service->Status.dwServiceType & SERVICE_INTERACTIVE_PROCESS)) + { + StartupInfo.dwFlags |= STARTF_INHERITDESKTOP; + StartupInfo.lpDesktop = L"WinSta0\\Default"; + } + Result = CreateProcessW(NULL, Service->lpImage->pszImagePath, NULL,