src: dotnet: WIP

This commit is contained in:
Bill Zissimopoulos 2017-04-07 12:35:20 -07:00
parent 33f5b8c05b
commit f117a89697
2 changed files with 17 additions and 17 deletions

View File

@ -129,7 +129,7 @@ namespace Fsp
MountPoint);
}
Int32 Mount(String MountPoint,
byte[] SecurityDescriptor = null,
Byte[] SecurityDescriptor = null,
Boolean Synchronized = false,
UInt32 DebugLog = 0)
{
@ -195,7 +195,7 @@ namespace Fsp
protected virtual Int32 GetSecurityByName(
String FileName,
out UInt32 FileAttributes/* or ReparsePointIndex */,
ref byte[] SecurityDescriptor)
ref Byte[] SecurityDescriptor)
{
FileAttributes = default(UInt32);
return STATUS_INVALID_DEVICE_REQUEST;
@ -336,7 +336,7 @@ namespace Fsp
protected virtual Int32 GetSecurity(
Object FileNode,
Object FileDesc,
ref byte[] SecurityDescriptor)
ref Byte[] SecurityDescriptor)
{
return STATUS_INVALID_DEVICE_REQUEST;
}
@ -344,7 +344,7 @@ namespace Fsp
Object FileNode,
Object FileDesc,
UInt32 SecurityInformation,
byte[] SecurityDescriptor)
Byte[] SecurityDescriptor)
{
return STATUS_INVALID_DEVICE_REQUEST;
}
@ -427,7 +427,7 @@ namespace Fsp
}
/* FSP_FILE_SYSTEM_INTERFACE */
private static byte[] SecurityDescriptorNotNull = new byte[0];
private static Byte[] SecurityDescriptorNotNull = new Byte[0];
private static Int32 GetVolumeInfo(
IntPtr FileSystem,
out VolumeInfo VolumeInfo)
@ -473,7 +473,7 @@ namespace Fsp
try
{
UInt32 FileAttributes;
byte[] SecurityDescriptorBytes = null;
Byte[] SecurityDescriptorBytes = null;
Int32 Result;
if (IntPtr.Zero != PSecurityDescriptorSize)
SecurityDescriptorBytes = SecurityDescriptorNotNull;
@ -836,7 +836,7 @@ namespace Fsp
try
{
Object FileNode, FileDesc;
byte[] SecurityDescriptorBytes = null;
Byte[] SecurityDescriptorBytes = null;
Int32 Result;
Api.GetFullContext(ref FullContext, out FileNode, out FileDesc);
if (IntPtr.Zero != PSecurityDescriptorSize)

View File

@ -542,11 +542,11 @@ namespace Fsp.Interop
internal static unsafe Int32 FspFileSystemSetMountPointEx(
IntPtr FileSystem,
String MountPoint,
byte[] SecurityDescriptor)
Byte[] SecurityDescriptor)
{
if (null != SecurityDescriptor)
{
fixed (byte *P = SecurityDescriptor)
fixed (Byte *P = SecurityDescriptor)
return _FspFileSystemSetMountPointEx(FileSystem, MountPoint, (IntPtr)P);
}
else
@ -556,7 +556,7 @@ namespace Fsp.Interop
internal unsafe static Object GetUserContext(
IntPtr NativePtr)
{
IntPtr UserContext = *(IntPtr *)((byte *)NativePtr + sizeof(IntPtr));
IntPtr UserContext = *(IntPtr *)((Byte *)NativePtr + sizeof(IntPtr));
return IntPtr.Zero != UserContext ? GCHandle.FromIntPtr(UserContext).Target : null;
}
internal unsafe static void SetUserContext(
@ -565,17 +565,17 @@ namespace Fsp.Interop
{
if (null != Obj)
{
Debug.Assert(IntPtr.Zero == *(IntPtr *)((byte *)NativePtr + sizeof(IntPtr)));
Debug.Assert(IntPtr.Zero == *(IntPtr *)((Byte *)NativePtr + sizeof(IntPtr)));
GCHandle Handle = GCHandle.Alloc(Obj, GCHandleType.Weak);
*(IntPtr *)((byte *)NativePtr + sizeof(IntPtr)) = (IntPtr)Handle;
*(IntPtr *)((Byte *)NativePtr + sizeof(IntPtr)) = (IntPtr)Handle;
}
else
{
IntPtr UserContext = *(IntPtr *)((byte *)NativePtr + sizeof(IntPtr));
IntPtr UserContext = *(IntPtr *)((Byte *)NativePtr + sizeof(IntPtr));
if (IntPtr.Zero != UserContext)
{
GCHandle.FromIntPtr(UserContext).Free();
*(IntPtr *)((byte *)NativePtr + sizeof(IntPtr)) = IntPtr.Zero;
*(IntPtr *)((Byte *)NativePtr + sizeof(IntPtr)) = IntPtr.Zero;
}
}
}
@ -622,7 +622,7 @@ namespace Fsp.Interop
}
internal unsafe static Int32 CopySecurityDescriptor(
byte[] SecurityDescriptorBytes,
Byte[] SecurityDescriptorBytes,
IntPtr SecurityDescriptor,
IntPtr PSecurityDescriptorSize)
{
@ -645,12 +645,12 @@ namespace Fsp.Interop
}
return 0/*STATUS_SUCCESS*/;
}
internal static byte[] MakeSecurityDescriptor(
internal static Byte[] MakeSecurityDescriptor(
IntPtr SecurityDescriptor)
{
if (IntPtr.Zero != SecurityDescriptor)
{
byte[] SecurityDescriptorBytes = new byte[GetSecurityDescriptorLength(SecurityDescriptor)];
Byte[] SecurityDescriptorBytes = new Byte[GetSecurityDescriptorLength(SecurityDescriptor)];
Marshal.Copy(SecurityDescriptor,
SecurityDescriptorBytes, 0, SecurityDescriptorBytes.Length);
return SecurityDescriptorBytes;