From 6421dd92a9e2aad5b296b22067182b04a27c02c0 Mon Sep 17 00:00:00 2001 From: Alberto Alonso Date: Wed, 2 Dec 2020 13:18:42 +0200 Subject: [PATCH] Fix an alignment problem in the FspFileSystemNotify interop that would leave a buffer size not aligned to a multiple of 8, and make notify calls fail. --- src/dotnet/Interop.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dotnet/Interop.cs b/src/dotnet/Interop.cs index 9547d06d..f978bddd 100644 --- a/src/dotnet/Interop.cs +++ b/src/dotnet/Interop.cs @@ -1188,10 +1188,11 @@ namespace Fsp.Interop int Length = 0; for (int I = 0; NotifyInfoArray.Length > I; I++) { - Length = (Length + 7) & ~7; // align to next qword boundary Length += NotifyInfoInternal.FileNameBufOffset + NotifyInfoArray[I].FileName.Length * 2; + Length = (Length + 7) & ~7; // align to next qword boundary } + Byte[] Buffer = new Byte[Length]; UInt32 BytesTransferred = default(UInt32); fixed (Byte *P = Buffer)