From 55589f872a72d7274934cf5b74f297b9f9dae170 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 20 Jul 2025 19:58:49 +0800 Subject: [PATCH] Resolve conflicts --- Flow.Launcher.Infrastructure/Win32Helper.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 0e7554d42..5770bbf12 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -816,20 +816,17 @@ namespace Flow.Launcher.Infrastructure if (threadId == 0) return string.Empty; var process = PInvoke.OpenProcess(PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_LIMITED_INFORMATION, false, pid); - if (process.Value != IntPtr.Zero) + if (process != HWND.Null) { - using var safeHandle = new SafeProcessHandle(process.Value, true); + using var safeHandle = new SafeProcessHandle((nint)process.Value, true); uint capacity = 2000; Span buffer = new char[capacity]; - fixed (char* pBuffer = buffer) + if (!PInvoke.QueryFullProcessImageName(safeHandle, PROCESS_NAME_FORMAT.PROCESS_NAME_WIN32, buffer, ref capacity)) { - if (!PInvoke.QueryFullProcessImageName(safeHandle, PROCESS_NAME_FORMAT.PROCESS_NAME_WIN32, (PWSTR)pBuffer, ref capacity)) - { - return string.Empty; - } - - return buffer[..(int)capacity].ToString(); + return string.Empty; } + + return buffer[..(int)capacity].ToString(); } return string.Empty;