Beispiel #1
0
 public unsafe static extern NTStatus NtCreateFile(
     out IntPtr FileHandle,
     DesiredAccess DesiredAccess,
     ref OBJECT_ATTRIBUTES ObjectAttributes,
     out IO_STATUS_BLOCK IoStatusBlock,
     long *AllocationSize,
     AllFileAttributes FileAttributes,
     ShareModes ShareAccess,
     CreateDisposition CreateDisposition,
     CreateOptions CreateOptions,
     void *EaBuffer,
     uint EaLength);
 public unsafe FullFileInformation(FILE_FULL_DIR_INFORMATION *info)
 {
     FileIndex              = info->FileIndex;
     CreationTimeUtc        = info->CreationTime.ToDateTimeUtc();
     LastAccessTimeUtc      = info->LastAccessTime.ToDateTimeUtc();
     LastWriteTimeUtc       = info->LastWriteTime.ToDateTimeUtc();
     ChangeTimeUtc          = info->ChangeTime.ToDateTimeUtc();
     EndOfFile              = info->EndOfFile;
     AllocationSize         = info->AllocationSize;
     FileAttributes         = info->FileAttributes;
     ExtendedAttributesSize = info->EaSize;
     FileName = info->FileName.CreateString();
 }
Beispiel #3
0
 /// <summary>
 /// Simple helper for CreateFile call that sets the expected values when opening a COM port.
 /// </summary>
 public static SafeFileHandle CreateComPortFileHandle(
     string path,
     AllFileAttributes fileAttributes = AllFileAttributes.None,
     FileFlags fileFlags = FileFlags.None)
 {
     return(Storage.Storage.CreateFile(
                path,
                CreationDisposition.OpenExisting,
                DesiredAccess.GenericReadWrite,
                0,
                fileAttributes,
                fileFlags));
 }
Beispiel #4
0
 public static extern bool SetFileAttributesW(
     string lpFileName,
     AllFileAttributes dwFileAttributes);