From 4ade942074cbb2d1e9f2fc6f63ba3f6d506e7c89 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Mon, 13 Mar 2017 21:29:36 +0200 Subject: [PATCH] NTFileSystemAdapter: Bugfix: FILE_DELETE_ON_CLOSE was ignored in some cases --- SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs b/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs index b803b68..909a6d2 100644 --- a/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs +++ b/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs @@ -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 &&