|
1 | 1 | using System; |
| 2 | +using System.Drawing; |
2 | 3 | using DokanNet.Native; |
3 | 4 |
|
4 | | -namespace DokanNet |
| 5 | +namespace DokanNet; |
| 6 | + |
| 7 | +/// <summary> |
| 8 | +/// Dokan mount options used to describe dokan device behavior. |
| 9 | +/// </summary> |
| 10 | +/// \if PRIVATE |
| 11 | +/// <seealso cref="DOKAN_OPTIONS.Options"/> |
| 12 | +/// \endif |
| 13 | +[Flags] |
| 14 | +public enum DokanOptions : uint |
5 | 15 | { |
6 | | - /// <summary> |
7 | | - /// Dokan mount options used to describe dokan device behavior. |
8 | | - /// </summary> |
9 | | - /// \if PRIVATE |
10 | | - /// <seealso cref="DOKAN_OPTIONS.Options"/> |
11 | | - /// \endif |
12 | | - [Flags] |
13 | | - public enum DokanOptions : uint |
14 | | - { |
15 | | - /// <summary>Fixed Drive.</summary> |
16 | | - FixedDrive = 0, |
| 16 | + /// <summary>Fixed Drive.</summary> |
| 17 | + FixedDrive = 0, |
17 | 18 |
|
18 | | - /// <summary>Enable output debug message.</summary> |
19 | | - DebugMode = 1, |
| 19 | + /// <summary>Enable output debug message.</summary> |
| 20 | + DebugMode = 1, |
20 | 21 |
|
21 | | - /// <summary>Enable output debug message to stderr.</summary> |
22 | | - StderrOutput = 2, |
| 22 | + /// <summary>Enable output debug message to stderr.</summary> |
| 23 | + StderrOutput = (1 << 1), |
23 | 24 |
|
24 | | - /// <summary>Use alternate stream.</summary> |
25 | | - AltStream = 4, |
| 25 | + /// <summary>Enable the use of alternate stream paths in the form |
| 26 | + /// [file-name]:[stream-name]. If this is not specified then the driver will |
| 27 | + /// fail any attempt to access a path with a colon.</summary> |
| 28 | + AltStream = (1 << 2), |
26 | 29 |
|
27 | | - /// <summary>Enable mount drive as write-protected.</summary> |
28 | | - WriteProtection = 8, |
| 30 | + /// <summary>Enable mount drive as write-protected.</summary> |
| 31 | + WriteProtection = (1 << 3), |
29 | 32 |
|
30 | | - /// <summary>Use network drive - Dokan network provider need to be installed.</summary> |
31 | | - NetworkDrive = 16, |
| 33 | + /// <summary>Use network drive - Dokan network provider needs to be installed and a \ref DOKAN_OPTIONS.UNCName provided.</summary> |
| 34 | + NetworkDrive = (1 << 4), |
32 | 35 |
|
33 | | - /// <summary>Use removable drive.</summary> |
34 | | - RemovableDrive = 32, |
| 36 | + /// <summary>Use removable drive |
| 37 | + /// Be aware that on some environments, the userland application will be denied |
| 38 | + /// to communicate with the drive which will result in a unwanted unmount. |
| 39 | + /// <a href="https://github.com/dokan-dev/dokany/issues/843">Issue #843</a>.</summary> |
| 40 | + RemovableDrive = (1 << 5), |
35 | 41 |
|
36 | | - /// <summary>Use mount manager.</summary> |
37 | | - MountManager = 64, |
| 42 | + /// <summary>Use Windows Mount Manager. |
| 43 | + /// This option is highly recommended to use for better system integration |
| 44 | + /// If a drive letter is used but is busy, Mount manager will assign one for us and |
| 45 | + /// <see cref="IDokanOperations2.Mounted" /> parameters will contain the new mount point.</summary> |
| 46 | + MountManager = (1 << 6), |
38 | 47 |
|
39 | | - /// <summary>Mount the drive on current session only.</summary> |
40 | | - CurrentSession = 128, |
| 48 | + /// <summary>Mount the drive on current session only |
| 49 | + /// Note: As Windows process only have on sessionID which is here used to define what is the current session, |
| 50 | + /// impersonation will not work if someone attend to mount for a user from another one (like system service). |
| 51 | + /// <a href="https://github.com/dokan-dev/dokany/issues/1196">Issue #1196</a>.</summary> |
| 52 | + CurrentSession = (1 << 7), |
41 | 53 |
|
42 | | - /// <summary>Enable Lockfile/Unlockfile operations.</summary> |
43 | | - UserModeLock = 256, |
| 54 | + /// <summary>Enable Lockfile/Unlockfile operations. Otherwise Dokan will take care of it.</summary> |
| 55 | + UserModeLock = (1 << 8), |
44 | 56 |
|
45 | | - /// <summary> |
46 | | - /// Enable methods in <see cref="Dokan.Notify"/>, which require this library to maintain a special |
47 | | - /// handle while the file system is mounted. |
48 | | - /// Without this flag, the methods in that inner class always return false if invoked. |
49 | | - /// </summary> |
50 | | - EnableNotificationAPI = 512, |
| 57 | + /// <summary> |
| 58 | + /// Enable Case sensitive path. |
| 59 | + /// By default all path are case insensitive. |
| 60 | + /// For case sensitive: \\dir\\File and \\diR\\file are different files |
| 61 | + /// but for case insensitive they are the same. |
| 62 | + /// </summary> |
| 63 | + CaseSensitive = (1 << 9), |
51 | 64 |
|
52 | | - /// <summary> |
53 | | - /// Enable Case sensitive path. |
54 | | - /// By default all path are case insensitive. |
55 | | - /// For case sensitive: \\dir\\File and \\diR\\file are different files |
56 | | - /// but for case insensitive they are the same. |
57 | | - /// </summary> |
58 | | - CaseSensitive = 1024, |
| 65 | + /// <summary> |
| 66 | + /// Allows unmounting of network drive via explorer |
| 67 | + /// </summary> |
| 68 | + EnableNetworkUnmount = (1 << 10), |
59 | 69 |
|
60 | | - /// <summary> |
61 | | - /// Enables unmounting of network drives via file explorer |
62 | | - /// </summary> |
63 | | - EnableNetworkUnmount = 2048, |
| 70 | + /// <summary> |
| 71 | + /// Forward the kernel driver global and volume logs to the userland. |
| 72 | + /// Can be very slow if single thread is enabled. |
| 73 | + /// </summary> |
| 74 | + DispatchDriverLogs = (1 << 11), |
64 | 75 |
|
65 | | - /// <summary> |
66 | | - /// Forward the kernel driver global and volume logs to the userland |
67 | | - /// </summary> |
68 | | - DispatchDriverLogs = 4096, |
69 | | - } |
| 76 | + /// <summary> |
| 77 | + /// Pull batches of events from the driver instead of a single one and execute them parallelly. |
| 78 | + /// This option should only be used on computers with low cpu count |
| 79 | + /// and userland filesystem taking time to process requests (like remote storage). |
| 80 | + /// </summary> |
| 81 | + AllowIpcBatching = (1 << 12), |
70 | 82 | } |
0 commit comments