Expand Minimize

QueryFullProcessImageName function

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

Syntax


BOOL WINAPI QueryFullProcessImageName(
  _In_     HANDLE hProcess,
  _In_     DWORD dwFlags,
  _Out_    LPTSTR lpExeName,
  _Inout_  PDWORD lpdwSize
);

Parameters

hProcess [in]

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 [in]

This parameter can be one of the following values.

ValueMeaning
0

The name should use the Win32 path format.

PROCESS_NAME_NATIVE
0x00000001

The name should use the native system path format.

 

lpExeName [out]

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

lpdwSize [in, out]

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]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

QueryFullProcessImageNameW (Unicode) and QueryFullProcessImageNameA (ANSI)

See also

GetModuleFileNameEx
GetProcessImageFileName
Process and Thread Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.