ProjectArcade
78 строк · 2.8 Кб
1using System.Runtime.InteropServices;2
3namespace DokanNet.Native4{
5/// <summary>6/// Dokan mount options used to describe dokan device behaviour7/// </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)]11public sealed class DOKAN_OPTIONS12{13/// <summary>14/// Version of the dokan features requested (version "123" is equal to Dokan version 1.2.3).15/// </summary>16public 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)]22public bool SingleThread;23
24/// <summary>25/// Features enable for the mount. See <see cref="DokanOptions"/>.26/// </summary>27[MarshalAs(UnmanagedType.U4)]28public DokanOptions Options;29
30/// <summary>31/// FileSystem can store anything here.32/// </summary>33public 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)]40public string MountPoint;41
42/// <summary>43/// UNC name used for network volume.44/// </summary>45[MarshalAs(UnmanagedType.LPWStr)]46public string UNCName;47
48/// <summary>49/// Max timeout in milliseconds of each request before Dokan give up.50/// </summary>51private uint Timeout;52public System.TimeSpan TimeOut53{54get { return System.TimeSpan.FromMilliseconds(Timeout); }55set { Timeout = (uint)value.TotalMilliseconds; }56}57
58/// <summary>59/// Allocation Unit Size of the volume. This will behave on the file size.60/// </summary>61public uint AllocationUnitSize;62
63/// <summary>64/// Sector Size of the volume. This will behave on the file size.65/// </summary>66public uint SectorSize;67/// <summary>68/// Length of the optional VolumeSecurityDescriptor provided. Set 0 will disable the option.69/// <summary>70public 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)]76public byte[] VolumeSecurityDescriptor;77}78}