Fix short format name configuration and format list return.

This commit is contained in:
akallabeth 2020-04-20 15:26:33 +02:00
parent a167f3b779
commit 8ec50b6cc1
2 changed files with 25 additions and 7 deletions

View File

@ -539,8 +539,10 @@ static UINT cliprdr_client_capabilities(CliprdrClientContext* context,
const CLIPRDR_CAPABILITIES* capabilities)
{
wStream* s;
UINT32 flags;
const CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet;
cliprdrPlugin* cliprdr = (cliprdrPlugin*)context->handle;
s = cliprdr_packet_new(CB_CLIP_CAPS, 0, 4 + CB_CAPSTYPE_GENERAL_LEN);
if (!s)
@ -555,7 +557,27 @@ static UINT cliprdr_client_capabilities(CliprdrClientContext* context,
Stream_Write_UINT16(s, generalCapabilitySet->capabilitySetType); /* capabilitySetType */
Stream_Write_UINT16(s, generalCapabilitySet->capabilitySetLength); /* lengthCapability */
Stream_Write_UINT32(s, generalCapabilitySet->version); /* version */
Stream_Write_UINT32(s, generalCapabilitySet->generalFlags); /* generalFlags */
flags = generalCapabilitySet->generalFlags;
/* Client capabilities are sent in response to server capabilities.
* -> Do not request features the server does not support.
* -> Update clipboard context feature state to what was agreed upon.
*/
if (!cliprdr->useLongFormatNames)
flags &= ~CB_USE_LONG_FORMAT_NAMES;
if (!cliprdr->streamFileClipEnabled)
flags &= ~CB_STREAM_FILECLIP_ENABLED;
if (!cliprdr->fileClipNoFilePaths)
flags &= ~CB_FILECLIP_NO_FILE_PATHS;
if (!cliprdr->canLockClipData)
flags &= CB_CAN_LOCK_CLIPDATA;
cliprdr->useLongFormatNames = flags & CB_USE_LONG_FORMAT_NAMES;
cliprdr->streamFileClipEnabled = flags & CB_STREAM_FILECLIP_ENABLED;
cliprdr->fileClipNoFilePaths = flags & CB_FILECLIP_NO_FILE_PATHS;
cliprdr->canLockClipData = flags & CB_CAN_LOCK_CLIPDATA;
Stream_Write_UINT32(s, flags); /* generalFlags */
WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientCapabilities");
return cliprdr_packet_send(cliprdr, s);
}
@ -1139,10 +1161,6 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p
}
cliprdr->log = WLog_Get("com.freerdp.channels.cliprdr.client");
cliprdr->useLongFormatNames = TRUE;
cliprdr->streamFileClipEnabled = FALSE;
cliprdr->fileClipNoFilePaths = TRUE;
cliprdr->canLockClipData = FALSE;
WLog_Print(cliprdr->log, WLOG_DEBUG, "VirtualChannelEntryEx");
CopyMemory(&(cliprdr->channelEntryPoints), pEntryPoints,
sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX));

View File

@ -402,7 +402,7 @@ UINT cliprdr_read_format_list(wStream* s, CLIPRDR_FORMAT_LIST* formatList, BOOL
WCHAR* wszFormatName;
wStream sub1, sub2;
CLIPRDR_FORMAT* formats = NULL;
UINT error = CHANNEL_RC_OK;
UINT error = ERROR_INTERNAL_ERROR;
asciiNames = (formatList->msgFlags & CB_ASCII_NAMES) ? TRUE : FALSE;
@ -551,7 +551,7 @@ UINT cliprdr_read_format_list(wStream* s, CLIPRDR_FORMAT_LIST* formatList, BOOL
}
}
return error;
return CHANNEL_RC_OK;
error_out:
cliprdr_free_format_list(formatList);