The GetCurrentProcessExecutableName method returns the name of executable file loaded in the current process.
HRESULT GetCurrentProcessExecutableName( [out, optional] PSTR Buffer, [in] ULONG BufferSize, [out, optional] PULONG ExeSize );
- Buffer [out, optional]
Receives the name of the executable file. If Buffer is NULL, this information is not returned.
- BufferSize [in]
Specifies the size in characters of the buffer Buffer.
- ExeSize [out, optional]
Receives the size in characters of the name of the executable file. If ExeSize is NULL, this information is not returned.
This method may also return error values. See Return Values for more details.
The method was successful.
The method was successful. However, the buffer was not large enough to hold the name of the executable file and it was truncated.
These methods are only available in user-mode debugging.
If the engine cannot determine the name of the executable file, it writes the string "?NoImage?" to the buffer.
For more information about processes, see Threads and Processes.