3.1.1.1.5.2 Receiving RDP-UDP2 Packet

msdn link

When an RDP-UDP2 payload is received, the receiver MUST parse the PacketPrefixByte and RDP-UDP2 packet from the payload using the procedure outlined below.

  1. Swap the first and eighth byte of the payload. A valid RDP-UDP2 payload MUST have packet length greater than 7.

  2. Remove the first byte from the payload and parse it as the PacketPrefixByte (section 2.2.1.3).

  3. If the Short_Packet_Length field in PacketPrefixByte is not 0, remove the last (7 - Short_Packet_Length) bytes from the payload.

  4. The remaining bytes in the payload must be parsed as an RDP-UDP2 Packet Layout (section 2.2.1.1).