Overview | ||||||||||||||||
Group | ||||||||||||||||
Quick Info
|
VirtualFreeEx
[New - Windows NT] The VirtualFreeEx function releases, decommits, or both, a region of memory within the virtual address space of a specified process. The difference between the VirtualFreeEx function and the VirtualFree function is that VirtualFree frees memory within the address space of the calling process, while VirtualFreeEx lets you specify a process. BOOL VirtualFreeEx( HANDLE hProcess,
| // process within which to free memory
|
LPVOID lpAddress,
| // starting address of memory region to free
|
DWORD dwSize,
| // size, in bytes, of memory region to free
|
DWORD dwFreeType
| // type of free operation
|
);
|
|
- the MEM_DECOMMIT flag is set
- lpAddress is the base address returned by the VirtualAllocEx function when the region was reserved
- dwSize is zero
Flag
| Meaning
|
MEM_DECOMMIT
| The function decommits the specified region of pages. The pages enter the
reserved state.
|
| The function does not fail if you attempt to decommit an uncommitted page.
This means that you can decommit a range of pages without first determining their
current commitment state.
|
MEM_RELEASE
| The function releases the specified region of pages. The pages enter the free
state.
If you specify this flag, dwSize must be zero, and lpAddress must point to the base address returned by the VirtualAllocEx function when the region was reserved. The function fails if either of these conditions is not met. |
| If any pages in the region are currently committed, the function first
decommits and then releases them.
The function does not fail if you attempt to release pages that are in different states, some reserved and some committed. This means that you can release a range of pages without first determining their current commitment state. |
State
| Meaning
|
Free
| The page is neither committed nor reserved. The page is not accessible to the
process. Attempting to read from or write to a free page results in an access
violation exception.
You can use the VirtualFreeEx function to put reserved or committed memory pages into the free state. |
Reserved
| The page is reserved. The range of addresses cannot be used by other
allocation functions. The page is not accessible and has no physical storage associated
with it. Attempting to read from or write to a free page results in an access
violation exception.
You can use the VirtualFreeEx function to put committed memory pages into the reserved state, and to put reserved memory pages into the free state. |
Committed
| The page is committed. Physical storage in memory or in the paging file on
disk is allocated for the page, and access is controlled by a protection code.
The operating system initializes and loads each committed page into physical memory only at the first attempt to read from or write to that page. When a process terminates, the operating system releases all storage for committed pages. You can use the VirtualAllocEx function to put committed memory pages into either the reserved or free state. |
- Decommit a region of committed or uncommitted pages. After this operation, the pages are in the reserved state.
- Release a region of reserved pages. After this operation, the pages are in the free state.
- Decommit and release a region of committed or uncommitted pages. After this operation, the pages are in the free state.
- Software for developers
-
Delphi Components
.Net Components
Software for Android Developers - More information resources
-
MegaDetailed.Net
Unix Manual Pages
Delphi Examples - Databases for Amazon shops developers
-
Amazon Categories Database
Browse Nodes Database