private CreateFile ( [ lpFileName, [ dwDesiredAccess, [ dwShareMode, [ lpSecurityAttributes, [ dwCreationDisposition, [ dwFlagsAndAttributes, [ hTemplateFile ) : |
||
lpFileName | [ | |
dwDesiredAccess | [ | |
dwShareMode | [ | |
lpSecurityAttributes | [ | |
dwCreationDisposition | [ | |
dwFlagsAndAttributes | [ | |
hTemplateFile | [ | |
Résultat |
// // Private Helpers // private static SafeFileHandle GetDirectoryHandle(string path) { // Get a native handle to the directory SafeFileHandle handle = NativeMethods.CreateFile( path, NativeMethods.FileAccess.GENERIC_WRITE, NativeMethods.FileShare.FILE_SHARE_NONE, IntPtr.Zero, NativeMethods.FileMode.OPEN_EXISTING, NativeMethods.FILE_FLAG_BACKUP_SEMANTICS, // Returns the directory handle IntPtr.Zero); if (handle.IsInvalid) { throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); } return(handle); }