Microsoft.Win32.SafeHandles.SafeFileHandleHelper.Open C# (CSharp) Méthode

Open() static private méthode

Opens a SafeFileHandle for a file descriptor created by a provided delegate.
static private Open ( Func fdFunc ) : SafeFileHandle
fdFunc Func /// The function that creates the file descriptor. Returns the file descriptor on success, or an invalid /// file descriptor on error with Marshal.GetLastWin32Error() set to the error code. ///
Résultat SafeFileHandle
        internal static SafeFileHandle Open(Func<SafeFileHandle> fdFunc)
        {
            SafeFileHandle handle = Interop.CheckIo(fdFunc());

            Debug.Assert(!handle.IsInvalid, "File descriptor is invalid");
            return handle;
        }
    }

Same methods

SafeFileHandleHelper::Open ( string path, Interop flags, int mode ) : SafeFileHandle
SafeFileHandleHelper