AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

VirtualFree

The VirtualFree function releases, decommits, or releases and decommits a region of pages within the virtual address space of the calling process.

VB4-32,5,6
Declare Function VirtualFree Lib "kernel32" (ByVal lpAddress As Long, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long

Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later

Library
Kernel32

Parameter Information
lpAddress
[in] Pointer to the base address of the region of pages to be freed. If the dwFreeType parameter includes MEM_RELEASE, this parameter must be the base address returned by the VirtualAlloc function when the region of pages was reserved.

dwSize
[in] Specifies the size, in bytes, of the region to be freed. If the dwFreeType parameter includes MEM_RELEASE, this parameter must be zero. Otherwise, the region of affected pages includes all pages containing one or more bytes in the range from the lpAddress parameter to (lpAddress+dwSize). This means that a 2-byte range straddling a page boundary causes both pages to be freed.

dwFreeType
[in] Specifies the type of free operation. This parameter can be one of the following values.
MEM_DECOMMIT
Decommits the specified region of committed pages.
An attempt to decommit an uncommitted page will not cause the function to fail. This means that a range of committed or uncommitted pages can be decommitted without having to worry about a failure.
MEM_RELEASE
Releases the specified region of reserved pages. If this value is specified, the dwSize parameter must be zero, or the function fails.

Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Examples

Related Functions

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/