ProjectArcade

Форк
0
78 строк · 2.8 Кб
1
using System.Runtime.InteropServices;
2

3
namespace DokanNet.Native
4
{
5
    /// <summary>
6
    /// Dokan mount options used to describe dokan device behaviour
7
    /// </summary>
8
    /// <see cref="NativeMethods.DokanMain"/>
9
    /// <remarks>This is the same structure as <c>PDOKAN_OPTIONS</c> (dokan.h) in the C version of Dokan.</remarks>
10
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 4)]
11
    public sealed class DOKAN_OPTIONS
12
    {
13
        /// <summary>
14
        /// Version of the dokan features requested (version "123" is equal to Dokan version 1.2.3).
15
        /// </summary>
16
        public ushort Version;
17

18
        /// <summary>
19
        /// Only use a single thread to process events. This is highly not recommended as can easily create a bottleneck.
20
        /// </summary>
21
        [MarshalAs(UnmanagedType.U1)]
22
        public bool SingleThread;
23

24
        /// <summary>
25
        /// Features enable for the mount. See <see cref="DokanOptions"/>.
26
        /// </summary>
27
        [MarshalAs(UnmanagedType.U4)]
28
        public DokanOptions Options;
29

30
        /// <summary>
31
        /// FileSystem can store anything here.
32
        /// </summary>
33
        public ulong GlobalContext;
34

35
        /// <summary>
36
        /// Mount point.
37
        /// Can be <c>M:\\</c>(drive letter) or <c>C:\\mount\\dokan</c> (path in NTFS).
38
        /// </summary>
39
        [MarshalAs(UnmanagedType.LPWStr)]
40
        public string MountPoint;
41

42
        /// <summary>
43
        /// UNC name used for network volume.
44
        /// </summary>
45
        [MarshalAs(UnmanagedType.LPWStr)]
46
        public string UNCName;
47

48
        /// <summary>
49
        /// Max timeout in milliseconds of each request before Dokan give up.
50
        /// </summary>
51
        private uint Timeout;
52
        public System.TimeSpan TimeOut
53
        {
54
            get { return System.TimeSpan.FromMilliseconds(Timeout); }
55
            set { Timeout = (uint)value.TotalMilliseconds; }
56
        }
57

58
        /// <summary>
59
        /// Allocation Unit Size of the volume. This will behave on the file size.
60
        /// </summary>
61
        public uint AllocationUnitSize;
62

63
        /// <summary>
64
        /// Sector Size of the volume. This will behave on the file size.
65
        /// </summary>
66
        public uint SectorSize;
67
        /// <summary>
68
        /// Length of the optional VolumeSecurityDescriptor provided. Set 0 will disable the option.
69
        /// <summary>
70
        public uint VolumeSecurityDescriptorLength;
71

72
        /// <summary>
73
        /// Optional Volume Security descriptor. See <a href="https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-initializesecuritydescriptor">InitializeSecurityDescriptor</a>
74
        /// <summary>
75
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16384, ArraySubType = UnmanagedType.U1)]
76
        public byte[] VolumeSecurityDescriptor;
77
    }
78
}

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

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

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

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