Initialize STARTUPINFOW.cb

This commit is contained in:
Jack251970 2025-09-06 13:34:30 +08:00
parent 4d4f1e8bf5
commit 97e3b3c850

View file

@ -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
/// </summary>
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<STARTUPINFOW>()
};
PROCESS_INFORMATION pi = new();
errorInfo = string.Empty;
HANDLE hShellProcess = HANDLE.Null, hShellProcessToken = HANDLE.Null, hPrimaryToken = HANDLE.Null;