Demonstrate the new FileDispositionInfoEx behavior
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
deleteex.cpp
deleteex.sln
deleteex.vcxproj
deleteex.vcxproj.filters
stdafx.cpp
stdafx.h
targetver.h

README.md

deleteex

There was an interesting discussion on NTFSD recently due to a file that could not be deleted:

http://www.osronline.com/showThread.CFM?link=286551

The issue was due to the fact that the file had an active image section (i.e. was currently loaded as an executable). However, the poster was only trying to delete a hard link to the file, not the last hard link to the file.

In playing with this more, it turns out that this case is properly handled by NTFS if you send the new FileDispositionInfoEx request. This will allow the link to be deleted even though there is an active image section, so long as it's not the last link to the file. This test application demonstrates the new behavior.

Building the sample

The provided solution builds using Visual Studio 2017. The target system must be running Windows 10 RS3 or later in order for the test to succeed.