private TS_LOGON_INFO ParseTsLogonInfo(byte[] data, ref int currentIndex)
{
TS_LOGON_INFO info = new TS_LOGON_INFO();
// TS_LOGON_INFO: cbDomain
info.cbDomain = ParseUInt32(data, ref currentIndex, false);
// TS_LOGON_INFO: Domain
byte[] domainBytes = GetBytes(data, ref currentIndex, ConstValue.TS_LOGON_INFO_DOMAIN_LENGTH);
info.Domain = Encoding.Unicode.GetString(domainBytes, 0, (int)info.cbDomain);
// TS_LOGON_INFO: cbUserName
info.cbUserName = ParseUInt32(data, ref currentIndex, false);
// TS_LOGON_INFO: UserName
byte[] usernameBytes = GetBytes(data, ref currentIndex, ConstValue.TS_LOGON_INFO_USER_NAME_LENGTH);
info.UserName = Encoding.Unicode.GetString(usernameBytes, 0, (int)info.cbUserName);
// TS_LOGON_INFO: SessionId
info.SessionId = ParseUInt32(data, ref currentIndex, false);
return info;
}