Fix an issue where it can't get the process name or executable path because of a permission issue
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace FocusVolumeControl;
|
||||
|
||||
@ -59,4 +60,11 @@ public class Native
|
||||
[DllImport("ntdll.dll")]
|
||||
public static extern int NtQueryInformationProcess(IntPtr processHandle, int processInformationClass, ref ParentProcessUtilities processInformation, int processInformationLength, out int returnLength);
|
||||
|
||||
|
||||
[DllImport("Kernel32.dll")]
|
||||
public static extern bool QueryFullProcessImageName(IntPtr hProcess, uint flags, StringBuilder buffer, ref uint bufferSize);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr OpenProcess(uint processAccess, bool inheritHandle, int processId);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user