GetModuleHandle

The GetModuleHandle function retrieves a module handle for the specified module. The module must have been loaded by the calling process.

Syntax

Copy
HMODULE GetModuleHandle(
    LPCTSTR lpModuleName,
);

Parameters

lpModuleName

The name of the loaded module (either an .edll or .ertos file). If the file name extension is omitted, the default library .edll extension is appended. The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the calling process.

If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.ertos file).

Return Value

If the function succeeds, it returns a handle to the specified module. 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

windows.h rtkrnl.lib