PDOKAN_OPERATIONS Struct Reference

Dokan API callbacks interface. More...

#include <dokan.h>

Data Fields

NTSTATUS(* ZwCreateFile )(LPCWSTR FileName, PDOKAN_IO_SECURITY_CONTEXT SecurityContext, ACCESS_MASK DesiredAccess, ULONG FileAttributes, ULONG ShareAccess, ULONG CreateDisposition, ULONG CreateOptions, PDOKAN_FILE_INFO DokanFileInfo)
 CreateFile Dokan API callback. More...
 
void(* Cleanup )(LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)
 Cleanup Dokan API callback. More...
 
void(* CloseFile )(LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)
 CloseFile Dokan API callback. More...
 
NTSTATUS(* ReadFile )(LPCWSTR FileName, LPVOID Buffer, DWORD BufferLength, LPDWORD ReadLength, LONGLONG Offset, PDOKAN_FILE_INFO DokanFileInfo)
 ReadFile Dokan API callback. More...
 
NTSTATUS(* WriteFile )(LPCWSTR FileName, LPCVOID Buffer, DWORD NumberOfBytesToWrite, LPDWORD NumberOfBytesWritten, LONGLONG Offset, PDOKAN_FILE_INFO DokanFileInfo)
 WriteFile Dokan API callback. More...
 
NTSTATUS(* FlushFileBuffers )(LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)
 FlushFileBuffers Dokan API callback. More...
 
NTSTATUS(* GetFileInformation )(LPCWSTR FileName, LPBY_HANDLE_FILE_INFORMATION Buffer, PDOKAN_FILE_INFO DokanFileInfo)
 GetFileInformation Dokan API callback. More...
 
NTSTATUS(* FindFiles )(LPCWSTR FileName, PFillFindData FillFindData, PDOKAN_FILE_INFO DokanFileInfo)
 FindFiles Dokan API callback. More...
 
NTSTATUS(* FindFilesWithPattern )(LPCWSTR PathName, LPCWSTR SearchPattern, PFillFindData FillFindData, PDOKAN_FILE_INFO DokanFileInfo)
 FindFilesWithPattern Dokan API callback. More...
 
NTSTATUS(* SetFileAttributes )(LPCWSTR FileName, DWORD FileAttributes, PDOKAN_FILE_INFO DokanFileInfo)
 SetFileAttributes Dokan API callback. More...
 
NTSTATUS(* SetFileTime )(LPCWSTR FileName, CONST FILETIME *CreationTime, CONST FILETIME *LastAccessTime, CONST FILETIME *LastWriteTime, PDOKAN_FILE_INFO DokanFileInfo)
 SetFileTime Dokan API callback. More...
 
NTSTATUS(* DeleteFile )(LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)
 DeleteFile Dokan API callback. More...
 
NTSTATUS(* DeleteDirectory )(LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)
 DeleteDirectory Dokan API callback. More...
 
NTSTATUS(* MoveFile )(LPCWSTR FileName, LPCWSTR NewFileName, BOOL ReplaceIfExisting, PDOKAN_FILE_INFO DokanFileInfo)
 MoveFile Dokan API callback. More...
 
NTSTATUS(* SetEndOfFile )(LPCWSTR FileName, LONGLONG ByteOffset, PDOKAN_FILE_INFO DokanFileInfo)
 SetEndOfFile Dokan API callback. More...
 
NTSTATUS(* SetAllocationSize )(LPCWSTR FileName, LONGLONG AllocSize, PDOKAN_FILE_INFO DokanFileInfo)
 SetAllocationSize Dokan API callback. More...
 
NTSTATUS(* LockFile )(LPCWSTR FileName, LONGLONG ByteOffset, LONGLONG Length, PDOKAN_FILE_INFO DokanFileInfo)
 LockFile Dokan API callback. More...
 
NTSTATUS(* UnlockFile )(LPCWSTR FileName, LONGLONG ByteOffset, LONGLONG Length, PDOKAN_FILE_INFO DokanFileInfo)
 UnlockFile Dokan API callback. More...
 
