{
throw new IOException("Win32 error " + err);
}
IntPtr p = MapViewOfFile(hFileMapping, mapAccess, (int)(position >> 32), (int)position, IntPtr.op_Explicit(length));
err = cli.System.Runtime.InteropServices.Marshal.GetLastWin32Error();
hFileMapping.Close();
if (p.Equals(IntPtr.Zero))
{
if (err == 8 /*ERROR_NOT_ENOUGH_MEMORY*/)
{
throw new OutOfMemoryError("Map failed");