Skip to content

Commit 55589f8

Browse files
committed
Resolve conflicts
1 parent 90eec91 commit 55589f8

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -816,20 +816,17 @@ internal static unsafe string GetProcessPathFromHwnd(HWND hWnd)
816816
if (threadId == 0) return string.Empty;
817817

818818
var process = PInvoke.OpenProcess(PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_LIMITED_INFORMATION, false, pid);
819-
if (process.Value != IntPtr.Zero)
819+
if (process != HWND.Null)
820820
{
821-
using var safeHandle = new SafeProcessHandle(process.Value, true);
821+
using var safeHandle = new SafeProcessHandle((nint)process.Value, true);
822822
uint capacity = 2000;
823823
Span<char> buffer = new char[capacity];
824-
fixed (char* pBuffer = buffer)
824+
if (!PInvoke.QueryFullProcessImageName(safeHandle, PROCESS_NAME_FORMAT.PROCESS_NAME_WIN32, buffer, ref capacity))
825825
{
826-
if (!PInvoke.QueryFullProcessImageName(safeHandle, PROCESS_NAME_FORMAT.PROCESS_NAME_WIN32, (PWSTR)pBuffer, ref capacity))
827-
{
828-
return string.Empty;
829-
}
830-
831-
return buffer[..(int)capacity].ToString();
826+
return string.Empty;
832827
}
828+
829+
return buffer[..(int)capacity].ToString();
833830
}
834831

835832
return string.Empty;

0 commit comments

Comments
 (0)