dokan.h File Reference
#include <windows.h>
#include <ntstatus.h>
#include "fileinfo.h"
#include "public.h"

Go to the source code of this file.

Data Structures

struct  PDOKAN_OPTIONS
 Dokan mount options used to describe Dokan device behavior. More...
 
struct  PDOKAN_FILE_INFO
 Dokan file information on the current operation. More...
 
struct  PDOKAN_OPERATIONS
 Dokan API callbacks interface. More...
 

Macros

#define WIN32_NO_STATUS
 
#define DOKANAPI   __declspec(dllimport) __stdcall
 
#define DOKAN_CALLBACK   __stdcall
 
#define DOKAN_VERSION   140
 
#define DOKAN_MINIMUM_COMPATIBLE_VERSION   110
 
#define DOKAN_DRIVER_NAME   L"dokan" DOKAN_MAJOR_API_VERSION L".sys"
 
#define DOKAN_NP_NAME   L"Dokan" DOKAN_MAJOR_API_VERSION
 
#define DOKAN_OPTION_DEBUG   1
 
#define DOKAN_OPTION_STDERR   2
 
#define DOKAN_OPTION_ALT_STREAM   4
 
#define DOKAN_OPTION_WRITE_PROTECT   8
 
#define DOKAN_OPTION_NETWORK   16
 
#define DOKAN_OPTION_REMOVABLE   32
 
#define DOKAN_OPTION_MOUNT_MANAGER   64
 
#define DOKAN_OPTION_CURRENT_SESSION   128
 
#define DOKAN_OPTION_FILELOCK_USER_MODE   256
 
#define DOKAN_OPTION_ENABLE_NOTIFICATION_API   512
 
#define DOKAN_OPTION_DISABLE_OPLOCKS   1024
 
#define DOKAN_OPTION_ENABLE_FCB_GARBAGE_COLLECTION   2048
 
#define DOKAN_SUCCESS   0
 
#define DOKAN_ERROR   -1
 
#define DOKAN_DRIVE_LETTER_ERROR   -2
 
#define DOKAN_DRIVER_INSTALL_ERROR   -3
 
#define DOKAN_START_ERROR   -4
 
#define DOKAN_MOUNT_ERROR   -5
 
#define DOKAN_MOUNT_POINT_ERROR   -6
 
#define DOKAN_VERSION_ERROR   -7
 

Typedefs

typedef int(WINAPI * PFillFindData) (PWIN32_FIND_DATAW, PDOKAN_FILE_INFO)
 FillFindData Used to add an entry in FindFiles operation. More...
 
typedef int(WINAPI * PFillFindStreamData) (PWIN32_FIND_STREAM_DATA, PDOKAN_FILE_INFO)
 FillFindStreamData Used to add an entry in FindStreams. More...
 

Functions

int DokanMain (PDOKAN_OPTIONS DokanOptions, PDOKAN_OPERATIONS DokanOperations)
 Mount a new Dokan Volume. More...
 
BOOL DokanUnmount (WCHAR DriveLetter)
 Unmount a Dokan device from a driver letter. More...
 
BOOL DokanRemoveMountPoint (LPCWSTR MountPoint)
 Unmount a Dokan device from a mount point. More...
 
BOOL DokanIsNameInExpression (LPCWSTR Expression, LPCWSTR Name, BOOL IgnoreCase)
 Checks whether Name matches Expression. More...
 
ULONG DokanVersion ()
 Get the version of Dokan. The returned ULONG is the version number without the dots. More...
 
ULONG DokanDriverVersion ()
 Get the version of the Dokan driver. The returned ULONG is the version number without the dots. More...
 
BOOL DokanResetTimeout (ULONG Timeout, PDOKAN_FILE_INFO DokanFileInfo)
 Extends the timeout of the current IO operation in driver. More...
 
HANDLE DokanOpenRequestorToken (PDOKAN_FILE_INFO DokanFileInfo)
 Get the handle to Access Token. More...
 
PDOKAN_CONTROL DokanGetMountPointList (BOOL uncOnly, PULONG nbRead)
 Get active Dokan mount points. More...
 
VOID DokanReleaseMountPointList (PDOKAN_CONTROL list)
 Release Mount point list resources from DokanGetMountPointList. More...
 
void DokanMapKernelToUserCreateFileFlags (ACCESS_MASK DesiredAccess, ULONG FileAttributes, ULONG CreateOptions, ULONG CreateDisposition, ACCESS_MASK *outDesiredAccess, DWORD *outFileAttributesAndFlags, DWORD *outCreationDisposition)
 Convert DOKAN_OPERATIONS::ZwCreateFile parameters to CreateFile parameters. More...
 
BOOL DokanNotifyCreate (LPCWSTR FilePath, BOOL IsDirectory)
 Notify dokan that a file or a directory has been created. More...
 
BOOL DokanNotifyDelete (LPCWSTR FilePath, BOOL IsDirectory)
 Notify dokan that a file or a directory has been deleted. More...
 
BOOL DokanNotifyUpdate (LPCWSTR FilePath)
 Notify dokan that file or directory attributes have changed. More...
 
BOOL DokanNotifyXAttrUpdate (LPCWSTR FilePath)
 Notify dokan that file or directory extended attributes have changed. More...
 
BOOL DokanNotifyRename (LPCWSTR OldPath, LPCWSTR NewPath, BOOL IsDirectory, BOOL IsInSameDirectory)
 Notify dokan that a file or a directory has been renamed. This method supports in-place rename for file/directory within the same parent. More...
 
NTSTATUS DokanNtStatusFromWin32 (DWORD Error)
 Convert WIN32 error to NTSTATUS. More...
 

Macro Definition Documentation

#define DOKAN_CALLBACK   __stdcall

Change calling convention to standard call

#define DOKANAPI   __declspec(dllimport) __stdcall

Import dokan API

#define WIN32_NO_STATUS

Do not include NTSTATUS. Fix duplicate preprocessor definitions

Typedef Documentation

typedef int(WINAPI * PFillFindData) (PWIN32_FIND_DATAW, PDOKAN_FILE_INFO)

FillFindData Used to add an entry in FindFiles operation.

Returns
1 if buffer is full, otherwise 0 (currently it never returns 1)
typedef int(WINAPI * PFillFindStreamData) (PWIN32_FIND_STREAM_DATA, PDOKAN_FILE_INFO)

FillFindStreamData Used to add an entry in FindStreams.

Returns
1 if buffer is full, otherwise 0 (currently it never returns 1)