mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-08 18:55:41 +08:00
Fix space-in-path game launching on Windows (#432)
This commit is contained in:
@@ -607,7 +607,7 @@ internal static partial class Program
|
|||||||
nint jobHandle = 0;
|
nint jobHandle = 0;
|
||||||
Environment.SetEnvironmentVariable(MitigatedChildEnvironment, "1");
|
Environment.SetEnvironmentVariable(MitigatedChildEnvironment, "1");
|
||||||
var created = CreateProcessW(
|
var created = CreateProcessW(
|
||||||
processPath,
|
null,
|
||||||
cmdLineBuilder,
|
cmdLineBuilder,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@@ -1433,7 +1433,7 @@ internal static partial class Program
|
|||||||
[DllImport("kernel32.dll", EntryPoint = "CreateProcessW", SetLastError = true, CharSet = CharSet.Unicode)]
|
[DllImport("kernel32.dll", EntryPoint = "CreateProcessW", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
private static extern bool CreateProcessW(
|
private static extern bool CreateProcessW(
|
||||||
string applicationName,
|
string? applicationName,
|
||||||
StringBuilder commandLine,
|
StringBuilder commandLine,
|
||||||
nint processAttributes,
|
nint processAttributes,
|
||||||
nint threadAttributes,
|
nint threadAttributes,
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ internal sealed class EmulatorProcess : IDisposable
|
|||||||
{
|
{
|
||||||
Environment.SetEnvironmentVariable(MitigatedChildEnvironment, "1");
|
Environment.SetEnvironmentVariable(MitigatedChildEnvironment, "1");
|
||||||
if (!CreateProcessW(
|
if (!CreateProcessW(
|
||||||
exePath,
|
null,
|
||||||
commandLine,
|
commandLine,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@@ -629,7 +629,7 @@ internal sealed class EmulatorProcess : IDisposable
|
|||||||
|
|
||||||
[DllImport("kernel32.dll", EntryPoint = "CreateProcessW", SetLastError = true, CharSet = CharSet.Unicode)]
|
[DllImport("kernel32.dll", EntryPoint = "CreateProcessW", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
private static extern bool CreateProcessW(string applicationName, StringBuilder commandLine, nint processAttributes, nint threadAttributes, [MarshalAs(UnmanagedType.Bool)] bool inheritHandles, uint flags, nint environment, string currentDirectory, ref StartupInfoEx startupInfo, out ProcessInformation processInformation);
|
private static extern bool CreateProcessW(string? applicationName, StringBuilder commandLine, nint processAttributes, nint threadAttributes, [MarshalAs(UnmanagedType.Bool)] bool inheritHandles, uint flags, nint environment, string currentDirectory, ref StartupInfoEx startupInfo, out ProcessInformation processInformation);
|
||||||
|
|
||||||
[DllImport("kernel32.dll", SetLastError = true)]
|
[DllImport("kernel32.dll", SetLastError = true)]
|
||||||
private static extern uint WaitForSingleObject(nint handle, uint milliseconds);
|
private static extern uint WaitForSingleObject(nint handle, uint milliseconds);
|
||||||
|
|||||||
Reference in New Issue
Block a user