RtGetModuleFileName

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

NOTE: This function has been deprecated and will be removed in a future release. Use RtGetModuleFileNameEx to retrieve the path for a file that contains a specified module.

Syntax

DWORD RtGetModuleFileName(
    HANDLE hProcess,
    HMODULE hModule,
    LPWSTR lpBaseName,
    DWORD nSize,
);

Parameters

hProcess

A handle to the RTSS 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. In Windows applications, this parameter is ignored, and this function behaves as if this parameter is NULL.

lpBaseName

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

nSize

The size of the lpBaseName buffer, in characters.

Return Value

If the function succeeds, the return value specifies the length of the string copied to the buffer, in characters. If the function fails, the return value is zero.

To get extended error information, call GetLastError.

Requirements

Minimum Supported Version RTX64 2013
Header Rtapi.h
Library RtApi.lib (Windows), Rtx_Rtss.lib (RTSS)