Win32 virtual memory allocation function
-
Win32 virtual memory allocation function
Virtual memory is the other API API foundation. API to virtual memory page for the distribution of the smallest units, X86, page length of 4 KB can be used to extract function GetSystemInfo page length. Virtual memory allocation functions include the following functions:
- LPVOID VirtualAlloc (LPVOID lpvAddress,
DWORD cbSize,
DWORD fdwAllocationType,
DWORD fdwProtect);
The distribution function for a range of virtual page. Parameters of a designated starting address; 2 parameters specified the length of memory allocation; three parameters specified distribution, and value MEM_COMMINT or MEM_RESERVE parameter control access to the four designated the allocation of memory logo, value for PAGE_READONLY, PAGE_READWRITE or PAGE_NOACCESS.
- LPVOID VirtualAllocEx (HANDLE process,
LPVOID lpvAddress,
DWORD cbSize,
DWORD fdwAllocationType,
DWORD fdwProtect);
VirtualAlloc function similar to the function, but the process allows you to specify process. VirtaulFree, VirtualProtect, VirtualQuery have corresponding spread function.
- BOOL VirtualFree (LPVOID lpvAddress,
DWORD dwSize,
DWORD dwFreeType);
The function for the release or recovery of the distribution of virtual memory. Parameters of a specified that the release or recovery of memory base address; If it is recovered, two parameters can be at the virtual addresses within the scope of any local, if it is released, the two parameters must be VirtualAlloc return address; three parameters specified whether to release or recovery of memory, Value for MEM_DECOMMINT or MEM_RELEASE.
- BOOL VirtualProtect (LPVOID lpvAddress,
DWORD cbSize,
DWORD fdwNewProtect,
PDWORD pfdwOldProtect);
The function has been used to change the distribution of page-protection page. Distribution of a specified parameters-page address parameter 2 designation page length parameter specified page 3 of protection attributes, values PAGE_READ, PAGE_WRITE, PAGE_READWRITE etc.; 4 to return to the original parameters of protection attributes.








0 Comments to “Win32 virtual memory allocation function”
No Comments. Send your comment.
Leave a Reply
You must be logged in to post a comment.