PyFilesystem / pyfilesystem

Python filesystem abstraction layer
http://pyfilesystem.org/
BSD 3-Clause "New" or "Revised" License
287 stars 63 forks source link

Dokan failed with error -7 for dokany 0.8.0 and -5 for 0.7.4 #236

Closed kitsmag closed 8 years ago

kitsmag commented 8 years ago

https://github.com/dokan-dev/dokany 's release 0.8.0 makes some severe changes, which cause fs.expose.dokan.mount to yield error -7, which means

#define DOKAN_VERSION_ERROR -7 /* Requested an incompatible version */

Liryna commented 8 years ago

:+1:

kitsmag commented 8 years ago

...and as I mentioned in dokan-dev/dokany#115

0.7.4 also yields a -5 (DOKAN_MOUNT_ERROR) for a simple example such as

from fs.osfs import OSFS
from fs.expose import dokan
fs = OSFS('.')
mp = dokan.mount(fs, 'Q')
Liryna commented 8 years ago

PyFilesystem has to be updated to work with dokany 0.8.0 https://github.com/dokan-dev/dokany/wiki/Update-dokan-legacy-application-to-Dokany

About 0.7.4, I have no idea, it should work if it was working with dokan 0.6.0

zommuter commented 8 years ago

Ok, I started #241 for this, currently it's messed up and e.g.

from fs.expose import dokan
from fs.osfs import OSFS
osfs = OSFS('.')
#dm = dokan.mount(osfs, 'Q:\\', flags=dokan.DOKAN_OPTION_DEBUG)
dm = dokan.mount(osfs, 'Q:\\', flags = 0x1234)

yields

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "fs\expose\dokan\__init__.py", line 1018, in _do_mount
    mount(fs,drive,**opts)
  File "fs\expose\dokan\__init__.py", line 922, in mount
    res = libdokan.DokanMain(ctypes.byref(opts),ctypes.byref(opstruct))
WindowsError: exception: access violation reading 0x0000123400000000
Traceback (most recent call last):
  File "test_dokan.py", line 5, in <module>
    dm = dokan.mount(osfs, 'Q:\\', flags = 0x1234)
  File "C:\Users\kit\Documents\src\pyfilesystem\fs\expose\dokan\__init__.py", line 931, in mount
    check_ready(mp)
  File "C:\Users\kit\Documents\src\pyfilesystem\fs\expose\dokan\__init__.py", line 898, in check_ready
    check_alive(mp)
  File "C:\Users\kit\Documents\src\pyfilesystem\fs\expose\dokan\__init__.py", line 890, in check_alive
    raise OSError("dokan mount process exited prematurely")
OSError: dokan mount process exited prematurely

Note how the flag (0x1234) seems to be misinterpreted as a pointer...

zommuter commented 8 years ago

Concerning 0.7.4, maybe 0.8.0 didn't cleanly uninstall, I haven't bothered too much trying 0.6.0 etc

lurch commented 8 years ago

Concerning 0.7.4, maybe 0.8.0 didn't cleanly uninstall...

To make different versions easier to test, you could try testing inside a VM, using VM images from https://dev.windows.com/en-us/microsoft-edge/tools/vms/

arekbulski commented 8 years ago

I advise this issue be closed. @Liryna is already working on Dokan support #256 and old verions should be of no concern. We should consolidate.

lurch commented 8 years ago

Consolidation sounds good to me. And it's good to see that Dokan itself is being actively maintained again, removing the need for supporting old (ancient) versions.