Dokan

user mode file system for windows    >>Japanese version

Next version of Dokan library

November 27th, 2008 in Dokan

I’m now preparing to launch the next version of Dokan library.

There are a lot of improvements from the previous version. I changed many parts of the driver especially communication between the driver and the user mode library. This makes Dokan much stable and removes some deadlocks. I also add some new features. If you are interested in the detail, please check the subversion repository.
Please be careful if you use the above files. They may crash your computer.

I’m planing to change the API to fix Explorer file deletion problem.
API changing requires to re-compile all other application that depends on Dokan library, such as Dokan.NET and Dokan Ruby binding. I need more tests because I changed a lot.

All the libraries will be launched in a week.
Thank you for many comments and bug reports.

2008/12/09 Update:
The next version of Dokan is almost done. I updated the repository. From this version, the license of Dokan driver is changed to LGPL from GPL. Dokan API is changed. DOKAN_FILE_INFO structure, DOKAN_OPTIONS structure, DeleteFile, DeleteDirectory and Cleanup are changed. Please re-check dokan.h file. I’m still investigating the existing issues and I hope to launch the new version in a few days.

13 Responses to “Next version of Dokan library”

  • MiaoYang
    November 28th, 2008 at 9:21 am

    Thank you!

  • kiki91
    December 1st, 2008 at 3:45 am

    How to use dokan.dll with Perl in Win32 ?

  • Michael
    December 2nd, 2008 at 6:41 pm

    cool!

  • Wolfram
    December 6th, 2008 at 2:28 am

    Hi Hiroki

    I hope that I didn’t spam

    I have compiled and tested your new version but the issue #36 is always existing under Windows XP Prof. SP3. :-(
    I have also tested the new version under Vista and there isn’t it a problem. So Dokan under Vista seems to be ok.
    :-)))) (but I have to do some stress tests … so we will see)
    I have debugged the version 0.3.9 of dokan.sys and i only can give you a hint that your filesystem think that the newly created file is a directory and so it throws the error INVALID_PARAMETER. This status will be set in line 77 of the write.c source. (May be its a stack problem) So now I know why I can see the write request in FILEMON but it didn’t come up to the dokan.dll. I hope that I give you some hints for your new release. May be it works better.
    Now I will setup my debugger to get more hints where the problem is.

    Thanks a lot for your great work :-)

    Best regards

    Wolfram

  • Paul
    December 7th, 2008 at 4:55 pm

    that’s what I have been looking for! Thank you.

  • DaveLoyall
    December 8th, 2008 at 8:19 pm

    Great work, Hiroki! Please consider dual licensing in a way that would maximize the number of people who will be able to use this.

  • Hiroki
    December 8th, 2008 at 9:23 pm

    Hi, DaveLoyall
    I will change the license of Dokan driver to LGPL from GPL.
    This is because now license of Dokan is bit complicated, driver is GPL, dokan.dll is GPL and others MIT, and I have many questions to ask whether driver can be used in commercial product.
    Do you think this license is not enough?

  • Hiroki
    December 9th, 2008 at 1:43 am

    Hello, Wolfram
    Thank you for your information. I think I could fix the problem on the latest version.

  • Wolfram
    December 9th, 2008 at 4:11 pm

    Thanks a lot for your reply :-)

  • Alexis
    December 9th, 2008 at 7:00 pm

    Hello Hiroki.

    We are currentely playing with dokan on a disk mirror like file system (really similar to mirror example you wrote).

    During our tests we discovered performance issue when we read files. Using notedpad several second is necessary to open a text file of ~300 bytes.

    I added some timestamps to the logs and took some traces. No I’m suspecting some issues in the driver.

    I added some timestamp (with GetTickCount) in the .dll logs.

    Did you planned to fix such issue in the next delivery ?

    A lot of tanks for you help.

    I joined bellow logs I obtained:

    >>>>>>>>>>>>>>>>>>
    16594942:###Create 0530 \totoche.txt
    16594942: CreateDisposition 1
    16594942:End of Create
    16594942:###GetFileInfo 0530
    16594942:###Cleanup 0530
    16594942:###Close 0530
    16594942:###Create 0531 \totoche.txt
    16594942: CreateDisposition 1
    16594942:End of Create
    16594942:###GetFileInfo 0531
    16594942:###GetFileInfo 0531
    16594952:###GetFileInfo 0531
    16594952:###Read 0531
    16594952:###Read file=\totoche.txt
    16594952:###Read end of callback
    16594952:###Read => Send IOCTL
    16594952:###Read => End of IOCTL
    16594952:###Cleanup 0531
    16594952:###Close 0531
    16595322:###Create 0532 \
    16595322: CreateDisposition 1
    16595322:End of Create
    16595322:###GetFileInfo 0532
    16595322:###Cleanup 0532
    16595332:###Close 0532
    16595342:###Create 0533 \
    16595342: CreateDisposition 1
    16595342:End of Create
    16595342:###GetFileInfo 0533
    16595342:###Cleanup 0533
    16595352:###Close 0533
    16595362:###Create 0534 \totoche.txt
    16595362: CreateDisposition 1
    16595362:End of Create
    16595362:###GetFileInfo 0534
    16595362:###Cleanup 0534
    16595362:###Close 0534
    16595362:###Create 0535 \totoche.txt
    16595362: CreateDisposition 1
    16595362:End of Create
    16595362:###GetFileInfo 0535
    16595362:###Cleanup 0535
    16595382:###Close 0535
    16595382:###Create 0536 \
    16595382:End of Create
    16595382:###FindFiles 0536
    16595412:index from 0
    16595412:FileMatch? : alexis (totoche.txt,0,0)
    16595412:FileMatch? : cygwin (totoche.txt,0,0)
    16595412:FileMatch? : Database (totoche.txt,0,0)
    16595412:FileMatch? : DirectShow (totoche.txt,0,0)
    16595412:FileMatch? : DRIVERS (totoche.txt,0,0)
    16595412:FileMatch? : e0dfc7da7f2dc09702 (totoche.txt,0,0)
    16595412:FileMatch? : INSTALL (totoche.txt,0,0)
    16595412:FileMatch? : Local_installation_source (totoche.txt,0,0)
    16595412:FileMatch? : Logs (totoche.txt,0,0)
    16595412:FileMatch? : MSDERelA (totoche.txt,0,0)
    16595412:FileMatch? : MSOCache (totoche.txt,0,0)
    16595412:FileMatch? : mvfslogs (totoche.txt,0,0)
    16595412:FileMatch? : My Installations (totoche.txt,0,0)
    16595412:FileMatch? : PATCHES (totoche.txt,0,0)
    16595412:FileMatch? : phpdev (totoche.txt,0,0)
    16595412:FileMatch? : Program Files (totoche.txt,0,0)
    16595412:FileMatch? : Recycled (totoche.txt,0,0)
    16595412:FileMatch? : RECYCLER (totoche.txt,0,0)
    16595412:FileMatch? : Rhapsody (totoche.txt,0,0)
    16595412:FileMatch? : swsetup (totoche.txt,0,0)
    16595412:FileMatch? : System Volume Information (totoche.txt,0,0)
    16595412:FileMatch? : TEMP (totoche.txt,0,0)
    16595412:FileMatch? : wamp (totoche.txt,0,0)
    16595412:FileMatch? : WINDOWS (totoche.txt,0,0)
    16595412:FileMatch? : WINNT (totoche.txt,0,0)
    16595412:FileMatch? : AUTOEXEC.BAT (totoche.txt,0,0)
    16595412:FileMatch? : boot.ini (totoche.txt,0,0)
    16595412:FileMatch? : BOOTSECT.DOS (totoche.txt,0,0)
    16595412:FileMatch? : CONFIG.SYS (totoche.txt,0,0)
    16595412:FileMatch? : devicetable.log (totoche.txt,0,0)
    16595412:FileMatch? : FRVELN0C25570-secu.txt (totoche.txt,0,0)
    16595412:FileMatch? : hiberfil.sys (totoche.txt,0,0)
    16595412:FileMatch? : IO.SYS (totoche.txt,0,0)
    16595412:FileMatch? : MSDOS.SYS (totoche.txt,0,0)
    16595412:FileMatch? : my.cnf (totoche.txt,0,0)
    16595422:FileMatch? : NTDETECT.COM (totoche.txt,0,0)
    16595422:FileMatch? : ntldr (totoche.txt,0,0)
    16595422:FileMatch? : pagefile.sys (totoche.txt,0,0)
    16595422:FileMatch? : ptdebug.txt (totoche.txt,0,0)
    16595422:FileMatch? : Rescued document.txt (totoche.txt,0,0)
    16595422:FileMatch? : totoche.txt (totoche.txt,0,0)
    16595422: =>return single entry
    16595422:index to 1
    16595422:###Cleanup 0536
    16595422:###Close 0536
    16595422:###Create 0537 \
    16595422:End of Create
    16595432:###QueryVolumeInfo 0537
    16595432:###Cleanup 0537
    16595432:###Close 0537
    16595432:###Create 0538 \totoche.txt
    16595432: CreateDisposition 1
    16595432:End of Create
    16595432:###QueryVolumeInfo 0538
    16595432:###GetFileInfo 0538
    16595432:###Cleanup 0538
    16595432:###Create 0539 \
    16595432:End of Create
    16595442:###Close 0538
    16595543:###Create 0540 \
    16595543:End of Create
    16595543:###FindFiles 0540
    16595553:index from 0
    16595553:FileMatch? : alexis (totoche.txt,0,0)
    16595553:FileMatch? : cygwin (totoche.txt,0,0)
    16595553:FileMatch? : Database (totoche.txt,0,0)
    16595553:FileMatch? : DirectShow (totoche.txt,0,0)
    16595553:FileMatch? : DRIVERS (totoche.txt,0,0)
    16595553:FileMatch? : e0dfc7da7f2dc09702 (totoche.txt,0,0)
    16595553:FileMatch? : INSTALL (totoche.txt,0,0)
    16595553:FileMatch? : Local_installation_source (totoche.txt,0,0)
    16595553:FileMatch? : Logs (totoche.txt,0,0)
    16595553:FileMatch? : MSDERelA (totoche.txt,0,0)
    16595553:FileMatch? : MSOCache (totoche.txt,0,0)
    16595553:FileMatch? : mvfslogs (totoche.txt,0,0)
    16595553:FileMatch? : My Installations (totoche.txt,0,0)
    16595553:FileMatch? : PATCHES (totoche.txt,0,0)
    16595553:FileMatch? : phpdev (totoche.txt,0,0)
    16595553:FileMatch? : Program Files (totoche.txt,0,0)
    16595553:FileMatch? : Recycled (totoche.txt,0,0)
    16595553:FileMatch? : RECYCLER (totoche.txt,0,0)
    16595553:FileMatch? : Rhapsody (totoche.txt,0,0)
    16595553:FileMatch? : swsetup (totoche.txt,0,0)
    16595553:FileMatch? : System Volume Information (totoche.txt,0,0)
    16595553:FileMatch? : TEMP (totoche.txt,0,0)
    16595553:FileMatch? : wamp (totoche.txt,0,0)
    16595553:FileMatch? : WINDOWS (totoche.txt,0,0)
    16595553:FileMatch? : WINNT (totoche.txt,0,0)
    16595553:FileMatch? : AUTOEXEC.BAT (totoche.txt,0,0)
    16595553:FileMatch? : boot.ini (totoche.txt,0,0)
    16595553:FileMatch? : BOOTSECT.DOS (totoche.txt,0,0)
    16595553:FileMatch? : CONFIG.SYS (totoche.txt,0,0)
    16595553:FileMatch? : devicetable.log (totoche.txt,0,0)
    16595553:FileMatch? : FRVELN0C25570-secu.txt (totoche.txt,0,0)
    16595553:FileMatch? : hiberfil.sys (totoche.txt,0,0)
    16595553:FileMatch? : IO.SYS (totoche.txt,0,0)
    16595553:FileMatch? : MSDOS.SYS (totoche.txt,0,0)
    16595553:FileMatch? : my.cnf (totoche.txt,0,0)
    16595553:FileMatch? : NTDETECT.COM (totoche.txt,0,0)
    16595553:FileMatch? : ntldr (totoche.txt,0,0)
    16595553:FileMatch? : pagefile.sys (totoche.txt,0,0)
    16595553:FileMatch? : ptdebug.txt (totoche.txt,0,0)
    16595553:FileMatch? : Rescued document.txt (totoche.txt,0,0)
    16595553:FileMatch? : totoche.txt (totoche.txt,0,0)
    16595553: =>return single entry
    16595553:index to 1
    16595563:###Cleanup 0540
    16595563:###Close 0540
    16595563:###Create 0541 \totoche.txt
    16595563: CreateDisposition 1
    16595563:End of Create
    16595563:###QueryVolumeInfo 0541
    16595563:###GetFileInfo 0541
    16595563:###GetFileInfo 0541
    16595563:###Cleanup 0541
    16595563:###Read 0541
    16595563:###Read file=\totoche.txt
    16595563:###Read end of callback
    16595563:###Read => Send IOCTL
    16595563:###Read => End of IOCTL
    16595563:###QueryVolumeInfo 9999
    16595563:###Create 0542 \totoche.txt
    16595563: CreateDisposition 1
    16595563:End of Create
    16595563:###GetFileInfo 0542

    =======================================================
    16595563:###Cleanup 0542
    16610564:###Close 0542
    =======================================================

    16610805:###Create 0543 \
    16610805:End of Create
    16610825:###FindFiles 0543
    16610845:index from 0
    1

  • Wolfram
    December 9th, 2008 at 10:47 pm

    Hi Hiroki

    I have found a solution (after 3h of debugging) for issue #36.

    In create.c line 533 upto 536 (DokanCompleteCreate) I changed :

    if (irpSp->Parameters.Create.Options & FILE_DIRECTORY_FILE || EventInfo->Create.Flags & DOKAN_FILE_DIRECTORY) { fcb->Flags |= DOKAN_FILE_DIRECTORY; }

    to

    if (((irpSp->Parameters.Create.Options & FILE_DIRECTORY_FILE) || (EventInfo->Create.Flags & DOKAN_FILE_DIRECTORY)) && (info == FILE_CREATED))
    {
    fcb->Flags |= DOKAN_FILE_DIRECTORY;
    }

    This will work for me :-)

    I have seen your changes in the newest version that you prefer (which also gives a solution for issue #36 :-) )

    if (NT_SUCCESS(status) &&
    (irpSp->Parameters.Create.Options & FILE_DIRECTORY_FILE || EventInfo->Create.Flags & DOKAN_FILE_DIRECTORY))
    {
    fcb->Flags |= DOKAN_FILE_DIRECTORY;
    }

    Can you give me some comments about which one is the better solution. NT_SUCCESS(status) or (info == FILE_CREATED) ?
    May be both ? I’m only a beginner in FS so I was happy to find a solution for issue #36. :-)))))

    I have also made some small changes in Mirror.exe and dokan.dll because if you try to rename a directory with a existing name you didn’t get the correct errorcode
    You will throw STATUS_NOT_IMPLEMENTED instead of STATUS_OBJECT_NAME_COLLISION. But this is not a great work for you. (Changes in setfile.c and MirrorMoveFile)
    If you want this changes leave a reply.

    So thanks a lot for your great work - I hope now it will work completely ;-)

    Best regards

    Wolfram

    Thanks a lot for your replies and

  • Hiroki
    December 10th, 2008 at 12:56 am

    Hi, Wolfram
    DOKAN_FILE_DIRECTORY should be set whenever Windows is trying to open a directory not only for creating a directory, so I think my change is better solution.

    > I have also made some small changes in Mirror.exe and dokan.dll
    > because if you try to rename a directory with a existing name you
    > didn’t get the correct errorcode
    > You will throw STATUS_NOT_IMPLEMENTED instead of
    > STATUS_OBJECT_NAME_COLLISION. But this is not a great work for you. >(Changes in setfile.c and MirrorMoveFile)
    I already changed MirrorMoveFile. Did you see it?
    I agree with you, could you tell me how did you change?

    Thanks,
    Hiroki Asakawa

  • Wolfram
    December 10th, 2008 at 4:33 pm

    Hi Hiroki

    Thanks for your reply - I agree with your changes. I have changed it to your code.

    I have looked to your mirror.c file about the changes of MirrorMoveFile. You have made the same changes. So I agree with you :-)

    I also looked at your new setfile.c … it looks complety different since my last download. So first I will tell you your orginal code lines



    case FileValidDataLengthInformation:
    status = DokanSetValidDataLengthInformation(EventContext, &fileInfo, DokanOperations);
    break;
    }

    openInfo->UserContext = fileInfo.Context;

    eventInfo->BufferLength = 0;

    if (status Status = STATUS_NOT_IMPLEMENTED;

    switch (error) {
    case ERROR_DIR_NOT_EMPTY:
    eventInfo->Status = STATUS_DIRECTORY_NOT_EMPTY;
    break;

    ### And this is what i added in the switch statement ###

    case ERROR_ALREADY_EXISTS:
    eventInfo->Status = STATUS_OBJECT_NAME_COLLISION;
    eventInfo->Create.Information = FILE_EXISTS;
    break;

    I hope this would be correct (I’m not sure because many dispatch function will come to the same switch statement - not only the DokanSetRenameInformation).
    But if your new changes will also work I think I have to download your new changes. I’m hungry to your next Release ;-)

    Thanks a lot for your reply … Now I will download and compile your changes that we have the same base.

    Best regards
    Wolfram

Leave a Reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image