fn handle_format_list(&self, payload: &mut Payload, length: u32) -> RdpResult<Vec<Vec<u8>>> {
        let list = FormatListPDU::<LongFormatName>::decode(payload, length)?;
        debug!(
            "{:?} data was copied on the RDP server",
            list.format_names
                .iter()
                .map(|n| n.format_id)
                .collect::<Vec<u32>>()
        );

        // if we want to support a variety of formats, we should clear
        // and re-initialize some local state (Clipboard Format ID Map)
        //
        // we're only supporting standard (text) formats right now, so
        // we don't need to maintain a local/remote mapping
        //
        // see section 3.1.1.1 for details

        let mut result = vec![encode_message(
            ClipboardPDUType::CB_FORMAT_LIST_RESPONSE,
            vec![],
        )?];

        for name in list.format_names {
            match FromPrimitive::from_u32(name.format_id) {
                Some(ClipboardFormat::CF_TEXT) | Some(ClipboardFormat::CF_OEMTEXT) => {
                    // request the data by imitating a paste event
                    result.push(encode_message(
                        ClipboardPDUType::CB_FORMAT_DATA_REQUEST,
                        FormatDataRequestPDU::for_id(name.format_id).encode()?,
                    )?);
                }
                _ => {
                    info!("{:?} data was copied on the remote desktop, but this format is unsupported", name.format_id);
                }
            }
        }

        Ok(result)
    }
/// Handles the format list PDU, which is a notification from the server
/// that some data was copied and can be requested at a later date.
Handles the format list PDU, which is a notification from the server
that some data was copied and can be requested at a later date.
Handles the format list PDU which is a notification from the server that some data was copied and can be requested at a later date .
fn handle_format_list(&self, payload: &mut Payload, length: u32) -> RdpResult<Vec<Vec<u8>>> {
        let list = FormatListPDU::<LongFormatName>::decode(payload, length)?;
        debug!(
            "{:?} data was copied on the RDP server",
            list.format_names
                .iter()
                .map(|n| n.format_id)
                .collect::<Vec<u32>>()
        );
        // if we want to support a variety of formats, we should clear
        // and re-initialize some local state (Clipboard Format ID Map)
        //
        // we're only supporting standard (text) formats right now, so
        // we don't need to maintain a local/remote mapping
        //
        // see section 3.1.1.1 for details
        let mut result = vec![encode_message(
            ClipboardPDUType::CB_FORMAT_LIST_RESPONSE,
            vec![],
        )?];
        for name in list.format_names {
            match FromPrimitive::from_u32(name.format_id) {
                Some(ClipboardFormat::CF_TEXT) | Some(ClipboardFormat::CF_OEMTEXT) => {
                    // request the data by imitating a paste event
                    result.push(encode_message(
                        ClipboardPDUType::CB_FORMAT_DATA_REQUEST,
                        FormatDataRequestPDU::for_id(name.format_id).encode()?,
                    )?);
                }
                _ => {
                    info!("{:?} data was copied on the remote desktop, but this format is unsupported", name.format_id);
                }
            }
        }
        Ok(result)
    }
fn handle_format_list ( & self , payload : & mut Payload , length : u32 ) -> RdpResult < Vec < Vec < u8 > > > { let list = FormatListPDU :: < LongFormatName > :: decode ( payload , length ) ? ; debug ! ( " " list format_names iter ( ) map ( n n format_id ) collect Vec u32 ( ) ) ; // if we want to support a variety of formats, we should clear // and re-initialize some local state (Clipboard Format ID Map) // // we're only supporting standard (text) formats right now, so // we don't need to maintain a local/remote mapping // // see section 3.1.1.1 for details let mut result = vec ! [ encode_message ( ClipboardPDUType CB_FORMAT_LIST_RESPONSE vec [ ] ) ] ; for name in list . format_names { match FromPrimitive :: from_u32 ( name . format_id ) { Some ( ClipboardFormat :: CF_TEXT ) | Some ( ClipboardFormat :: CF_OEMTEXT ) => { // request the data by imitating a paste event result . push ( encode_message ( ClipboardPDUType :: CB_FORMAT_DATA_REQUEST , FormatDataRequestPDU :: for_id ( name . format_id ) . encode ( ) ? , ) ? ) ; } _ => { info ! ( " " name format_id ) ; } } } Ok ( result ) }
Handles the format list PDU, which is a notification from the server
that some data was copied and can be requested at a later date.
Handles the format list PDU which is a notification from the server that some data was copied and can be requested at a later date .
&self
payload
&mut Payload
length
u32
&self
payload
&mut Payload
length
u32