jetwhiz / encfs4win

Windows port of EncFS
https://encfs.win
Other
399 stars 41 forks source link

File Explorer fails to update on mount in Win10 build 2004 #146

Closed jon-blum closed 3 years ago

jon-blum commented 3 years ago

Seen now on multiple Windows 10 machines after upgrading to Win10 build 2004 from 1909: when mounting a virtual drive using EncFS4win v1.10, the drive does not appear in the left-hand pane of an existing File Explorer window. If a new File Explorer window is opened, the drive is visible there.

This may be a DOKAN issue. No such problems occurred in build 1909 or previous.

jon-blum commented 3 years ago

Update: this appears to be a DOKAN issue. It seems that security restrictions have tightened, and -- at least under some circumstances -- the DOKAN service can no longer send the notification message to File Explorer using the SHChangeNotify function, because it's running as a different user (the service user).

The solution is for EncFS4win to send the notifications itself. The patch appears to be simple:

ifdef _WIN32

            SHChangeNotify(SHCNE_DRIVEADD, SHCNF_PATH, 
                (LPCVOID) mountPoint, NULL);

endif

ifdef _WIN32

SHChangeNotify(SHCNE_DRIVEREMOVED, SHCNF_PATH,
    (LPCVOID)arg->mountPoint.c_str(), NULL);

endif

As far as I've been able to tell in my limited testing, if DOKAN is working then the duplicate notifications do no harm.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jon-blum commented 3 years ago

Update: even with the Dokan fix in, the behaviour still seems to be only intermittently successful. I'll continue to test and see if I can find out more on the Dokan end.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.