2 ways windows gets physical memory-essay Records

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.