diff --git a/src/dotnet/Interop.cs b/src/dotnet/Interop.cs index 578ee345..a6b41ddf 100644 --- a/src/dotnet/Interop.cs +++ b/src/dotnet/Interop.cs @@ -196,10 +196,28 @@ namespace Fsp.Interop /// Not currently implemented. Set to 0. /// public UInt32 HardLinks; + /// /// The extended attribute size of the file. /// - public UInt32 EaSize; + public UInt32 EaSize + { + get { return GetEaSize(); } + set { SetEaSize(value); } + } + + internal static int EaSizeOffset = + (int)Marshal.OffsetOf(typeof(FileInfo), "HardLinks") + 4; + internal unsafe UInt32 GetEaSize() + { + fixed (FileInfo *P = &this) + return *(UInt32 *)((Int64)(IntPtr)P + EaSizeOffset); + } + internal unsafe void SetEaSize(UInt32 value) + { + fixed (FileInfo *P = &this) + *(UInt32 *)((Int64)(IntPtr)P + EaSizeOffset) = value; + } } [StructLayout(LayoutKind.Sequential)] diff --git a/tst/passthrough-dotnet/Program.cs b/tst/passthrough-dotnet/Program.cs index 43ad156a..3d3521e0 100644 --- a/tst/passthrough-dotnet/Program.cs +++ b/tst/passthrough-dotnet/Program.cs @@ -78,7 +78,6 @@ namespace passthrough FileInfo.ChangeTime = FileInfo.LastWriteTime; FileInfo.IndexNumber = 0; FileInfo.HardLinks = 0; - FileInfo.EaSize = 0; } public Int32 GetFileInfo(out FileInfo FileInfo) { @@ -99,7 +98,6 @@ namespace passthrough FileInfo.ChangeTime = FileInfo.LastWriteTime; FileInfo.IndexNumber = 0; FileInfo.HardLinks = 0; - FileInfo.EaSize = 0; } else GetFileInfoFromFileSystemInfo(DirInfo, out FileInfo);