if (p.Equals(IntPtr.Zero) || p.Equals(new IntPtr(-1)))
{
throw new IOException("file mapping failed");
}
cli.System.GC.AddMemoryPressure(length);
return p.ToInt64();
}
@DllImportAttribute.Annotation(value="kernel32", SetLastError=true)
private static native SafeFileHandle CreateFileMapping(SafeFileHandle hFile, IntPtr lpAttributes, int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, String lpName);