microsoft / winfile

Original Windows File Manager (winfile) with enhancements
MIT License
6.82k stars 706 forks source link

Left Pane implodes on dead Reparse Points #306

Closed schinagl closed 2 years ago

schinagl commented 2 years ago

Problem

The left pane implodes to the root drive if one clicks on a dead Reparse Point

How to test

Download ln.exe from https://schinagl.priv.at/nt/ln/ln64.zip and place it in the same directory as the below .bat file Start TestDeadReparseImplode.bat from an administrative command prompt (or grant yourself the right to create symbolic links) in your e.g. temp directory.

It builds a structure like

└───dest
    └───sl
        ├───iLib_dead
        └───iLib_symlink

Navigate to x:\dest\sl and double click on iLib_symlink. The left pane does not implode to the root as the original version does.

Comments to the code

There is one little change in CreateDTABlockWorker(), which deals with the failing WFFindFirst and checks if the item was a dead Reparse Point

malxau commented 2 years ago

I tried this out and it works for me as described. I think it's better to use FILE_ATTRIBUTE_REPARSE_POINT here, because if an object is inaccessible it doesn't really matter whether it's a link or not - collapsing back to the root won't help.