diff --git a/channels/cliprdr/client/cliprdr_main.c b/channels/cliprdr/client/cliprdr_main.c index 229124fde..daee269a1 100644 --- a/channels/cliprdr/client/cliprdr_main.c +++ b/channels/cliprdr/client/cliprdr_main.c @@ -321,6 +321,8 @@ static UINT cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, request.msgType = CB_FILECONTENTS_REQUEST; request.msgFlags = flags; request.dataLen = length; + request.haveClipDataId = FALSE; + Stream_Read_UINT32(s, request.streamId); /* streamId (4 bytes) */ Stream_Read_UINT32(s, request.listIndex); /* listIndex (4 bytes) */ Stream_Read_UINT32(s, request.dwFlags); /* dwFlags (4 bytes) */ @@ -329,9 +331,10 @@ static UINT cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, Stream_Read_UINT32(s, request.cbRequested); /* cbRequested (4 bytes) */ if (Stream_GetRemainingLength(s) >= 4) + { Stream_Read_UINT32(s, request.clipDataId); /* clipDataId (4 bytes) */ - else - request.clipDataId = 0; + request.haveClipDataId = TRUE; + } IFCALLRET(context->ServerFileContentsRequest, error, context, &request); @@ -900,20 +903,19 @@ static UINT cliprdr_client_file_contents_request(CliprdrClientContext* context, } Stream_Write_UINT32(s, fileContentsRequest->streamId); /* streamId (4 bytes) */ - Stream_Write_UINT32(s, - fileContentsRequest->listIndex); /* listIndex (4 bytes) */ + Stream_Write_UINT32(s, fileContentsRequest->listIndex); /* listIndex (4 bytes) */ Stream_Write_UINT32(s, fileContentsRequest->dwFlags); /* dwFlags (4 bytes) */ - Stream_Write_UINT32(s, - fileContentsRequest->nPositionLow); /* nPositionLow (4 bytes) */ - Stream_Write_UINT32(s, - fileContentsRequest->nPositionHigh); /* nPositionHigh (4 bytes) */ - Stream_Write_UINT32(s, - fileContentsRequest->cbRequested); /* cbRequested (4 bytes) */ - Stream_Write_UINT32(s, - fileContentsRequest->clipDataId); /* clipDataId (4 bytes) */ + Stream_Write_UINT32(s, fileContentsRequest->nPositionLow); /* nPositionLow (4 bytes) */ + Stream_Write_UINT32(s, fileContentsRequest->nPositionHigh); /* nPositionHigh (4 bytes) */ + Stream_Write_UINT32(s, fileContentsRequest->cbRequested); /* cbRequested (4 bytes) */ + + if (fileContentsRequest->haveClipDataId) + Stream_Write_UINT32(s, fileContentsRequest->clipDataId); /* clipDataId (4 bytes) */ + WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientFileContentsRequest: streamId: 0x%08"PRIX32"", fileContentsRequest->streamId); + return cliprdr_packet_send(cliprdr, s); } diff --git a/include/freerdp/channels/cliprdr.h b/include/freerdp/channels/cliprdr.h index a9f772778..cbecb4e21 100644 --- a/include/freerdp/channels/cliprdr.h +++ b/include/freerdp/channels/cliprdr.h @@ -217,6 +217,7 @@ struct _CLIPRDR_FILE_CONTENTS_REQUEST UINT32 nPositionLow; UINT32 nPositionHigh; UINT32 cbRequested; + BOOL haveClipDataId; UINT32 clipDataId; }; typedef struct _CLIPRDR_FILE_CONTENTS_REQUEST CLIPRDR_FILE_CONTENTS_REQUEST;