RtGetModuleFileNameEx

The RtGetModuleFileNameEx function retrieves the fully qualified path for the file that contains the specified module. The module must have been loaded by the current process.

Syntax

Copy
DWORD RtGetModuleFileNameEx(
    HANDLE hProcess,
    HMODULE hModule,
    LPWSTR lpPathName,
    DWORD nSize,
);

Parameters

hProcess

A handle to the process that contains the module. This parameter must not be NULL.

hModule

A handle to the module. If this parameter is NULL, this function returns the name of the file used to create the calling process.

lpPathName

A pointer to the buffer that receives the absolute pathname of the module. If the absolute pathname is longer than maximum number of characters specified by the nSize parameter, the absolute pathname is truncated.

nSize

The size of the lpPathName buffer, in characters. A MAX_PATH buffer guarantees the function will always give the full path.

Return Value

If the function succeeds, it returns the value specifies the length of the string copied to the buffer, in characters. If the function fails, it returns 0 (zero).

To get extended error information, call GetLastError.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

Rtapi.h rtkrnl.lib