Пример #1
0
/**
 * Function description
 *
 * @return 0 on success, otherwise a Win32 error code
 */
UINT disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s)
{
	UINT32 type;
	UINT32 length;

	if (Stream_GetRemainingLength(s) < 8)
	{
		WLog_ERR(TAG, "not enought remaining data");
		return ERROR_INVALID_DATA;
	}

	Stream_Read_UINT32(s, type); /* Type (4 bytes) */
	Stream_Read_UINT32(s, length); /* Length (4 bytes) */

	//WLog_ERR(TAG,  "Type: %d Length: %d", type, length);

	switch (type)
	{
		case DISPLAY_CONTROL_PDU_TYPE_CAPS:
			return disp_recv_display_control_caps_pdu(callback, s);

		default:
			WLog_ERR(TAG, "Type %d not recognized!", type);
			return ERROR_INTERNAL_ERROR;
	}
}
Пример #2
0
int disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s)
{
	UINT32 type;
	UINT32 length;

	Stream_Read_UINT32(s, type); /* Type (4 bytes) */
	Stream_Read_UINT32(s, length); /* Length (4 bytes) */

	//fprintf(stderr, "Type: %d Length: %d\n", type, length);

	switch (type)
	{
		case DISPLAY_CONTROL_PDU_TYPE_CAPS:
			disp_recv_display_control_caps_pdu(callback, s);
			break;

		default:
			break;
	}

	return 0;
}