ProjectArcade
32 строки · 1.7 Кб
1using System;
2using System.IO;
3using System.Runtime.InteropServices;
4using DokanNet.Native;
5
6namespace DokanNet
7{
8public static class Extensions
9{
10/// <summary>
11/// Check if the FileSystem is still running or not.
12/// </summary>
13/// <param name="dokanInstance">The dokan mount context created by <see cref="CreateFileSystem"/>.</param>
14/// <returns>Whether the FileSystem is still running or not.</returns>
15public static Boolean IsFileSystemRunning(this DokanInstance dokanInstance)
16{
17return NativeMethods.DokanIsFileSystemRunning(dokanInstance.DokanHandle);
18}
19
20/// <summary>
21/// Wait until the FileSystem is unmount.
22/// </summary>
23/// <param name="dokanInstance">The dokan mount context created by <see cref="CreateFileSystem"/>.</param>
24/// <param name="milliSeconds">The time-out interval, in milliseconds. If a nonzero value is specified, the function waits until the object is signaled or the interval elapses. If <param name="milliSeconds"> is zero,
25/// the function does not enter a wait state if the object is not signaled; it always returns immediately. If <param name="milliSeconds"> is INFINITE, the function will return only when the object is signaled.</param>
26/// <returns>See <a href="https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject">WaitForSingleObject</a> for a description of return values.</returns>
27public static UInt32 WaitForFileSystemClosed(this DokanInstance dokanInstance, UInt32 milliSeconds)
28{
29return NativeMethods.DokanWaitForFileSystemClosed(dokanInstance.DokanHandle, milliSeconds);
30}
31}
32}
33