Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrDecoder.ParseTsLogonInfoFields C# (CSharp) Method

ParseTsLogonInfoFields() private method

Parse TS_LOGON_INFO_FIELD array (parser index is updated according to parsed length)
private ParseTsLogonInfoFields ( byte data, int &currentIndex, FieldsPresent_Values presentFlag ) : TS_LOGON_INFO_FIELD[]
data byte data to be parsed
currentIndex int current parser index
presentFlag FieldsPresent_Values fields present flag
return TS_LOGON_INFO_FIELD[]
        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;
        }
RdpbcgrDecoder