dotnet: properly handle SetDelete/CanDelete resolution

This commit is contained in:
Bill Zissimopoulos 2018-08-29 20:54:49 -07:00
parent 4725ff41d3
commit 9851f1b2c8
2 changed files with 4 additions and 22 deletions

View File

@ -1073,7 +1073,10 @@ namespace Fsp
String FileName,
Boolean DeleteFile)
{
return STATUS_INVALID_DEVICE_REQUEST;
if (DeleteFile)
return CanDelete(FileNode, FileDesc, FileName);
else
return STATUS_SUCCESS;
}
/* helpers */

View File

@ -754,26 +754,6 @@ namespace Fsp
return ExceptionHandler(FileSystem, ex);
}
}
private static Int32 CanDelete(
IntPtr FileSystemPtr,
ref FullContext FullContext,
String FileName)
{
FileSystemBase FileSystem = (FileSystemBase)Api.GetUserContext(FileSystemPtr);
try
{
Object FileNode, FileDesc;
Api.GetFullContext(ref FullContext, out FileNode, out FileDesc);
return FileSystem.CanDelete(
FileNode,
FileDesc,
FileName);
}
catch (Exception ex)
{
return ExceptionHandler(FileSystem, ex);
}
}
private static Int32 Rename(
IntPtr FileSystemPtr,
ref FullContext FullContext,
@ -1109,7 +1089,6 @@ namespace Fsp
_FileSystemInterface.GetFileInfo = GetFileInfo;
_FileSystemInterface.SetBasicInfo = SetBasicInfo;
_FileSystemInterface.SetFileSize = SetFileSize;
_FileSystemInterface.CanDelete = CanDelete;
_FileSystemInterface.Rename = Rename;
_FileSystemInterface.GetSecurity = GetSecurity;
_FileSystemInterface.SetSecurity = SetSecurity;