private TS_LOGON_INFO_FIELD[] ParseTsLogonInfoFields(
byte[] data,
ref int currentIndex,
FieldsPresent_Values presentFlag)
{
// list to save info field(s)
List<TS_LOGON_INFO_FIELD> list = new List<TS_LOGON_INFO_FIELD>();
// Auto reconnect field (optional)
if (IsFlagExist((uint)presentFlag, (uint)FieldsPresent_Values.LOGON_EX_AUTORECONNECTCOOKIE))
{
TS_LOGON_INFO_FIELD autoReconnectField = new TS_LOGON_INFO_FIELD();
autoReconnectField.cbFieldData = ParseUInt32(data, ref currentIndex, false);
autoReconnectField.FieldData = ParseArcScPrivatePacket(data, ref currentIndex);
list.Add(autoReconnectField);
}
// Logon error info field (optional)
if (IsFlagExist((uint)presentFlag, (uint)FieldsPresent_Values.LOGON_EX_LOGONERRORS))
{
TS_LOGON_INFO_FIELD logonErrorField = new TS_LOGON_INFO_FIELD();
logonErrorField.cbFieldData = ParseUInt32(data, ref currentIndex, false);
logonErrorField.FieldData = ParseTsLogonErrorsInfo(data, ref currentIndex);
list.Add(logonErrorField);
}
// copy fields to array
TS_LOGON_INFO_FIELD[] fields = new TS_LOGON_INFO_FIELD[list.Count];
for (int i = 0; i < list.Count; ++i)
{
fields[i] = list[i];
}
return fields;
}