using System.Runtime.InteropServices;
namespace StabilityMatrix.Core.ReparsePoints;
///
/// Because the tag we're using is IO_REPARSE_TAG_MOUNT_POINT,
/// we use the MountPointReparseBuffer struct in the DUMMYUNIONNAME union.
///
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ReparseDataBuffer
{
///
/// Reparse point tag. Must be a Microsoft reparse point tag.
///
public uint ReparseTag;
///
/// Size, in bytes, of the reparse data in the buffer that points to.
/// This can be calculated by:
/// (4 * sizeof(ushort)) + SubstituteNameLength + PrintNameLength +
/// (namesAreNullTerminated ? 2 * sizeof(char) : 0);
///
public ushort ReparseDataLength;
///
/// Reserved; do not use.
///
#pragma warning disable CS0169 // Field is never used
private ushort Reserved;
#pragma warning restore CS0169 // Field is never used
///
/// Offset, in bytes, of the substitute name string in the array.
///
public ushort SubstituteNameOffset;
///
/// Length, in bytes, of the substitute name string. If this string is null-terminated,
/// does not include space for the null character.
///
public ushort SubstituteNameLength;
///
/// Offset, in bytes, of the print name string in the array.
///
public ushort PrintNameOffset;
///
/// Length, in bytes, of the print name string. If this string is null-terminated,
/// does not include space for the null character.
///
public ushort PrintNameLength;
///
/// A buffer containing the unicode-encoded path string. The path string contains
/// the substitute name string and print name string.
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x3FF0)]
public byte[] PathBuffer;
}