ProjectArcade

Форк
0
109 строк · 5.5 Кб
1
using System.IO;
2
using System.Runtime.InteropServices;
3
using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
4

5
namespace DokanNet.Native
6
{
7
    /// <summary>
8
    /// Contains information about the file that is found by the FindFirstFile, FindFirstFileEx, or FindNextFile function.
9
    /// </summary>
10
    /// <remarks>
11
    /// If a file has a long file name, the complete name appears in the cFileName member, and the 8.3 format truncated version
12
    /// of the name appears in the <see cref="cAlternateFileName"/>member. Otherwise,<see cref="cAlternateFileName"/> is empty. If the FindFirstFileEx function
13
    /// was called with a value of FindExInfoBasic in the fInfoLevelId parameter, the <see cref="cAlternateFileName"/> member will always contain
14
    /// a NULL string value. This remains true for all subsequent calls to the FindNextFile function. As an alternative method of
15
    /// retrieving the 8.3 format version of a file name, you can use the GetShortPathName function. For more information about
16
    /// file names, see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx">Naming Files, Paths, and Namespaces (MSDN)</a>.
17
    /// 
18
    /// Not all file systems can record creation and last access times, and not all file systems record them in the same manner.
19
    /// For example, on the FAT file system, create time has a resolution of 10 milliseconds, write time has a resolution of
20
    /// 2 seconds, and access time has a resolution of 1 day. The NTFS file system delays updates to the last access time for
21
    /// a file by up to 1 hour after the last access.For more information, see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724290(v=vs.85).aspx">File Times (MSDN)</a>.
22
    /// </remarks>
23
    /// \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa365740%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396">WIN32_FIND_DATA structure (MSDN)</a>
24
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 4)]
25
    internal struct WIN32_FIND_DATA
26
    {
27
        /// <summary>
28
        /// The file attributes of a file.
29
        /// 
30
        /// For possible values and their descriptions, see <see cref="FileAttributes"/>.
31
        /// The <see cref="FileAttributes.SparseFile"/> attribute on the file is set if any of 
32
        /// the streams of the file have ever been sparse.
33
        /// </summary>
34
        public FileAttributes dwFileAttributes;
35

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

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

55
        /// <summary>
56
        /// A <see cref="FILETIME"/> structure.
57
        /// 
58
        /// For a file, the structure specifies when the file was last written to, 
59
        /// truncated, or overwritten, for example, when WriteFile or SetEndOfFile 
60
        /// are used. The date and time are not updated when file attributes or 
61
        /// security descriptors are changed.
62
        /// 
63
        /// For a directory, the structure specifies when the directory is created.
64
        /// If the underlying file system does not support last write time, 
65
        /// this member is zero.
66
        /// </summary>
67
        public FILETIME ftLastWriteTime;
68

69
        /// <summary>
70
        /// The high-order DWORD value of the file size, in bytes.
71
        /// 
72
        /// This value is zero unless the file size is greater than MAXDWORD.
73
        /// 
74
        /// The size of the file is equal to (nFileSizeHigh* (MAXDWORD+1)) + nFileSizeLow.
75
        /// </summary>
76
        public uint nFileSizeHigh;
77

78
        /// <summary>
79
        /// The low-order DWORD value of the file size, in bytes.
80
        /// </summary>
81
        public uint nFileSizeLow;
82

83
        /// <summary>
84
        /// If the <see cref="dwFileAttributes"/> member includes the <see cref="FileAttributes.ReparsePoint"/> attribute, 
85
        /// this member specifies the reparse point tag. 
86
        /// Otherwise, this value is undefined and should not be used.
87
        /// </summary>
88
        /// \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa365511(v=vs.85).aspx">Reparse Point Tags (MSDN)</a>
89
        private readonly uint dwReserved0;
90

91
        /// <summary>
92
        /// Reserved for future use.
93
        /// </summary>
94
        private readonly uint dwReserved1;
95

96
        /// <summary>
97
        /// The name of the file.
98
        /// </summary>
99
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
100
        public string cFileName;
101

102
        /// <summary>
103
        /// An alternative name for the file.
104
        /// This name is in the classic 8.3 file name format.
105
        /// </summary>
106
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
107
        private readonly string cAlternateFileName;
108
    }
109
}

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

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

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

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