1typedefenum_system_information_class {2 Systembasicinformation,3Systemprocessorinformation,//Obsolete...delete4 Systemperformanceinformation,5 Systemtimeofdayinformation,6 Systempathinformation,7 Systemprocessinformation,8 Systemcallcountinformation,9 Systemdeviceinformation,Ten Systemprocessorperformanceinformation, One Systemflagsinformation, A Systemcalltimeinformation, - Systemmoduleinformation, - Systemlocksinformation, the Systemstacktraceinformation, - Systempagedpoolinformation, - Systemnonpagedpoolinformation, - Systemhandleinformation, + Systemobjectinformation, - Systempagefileinformation, + Systemvdminstemulinformation, A Systemvdmbopinformation, at Systemfilecacheinformation, - Systempooltaginformation, - Systeminterruptinformation, - Systemdpcbehaviorinformation, - Systemfullmemoryinformation, - Systemloadgdidriverinformation, in Systemunloadgdidriverinformation, - Systemtimeadjustmentinformation, to Systemsummarymemoryinformation, + Systemmirrormemoryinformation, - Systemperformancetraceinformation, the SystemObsolete0, * Systemexceptioninformation, $ Systemcrashdumpstateinformation,Panax Notoginseng Systemkerneldebuggerinformation, - Systemcontextswitchinformation, the Systemregistryquotainformation, + Systemextendservicetableinformation, A Systempriorityseperation, the Systemverifieradddriverinformation, + Systemverifierremovedriverinformation, - Systemprocessoridleinformation, $ Systemlegacydriverinformation, $ Systemcurrenttimezoneinformation, - Systemlookasideinformation, - Systemtimeslipnotification, the Systemsessioncreate, - Systemsessiondetach,Wuyi Systemsessioninformation, the Systemrangestartinformation, - Systemverifierinformation, Wu Systemverifierthunkextend, - Systemsessionprocessinformation, About Systemloadgdidriverinsystemspace, $ Systemnumaprocessormap, - Systemprefetcherinformation, - Systemextendedprocessinformation, - Systemrecommendedshareddataalignment, A Systemcompluspackage, + Systemnumaavailablememory, the Systemprocessorpowerinformation, - Systememulationbasicinformation, $ Systememulationprocessorinformation, the Systemextendedhandleinformation, the Systemlostdelayedwriteinformation, the Systembigpoolinformation, the Systemsessionpooltaginformation, - Systemsessionmappedviewinformation, in Systemhotpatchinformation, the Systemobjectsecuritymode, the Systemwatchdogtimerhandler, About Systemwatchdogtimerinformation, the Systemlogicalprocessorinformation, the Systemwow64sharedinformation, the Systemregisterfirmwaretableinformationhandler, + Systemfirmwaretableinformation, - Systemmoduleinformationex, the Systemverifiertriageinformation,Bayi Systemsuperfetchinformation, the Systemmemorylistinformation, the Systemfilecacheinformationex, -Maxsysteminfoclass,//Maxsysteminfoclass should always being the last enum - theSystempagememoryinformation =123 the} system_information_class, *Psystem_information_class; the thetypedefstruct_system_basic_information - { theULONG Unknown;//Always contains zero theULONG maximumincrement;//a unit of measurement for a clock theULONG physicalpagesize;//size of a memory page94ULONG numberofphysicalpages;//How many pages are managed by the system theULONG Lowestphysicalpage;//low-end memory pages theULONG Highestphysicalpage;//high-end memory pages the ULONG allocationgranularity;98ULONG lowestuseraddress;//Ground-end user address AboutULONG highestuseraddress;//high-end user address -ULONG activeprocessors;//the activated processor101UCHAR numberprocessors;//How many processors are there?102}system_basic_information, *psystem_basic_information;103 104NTSTATUS (__stdcall *zwquerysysteminformation) ( the _in_ system_information_class Systeminformationclass,106 _inout_ PVOID SystemInformation,107 _in_ ULONG systeminformationlength,108_out_opt_ pulong returnlength) =0;109 the 111 int_tmain (intARGC, _tchar*argv[]) the {113 //Way One zwquerysysteminformation theHmodule Hntdll = GetModuleHandle (_t ("Ntdll.dll")); the* (LPVOID *) &zwquerysysteminformation = GetProcAddress (Hntdll,"zwquerysysteminformation"); the 117System_basic_information SBI = {0 };118 Zwquerysysteminformation (119 Systembasicinformation, -&SBI,121 sizeof(SBI),122 NULL);123 124unsigned __int64 nsize = (unsigned __int64) SBI. Numberofphysicalpages *SBI. Physicalpagesize; the 126 127 //mode two globalmemorystatusex - memorystatusex Msex;129Msex.dwlength =sizeof(msex); theGlobalMemoryStatusEx (&msex);131Msex.ulltotalphys;//Physical Memory Size the 133 return 0;134}
2 ways windows gets physical memory-essay Records