MSDN上面原文:
GetModuleBaseName()
The GetModuleBaseName function retrieves the base name of the specified module. //GetModuleBaseName函数检索指定模块的基本名称(以’\0’终止)
DWORD GetModuleBaseName(
HANDLE hProcess, // handle to process
HMODULE hModule, // handle to module
LPTSTR lpBaseName, // base name buffer
DWORD nSize // maximum characters to retrieve
);
Parameters//参数
hProcess
[in] Handle to the process that contains the module.
hModule
[in] Handle to the module.
lpBaseName
[out] 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 base name is truncated.
nSize
[in] Specifies the maximum number of characters to copy to the lpBaseName buffer.
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.
GetModuleFileNameEx()
The GetModuleFileNameEx function retrieves the fully qualified path for the specified module.
DWORD GetModuleFileNameEx(
HANDLE hProcess, // handle to process
HMODULE hModule, // handle to module
LPTSTR lpFilename, // path buffer
DWORD nSize // maximum characters to retrieve
);
Parameters
hProcess
[in] Handle to the process that contains the module.
hModule
[in] Handle to the module.
lpFilename
[out] Pointer to the buffer that receives the fully qualified path to the module. If the file name is longer than maximum number of characters specified by the nSize parameter, the file name is truncated.
nSize
[in] Specifies the maximum number of characters to copy to the lpFilename buffer.
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.
博客介绍了MSDN上的GetModuleBaseName和GetModuleFileNameEx两个函数。GetModuleBaseName用于检索指定模块的基本名称,GetModuleFileNameEx用于获取指定模块的完整路径。详细说明了两个函数的参数及返回值情况,失败时可调用GetLastError获取扩展错误信息。
3841

被折叠的 条评论
为什么被折叠?



