ProjectArcade

Форк
0
/
BY_HANDLE_FILE_INFORMATION.cs 
105 строк · 5.3 Кб
1
using System.Runtime.InteropServices;
2
using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
3

4
namespace DokanNet.Native
5
{
6
    /// <summary>
7
    /// Contains information that the <see cref="DokanOperationProxy.GetFileInformationProxy"/> function retrieves.
8
    /// </summary>
9
    /// <remarks>
10
    /// The identifier that is stored in the nFileIndexHigh and nFileIndexLow members is called the file ID.
11
    /// Support for file IDs is file system-specific. File IDs are not guaranteed to be unique over time,
12
    /// because file systems are free to reuse them. In some cases, the file ID for a file can change over time.
13
    /// 
14
    /// In the FAT file system, the file ID is generated from the first cluster of the containing directory
15
    /// and the byte offset within the directory of the entry for the file. Some defragmentation products
16
    /// change this byte offset. (Windows in-box defragmentation does not.) Thus, a FAT file ID can change
17
    /// over time.Renaming a file in the FAT file system can also change the file ID, but only if the new
18
    /// file name is longer than the old one.
19
    /// 
20
    /// In the NTFS file system, a file keeps the same file ID until it is deleted. You can replace one file
21
    /// with another file without changing the file ID by using the ReplaceFile function. However, the file ID
22
    /// of the replacement file, not the replaced file, is retained as the file ID of the resulting file.
23
    /// 
24
    /// Not all file systems can record creation and last access time, and not all file systems record them
25
    /// in the same manner. For example, on a Windows FAT file system, create time has a resolution of
26
    /// 10 milliseconds, write time has a resolution of 2 seconds, and access time has a resolution of
27
    /// 1 day (the access date). On the NTFS file system, access time has a resolution of 1 hour.
28
    /// </remarks>
29
    /// \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363788%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396">BY_HANDLE_FILE_INFORMATION structure (MSDN)</a>
30
    [StructLayout(LayoutKind.Sequential, Pack = 4)]
31
    internal struct BY_HANDLE_FILE_INFORMATION
32
    {
33
        /// <summary>
34
        /// The file attributes. For possible values and their descriptions.
35
        /// </summary>
36
        public uint dwFileAttributes;
37

38
        /// <summary>
39
        /// A <see cref="FILETIME"/> structure that specifies when a file or directory is created. 
40
        /// If the underlying file system does not support creation time, this member is zero (0).
41
        /// </summary>
42
        public FILETIME ftCreationTime;
43

44
        /// <summary>
45
        ///  A <see cref="FILETIME"/> structure.
46
        /// For a file, the structure specifies the last time that a file is read from or written to.
47
        /// For a directory, the structure specifies when the directory is created.
48
        /// For both files and directories, the specified date is correct, but the time of day is always set to midnight.
49
        /// If the underlying file system does not support the last access time, this member is zero (0).
50
        /// </summary>
51
        public FILETIME ftLastAccessTime;
52

53
        /// <summary>
54
        /// A <see cref="FILETIME"/> structure. 
55
        /// For a file, the structure specifies the last time that a file is written to. 
56
        /// For a directory, the structure specifies when the directory is created. 
57
        /// If the underlying file system does not support the last write time, this member is zero (0).
58
        /// </summary>
59
        public FILETIME ftLastWriteTime;
60

61
        /// <summary>
62
        /// The serial number of the volume that contains a file.
63
        /// </summary>
64
        internal uint dwVolumeSerialNumber;
65

66
        /// <summary>
67
        /// The high-order part of the file size.
68
        /// </summary>
69
        public uint nFileSizeHigh;
70

71
        /// <summary>
72
        /// The low-order part of the file size.
73
        /// </summary>
74
        public uint nFileSizeLow;
75

76
        /// <summary>
77
        /// The number of links to this file. 
78
        /// For the FAT file system this member is always 1. 
79
        /// For the NTFS file system, it can be more than 1.
80
        /// </summary>
81
        internal uint dwNumberOfLinks;
82

83
        /// <summary>
84
        /// The high-order part of a unique identifier that is associated with a file. 
85
        /// For more information, see <see cref="nFileIndexLow"/>.
86
        /// </summary>
87
        internal uint nFileIndexHigh;
88

89
        /// <summary>
90
        /// The low-order part of a unique identifier that is associated with a file.
91
        /// 
92
        /// The identifier (low and high parts) and the volume serial number uniquely 
93
        /// identify a file on a single computer. To determine whether two open handles 
94
        /// represent the same file, combine the identifier and the volume serial number 
95
        /// for each file and compare them.
96
        /// 
97
        /// The ReFS file system, introduced with Windows Server 2012, includes 128-bit 
98
        /// file identifiers. To retrieve the 128-bit file identifier use the 
99
        /// GetFileInformationByHandleEx function with FileIdInfo to retrieve 
100
        /// the FILE_ID_INFO structure. The 64-bit identifier in this structure is not 
101
        /// guaranteed to be unique on ReFS.
102
        /// </summary>
103
        internal uint nFileIndexLow;
104
    }
105
}

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.