ProjectArcade

Форк
0
246 строк · 7.7 Кб
1
using System;
2

3
namespace DokanNet
4
{
5
    /// <summary>
6
    /// Defines standard, specific, and generic rights. 
7
    /// These rights are used in access control entries (ACEs) and are the primary means of 
8
    /// specifying the requested or granted access to an object. 
9
    /// </summary>
10
    /// <remarks>
11
    /// This extends the <c><see cref="System.IO.FileAccess"/></c> enumerator in .NET that only 
12
    /// contains flags for <c>Read</c> (<c>0x01</c>) and <c>Write</c> (<c>0x10</c>).
13
    /// </remarks>
14
    /// \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa374896(v=vs.85).aspx">Access Mask Format (MSDN)</a>
15
    /// \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa374892(v=vs.85).aspx">ACCESS_MASK (MSDN)</a>
16
    /// \see <a href="https://msdn.microsoft.com/en-us/library/4z36sx0f.aspx">FileAccess Enumeration (MSDN)</a>
17
    [Flags]
18
    public enum FileAccess : long
19
    {
20
        /// <summary>
21
        /// No access defined.
22
        /// </summary>
23
        None = 0,
24

25
        /// <summary>
26
        /// Read access right to an object.
27
        /// </summary>
28
        /// \native
29
        /// \table
30
        /// \nativeconst{FILE_READ_DATA,0x00000001,File & pipe}
31
        /// \nativeconst{FILE_LIST_DIRECTORY,0x00000001,Directory}
32
        /// \endtable
33
        /// \endnative
34
        ReadData = 1,
35

36
        /// <summary>
37
        /// Write access right to an object.
38
        /// </summary>
39
        /// \native
40
        /// \table
41
        /// \nativeconst{FILE_WRITE_DATA,0x00000002,File & pipe}
42
        /// \nativeconst{FILE_ADD_FILE,0x00000002,Directory}
43
        /// \endtable
44
        /// \endnative
45
        WriteData = 1L << 1,
46

47
        /// <summary>
48
        /// For a file object, the right to append data to the file.
49
        /// </summary>
50
        /// \native
51
        /// \table
52
        /// \nativeconst{FILE_APPEND_DATA,0x00000004,File}
53
        /// \nativeconst{FILE_ADD_SUBDIRECTORY,0x00000004,Directory}
54
        /// \nativeconst{FILE_CREATE_PIPE_INSTANCE,0x00000004,Named pipe}
55
        /// \endtable
56
        /// \endnative
57
        AppendData = 1L << 2,
58

59
        /// <summary>
60
        /// The right to read extended file attributes.
61
        /// </summary>
62
        /// \native
63
        /// \table
64
        /// \nativeconst{FILE_READ_EA,0x00000008,File & directory}
65
        /// \endtable
66
        /// \endnative
67
        ReadExtendedAttributes = 1L << 3,
68

69
        /// <summary>
70
        /// The right to write extended file attributes.
71
        /// </summary>
72
        /// \native
73
        /// \table
74
        /// \nativeconst{FILE_WRITE_EA,0x00000010,File & directory}
75
        /// \endtable
76
        /// \endnative
77
        WriteExtendedAttributes = 1L << 4,
78

79
        /// <summary>
80
        /// For a native code file, the right to execute the file.
81
        /// This access right given to scripts may cause the script to be executable, depending on the script interpreter.
82
        /// </summary>
83
        /// \native
84
        /// \table
85
        /// \nativeconst{FILE_EXECUTE,0x00000020,File}
86
        /// \nativeconst{FILE_TRAVERSE,0x00000020,Directory}
87
        /// \endtable
88
        /// \endnative
89
        Execute = 1L << 5,
90

91
        /// <summary>
92
        /// For a directory, the right to delete a directory and all the files it contains, including read-only files.
93
        /// </summary>
94
        /// \native
95
        /// \table
96
        /// \nativeconst{FILE_DELETE_CHILD,0x00000040,Directory}
97
        /// \endtable
98
        /// \endnative
99
        DeleteChild = 1L << 6,
100

101
        /// <summary>
102
        /// The right to read file attributes.
103
        /// </summary>
104
        /// \native
105
        /// \table
106
        /// \nativeconst{FILE_READ_ATTRIBUTES,0x00000080,All}
107
        /// \endtable
108
        /// \endnative
109
        ReadAttributes = 1L << 7,
110

111
        /// <summary>
112
        /// The right to write file attributes.
113
        /// </summary>
114
        /// \native
115
        /// \table
116
        /// \nativeconst{FILE_WRITE_ATTRIBUTES,0x00000100,All}
117
        /// \endtable
118
        /// \endnative
119
        WriteAttributes = 1L << 8,
120

121
        /// <summary>
122
        /// The right to delete the object.
123
        /// </summary>
124
        /// \native
125
        /// \table
126
        /// \nativeconst{DELETE,0x00010000}
127
        /// \endtable
128
        /// \endnative
129
        Delete = 1L << 16,
130

131
        /// <summary>
132
        /// The right to read the information in the object's security descriptor, 
133
        /// not including the information in the system access control list (SACL).
134
        /// </summary>
135
        /// \native
136
        /// \table
137
        /// \nativeconst{READ_CONTROL,0x00020000}
138
        /// \endtable
139
        /// \endnative
140
        ReadPermissions = 1L << 17,
141

142
        /// <summary>
143
        /// The right to modify the discretionary access control list (DACL) in 
144
        /// the object's security descriptor.
145
        /// </summary>
146
        /// \native
147
        /// \table
148
        /// \nativeconst{WRITE_DAC,0x00040000}
149
        /// \endtable
150
        /// \endnative
151
        ChangePermissions = 1L << 18,
152

153
        /// <summary>
154
        /// The right to change the owner in the object's security descriptor.
155
        /// </summary>
156
        /// \native
157
        /// \table
158
        /// \nativeconst{WRITE_OWNER,0x00080000}
159
        /// \endtable
160
        /// \endnative
161
        SetOwnership = 1L << 19,
162

163
        /// <summary>
164
        /// The right to use the object for synchronization. 
165
        /// This enables a thread to wait until the object is in the signaled state. 
166
        /// Some object types do not support this access right.
167
        /// </summary>
168
        /// \native
169
        /// \table
170
        /// \nativeconst{SYNCHRONIZE,0x00100000}
171
        /// \endtable
172
        /// \endnative
173
        Synchronize = 1L << 20,
174

175
        /// <summary>
176
        /// Obsolete, use <see cref="FileAccess.AccessSystemSecurity"/> instead. 
177
        /// </summary>
178
        [Obsolete("Use AccessSystemSecurity instead")]
179
        Reserved = AccessSystemSecurity,
180

181
        /// <summary>
182
        /// Access system security. 
183
        /// It is used to indicate access to a system access control list (SACL). 
184
        /// This type of access requires the calling process to have the <c>SE_SECURITY_NAME</c> 
185
        /// (Manage auditing and security log) privilege. If this flag is set in 
186
        /// the access mask of an audit access ACE (successful or unsuccessful access), 
187
        /// the SACL access will be audited.
188
        /// </summary>
189
        /// \native
190
        /// \table
191
        /// \nativeconst{ACCESS_SYSTEM_SECURITY,0x01000000}
192
        /// \endtable
193
        /// \endnative
194
        AccessSystemSecurity = 1L << 24,
195

196
        /// <summary>
197
        /// All the access rights that are valid for the caller.
198
        /// </summary>
199
        /// \native
200
        /// \table
201
        /// \nativeconst{MAXIMUM_ALLOWED,0x02000000}
202
        /// \endtable
203
        /// \endnative
204
        MaximumAllowed = 1L << 25,
205

206
        /// <summary>
207
        /// All possible access rights.
208
        /// </summary>
209
        /// \native
210
        /// \table
211
        /// \nativeconst{GENERIC_ALL,0x10000000}
212
        /// \endtable
213
        /// \endnative
214
        GenericAll = 1L << 28,
215

216
        /// <summary>
217
        /// Generic execute access. 
218
        /// </summary>
219
        /// \native
220
        /// \table
221
        /// \nativeconst{GENERIC_EXECUTE,0x20000000}
222
        /// \endtable
223
        /// \endnative
224
        GenericExecute = 1L << 29,
225

226
        /// <summary>
227
        /// Generic write access.
228
        /// </summary>
229
        /// \native
230
        /// \table
231
        /// \nativeconst{GENERIC_WRITE,0x40000000}
232
        /// \endtable
233
        /// \endnative
234
        GenericWrite = 1L << 30,
235

236
        /// <summary>
237
        /// Generic read access.
238
        /// </summary>
239
        /// \native
240
        /// \table
241
        /// \nativeconst{GENERIC_READ,0x80000000}
242
        /// \endtable
243
        /// \endnative
244
        GenericRead = 1L << 31
245
    }
246
}

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

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

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

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