MapViewOfFileNuma2 function (memoryapi.h)

Maps a view of a file or a pagefile-backed section into the address space of the specified process.

Syntax

PVOID MapViewOfFileNuma2(
  [in]           HANDLE  FileMappingHandle,
  [in]           HANDLE  ProcessHandle,
  [in]           ULONG64 Offset,
  [in, optional] PVOID   BaseAddress,
  [in]           SIZE_T  ViewSize,
  [in]           ULONG   AllocationType,
  [in]           ULONG   PageProtection,
  [in]           ULONG   PreferredNode
);

Parameters

[in] FileMappingHandle

A HANDLE to a section that is to be mapped into the address space of the specified process.

[in] ProcessHandle

A HANDLE to a process into which the section will be mapped.

[in] Offset

The offset from the beginning of the section. This must be 64k aligned.

[in, optional] BaseAddress

The desired base address of the view. The address is rounded down to the nearest 64k boundary. If this parameter is NULL, the system picks the base address.

[in] ViewSize

The number of bytes to map. A value of zero (0) specifies that the entire section is to be mapped.

[in] AllocationType

The type of allocation. This parameter can be zero (0) or one of the following constant values:

  • MEM_RESERVE - Maps a reserved view
  • MEM_LARGE_PAGES - Maps a large page view

[in] PageProtection

The desired page protection.

For file-mapping objects created with the SEC_IMAGE attribute, the PageProtection parameter has no effect, and should be set to any valid value such as PAGE_READONLY.

[in] PreferredNode

The preferred NUMA node for this memory.

Return value

Returns the base address of the mapped view, if successful. Otherwise, returns NULL and extended error status is available using GetLastError.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1703 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header memoryapi.h (include Windows.h, Memoryapi.h)
Library Onecore.lib; Onecoreuap.lib
DLL Api-ms-win-core-memory-l1-1-5.dll

See also

MapViewOfFile

MapViewOfFileNuma