QueryFullProcessImageNameA function

Retrieves the full name of the executable image for the specified process.

Syntax

BOOL QueryFullProcessImageNameA(
  HANDLE hProcess,
  DWORD  dwFlags,
  LPSTR  lpExeName,
  PDWORD lpdwSize
);

Parameters

hProcess

A handle to the process. This handle must be created with the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right. For more information, see Process Security and Access Rights.

dwFlags

This parameter can be one of the following values.

Value Meaning
0
The name should use the Win32 path format.
PROCESS_NAME_NATIVE
0x00000001
The name should use the native system path format.

lpExeName

The path to the executable image. If the function succeeds, this string is null-terminated.

lpdwSize

On input, specifies the size of the lpExeName buffer, in characters. On success, receives the number of characters written to the buffer, not including the null-terminating character.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

GetModuleFileNameEx

GetProcessImageFileName

Process and Thread Functions