PsApiGetProcessImageFileName Method

Retrieves the name of the executable file for the specified process.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("PsApi.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static uint GetProcessImageFileName(
	IntPtr hProcess,
	StringBuilder imageFileName,
	uint size
)

Parameters

hProcess  IntPtr
A handle to the process.

The handle must have the QueryInformation or QueryLimitedInformation access right.

imageFileName  StringBuilder
A pointer to a buffer that receives the full path to the executable file.
size  UInt32
The size of the lpImageFileName buffer, in characters.

Return Value

UInt32
If the function succeeds, the return value specifies the length of the string copied to the buffer.

If the function fails, the return value is zero.

Remarks

See Also