private static SafeFileHandle GetFileHandle(string normalizedPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) { var handle = NativeMethods.CreateFile(normalizedPath, access.ToNative(), share.ToNative(), IntPtr.Zero, mode.ToNative(), options.ToNative(), IntPtr.Zero); if (handle.IsInvalid) { throw LongPathCommon.GetExceptionFromLastWin32Error(); } return(handle); }
private static SafeFileHandle GetFileHandle(string normalizedPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) { var handle = NativeMethods.CreateFile(normalizedPath, access.ToNative(), share.ToNative(), IntPtr.Zero, mode.ToNative(), options.ToNative(), IntPtr.Zero); if (handle.IsInvalid) throw LongPathCommon.GetExceptionFromLastWin32Error(); return handle; }