-
GetModuleInformation
鎖定
GetModuleInformation是計算機函數。
目錄
GetModuleInformation語法 Syntax
BOOL WINAPI GetModuleInformation
__in HANDLE hProcess,
__in HMODULE hModule,
__out LPMODULEINFO lpmodinfo,
__in DWORD cb
GetModuleInformation參數説明 Parameters
hProcess
指向包含模塊的進程的句柄。這個句柄一定要有 PROCESS_QUERY_INFORMATION 和 PROCESS_VM_READ 權限。參考 Process Security and Access Rights
[3]
hModule
指向模塊的句柄。
lpmodinfo
指向 MODULEINFO 結構的指針,該結構將會儲存關於模塊的信息。
cb
結構 MODULEINFO
[2]
的大小(以字節計算)。
GetModuleInformation返回值 Return Value
如果函數成功,將返回非零數值
GetModuleInformation附註 Remarks
從 Window7 和 Windows Server 2008 R2 開始,Psapi.h 為 PSAPI 函數建立版本號。版本號會影響調用函數的名字和程序要加載的庫。(原文:Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI version number affects the name used to call the function and the library that a program must load.)
如果 PSAPI_VERSION 是 2 或者更高,該函數將會在 Psapi.h 定義為 K32GetModuleInformation 並且由 Kernel32.lib 和 Kernel32.dll 導出。如果 PSAPI_VERSION 是 1,該函數被定義為 GetModuleInformation 並且由 Psapi.lib 和 Psapi.dll 封裝處理來調用 K32GetModuleInformation。(原文:If PSAPI_VERSION is 2 or greater, this function is defined as K32GetModuleInformation in Psapi.h and exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetModuleInformation in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetModuleInformation.)
那些要運行在所有 Windows 版本的程序應該始終用 GetModuleInformation 名字來調用。為了確保名字正確,添加 Psapi.lib 到 TARGETLIBS macro(我不太清楚這東西,應該是説要引用 Psapi.lib)和用 –DPSAPI_VERSION=1 來編譯程序。要動態加載動態鏈接庫的要加載 Psapi.dll。(原文:Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as GetModuleInformation. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.)
GetModuleInformation要求 Requirements
客户端最低版本 | Windows 2000 專業版/Windows 2000 Professional |
服務器最低版本 | Windows 2000 Server |
頭文件 | Psapi.h |
庫/Library | Window 7 和 Windows Server 2008 R2 下:Kernel32.lib 和 Psapi.lib(如果 PSAPI_VERSION=1 ) Windows Server 2008,Windows Vista,Windows Server 2003 和 Windows XP/2000 下:Psapi.lib |
動態鏈接庫/DLL | Window 7 和 Windows Server 2008 R2 下:Kernel32.dll 和 Psapi.dll(如果 PSAPI_VERSION=1 ) Windows Server 2008,Windows Vista,Windows Server 2003 和 Windows XP/2000 下:Psapi.dll |
- 詞條統計
-
- 瀏覽次數:次
- 編輯次數:12次歷史版本
- 最近更新: 青青的麦田year