From bfac450d241881e1a2e189d69b55a44926edd944 Mon Sep 17 00:00:00 2001 From: Leo Loobeek Date: Wed, 5 Jun 2019 15:53:07 -0500 Subject: [PATCH] Added sizes to a few types to fix intermittent issues with CreateProcess() --- TikiLoader/Loader.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TikiLoader/Loader.cs b/TikiLoader/Loader.cs index 0d49894..f19c8f3 100644 --- a/TikiLoader/Loader.cs +++ b/TikiLoader/Loader.cs @@ -136,6 +136,7 @@ namespace TikiLoader STARTUPINFOEX sInfoEx = new STARTUPINFOEX(); PROCESS_INFORMATION pInfo = new PROCESS_INFORMATION(); + sInfoEx.StartupInfo.cb = (uint)Marshal.SizeOf(sInfoEx); IntPtr lpValue = IntPtr.Zero; try @@ -143,6 +144,8 @@ namespace TikiLoader SECURITY_ATTRIBUTES pSec = new SECURITY_ATTRIBUTES(); SECURITY_ATTRIBUTES tSec = new SECURITY_ATTRIBUTES(); + pSec.nLength = Marshal.SizeOf(pSec); + tSec.nLength = Marshal.SizeOf(tSec); uint flags = CreateSuspended | DetachedProcess | CreateNoWindow | EXTENDED_STARTUPINFO_PRESENT; @@ -533,4 +536,4 @@ namespace TikiLoader } } -} \ No newline at end of file +}