mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Resolve conflicts
This commit is contained in:
parent
90eec91c4e
commit
55589f872a
1 changed files with 6 additions and 9 deletions
|
|
@ -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<char> 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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue