NTFileSystemAdapter: Bugfix: FILE_DELETE_ON_CLOSE was ignored in some cases

This commit is contained in:
Tal Aloni 2017-03-13 21:29:36 +02:00
parent ef6551aaca
commit 4ade942074

View file

@ -230,7 +230,6 @@ namespace SMBLibrary
}
else
{
deleteOnClose = (createOptions & CreateOptions.FILE_DELETE_ON_CLOSE) > 0;
NTStatus openStatus = OpenFileStream(out stream, path, fileAccess, shareAccess, createOptions);
if (openStatus != NTStatus.STATUS_SUCCESS)
{
@ -238,6 +237,7 @@ namespace SMBLibrary
}
}
deleteOnClose = (createOptions & CreateOptions.FILE_DELETE_ON_CLOSE) > 0;
handle = new FileHandle(path, entry.IsDirectory, stream, deleteOnClose);
if (fileStatus != FileStatus.FILE_CREATED &&
fileStatus != FileStatus.FILE_OVERWRITTEN &&