From 1d619e0874aaa663fe821cee9fa063c3113c973c Mon Sep 17 00:00:00 2001 From: "Felix A. Croes" Date: Tue, 14 May 2019 11:38:55 +0200 Subject: [PATCH] Use pointers instead of references. To avoid copying structs needlessly. --- src/dotnet/Interop.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/dotnet/Interop.cs b/src/dotnet/Interop.cs index 08079c92..af3cfa6b 100644 --- a/src/dotnet/Interop.cs +++ b/src/dotnet/Interop.cs @@ -725,7 +725,7 @@ namespace Fsp.Interop IntPtr FileSystem, ref FspFsctlTransactRsp Response); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate ref FspFileSystemOperationContext FspFileSystemGetOperationContext(); + internal unsafe delegate FspFileSystemOperationContext *FspFileSystemGetOperationContext(); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate IntPtr FspFileSystemMountPointF( IntPtr FileSystem); @@ -961,9 +961,7 @@ namespace Fsp.Interop } internal static unsafe UInt64 FspFileSystemGetOperationRequestHint() { - FspFileSystemOperationContext Context = FspFileSystemGetOperationContext(); - FspFsctlTransactReq Request = *Context.Request; - return Request.Hint; + return FspFileSystemGetOperationContext()->Request->Hint; } internal static unsafe Boolean FspFileSystemAddDirInfo( ref DirInfo DirInfo,