[INCLUDE][WINLOGON] Rename the STARTF_SCRNSAVER flag to STARTF_SCREENSAVER,

as documented in "Advanced Windows NT" by Jeffrey M. Richter (Microsoft Press),
and in https://is.muni.cz/el/1433/jaro2010/PB167/um/cv5/undocumented_CreateProcess.pdf .

[INCLUDE][SERVICES][WIN32K:NTUSER] Add an undocumented STARTF_INHERITDESKTOP flag
for the STARTUPINFO::dwFlags structure member, whose purpose is to tell Win32k
that the created handles to the window station and desktop to which the
process is connecting to, can be inherited by its child processes.
It is used when starting interactive services.
Observed via API monitoring on Windows 2003.
This commit is contained in:
Hermès Bélusca-Maïto
2018-07-22 20:45:16 +02:00
parent f3699c3838
commit fd39f92fcb
4 changed files with 12 additions and 6 deletions

View File

@@ -17,6 +17,8 @@
#include <userenv.h>
#include <strsafe.h>
#include <reactos/undocuser.h>
#define NDEBUG
#include <debug.h>
@@ -1674,6 +1676,7 @@ ScmStartUserModeService(PSERVICE Service,
if ((NoInteractiveServices == 0) &&
(Service->Status.dwServiceType & SERVICE_INTERACTIVE_PROCESS))
{
StartupInfo.dwFlags |= STARTF_INHERITDESKTOP;
StartupInfo.lpDesktop = L"WinSta0\\Default";
}

View File

@@ -327,7 +327,7 @@ StartScreenSaver(
ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW));
ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION));
StartupInfo.cb = sizeof(STARTUPINFOW);
StartupInfo.dwFlags = STARTF_SCRNSAVER;
StartupInfo.dwFlags = STARTF_SCREENSAVER;
/* FIXME: run the screen saver on the screen saver desktop */
ret = CreateProcessW(szApplicationName,

View File

@@ -156,8 +156,11 @@ extern "C" {
#define DFCS_MENUARROWUP 0x0008
#define DFCS_MENUARROWDOWN 0x0010
#define STARTF_SCRNSAVER 0x80000000
//
// Undocumented flags for CreateProcess
//
#define STARTF_INHERITDESKTOP 0x40000000
#define STARTF_SCREENSAVER 0x80000000
#define MOD_WINLOGON_SAS 0x8000

View File

@@ -165,8 +165,8 @@ UserProcessCreate(PEPROCESS Process)
/* Setup process flags */
ppiCurrent->W32PF_flags |= W32PF_PROCESSCONNECTED;
if ( Process->Peb->ProcessParameters &&
Process->Peb->ProcessParameters->WindowFlags & STARTF_SCRNSAVER )
if (Process->Peb->ProcessParameters &&
(Process->Peb->ProcessParameters->WindowFlags & STARTF_SCREENSAVER))
{
ppiScrnSaver = ppiCurrent;
ppiCurrent->W32PF_flags |= W32PF_SCREENSAVER;
@@ -603,7 +603,7 @@ InitThreadCallback(PETHREAD Thread)
Status = IntResolveDesktop(Process,
&DesktopPath,
FALSE,
!!(ProcessParams->WindowFlags & STARTF_INHERITDESKTOP),
&hWinSta,
&hDesk);