From 97e3b3c85099d2367cbe203338b919426860e758 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 6 Sep 2025 13:34:30 +0800 Subject: [PATCH] Initialize STARTUPINFOW.cb --- Flow.Launcher.Infrastructure/Win32Helper.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index e644a0660..ea90fd47b 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; @@ -923,7 +923,10 @@ namespace Flow.Launcher.Infrastructure /// public static unsafe bool RunAsDesktopUser(string app, string currentDir, string cmdLine, bool loadProfile, bool createNoWindow, out string errorInfo) { - STARTUPINFOW si = new(); + STARTUPINFOW si = new() + { + cb = (uint)Marshal.SizeOf() + }; PROCESS_INFORMATION pi = new(); errorInfo = string.Empty; HANDLE hShellProcess = HANDLE.Null, hShellProcessToken = HANDLE.Null, hPrimaryToken = HANDLE.Null;