Skip to content

Latest commit

 

History

History
96 lines (77 loc) · 3.4 KB

nf-winbase-addsecurememorycachecallback.md

File metadata and controls

96 lines (77 loc) · 3.4 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:winbase.AddSecureMemoryCacheCallback
AddSecureMemoryCacheCallback function (winbase.h)
Registers a callback function to be called when a secured memory range is freed or its protections are changed.
AddSecureMemoryCacheCallback
AddSecureMemoryCacheCallback function
base.addsecurememorycachecallback
winbase/AddSecureMemoryCacheCallback
base\addsecurememorycachecallback.htm
base
6c89d6f3-182e-4b10-931c-8d55d603c9dc
12/05/2018
AddSecureMemoryCacheCallback, AddSecureMemoryCacheCallback function, base.addsecurememorycachecallback, winbase/AddSecureMemoryCacheCallback
winbase.h
Windows.h
Windows
Windows Vista with SP1 [desktop apps only]
Windows Server 2008 [desktop apps only]
Kernel32.lib
Kernel32.dll
Windows
19H1
AddSecureMemoryCacheCallback
winbase/AddSecureMemoryCacheCallback
c++
APIRef
kbSyntax
DllExport
kernel32.dll
AddSecureMemoryCacheCallback

AddSecureMemoryCacheCallback function

-description

Registers a callback function to be called when a secured memory range is freed or its protections are changed.

-parameters

-param pfnCallBack [in]

A pointer to the application-defined SecureMemoryCacheCallback function to register.

-returns

If the function succeeds, it registers the callback function and returns TRUE.

If the function fails, it returns FALSE. To get extended error information, call the GetLastError function.

-remarks

An application that performs I/O directly to a high-performance device typically caches a virtual-to-physical memory mapping for the buffer it uses for the I/O. The device's driver typically secures this memory address range by calling the MmSecureVirtualMemory routine, which prevents the memory range from being freed or its protections changed until the driver unsecures the memory.

An application can use AddSecureMemoryCacheCallback to register a callback function that will be called when the memory is freed or its protections are changed, so the application can invalidate its cached memory mapping. For more information, see SecureMemoryCacheCallback.

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers.

-see-also

RemoveSecureMemoryCacheCallback

SecureMemoryCacheCallback