Skip to content

Latest commit

 

History

History
97 lines (74 loc) · 3.21 KB

nf-memoryapi-virtualunlock.md

File metadata and controls

97 lines (74 loc) · 3.21 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:memoryapi.VirtualUnlock
VirtualUnlock function (memoryapi.h)
Unlocks a specified range of pages in the virtual address space of a process, enabling the system to swap the pages out to the paging file if necessary.
VirtualUnlock
VirtualUnlock function
_win32_virtualunlock
base.virtualunlock
winbase/VirtualUnlock
base\virtualunlock.htm
base
cb868c8a-ac0d-42ad-bf72-2ae617bc0427
12/05/2018
VirtualUnlock, VirtualUnlock function, _win32_virtualunlock, base.virtualunlock, winbase/VirtualUnlock
memoryapi.h
Windows.h, Memoryapi.h
Windows
Windows XP [desktop apps \| UWP apps]
Windows Server 2003 [desktop apps \| UWP apps]
onecore.lib
Kernel32.dll
Windows
19H1
VirtualUnlock
memoryapi/VirtualUnlock
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-memory-l1-1-1.dll
KernelBase.dll
API-MS-Win-Core-memory-l1-1-2.dll
API-MS-Win-Core-memory-l1-1-3.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
API-MS-Win-Core-Memory-L1-1-4.dll
VirtualUnlock

VirtualUnlock function

-description

Unlocks a specified range of pages in the virtual address space of a process, enabling the system to swap the pages out to the paging file if necessary.

-parameters

-param lpAddress [in]

A pointer to the base address of the region of pages to be unlocked.

-param dwSize [in]

The size of the region being unlocked, in bytes. 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 unlocked.

-returns

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.

-remarks

For the function to succeed, the range specified need not match a range passed to a previous call to the VirtualLock function, but all pages in the range must be locked. If any of the pages in the specified range are not locked, VirtualUnlock removes such pages from the working set, sets last error to ERROR_NOT_LOCKED, and returns FALSE.

Calling VirtualUnlock on a range of memory that is not locked releases the pages from the process's working set.

-see-also

Memory Management Functions

Virtual Memory Functions

VirtualLock