Example #1
0
        /// <summary>
        /// Returns the <see cref="SafeFileHandle"/> and fills <see cref="Win32FindData"/> from the passes path.
        /// </summary>
        /// <param name="path">Path to the file system entry</param>
        /// <returns><see cref="SafeFileHandle"/></returns>
        /// <exception cref="PathNotFoundException">This error is fired if the specified path or a part of them does not exist.</exception>
        internal static SafeFileHandle OpenReadWriteFileSystemEntryHandle(string path)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(path));

            Contract.Ensures(Contract.Result <SafeFileHandle>() != null);

            return(Win32SafeNativeMethods.OpenReadWriteFileSystemEntryHandle(path, (0x40000000 | 0x80000000), FileShare.Read | FileShare.Write | FileShare.Delete, IntPtr.Zero, FileMode.Open, (0x02000000), IntPtr.Zero));
        }
Example #2
0
 /// <summary>
 ///     Returns the <see cref="SafeFileHandle" /> and fills <see cref="Win32FindData" /> from the passes path.
 /// </summary>
 /// <param name="path">Path to the file system entry</param>
 /// <returns>
 ///     <see cref="SafeFileHandle" />
 /// </returns>
 internal static SafeFileHandle OpenReadWriteFileSystemEntryHandle(string path)
 {
     return(Win32SafeNativeMethods.OpenReadWriteFileSystemEntryHandle(path, (0x40000000 | 0x80000000), FileShare.Read | FileShare.Write | FileShare.Delete, IntPtr.Zero, FileMode.Open, (0x02000000), IntPtr.Zero));
 }