private TS_LOGON_INFO_VERSION_2 ParseTsLogonInfoVersion2(byte[] data, ref int currentIndex)
{
TS_LOGON_INFO_VERSION_2 info = new TS_LOGON_INFO_VERSION_2();
// TS_LOGON_INFO_VERSION_2:
info.Version = (TS_LOGON_INFO_VERSION_2_Version_Values)ParseUInt16(data, ref currentIndex, false);
// TS_LOGON_INFO_VERSION_2: Size
info.Size = ParseUInt32(data, ref currentIndex, false);
// TS_LOGON_INFO_VERSION_2: SessionId
info.SessionId = ParseUInt32(data, ref currentIndex, false);
// TS_LOGON_INFO_VERSION_2: cbDomain
info.cbDomain = ParseUInt32(data, ref currentIndex, false);
// TS_LOGON_INFO_VERSION_2: cbUserName
info.cbUserName = ParseUInt32(data, ref currentIndex, false);
// TS_LOGON_INFO_VERSION_2: Pad
info.Pad = GetBytes(data, ref currentIndex, ConstValue.TS_LOGON_INFO_VERSION_2_PAD_LENGTH);
// TS_LOGON_INFO_VERSION_2: Domain
byte[] domainBytes = GetBytes(data, ref currentIndex, (int)info.cbDomain);
info.Domain = Encoding.Unicode.GetString(domainBytes);
// TS_LOGON_INFO_VERSION_2: UserName
byte[] usernameBytes = GetBytes(data, ref currentIndex, (int)info.cbUserName);
info.UserName = Encoding.Unicode.GetString(usernameBytes);
return info;
}