From aldeid
Jump to navigation Jump to search


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


DWORD WINAPI GetProcessImageFileName(
  _In_  HANDLE hProcess,
  _Out_ LPTSTR lpImageFileName,
  _In_  DWORD  nSize


hProcess [in]
A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right.
Windows Server 2003 and Windows XP: The handle must have the PROCESS_QUERY_INFORMATION access right.
lpImageFileName [out]
A pointer to a buffer that receives the full path to the executable file.
nSize [in]
The size of the lpImageFileName buffer, in characters.

Return value

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. To get extended error information, call GetLastError.