CreateFileMapping (kernel32)
Last changed: -211.5.143.129

.
Summary
The CreateFileMapping function creates or opens a named or unnamed file mapping object for the specified file.

C# Signature:

[DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Auto)]
static extern IntPtr CreateFileMapping(IntPtr hFile,
   IntPtr lpFileMappingAttributes,
   FileMappingPageProtection flProtect,
   uint dwMaximumSizeHigh,
   uint dwMaximumSizeLow,
   [MarshalAs(UnmanagedType.LPTStr)] string lpName);

User-Defined Types:

[Flags]
enum FileMappingPageProtection : uint
{
    PageReadonly = 0x02,
    PageReadWrite = 0x04,
    PageWriteCopy = 0x08,
    PageExecuteRead = 0x20,
    PageExecuteReadWrite = 0x40,
    SectionCommit = 0x8000000,
    SectionImage = 0x1000000,
    SectionNoCache = 0x10000000,
    SectionReserve = 0x4000000,
}

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation