The TS_SET_KEYBOARD_INDICATORS_PDU structure contains the actual contents of the Set Keyboard Indicators PDU. The contents of the LedFlags field is identical to the flags used in the Client Synchronize Input Event Notification (see section ).
file:///C:/ts_dev/TestSuites/MS-RDPBCGR/TestSuite/Src/TD/latest_XMLS_16may/RDPBCGR/ _rfc_ms-rdpbcgr2_1_7_2_1_1.xml
        /// <summary>
        /// Parse TS_SET_KEYBOARD_INDICATORS_PDU
        /// (parser index is updated according to parsed length)
        /// </summary>
        /// <param name="data">data to be parsed</param>
        /// <param name="currentIndex">current parser index</param>
        /// <returns>TS_SET_KEYBOARD_INDICATORS_PDU</returns>
        private TS_SET_KEYBOARD_INDICATORS_PDU ParseTsSetKeyboardIndicatorsPdu(byte[] data, ref int currentIndex)
        {
            TS_SET_KEYBOARD_INDICATORS_PDU pdu = new TS_SET_KEYBOARD_INDICATORS_PDU();

            // TS_SET_KEYBOARD_INDICATORS_PDU: shareDataHeader
            pdu.shareDataHeader = ParseTsShareDataHeader(data, ref currentIndex);

            // TS_SET_KEYBOARD_INDICATORS_PDU: UnitId
            pdu.UnitId = ParseUInt16(data, ref currentIndex, false);

            // TS_SET_KEYBOARD_INDICATORS_PDU: LedFlags
            pdu.LedFlags = (LedFlags_Values)ParseUInt16(data, ref currentIndex, false);

            return pdu;
        }
Exemplo n.º 2
0
        private byte[] EncodeKeyboardIndicatorsData(TS_SET_KEYBOARD_INDICATORS_PDU setKeyBdIndicatorsPduData)
        {
            List<byte> dataBuffer = new List<byte>();

            RdpbcgrEncoder.EncodeStructure(dataBuffer, setKeyBdIndicatorsPduData.shareDataHeader);
            RdpbcgrEncoder.EncodeStructure(dataBuffer, setKeyBdIndicatorsPduData.UnitId);
            RdpbcgrEncoder.EncodeStructure(dataBuffer, (ushort)setKeyBdIndicatorsPduData.LedFlags);

            return dataBuffer.ToArray();
        }