cliprdr: process format list response PDU.

This commit is contained in:
Vic Lee 2011-07-13 00:01:50 +08:00
parent a57fe59660
commit b4a0b651f8
2 changed files with 14 additions and 2 deletions

View File

@ -123,6 +123,9 @@ static void cliprdr_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
cliprdr_process_format_list(cliprdr, data_in, dataLen); cliprdr_process_format_list(cliprdr, data_in, dataLen);
break; break;
case CB_FORMAT_LIST_RESPONSE:
break;
default: default:
DEBUG_WARN("unknown msgType %d", msgType); DEBUG_WARN("unknown msgType %d", msgType);
break; break;

View File

@ -69,6 +69,11 @@ static const uint8 test_format_list_data[] =
"\x6D\x00\x61\x00\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x6D\x00\x61\x00\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
}; };
static const uint8 test_format_list_response_data[] =
{
"\x03\x00\x01\x00\x00\x00\x00\x00"
};
static int test_rdp_channel_data(rdpInst* inst, int chan_id, char* data, int data_size) static int test_rdp_channel_data(rdpInst* inst, int chan_id, char* data, int data_size)
{ {
printf("chan_id %d data_size %d\n", chan_id, data_size); printf("chan_id %d data_size %d\n", chan_id, data_size);
@ -125,15 +130,19 @@ void test_cliprdr(void)
format_list_event->formats = (uint32*)xmalloc(sizeof(uint32) * 2); format_list_event->formats = (uint32*)xmalloc(sizeof(uint32) * 2);
format_list_event->formats[0] = CB_FORMAT_TEXT; format_list_event->formats[0] = CB_FORMAT_TEXT;
format_list_event->formats[1] = CB_FORMAT_HTML; format_list_event->formats[1] = CB_FORMAT_HTML;
/* cliprdr sends format list PDU to server */
event_processed = 0; event_processed = 0;
freerdp_chanman_send_event(chan_man, "cliprdr", event); freerdp_chanman_send_event(chan_man, "cliprdr", event);
/* cliprdr sends format list PDU to server */
while (!event_processed) while (!event_processed)
{ {
freerdp_chanman_check_fds(chan_man, &inst); freerdp_chanman_check_fds(chan_man, &inst);
} }
/* server sends format list response PDU to cliprdr */
freerdp_chanman_data(&inst, 0, (char*)test_format_list_response_data, sizeof(test_format_list_response_data) - 1,
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_format_list_response_data) - 1);
/* server sends format list PDU to cliprdr */ /* server sends format list PDU to cliprdr */
freerdp_chanman_data(&inst, 0, (char*)test_format_list_data, sizeof(test_format_list_data) - 1, freerdp_chanman_data(&inst, 0, (char*)test_format_list_data, sizeof(test_format_list_data) - 1,
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_format_list_data) - 1); CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, sizeof(test_format_list_data) - 1);