NTSTATUS(* GetDiskFreeSpace )(PULONGLONG FreeBytesAvailable, PULONGLONG TotalNumberOfBytes, PULONGLONG TotalNumberOfFreeBytes, PDOKAN_FILE_INFO DokanFileInfo)
 GetDiskFreeSpace Dokan API callback. More...
 
NTSTATUS(* GetVolumeInformation )(LPWSTR VolumeNameBuffer, DWORD VolumeNameSize, LPDWORD VolumeSerialNumber, LPDWORD MaximumComponentLength, LPDWORD FileSystemFlags, LPWSTR FileSystemNameBuffer, DWORD FileSystemNameSize, PDOKAN_FILE_INFO DokanFileInfo)
 GetVolumeInformation Dokan API callback. More...
 
NTSTATUS(* Mounted )(LPCWSTR MountPoint, PDOKAN_FILE_INFO DokanFileInfo)
 Mounted Dokan API callback. More...
 
NTSTATUS(* Unmounted )(PDOKAN_FILE_INFO DokanFileInfo)
 Unmounted Dokan API callback. More...
 
NTSTATUS(* GetFileSecurity )(LPCWSTR FileName, PSECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG BufferLength, PULONG LengthNeeded, PDOKAN_FILE_INFO DokanFileInfo)
 GetFileSecurity Dokan API callback. More...
 
NTSTATUS(* SetFileSecurity )(LPCWSTR FileName, PSECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG BufferLength, PDOKAN_FILE_INFO DokanFileInfo)
 SetFileSecurity Dokan API callback. More...
 
NTSTATUS(* FindStreams )(LPCWSTR FileName, PFillFindStreamData FillFindStreamData, PVOID FindStreamContext, PDOKAN_FILE_INFO DokanFileInfo)
 FindStreams Dokan API callback. More...
 

Detailed Description

Dokan API callbacks interface.

DOKAN_OPERATIONS is a struct of callbacks that describe all Dokan API operations that will be called when Windows access to the filesystem.

