public override StackPacket Clone() { SlowPathOutputPdu pduClone = new SlowPathOutputPdu(); pduClone.commonHeader = commonHeader; if (slowPathUpdates != null) { Collection<RdpbcgrSlowPathUpdatePdu> updates = new Collection<RdpbcgrSlowPathUpdatePdu>(); for (int i = 0; i < slowPathUpdates.Length; ++i) { updates.Add(slowPathUpdates[i]); } pduClone.slowPathUpdates = new RdpbcgrSlowPathUpdatePdu[updates.Count]; for (int i = 0; i < updates.Count; ++i) { pduClone.slowPathUpdates[i] = updates[i]; } } return pduClone; }
/// <summary> /// Decode Slow-Path Update PDU including Slow-Path Graphics Update PDU and Slow-Path Pointer Update PDU. /// </summary> /// <param name="data">data to be parsed</param> /// <param name="decryptedUserData">decrypted user data to be parsed</param> /// <param name="type">security header type</param> /// <returns>decoded Slow-Path Update PDU</returns> public StackPacket DecodeSlowPathUpdatePDU( byte[] data, byte[] decryptedUserData, SecurityHeaderType type) { SlowPathOutputPdu pdu = new SlowPathOutputPdu(); // data index int dataIndex = 0; // SlowPathOutputPDU: commonHeader pdu.commonHeader = ParseMcsCommonHeader(data, ref dataIndex, type); // user data index int userDataIndex = 0; // SlowPathOutputPDU: slowPathUpdates pdu.slowPathUpdates = ParseSlowPathUpdates(decryptedUserData, ref userDataIndex); // Check if data length exceeded expectation VerifyDataLength(decryptedUserData.Length, userDataIndex, ConstValue.ERROR_MESSAGE_DATA_LENGTH_EXCEEDED); return pdu; }
public SlowPathOutputPduEx(SlowPathOutputPdu orgPdu, RdpbcgrServerSessionContext serverSessionContext) : base(serverSessionContext) { this.commonHeader = orgPdu.commonHeader; if (orgPdu.slowPathUpdates != null) { Collection<RdpbcgrSlowPathUpdatePdu> updates = new Collection<RdpbcgrSlowPathUpdatePdu>(); for (int i = 0; i < orgPdu.slowPathUpdates.Length; ++i) { updates.Add(orgPdu.slowPathUpdates[i]); } this.slowPathUpdates = new RdpbcgrSlowPathUpdatePdu[updates.Count]; for (int i = 0; i < updates.Count; ++i) { this.slowPathUpdates[i] = updates[i]; } } }