码迷,mamicode.com
首页 > Windows程序 > 详细

【API】获取系统内存所有状态

时间:2018-02-02 18:28:23      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:ini   state   ase   nim   amp   imu   ima   http   virt   

SYSTEM_INFO sysInfo = {0}; GetSystemInfo(&sysInfo); DWORD dwMinAddr = (DWORD)sysInfo.lpMinimumApplicationAddress; DWORD dwMaxAddr = (DWORD)sysInfo.lpMaximumApplicationAddress; MEMORY_BASIC_INFORMATION memBase; int i = 0; for (dwMinAddr; dwMinAddr < dwMaxAddr;) { if (VirtualQuery((LPVOID)dwMinAddr, &memBase, sizeof(memBase)) == sizeof(memBase)) { wprintf(_T("%d %x %x %d\r\n"),i ++,memBase.BaseAddress, memBase.RegionSize,memBase.AllocationProtect); } dwMinAddr += memBase.RegionSize; } typedef struct _MEMORY_BASIC_INFORMATION { PVOID BaseAddress; PVOID AllocationBase; DWORD AllocationProtect; DWORD RegionSize; DWORD State; DWORD Protect; DWORD Type; } MEMORY_BASIC_INFORMATION;

技术分享图片

【API】获取系统内存所有状态

标签:ini   state   ase   nim   amp   imu   ima   http   virt   

原文地址:http://blog.51cto.com/383156647/2068232

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!