[This is preliminary documentation and subject to change.]
The MapViewOfFileVlm function maps a view of a file into the address space of the calling process.
LPVOID MapViewOfFileVlm(
HANDLE hFileMappingObject, // file-mapping object to map into
// address space
DWORD dwDesiredAccess, // desired access mode
DWORDLONG ulOffset, // offset into mapping region
DWORDLONG ulNumberOfBytesToMap, // size of mapping in bytes
PVOID64 lpBaseAddress // address of region of shared memory
);
Value | Meaning |
---|---|
FILE_MAP_READ | Read-only access. The object whose handle is passed in the hFileMappingObject parameter must have been created with PAGE_READWRITE or PAGE_READONLY protection. A read-only view of the file is mapped. |
FILE_MAP_WRITE | Read-write access. The hFileMappingObject object must have been created with PAGE_READWRITE protection. A read-write view of the file is mapped. |
If the function succeeds, the return value is the starting address of the mapped view, after any rounding down.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Mapping a file makes the specified portion of the file visible in the address space of the calling process.
Multiple views of a file (or of a file-mapping object and its mapped file) are said to be "coherent" if they contain identical data at a specified time. Coherence occurs if the file views are derived from the same file-mapping object. A process can duplicate a file-mapping object handle in another process by using the DuplicateHandle function. A process other than the file-mapping object's creator can open the object by name by using the OpenFileMapping function.
A mapped view of a file is not guaranteed to be coherent with a file being accessed by the ReadFile, WriteFile, ReadFileVlm or WriteFileVlm function.
A call to MapViewOfFileVlm fails if there is not enough address space to map the requested number of bytes.
Because VLM virtual space is not paged, page file size is not a concern.
Note To guard against an access violation, use structured exception handling to protect any code that writes to or reads from a memory-mapped view. For more information on structured exception handling, see Reading and Writing.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Memory Management Overview, Memory Management Functions, Very Large Memory (VLM), CreateFileMapping, DuplicateHandle, GetSystemInfo, MapViewOfFileEx, OpenFileMapping, ReadFile, ReadFileVlm, SYSTEM_INFO, UnmapViewOfFileVlm, WriteFile, WriteFileVlm