Skip to content

Latest commit

 

History

History
125 lines (92 loc) · 4.83 KB

nf-memoryapi-openfilemappingfromapp.md

File metadata and controls

125 lines (92 loc) · 4.83 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.OpenFileMappingFromApp
OpenFileMappingFromApp function (memoryapi.h)
Opens a named file mapping object. (OpenFileMappingFromApp)
OpenFileMappingFromApp
OpenFileMappingFromApp function
base.openfilemappingfromapp
memoryapi/OpenFileMappingFromApp
base\openfilemappingfromapp.htm
base
66BAB9A6-F983-49D8-8F87-69A3CCBBB1BC
12/05/2018
OpenFileMappingFromApp, OpenFileMappingFromApp function, base.openfilemappingfromapp, memoryapi/OpenFileMappingFromApp
memoryapi.h
Windows.h
Windows
Windows 10 [desktop apps \| UWP apps]
Windows Server 2016 [desktop apps \| UWP apps]
WindowsApp.lib
Kernel32.dll
Windows
19H1
OpenFileMappingFromApp
memoryapi/OpenFileMappingFromApp
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-memory-l1-1-3.dll
KernelBase.dll
API-MS-Win-Core-Memory-L1-1-4.dll
OpenFileMappingFromApp

OpenFileMappingFromApp function

-description

Opens a named file mapping object.

-parameters

-param DesiredAccess [in]

The access to the file mapping object. This access is checked against any security descriptor on the target file mapping object. For a list of values, see File Mapping Security and Access Rights. You can only open the file mapping object for FILE_MAP_EXECUTE access if your app has the codeGeneration capability.

-param InheritHandle [in]

If this parameter is TRUE, a process created by the CreateProcess function can inherit the handle; otherwise, the handle cannot be inherited.

-param Name [in]

The name of the file mapping object to be opened. If there is an open handle to a file mapping object by this name and the security descriptor on the mapping object does not conflict with the DesiredAccess parameter, the open operation succeeds. The name can have a "Global" or "Local" prefix to explicitly open an object in the global or session namespace. The remainder of the name can contain any character except the backslash character (\). For more information, see Kernel Object Namespaces. Fast user switching is implemented using Terminal Services sessions. The first user to log on uses session 0, the next user to log on uses session 1, and so on. Kernel object names must follow the guidelines outlined for Terminal Services so that applications can support multiple users.

-returns

If the function succeeds, the return value is an open handle to the specified file mapping object.

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

-remarks

You can call OpenFileMappingFromApp from Windows Store apps with just-in-time (JIT) capabilities to use JIT functionality. The app must include the codeGeneration capability in the app manifest file to use JIT capabilities. OpenFileMappingFromApp lets Windows Store apps use the MemoryMappedFile class in the .NET Framework.

The handle that OpenFileMappingFromApp returns can be used with any function that requires a handle to a file mapping object.

When modifying a file through a mapped view, the last modification timestamp may not be updated automatically. If required, the caller should use SetFileTime to set the timestamp.

When it is no longer needed, the caller should call release the handle returned by OpenFileMappingFromApp with a call to CloseHandle.

-see-also

CreateFileMapping

File Mapping Functions

Memory Management Functions

OpenFileMapping

Sharing Files and Memory