For now, I've moved the Sequential structs to a seperate file (hurrah for partial classes). However, it would be nice for Regionerate to ignore Sequential structs, or provide a way to ignore segments of code.
An example of this is:
- Code: Select all
[StructLayout(LayoutKind.Sequential)]
internal struct WINSTATIONINFORMATIONW
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 70)]
Byte[] Reserved1;
public UInt32 SessionId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
Byte[] Reserved2;
public System.Runtime.InteropServices.ComTypes.FILETIME ConnectTime;
public System.Runtime.InteropServices.ComTypes.FILETIME DisconnectTime;
public System.Runtime.InteropServices.ComTypes.FILETIME LastInputTime;
public System.Runtime.InteropServices.ComTypes.FILETIME LoginTime;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1096)]
Byte[] Reserved3;
public System.Runtime.InteropServices.ComTypes.FILETIME CurrentTime;
}
Which ends up as:
- Code: Select all
[StructLayout(LayoutKind.Sequential)]
internal struct WINSTATIONINFORMATIONW
{
#region Data Members (9)
public System.Runtime.InteropServices.ComTypes.FILETIME ConnectTime;
public System.Runtime.InteropServices.ComTypes.FILETIME CurrentTime;
public System.Runtime.InteropServices.ComTypes.FILETIME DisconnectTime;
public System.Runtime.InteropServices.ComTypes.FILETIME LastInputTime;
public System.Runtime.InteropServices.ComTypes.FILETIME LoginTime;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 70)]
Byte[] Reserved1;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
Byte[] Reserved2;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1096)]
Byte[] Reserved3;
public UInt32 SessionId;
#endregion Data Members
}
