mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
dotnet: properly handle SetDelete/CanDelete resolution
This commit is contained in:
parent
4725ff41d3
commit
9851f1b2c8
@ -1073,7 +1073,10 @@ namespace Fsp
|
|||||||
String FileName,
|
String FileName,
|
||||||
Boolean DeleteFile)
|
Boolean DeleteFile)
|
||||||
{
|
{
|
||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
if (DeleteFile)
|
||||||
|
return CanDelete(FileNode, FileDesc, FileName);
|
||||||
|
else
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* helpers */
|
/* helpers */
|
||||||
|
@ -754,26 +754,6 @@ namespace Fsp
|
|||||||
return ExceptionHandler(FileSystem, ex);
|
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(
|
private static Int32 Rename(
|
||||||
IntPtr FileSystemPtr,
|
IntPtr FileSystemPtr,
|
||||||
ref FullContext FullContext,
|
ref FullContext FullContext,
|
||||||
@ -1109,7 +1089,6 @@ namespace Fsp
|
|||||||
_FileSystemInterface.GetFileInfo = GetFileInfo;
|
_FileSystemInterface.GetFileInfo = GetFileInfo;
|
||||||
_FileSystemInterface.SetBasicInfo = SetBasicInfo;
|
_FileSystemInterface.SetBasicInfo = SetBasicInfo;
|
||||||
_FileSystemInterface.SetFileSize = SetFileSize;
|
_FileSystemInterface.SetFileSize = SetFileSize;
|
||||||
_FileSystemInterface.CanDelete = CanDelete;
|
|
||||||
_FileSystemInterface.Rename = Rename;
|
_FileSystemInterface.Rename = Rename;
|
||||||
_FileSystemInterface.GetSecurity = GetSecurity;
|
_FileSystemInterface.GetSecurity = GetSecurity;
|
||||||
_FileSystemInterface.SetSecurity = SetSecurity;
|
_FileSystemInterface.SetSecurity = SetSecurity;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user