术语 | getprocessmemoryinfo |
释义 | GetProcessMemoryInfo 语法: C++ BOOL WINAPI GetProcessMemoryInfo( __in HANDLE Process, __out PPROCESS_MEMORY_COUNTERS ppsmemCounters, __in DWORD cb ); GetProcessMemoryInfo功能 检索有关指定进程的内存使用情况。 参数 工艺 [in] 句柄的进程。句柄必须有PROCESS_QUERY_INFORMATION或PROCESS_QUERY_LIMITED_INFORMATION访问权和PROCESS_VM_READ访问权。有关更多信息,请参见过程的安全性和访问权限。 Windows Server 2003和Windows XP/2000操作系统:句柄必须具有PROCESS_QUERY_INFORMATION和PROCESS_VM_READ访问权限。 ppsmemCounters [out] 向PROCESS_MEMORY_COUNTERS或PROCESS_MEMORY_COUNTERS_EX结构,收到有关这一进程的内存使用信息的指针。 文件 [in] 该ppsmemCounters结构的大小,以字节为单位。 返回值 如果函数成功,返回值为非零。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 与PSAPI版本的Windows 7和Windows Server 2008 R2的2起,这个函数被定义为K32GetProcessMemoryInfo在Psapi.h和Kernel32.lib和Kernel32.dll出口。但是,您应该始终作为GetProcessMemoryInfo调用这个函数。为了确保对程序将运行在Windows的早期版本的符号的正确决议,添加Psapi.lib到TARGETLIBS宏和编译程序与- DPSAPI_VERSION = 1。 实例 有关示例,请参见收集一个进程内存使用信息。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderPsapi.h LibraryKernel32.lib在Windows 7和Windows Server 2008 R2的Psapi.lib在Windows Server 2008,Windows Vista中的Windows Server 2003,和Windows XP/2000 DLLKernel32.dll在Windows 7和Windows Server 2008 R2的Psapi.dll在Windows Server 2008,Windows Vista中的Windows Server 2003,和Windows XP/2000 参见 EnumProcesses 内存性能信息 PROCESS_MEMORY_COUNTERS PROCESS_MEMORY_COUNTERS_EX 进程的内存使用信息 PSAPI函数 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==GetProcessMemoryInfo Function Retrieves information about the memory usage of the specified process. Syntax C++ BOOL WINAPI GetProcessMemoryInfo( __in HANDLE Process, __out PPROCESS_MEMORY_COUNTERS ppsmemCounters, __in DWORD cb ); Parameters Process [in] A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right and the PROCESS_VM_READ access right. For more information, see Process Security and Access Rights . Windows Server 2003 and Windows XP/2000: The handle must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights. ppsmemCounters [out] A pointer to the PROCESS_MEMORY_COUNTERS or PROCESS_MEMORY_COUNTERS_EX structure that receives information about the memory usage of the process. cb [in] The size of the ppsmemCounters structure, in bytes. Return Value If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError . Remarks Starting with PSAPI version 2 for Windows 7 and Windows Server 2008 R2, this function is defined as K32GetProcessMemoryInfo in Psapi.h and exported in Kernel32.lib and Kernel32.dll. However, you should always call this function as GetProcessMemoryInfo. To ensure correct resolution of symbols for programs that will run on earlier versions of Windows, add Psapi.lib to the TARGETLIBS macro and compile the program with –DPSAPI_VERSION=1. Examples For an example, see Collecting Memory Usage Information for a Process . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderPsapi.h LibraryKernel32.lib on Windows 7 and Windows Server 2008 R2, Psapi.lib on Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000 DLLKernel32.dll on Windows 7 and Windows Server 2008 R2, Psapi.dll on Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000 See Also EnumProcesses Memory Performance Information PROCESS_MEMORY_COUNTERS PROCESS_MEMORY_COUNTERS_EX Process Memory Usage Information PSAPI Functions Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms683219(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。