Group: File Mapping - Library: kernel32
The MapViewOfFile function maps a view of a file mapping into the address space of the calling process.
Using File Mapping for enumerating files opened by Visual FoxPro
Using shared memory to exchange data between applications (processes)
LPVOID MapViewOfFile(
HANDLE hFileMappingObject,
DWORD dwDesiredAccess,
DWORD dwFileOffsetHigh,
DWORD dwFileOffsetLow,
SIZE_T dwNumberOfBytesToMap
);
DECLARE LONG MapViewOfFile IN kernel32;
INTEGER hFileMappingObject,;
INTEGER dwDesiredAccess,;
LONG dwFileOffsetHi,;
LONG dwFileOffsetLo,;
LONG dwNumberOfBytesToMap
hFileMappingObject [in] Handle to an open handle of a file mapping object. The CreateFileMapping and OpenFileMapping functions return this handle.
dwDesiredAccess [in] Type of access to the file mapping object, and therefore, the protection of the pages.
dwFileOffsetHigh [in] High-order DWORD of the file offset where the view is to begin.
dwFileOffsetLow [in] Low-order DWORD of the file offset where the view is to begin.
dwNumberOfBytesToMap [in] Number of bytes of the file mapping to map to the view.
If the function succeeds, the return value is the starting address of the mapped view.
Mapping a file makes the specified portion of the file visible in the address space of the calling process.
For files that are larger than your address space, you can only map a small portion of the file data at a time. When you are through with the first view, then you unmap it and map a new view.
See also: MapViewOfFileEx, OpenFileMapping, UnmapViewOfFile.