src: dotnet: WIP

This commit is contained in:
Bill Zissimopoulos 2017-04-03 15:15:13 -07:00
parent 858f77cdf7
commit 74c2494bbd
2 changed files with 71 additions and 7 deletions

View File

@ -367,10 +367,25 @@ namespace Fsp
Boolean ResolveLastPathComponent, Boolean ResolveLastPathComponent,
out IoStatusBlock PIoStatus, out IoStatusBlock PIoStatus,
IntPtr Buffer, IntPtr Buffer,
out UIntPtr PSize) ref UIntPtr PSize)
{
return Api.FspFileSystemResolveReparsePoints(
_FileSystem,
GetReparsePointByName,
IntPtr.Zero,
FileName,
ReparsePointIndex,
ResolveLastPathComponent,
out PIoStatus,
Buffer,
ref PSize);
}
protected virtual Int32 GetReparsePointByName(
String FileName,
Boolean IsDirectory,
IntPtr Buffer,
ref UIntPtr PSize)
{ {
PIoStatus = default(IoStatusBlock);
PSize = default(UIntPtr);
return STATUS_INVALID_DEVICE_REQUEST; return STATUS_INVALID_DEVICE_REQUEST;
} }
protected virtual Int32 GetReparsePoint( protected virtual Int32 GetReparsePoint(
@ -897,7 +912,7 @@ namespace Fsp
Boolean ResolveLastPathComponent, Boolean ResolveLastPathComponent,
out IoStatusBlock PIoStatus, out IoStatusBlock PIoStatus,
IntPtr Buffer, IntPtr Buffer,
out UIntPtr PSize) ref UIntPtr PSize)
{ {
FileSystem self = (FileSystem)Api.FspFileSystemGetUserContext(FileSystem); FileSystem self = (FileSystem)Api.FspFileSystemGetUserContext(FileSystem);
try try
@ -908,12 +923,33 @@ namespace Fsp
ResolveLastPathComponent, ResolveLastPathComponent,
out PIoStatus, out PIoStatus,
Buffer, Buffer,
out PSize); ref PSize);
} }
catch (Exception ex) catch (Exception ex)
{ {
PIoStatus = default(IoStatusBlock); PIoStatus = default(IoStatusBlock);
PSize = default(UIntPtr); return self.ExceptionHandler(ex);
}
}
private static Int32 GetReparsePointByName(
IntPtr FileSystem,
IntPtr Context,
String FileName,
Boolean IsDirectory,
IntPtr Buffer,
ref UIntPtr PSize)
{
FileSystem self = (FileSystem)Api.FspFileSystemGetUserContext(FileSystem);
try
{
return self.GetReparsePointByName(
FileName,
IsDirectory,
Buffer,
ref PSize);
}
catch (Exception ex)
{
return self.ExceptionHandler(ex); return self.ExceptionHandler(ex);
} }
} }

View File

@ -317,7 +317,7 @@ namespace Fsp.Interop
Boolean ResolveLastPathComponent, Boolean ResolveLastPathComponent,
out IoStatusBlock PIoStatus, out IoStatusBlock PIoStatus,
IntPtr Buffer, IntPtr Buffer,
out UIntPtr PSize); ref UIntPtr PSize);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate Int32 GetReparsePoint( internal delegate Int32 GetReparsePoint(
IntPtr FileSystem, IntPtr FileSystem,
@ -416,6 +416,24 @@ namespace Fsp.Interop
internal static extern Int32 FspFileSystemStopDispatcher( internal static extern Int32 FspFileSystemStopDispatcher(
IntPtr FileSystem); IntPtr FileSystem);
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern Int32 FspFileSystemFindReparsePoint(
IntPtr FileSystem,
GetReparsePointByName GetReparsePointByName,
IntPtr Context,
[MarshalAs(UnmanagedType.LPWStr)] String FileName,
out UInt32 PReparsePointIndex);
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern Int32 FspFileSystemResolveReparsePoints(
IntPtr FileSystem,
GetReparsePointByName GetReparsePointByName,
IntPtr Context,
[MarshalAs(UnmanagedType.LPWStr)] String FileName,
UInt32 ReparsePointIndex,
Boolean ResolveLastPathComponent,
out IoStatusBlock PIoStatus,
IntPtr Buffer,
ref UIntPtr PSize);
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern Int32 FspVersion( internal static extern Int32 FspVersion(
out UInt32 PVersion); out UInt32 PVersion);
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
@ -424,6 +442,16 @@ namespace Fsp.Interop
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern UInt32 FspWin32FromNtStatus( internal static extern UInt32 FspWin32FromNtStatus(
Int32 Status); Int32 Status);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate Int32 GetReparsePointByName(
IntPtr FileSystem,
IntPtr Context,
[MarshalAs(UnmanagedType.LPWStr)] String FileName,
Boolean IsDirectory,
IntPtr Buffer,
ref UIntPtr PSize);
internal static unsafe Int32 FspFileSystemSetMountPointEx( internal static unsafe Int32 FspFileSystemSetMountPointEx(
IntPtr FileSystem, IntPtr FileSystem,
String MountPoint, String MountPoint,