Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/XIVLauncher.Common.Windows/WindowsDalamudRunner.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#nullable enable
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand All @@ -20,7 +21,7 @@ public class WindowsDalamudRunner : IDalamudRunner
{
"launch",
$"--mode={(loadMethod == DalamudLoadMethod.EntryPoint ? "entrypoint" : "inject")}",
$"--handle-owner={(long)inheritableCurrentProcess.Handle}",
$"--handle-owner={(long)(inheritableCurrentProcess?.Handle ?? IntPtr.Zero)}",
$"--game=\"{gameExe.FullName}\"",
$"--dalamud-working-directory=\"{startInfo.WorkingDirectory}\"",
$"--dalamud-configuration-path=\"{startInfo.ConfigurationPath}\"",
Expand Down Expand Up @@ -189,7 +190,7 @@ private static extern bool DuplicateHandle(
[MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,
DuplicateOptions dwOptions);

private static Process GetInheritableCurrentProcessHandle() {
private static Process? GetInheritableCurrentProcessHandle() {
if (!DuplicateHandle(Process.GetCurrentProcess().Handle, Process.GetCurrentProcess().Handle, Process.GetCurrentProcess().Handle, out var inheritableCurrentProcessHandle, 0, true, DuplicateOptions.SameAccess)) {
Log.Error("Failed to call DuplicateHandle: Win32 error code {0}", Marshal.GetLastWin32Error());
return null;
Expand Down