Package cli.Microsoft.Win32.SafeHandles

Examples of cli.Microsoft.Win32.SafeHandles.SafeFileHandle


                default:
                    throw new Error();
            }

            long maxSize = length + position;
            SafeFileHandle hFileMapping = CreateFileMapping(fs.get_SafeFileHandle(), IntPtr.Zero, fileProtect, (int)(maxSize >> 32), (int)maxSize, null);
            int err = cli.System.Runtime.InteropServices.Marshal.GetLastWin32Error();
            if (hFileMapping.get_IsInvalid())
            {
                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");
View Full Code Here

TOP

Related Classes of cli.Microsoft.Win32.SafeHandles.SafeFileHandle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.