If an error occurs, return NTSTATUS (https://support.microsoft.com/en-us/kb/113996). Win32 Error can be converted to NTSTATUS with DokanNtStatusFromWin32

All callbacks can be set to NULL or return STATUS_NOT_IMPLEMENTED if supporting one of them is not desired. Be aware that returning such values to important callbacks such as DOKAN_OPERATIONS.ZwCreateFile / DOKAN_OPERATIONS.ReadFile / ... would make the filesystem not work or become unstable.

Field Documentation

void( * PDOKAN_OPERATIONS::Cleanup) (LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)

Cleanup Dokan API callback.

Cleanup request before CloseFile is called.

When DOKAN_FILE_INFO.DeleteOnClose is TRUE, the file in Cleanup must be deleted. The function cannot fail therefore the filesystem need to ensure ahead that a the delete can safely happen during Cleanup. See DeleteFile documentation for explanation.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
DokanFileInfoInformation about the file or directory.
See also
DeleteFile
DeleteDirectory
void( * PDOKAN_OPERATIONS::CloseFile) (LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)

CloseFile Dokan API callback.

Clean remaining Context

CloseFile is called at the end of the life of the context. Anything remaining in DOKAN_FILE_INFO::Context must be cleared before returning.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
DokanFileInfoInformation about the file or directory.
NTSTATUS( * PDOKAN_OPERATIONS::DeleteDirectory) (LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)

DeleteDirectory Dokan API callback.

Check if it is possible to delete a directory.

DeleteDirectory will also be called with DOKAN_FILE_INFO.DeleteOnClose set to FALSE to notify the driver when the file is no longer requested to be deleted.

The Directory in DeleteDirectory should not be deleted, but instead must be checked as to whether or not it can be deleted, and STATUS_SUCCESS should be returned (when it can be deleted) or appropriate error codes, such as STATUS_ACCESS_DENIED, STATUS_OBJECT_PATH_NOT_FOUND, or STATUS_DIRECTORY_NOT_EMPTY, should be returned.

When STATUS_SUCCESS is returned, a Cleanup call is received afterwards with DOKAN_FILE_INFO.DeleteOnClose set to TRUE. Only then must the closing file be deleted.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result. DeleteFile Cleanup
NTSTATUS( * PDOKAN_OPERATIONS::DeleteFile) (LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)

DeleteFile Dokan API callback.

Check if it is possible to delete a file.

DeleteFile will also be called with DOKAN_FILE_INFO.DeleteOnClose set to FALSE to notify the driver when the file is no longer requested to be deleted.

The file in DeleteFile should not be deleted, but instead the file must be checked as to whether or not it can be deleted, and STATUS_SUCCESS should be returned (when it can be deleted) or appropriate error codes, such as STATUS_ACCESS_DENIED or STATUS_OBJECT_NAME_NOT_FOUND, should be returned.

When STATUS_SUCCESS is returned, a Cleanup call is received afterwards with DOKAN_FILE_INFO.DeleteOnClose set to TRUE. Only then must the closing file be deleted.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
DeleteDirectory
Cleanup
NTSTATUS( * PDOKAN_OPERATIONS::FindFiles) (LPCWSTR FileName, PFillFindData FillFindData, PDOKAN_FILE_INFO DokanFileInfo)

FindFiles Dokan API callback.

List all files in the requested path. DOKAN_OPERATIONS::FindFilesWithPattern is checked first. If it is not implemented or returns STATUS_NOT_IMPLEMENTED, then FindFiles is called, if assigned. It is recommended to have this implemented for performance reason.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
FillFindDataCallback that has to be called with PWIN32_FIND_DATAW that contain file information.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
FindFilesWithPattern
NTSTATUS( * PDOKAN_OPERATIONS::FindFilesWithPattern) (LPCWSTR PathName, LPCWSTR SearchPattern, PFillFindData FillFindData, PDOKAN_FILE_INFO DokanFileInfo)

FindFilesWithPattern Dokan API callback.

Same as DOKAN_OPERATIONS::FindFiles but with a search pattern.
The search pattern is a Windows MS-DOS-style expression. It can contain wild cards and extended characters or none of them. See DokanIsNameInExpression.

If the function is not implemented, DOKAN_OPERATIONS::FindFiles will be called instead and the result will be filtered internally by the library. It is recommended to have this implemented for performance reason.

Parameters
PathNamePath requested by the Kernel on the FileSystem.
SearchPatternSearch pattern.
FillFindDataCallback that has to be called with PWIN32_FIND_DATAW that contains file information.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
FindFiles
DokanIsNameInExpression
NTSTATUS( * PDOKAN_OPERATIONS::FindStreams) (LPCWSTR FileName, PFillFindStreamData FillFindStreamData, PVOID FindStreamContext, PDOKAN_FILE_INFO DokanFileInfo)

FindStreams Dokan API callback.

Retrieve all NTFS Streams informations on the file. This is only called if DOKAN_OPTION_ALT_STREAM is enabled.

Since
Supported since version 0.8.0. The version must be specified in DOKAN_OPTIONS::Version.
Parameters
FileNameFile path requested by the Kernel on the FileSystem.
FillFindStreamDataCallback that has to be called with PWIN32_FIND_STREAM_DATA that contain stream information.
FindStreamContextContext for the event to pass to the callback FillFindStreamData.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
NTSTATUS( * PDOKAN_OPERATIONS::FlushFileBuffers) (LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)

FlushFileBuffers Dokan API callback.

Clears buffers for this context and causes any buffered data to be written to the file.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
NTSTATUS( * PDOKAN_OPERATIONS::GetDiskFreeSpace) (PULONGLONG FreeBytesAvailable, PULONGLONG TotalNumberOfBytes, PULONGLONG TotalNumberOfFreeBytes, PDOKAN_FILE_INFO DokanFileInfo)

GetDiskFreeSpace Dokan API callback.

Retrieves information about the amount of space that is available on a disk volume. It consits of the total amount of space, the total amount of free space, and the total amount of free space available to the user that is associated with the calling thread.

Neither GetDiskFreeSpace nor GetVolumeInformation save the DOKAN_FILE_INFO.Context. Before these methods are called, ZwCreateFile may not be called. (ditto CloseFile and Cleanup)

Parameters
FreeBytesAvailableAmount of available space.
TotalNumberOfBytesTotal size of storage space
TotalNumberOfFreeBytesAmount of free space
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
GetDiskFreeSpaceEx function (MSDN)
GetVolumeInformation
NTSTATUS( * PDOKAN_OPERATIONS::GetFileInformation) (LPCWSTR FileName, LPBY_HANDLE_FILE_INFORMATION Buffer, PDOKAN_FILE_INFO DokanFileInfo)

GetFileInformation Dokan API callback.

Get specific information on a file.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
BufferBY_HANDLE_FILE_INFORMATION struct to fill.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
NTSTATUS( * PDOKAN_OPERATIONS::GetFileSecurity) (LPCWSTR FileName, PSECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG BufferLength, PULONG LengthNeeded, PDOKAN_FILE_INFO DokanFileInfo)

GetFileSecurity Dokan API callback.

Get specified information about the security of a file or directory.

Return STATUS_NOT_IMPLEMENTED to let dokan library build a sddl of the current process user with authenticate user rights for context menu. Return STATUS_BUFFER_OVERFLOW if buffer size is too small.

Since
Supported since version 0.6.0. The version must be specified in DOKAN_OPTIONS::Version.
Parameters
FileNameFile path requested by the Kernel on the FileSystem.
SecurityInformationA SECURITY_INFORMATION value that identifies the security information being requested.
SecurityDescriptorA pointer to a buffer that receives a copy of the security descriptor of the requested file.
BufferLengthSpecifies the size, in bytes, of the buffer.
LengthNeededA pointer to the variable that receives the number of bytes necessary to store the complete security descriptor.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
SetFileSecurity
GetFileSecurity function (MSDN)
NTSTATUS( * PDOKAN_OPERATIONS::GetVolumeInformation) (LPWSTR VolumeNameBuffer, DWORD VolumeNameSize, LPDWORD VolumeSerialNumber, LPDWORD MaximumComponentLength, LPDWORD FileSystemFlags, LPWSTR FileSystemNameBuffer, DWORD FileSystemNameSize, PDOKAN_FILE_INFO DokanFileInfo)

GetVolumeInformation Dokan API callback.

Retrieves information about the file system and volume associated with the specified root directory.

Neither GetVolumeInformation nor GetDiskFreeSpace save the DOKAN_FILE_INFO::Context. Before these methods are called, ZwCreateFile may not be called. (ditto CloseFile and Cleanup)

VolumeName length can be anything that fit in the provided buffer. But some Windows component expect it to be no longer than 32 characters that why it is recommended to set a value under this limit.

FileSystemName could be anything up to 10 characters. But Windows check few feature availability based on file system name. For this, it is recommended to set NTFS or FAT here.

FILE_READ_ONLY_VOLUME is automatically added to the FileSystemFlags if DOKAN_OPTION_WRITE_PROTECT was specified in DOKAN_OPTIONS when the volume was mounted.

Parameters
VolumeNameBufferA pointer to a buffer that receives the name of a specified volume.
VolumeNameSizeThe length of a volume name buffer.
VolumeSerialNumberA pointer to a variable that receives the volume serial number.
MaximumComponentLengthA pointer to a variable that receives the maximum length.
FileSystemFlagsA pointer to a variable that receives flags associated with the specified file system.
FileSystemNameBufferA pointer to a buffer that receives the name of the file system.
FileSystemNameSizeThe length of the file system name buffer.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
GetVolumeInformation function (MSDN)
GetDiskFreeSpace
NTSTATUS( * PDOKAN_OPERATIONS::LockFile) (LPCWSTR FileName, LONGLONG ByteOffset, LONGLONG Length, PDOKAN_FILE_INFO DokanFileInfo)

LockFile Dokan API callback.

Lock file at a specific offset and data length. This is only used if DOKAN_OPTION_FILELOCK_USER_MODE is enabled.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
ByteOffsetOffset from where the lock has to be continued.
LengthData length to lock.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
UnlockFile
NTSTATUS( * PDOKAN_OPERATIONS::Mounted) (LPCWSTR MountPoint, PDOKAN_FILE_INFO DokanFileInfo)

Mounted Dokan API callback.

Called when Dokan successfully mounts the volume.

If DOKAN_OPTION_MOUNT_MANAGER is enabled and the drive letter requested is busy, the MountPoint can contain a different drive letter that the mount manager assigned us.

Parameters
MountPointThe mount point assign to the instance.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result. The value is currently not used by the library.
See also
Unmounted
NTSTATUS( * PDOKAN_OPERATIONS::MoveFile) (LPCWSTR FileName, LPCWSTR NewFileName, BOOL ReplaceIfExisting, PDOKAN_FILE_INFO DokanFileInfo)

MoveFile Dokan API callback.

Move a file or directory to a new destination

Parameters
FileNamePath for the file to be moved.
NewFileNamePath for the new location of the file.
ReplaceIfExistingIf destination already exists, can it be replaced?
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
NTSTATUS( * PDOKAN_OPERATIONS::ReadFile) (LPCWSTR FileName, LPVOID Buffer, DWORD BufferLength, LPDWORD ReadLength, LONGLONG Offset, PDOKAN_FILE_INFO DokanFileInfo)

ReadFile Dokan API callback.

ReadFile callback on the file previously opened in DOKAN_OPERATIONS.ZwCreateFile. It can be called by different threads at the same time, so the read/context has to be thread safe.

When apps make use of memory mapped files, DOKAN_OPERATIONS.WriteFile or DOKAN_OPERATIONS.ReadFile functions may be invoked after DOKAN_OPERATIONS.Cleanup in order to complete the I/O operations. The file system application should also properly work in this case.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
BufferRead buffer that has to be filled with the read result.
BufferLengthBuffer length and read size to continue with.
ReadLengthTotal data size that has been read.
OffsetOffset from where the read has to be continued.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
WriteFile
NTSTATUS( * PDOKAN_OPERATIONS::SetAllocationSize) (LPCWSTR FileName, LONGLONG AllocSize, PDOKAN_FILE_INFO DokanFileInfo)

SetAllocationSize Dokan API callback.

SetAllocationSize is used to truncate or extend a file.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
AllocSizeFile length to set.
DokanFileInfoInformation about the file or directory.
See also
FileAllocationInformation (MSDN)
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
NTSTATUS( * PDOKAN_OPERATIONS::SetEndOfFile) (LPCWSTR FileName, LONGLONG ByteOffset, PDOKAN_FILE_INFO DokanFileInfo)

SetEndOfFile Dokan API callback.

SetEndOfFile is used to truncate or extend a file (physical file size).

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
ByteOffsetFile length to set.
DokanFileInfoInformation about the file or directory.
See also
FileEndOfFileInformation (MSDN)
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
NTSTATUS( * PDOKAN_OPERATIONS::SetFileAttributes) (LPCWSTR FileName, DWORD FileAttributes, PDOKAN_FILE_INFO DokanFileInfo)

SetFileAttributes Dokan API callback.

Set file attributes on a specific file

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
FileAttributesFileAttributes to set on file.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
NTSTATUS( * PDOKAN_OPERATIONS::SetFileSecurity) (LPCWSTR FileName, PSECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG BufferLength, PDOKAN_FILE_INFO DokanFileInfo)

SetFileSecurity Dokan API callback.

Sets the security of a file or directory object.

Since
Supported since version 0.6.0. The version must be specified in DOKAN_OPTIONS::Version.
Parameters
FileNameFile path requested by the Kernel on the FileSystem.
SecurityInformationStructure that identifies the contents of the security descriptor pointed by SecurityDescriptor param.
SecurityDescriptorA pointer to a SECURITY_DESCRIPTOR structure.
BufferLengthSpecifies the size, in bytes, of the buffer.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
GetFileSecurity
SetFileSecurity function (MSDN)
NTSTATUS( * PDOKAN_OPERATIONS::SetFileTime) (LPCWSTR FileName, CONST FILETIME *CreationTime, CONST FILETIME *LastAccessTime, CONST FILETIME *LastWriteTime, PDOKAN_FILE_INFO DokanFileInfo)

SetFileTime Dokan API callback.

Set file attributes on a specific file

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
CreationTimeCreation FILETIME.
LastAccessTimeLastAccess FILETIME.
LastWriteTimeLastWrite FILETIME.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
NTSTATUS( * PDOKAN_OPERATIONS::UnlockFile) (LPCWSTR FileName, LONGLONG ByteOffset, LONGLONG Length, PDOKAN_FILE_INFO DokanFileInfo)

UnlockFile Dokan API callback.

Unlock file at a specific offset and data length. This is only used if DOKAN_OPTION_FILELOCK_USER_MODE is enabled.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
ByteOffsetOffset from where the lock has to be continued.
LengthData length to lock.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
LockFile
NTSTATUS( * PDOKAN_OPERATIONS::Unmounted) (PDOKAN_FILE_INFO DokanFileInfo)

Unmounted Dokan API callback.

Called when Dokan is unmounting the volume.

Parameters
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result. The value is currently not used by the library.
See also
Mounted
NTSTATUS( * PDOKAN_OPERATIONS::WriteFile) (LPCWSTR FileName, LPCVOID Buffer, DWORD NumberOfBytesToWrite, LPDWORD NumberOfBytesWritten, LONGLONG Offset, PDOKAN_FILE_INFO DokanFileInfo)

WriteFile Dokan API callback.

WriteFile callback on the file previously opened in DOKAN_OPERATIONS.ZwCreateFile It can be called by different threads at the same time, sp the write/context has to be thread safe.

When apps make use of memory mapped files ( DOKAN_FILE_INFO.PagingIo ), DOKAN_OPERATIONS.WriteFile or DOKAN_OPERATIONS.ReadFile functions may be invoked after DOKAN_OPERATIONS.Cleanup in order to complete the I/O operations. The file system application should also properly work in this case. This type of request should follow Windows rules like not extending the current file size.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
BufferData that has to be written.
NumberOfBytesToWriteBuffer length and write size to continue with.
NumberOfBytesWrittenTotal number of bytes that have been written.
OffsetOffset from where the write has to be continued.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
ReadFile
NTSTATUS( * PDOKAN_OPERATIONS::ZwCreateFile) (LPCWSTR FileName, PDOKAN_IO_SECURITY_CONTEXT SecurityContext, ACCESS_MASK DesiredAccess, ULONG FileAttributes, ULONG ShareAccess, ULONG CreateDisposition, ULONG CreateOptions, PDOKAN_FILE_INFO DokanFileInfo)

CreateFile Dokan API callback.

CreateFile is called each time a request is made on a file system object.

In case OPEN_ALWAYS & CREATE_ALWAYS are successfully opening an existing file, STATUS_OBJECT_NAME_COLLISION should be returned instead of STATUS_SUCCESS . This will inform Dokan that the file has been opened and not created during the request.

If the file is a directory, CreateFile is also called. In this case, CreateFile should return STATUS_SUCCESS when that directory can be opened and DOKAN_FILE_INFO.IsDirectory has to be set to TRUE. On the other hand, if DOKAN_FILE_INFO.IsDirectory is set to TRUE but the path targets a file, STATUS_NOT_A_DIRECTORY must be returned.

DOKAN_FILE_INFO.Context can be used to store Data (like HANDLE) that can be retrieved in all other requests related to the Context. To avoid memory leak, Context needs to be released in DOKAN_OPERATIONS.Cleanup.

Parameters
FileNameFile path requested by the Kernel on the FileSystem.
SecurityContextSecurityContext, see https://msdn.microsoft.com/en-us/library/windows/hardware/ff550613(v=vs.85).aspx
DesiredAccessSpecifies an ACCESS_MASK value that determines the requested access to the object.
FileAttributesSpecifies one or more FILE_ATTRIBUTE_XXX flags, which represent the file attributes to set if a file is created or overwritten.
ShareAccessType of share access, which is specified as zero or any combination of FILE_SHARE_* flags.
CreateDispositionSpecifies the action to perform if the file does or does not exist.
CreateOptionsSpecifies the options to apply when the driver creates or opens the file.
DokanFileInfoInformation about the file or directory.
Returns
STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
See also
See ZwCreateFile for more information about the parameters of this callback (MSDN).
DokanMapKernelToUserCreateFileFlags

The documentation for this struct was generated from the following file: