Skip to content

Commit

Permalink
Update Dokan version to 2.2.0.1000
Browse files Browse the repository at this point in the history
  • Loading branch information
landrix committed Aug 20, 2024
1 parent df2f36d commit 919e613
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
24 changes: 19 additions & 5 deletions Dokan.pas
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(*
Dokan API wrapper for Delphi based on Release 2.0.6.1000
https://github.com/dokan-dev/dokany/releases/tag/v2.0.6.1000
Dokan API wrapper for Delphi based on Release 2.2.0.1000
https://github.com/dokan-dev/dokany/releases/tag/v2.2.0.1000
Copyright (C) 2019 - 2024 Sven Harazim
Dokan : user-mode file system library for Windows
Expand Down Expand Up @@ -44,7 +44,7 @@ interface
DokanLibrary = 'dokan2.dll';

//The current Dokan version (200 means ver 2.0.0).
DOKAN_VERSION = 206;
DOKAN_VERSION = 220;
//Minimum Dokan version (ver 2.0.0) accepted
DOKAN_MINIMUM_COMPATIBLE_VERSION = 200;

Expand All @@ -68,12 +68,15 @@ interface
//Use mount manager
DOKAN_OPTION_MOUNT_MANAGER = 64;
//Mount the drive on current session only
//Note: As Windows process only have on sessionID which is here used to define what is the current session,
//impersonation will not work if someone attend to mount for a user from another one (like system service).
//See issue #1196
DOKAN_OPTION_CURRENT_SESSION = 128;
//Enable Lockfile/Unlockfile operations. Otherwise Dokan will take care of it
DOKAN_OPTION_FILELOCK_USER_MODE = 256;
//Enable Case sensitive path.
//By default all path are case insensitive.
//For case sensitive: \dir\File & \diR\file are different files
//For case sensitive: \dir\File & \diR\\file are different files
//but for case insensitive they are the same.
DOKAN_OPTION_CASE_SENSITIVE = 512;
//Allows unmounting of network drive via explorer */
Expand All @@ -88,14 +91,15 @@ interface

type
DOKAN_HANDLE = THandle;
HANDLE = THandle;

//Dokan mount options used to describe Dokan device behavior.
_DOKAN_OPTIONS = record
Version: USHORT; //Version of the Dokan features requested without dots (version "123" is equal to Dokan version 1.2.3).
SingleThread: ByteBool; //Only use a single thread to process events. This is highly not recommended as can easily create a bottleneck.
Options: ULONG; //Features enabled for the mount. See \ref DOKAN_OPTION.
GlobalContext: ULONG64; //FileSystem can store anything here.
MountPoint: LPCWSTR; //Mount point. It can be a driver letter like "M:\" or a folder path "C:\mount\dokan" on a NTFS partition.
MountPoint: LPCWSTR; //Mount point. It can be a driver letter like "M:\" or an existing empty folder path "C:\mount\dokan" on a NTFS partition. */
UNCName: LPCWSTR; //UNC Name for the Network Redirector
Timeout: ULONG; //Max timeout in milliseconds of each request before Dokan gives up to wait events to complete. The default timeout value is 15 seconds.
AllocationUnitSize: ULONG;//Allocation Unit Size of the volume. This will affect the file size.
Expand Down Expand Up @@ -410,6 +414,8 @@ _DOKAN_MOUNT_POINT_INFO = record
DokanCreateFileSystem: function (DokanOptions : PDOKAN_OPTIONS; DokanOperations : PDOKAN_OPERATIONS; var DokanInstance : DOKAN_HANDLE) : Integer; stdcall = nil;
DokanIsFileSystemRunning: function (DokanInstance : DOKAN_HANDLE) : BOOL; stdcall = nil;
DokanWaitForFileSystemClosed: function (DokanInstance : DOKAN_HANDLE; dwMilliseconds : DWORD) : DWORD; stdcall = nil;
DokanRegisterWaitForFileSystemClosed: function (DokanInstance : DOKAN_HANDLE; var WaitHandle : PHANDLE; Callback : TWaitOrTimerCallback; Context : PVOID; dwMilliseconds : DWORD): BOOL; stdcall = nil;
DokanUnregisterWaitForFileSystemClosed: function (WaitHandle : HANDLE; WaitForCallbacks : BOOL): BOOL; stdcall = nil;
DokanCloseHandle: procedure (DokanInstance : DOKAN_HANDLE); stdcall = nil;
DokanUnmount: function (DriveLetter: WCHAR): BOOL; stdcall = nil;
DokanRemoveMountPoint: function (MountPoint: LPCWSTR): BOOL; stdcall = nil;
Expand Down Expand Up @@ -442,6 +448,8 @@ function DokanMain(Options: PDOKAN_OPTIONS; Operations: PDOKAN_OPERATIONS): Inte
function DokanCreateFileSystem(DokanOptions : PDOKAN_OPTIONS; DokanOperations : PDOKAN_OPERATIONS; var DokanInstance : DOKAN_HANDLE) : Integer; stdcall;
function DokanIsFileSystemRunning(DokanInstance : DOKAN_HANDLE) : BOOL; stdcall;
function DokanWaitForFileSystemClosed(DokanInstance : DOKAN_HANDLE; dwMilliseconds : DWORD) : DWORD; stdcall;
function DokanRegisterWaitForFileSystemClosed(DokanInstance : DOKAN_HANDLE; var WaitHandle : PHANDLE; Callback : TWaitOrTimerCallback; Context : PVOID; dwMilliseconds : DWORD): BOOL; stdcall;
function DokanUnregisterWaitForFileSystemClosed(WaitHandle : HANDLE; WaitForCallbacks : BOOL): BOOL; stdcall;
procedure DokanCloseHandle(DokanInstance : DOKAN_HANDLE); stdcall;
function DokanUnmount(DriveLetter: WCHAR): BOOL; stdcall;
function DokanRemoveMountPoint(MountPoint: LPCWSTR): BOOL; stdcall;
Expand Down Expand Up @@ -496,6 +504,8 @@ function DokanLoad(const LibFileName: string = DokanLibrary): Boolean;
DokanCreateFileSystem := GetProc('DokanCreateFileSystem');
DokanIsFileSystemRunning := GetProc('DokanIsFileSystemRunning');
DokanWaitForFileSystemClosed := GetProc('DokanWaitForFileSystemClosed');
DokanRegisterWaitForFileSystemClosed := GetProc('DokanRegisterWaitForFileSystemClosed');
DokanUnregisterWaitForFileSystemClosed := GetProc('DokanUnregisterWaitForFileSystemClosed');
DokanCloseHandle := GetProc('DokanCloseHandle');
DokanUnmount := GetProc('DokanUnmount');
DokanRemoveMountPoint := GetProc('DokanRemoveMountPoint');
Expand Down Expand Up @@ -530,6 +540,8 @@ procedure DokanFree();
DokanCreateFileSystem := nil;
DokanIsFileSystemRunning := nil;
DokanWaitForFileSystemClosed := nil;
DokanRegisterWaitForFileSystemClosed := nil;
DokanUnregisterWaitForFileSystemClosed := nil;
DokanCloseHandle := nil;
DokanUnmount := nil;
DokanRemoveMountPoint := nil;
Expand Down Expand Up @@ -561,6 +573,8 @@ function DokanMain; external DokanLibrary;
function DokanCreateFileSystem; external DokanLibrary;
function DokanIsFileSystemRunning; external DokanLibrary;
function DokanWaitForFileSystemClosed; external DokanLibrary;
function DokanRegisterWaitForFileSystemClosed; external DokanLibrary;
function DokanUnregisterWaitForFileSystemClosed; external DokanLibrary;
procedure DokanCloseHandle; external DokanLibrary;
function DokanUnmount; external DokanLibrary;
function DokanRemoveMountPoint; external DokanLibrary;
Expand Down
4 changes: 2 additions & 2 deletions DokanWin.pas
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(*
Dokan API wrapper for Delphi based on Release 2.0.6.1000
https://github.com/dokan-dev/dokany/releases/tag/v2.0.6.1000
Dokan API wrapper for Delphi based on Release 2.2.0.1000
https://github.com/dokan-dev/dokany/releases/tag/v2.2.0.1000
Copyright (C) 2019 - 2024 Sven Harazim
Dokan : user-mode file system library for Windows
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ Delphi/FreePascal and Dokan library
## Supported Dokan Version
https://github.com/dokan-dev/dokany

2.0.6.1000
2.2.0.1000

https://github.com/dokan-dev/dokany/releases/tag/v2.0.6.1000
https://github.com/dokan-dev/dokany/releases/tag/v2.2.0.1000
4 changes: 2 additions & 2 deletions Samples/Mirror/Mirror.dpr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(*
Dokan API wrapper for Delphi based on Release 2.0.6.1000
https://github.com/dokan-dev/dokany/releases/tag/v2.0.6.1000
Dokan API wrapper for Delphi based on Release 2.2.0.1000
https://github.com/dokan-dev/dokany/releases/tag/v2.2.0.1000
Copyright (C) 2019 - 2024 Sven Harazim
Dokan : user-mode file system library for Windows
Expand Down
3 changes: 2 additions & 1 deletion Samples/Mirror/Mirror.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>20.1</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<Platform Condition="'$(Platform)'==''">Win64</Platform>
<ProjectName Condition="'$(ProjectName)'==''">Mirror</ProjectName>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
Expand Down
Binary file modified Samples/Mirror/Mirror.res
Binary file not shown.

0 comments on commit 919e613

Please sign in to comment.