Skip to content

Commit 97e3b3c

Browse files
committed
Initialize STARTUPINFOW.cb
1 parent 4d4f1e8 commit 97e3b3c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.ComponentModel;
44
using System.Diagnostics;
@@ -923,7 +923,10 @@ public static bool IsAdministrator()
923923
/// </summary>
924924
public static unsafe bool RunAsDesktopUser(string app, string currentDir, string cmdLine, bool loadProfile, bool createNoWindow, out string errorInfo)
925925
{
926-
STARTUPINFOW si = new();
926+
STARTUPINFOW si = new()
927+
{
928+
cb = (uint)Marshal.SizeOf<STARTUPINFOW>()
929+
};
927930
PROCESS_INFORMATION pi = new();
928931
errorInfo = string.Empty;
929932
HANDLE hShellProcess = HANDLE.Null, hShellProcessToken = HANDLE.Null, hPrimaryToken = HANDLE.Null;

0 commit comments

Comments
 (0)