标签: SYSTEM_INFO sysInfo = {0};GetSystemInfo(sysInfo);DWORD

时间:2022-05-27 05:49:54

标签:

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;

标签: SYSTEM_INFO sysInfo = {0};GetSystemInfo(sysInfo);DWORD

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