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) */
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);
}
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);
}