From 4e2cca167dd9780f57a1f2b9359745131c2d306d Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Sun, 17 May 2026 08:42:32 +0900 Subject: [PATCH] [WINLOGON] Optimize StartLsass and StartServicesManager (#9016) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optimize for speed. JIRA issue: N/A Do not initialize the STARTUPINFO member, which is already filled with zeros, with zeros, in StartLsass and StartServicesManager functions. Co-authored-by: Hermès BÉLUSCA - MAÏTO --- base/system/winlogon/winlogon.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/base/system/winlogon/winlogon.c b/base/system/winlogon/winlogon.c index 9bf6d844bcf..30c585f68b8 100644 --- a/base/system/winlogon/winlogon.c +++ b/base/system/winlogon/winlogon.c @@ -5,7 +5,7 @@ * PURPOSE: Logon * PROGRAMMERS: Thomas Weidenmueller (w3seek@users.sourceforge.net) * Filip Navara - * Herv Poussineau (hpoussin@reactos.org) + * Hervé Poussineau (hpoussin@reactos.org) */ /* INCLUDES *****************************************************************/ @@ -46,23 +46,13 @@ static BOOL StartServicesManager(VOID) { - STARTUPINFOW StartupInfo; + STARTUPINFOW StartupInfo = { sizeof(StartupInfo) }; PROCESS_INFORMATION ProcessInformation; LPCWSTR ServiceString = L"services.exe"; BOOL res; /* Start the service control manager (services.exe) */ - ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); - StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.lpReserved = NULL; - StartupInfo.lpDesktop = NULL; - StartupInfo.lpTitle = NULL; - StartupInfo.dwFlags = 0; - StartupInfo.cbReserved2 = 0; - StartupInfo.lpReserved2 = 0; - TRACE("WL: Creating new process - %S\n", ServiceString); - res = CreateProcessW(ServiceString, NULL, NULL, @@ -94,23 +84,13 @@ static BOOL StartLsass(VOID) { - STARTUPINFOW StartupInfo; + STARTUPINFOW StartupInfo = { sizeof(StartupInfo) }; PROCESS_INFORMATION ProcessInformation; LPCWSTR ServiceString = L"lsass.exe"; BOOL res; /* Start the local security authority subsystem (lsass.exe) */ - ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); - StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.lpReserved = NULL; - StartupInfo.lpDesktop = NULL; - StartupInfo.lpTitle = NULL; - StartupInfo.dwFlags = 0; - StartupInfo.cbReserved2 = 0; - StartupInfo.lpReserved2 = 0; - TRACE("WL: Creating new process - %S\n", ServiceString); - res = CreateProcessW(ServiceString, NULL, NULL,