mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
dotnet: FileSystemHost: fixes
This commit is contained in:
parent
f36cacaf84
commit
b5bfeee027
@ -239,7 +239,7 @@ namespace Fsp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* FSP_FILE_SYSTEM_INTERFACE */
|
/* FSP_FILE_SYSTEM_INTERFACE */
|
||||||
private static Byte[] SecurityDescriptorNotNull = new Byte[0];
|
private static Byte[] ByteBufferNotNull = new Byte[0];
|
||||||
private static Int32 ExceptionHandler(
|
private static Int32 ExceptionHandler(
|
||||||
FileSystemBase FileSystem,
|
FileSystemBase FileSystem,
|
||||||
Exception ex)
|
Exception ex)
|
||||||
@ -301,7 +301,7 @@ namespace Fsp
|
|||||||
Byte[] SecurityDescriptorBytes = null;
|
Byte[] SecurityDescriptorBytes = null;
|
||||||
Int32 Result;
|
Int32 Result;
|
||||||
if (IntPtr.Zero != PSecurityDescriptorSize)
|
if (IntPtr.Zero != PSecurityDescriptorSize)
|
||||||
SecurityDescriptorBytes = SecurityDescriptorNotNull;
|
SecurityDescriptorBytes = ByteBufferNotNull;
|
||||||
Result = FileSystem.GetSecurityByName(
|
Result = FileSystem.GetSecurityByName(
|
||||||
FileName,
|
FileName,
|
||||||
out FileAttributes,
|
out FileAttributes,
|
||||||
@ -680,13 +680,15 @@ namespace Fsp
|
|||||||
Byte[] SecurityDescriptorBytes;
|
Byte[] SecurityDescriptorBytes;
|
||||||
Int32 Result;
|
Int32 Result;
|
||||||
Api.GetFullContext(ref FullContext, out FileNode, out FileDesc);
|
Api.GetFullContext(ref FullContext, out FileNode, out FileDesc);
|
||||||
SecurityDescriptorBytes = SecurityDescriptorNotNull;
|
SecurityDescriptorBytes = ByteBufferNotNull;
|
||||||
Result = FileSystem.GetSecurity(
|
Result = FileSystem.GetSecurity(
|
||||||
FileNode,
|
FileNode,
|
||||||
FileDesc,
|
FileDesc,
|
||||||
ref SecurityDescriptorBytes);
|
ref SecurityDescriptorBytes);
|
||||||
return Api.CopySecurityDescriptor(SecurityDescriptorBytes,
|
if (0 <= Result)
|
||||||
|
Result = Api.CopySecurityDescriptor(SecurityDescriptorBytes,
|
||||||
SecurityDescriptor, PSecurityDescriptorSize);
|
SecurityDescriptor, PSecurityDescriptorSize);
|
||||||
|
return Result;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user