dokan-dev / dokan-delphi

Dokan Delphi Wrapper
MIT License
60 stars 22 forks source link

Dokan 2.0.0 support #9

Closed Liryna closed 1 year ago

Liryna commented 2 years ago

Dokan 2.0.0 was just released 🥳 . There are a few changes in the API dokan.h and some logic described here that changed. It would be great if the wrapper could implement those changes! And of course, feel free to ping me if any questions or issues arise. Thanks in advance! 👍

landrix commented 1 year ago

Hi @Liryna , can you maybe give me a hint? I can't get any further with the migration to Dokan 2. I think I did everything right with the new header file. But when I start my mirror.exe, DokanMain returns with error.

Dokan immediately prints "Unmount"

and DokanMain returns with

DOKAN_MOUNT_ERROR: Writeln(ErrOutput, 'Can''t assign a drive letter');

When I go back to version 1.4 everything works. Even if I use version 2 of the supplied mirror.exe, everything works. I have no idea right now. Also the kernel debug log of dokan2.dll didn't help me.

Startparameters are /R d:\test /L k:\ /D /S /O

branch: https://github.com/dokan-dev/dokan-delphi/tree/dev_2.0.6.1000

Thanks, Sven

Liryna commented 1 year ago

Hi @landrix ,

Haven't found anything very obvious but:

DokanInit seems to be called correctly therefore it should not be that. There is really no logs at all printer by the library ?

darnocian commented 1 year ago

@landrix hi Sven... I'm happy to help investigate as well. I'll have a look at the branch dev_2.0.6.1000

darnocian commented 1 year ago

I spotted some differences on the entrypoints. I've raised https://github.com/dokan-dev/dokan-delphi/pull/10 But I'm still getting the same error as well... Can't assign a drive letter

landrix commented 1 year ago

I've found everything so far. A lot of pointer magic has changed in version 2. Thanks everyone, it's working for now. Now I have to check everything.

darnocian commented 1 year ago

Well done @landrix

I agree with your approach with the latest commit to keep the core api as close to the C header as you have done by removing the 'var' and mapping onto the pointer types. Less chances of error that way. Embarcadero has done this a lot in the windows.pas, which has at times also prevented certain use cases such as when a parameter can take nil.

Liryna commented 1 year ago

Thanks @darnocian for your help and @landrix for doing the migration to the v2! Good work!