Merge pull request #5376 from kubistika/bugfix/rdpgfx-server-v10.6-PDUs

rdpgfx: Fix GFX v10.6 PDUs parsing and naming according to the spec
This commit is contained in:
akallabeth 2019-05-06 15:32:32 +02:00 committed by GitHub
commit 95b8b43d4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 21 deletions

View File

@ -1209,7 +1209,7 @@ static UINT rdpgfx_recv_map_surface_to_scaled_output_pdu(RDPGFX_CHANNEL_CALLBACK
RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface;
UINT error = CHANNEL_RC_OK;
if (Stream_GetRemainingLength(s) < 12)
if (Stream_GetRemainingLength(s) < 20)
{
WLog_Print(gfx->log, WLOG_ERROR, "not enough data!");
return ERROR_INVALID_DATA;
@ -1219,11 +1219,11 @@ static UINT rdpgfx_recv_map_surface_to_scaled_output_pdu(RDPGFX_CHANNEL_CALLBACK
Stream_Read_UINT16(s, pdu.reserved); /* reserved (2 bytes) */
Stream_Read_UINT32(s, pdu.outputOriginX); /* outputOriginX (4 bytes) */
Stream_Read_UINT32(s, pdu.outputOriginY); /* outputOriginY (4 bytes) */
Stream_Read_UINT32(s, pdu.targetX);
Stream_Read_UINT32(s, pdu.targetY);
Stream_Read_UINT32(s, pdu.targetWidth); /* targetWidth (4 bytes) */
Stream_Read_UINT32(s, pdu.targetHeight); /* targetHeight (4 bytes) */
WLog_Print(gfx->log, WLOG_DEBUG,
"RecvMapSurfaceToOutputPdu: surfaceId: %"PRIu16" outputOriginX: %"PRIu32" outputOriginY: %"PRIu32" targetX: %"PRIu32" targetY: %"PRIu32,
pdu.surfaceId, pdu.outputOriginX, pdu.outputOriginY, pdu.targetX, pdu.targetY);
"RecvMapSurfaceToScaledOutputPdu: surfaceId: %"PRIu16" outputOriginX: %"PRIu32" outputOriginY: %"PRIu32" targetWidth: %"PRIu32" targetHeight: %"PRIu32,
pdu.surfaceId, pdu.outputOriginX, pdu.outputOriginY, pdu.targetWidth, pdu.targetHeight);
if (context)
{
@ -1283,7 +1283,7 @@ static UINT rdpgfx_recv_map_surface_to_scaled_window_pdu(RDPGFX_CHANNEL_CALLBACK
RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface;
UINT error = CHANNEL_RC_OK;
if (Stream_GetRemainingLength(s) < 18)
if (Stream_GetRemainingLength(s) < 26)
{
WLog_Print(gfx->log, WLOG_ERROR, "not enough data!");
return ERROR_INVALID_DATA;
@ -1293,11 +1293,11 @@ static UINT rdpgfx_recv_map_surface_to_scaled_window_pdu(RDPGFX_CHANNEL_CALLBACK
Stream_Read_UINT64(s, pdu.windowId); /* windowId (8 bytes) */
Stream_Read_UINT32(s, pdu.mappedWidth); /* mappedWidth (4 bytes) */
Stream_Read_UINT32(s, pdu.mappedHeight); /* mappedHeight (4 bytes) */
Stream_Read_UINT32(s, pdu.targetWidth);
Stream_Read_UINT32(s, pdu.targetHeight);
Stream_Read_UINT32(s, pdu.targetWidth); /* targetWidth (4 bytes) */
Stream_Read_UINT32(s, pdu.targetHeight); /* targetHeight (4 bytes) */
WLog_Print(gfx->log, WLOG_DEBUG,
"RecvMapSurfaceToWindowPdu: surfaceId: %"PRIu16" windowId: 0x%016"PRIX64" mappedWidth: %"PRIu32" mappedHeight: %"PRIu32"",
pdu.surfaceId, pdu.windowId, pdu.mappedWidth, pdu.mappedHeight);
"RecvMapSurfaceToScaledWindowPdu: surfaceId: %"PRIu16" windowId: 0x%016"PRIX64" mappedWidth: %"PRIu32" mappedHeight: %"PRIu32" targetWidth: %"PRIu32" targetHeight: %"PRIu32"",
pdu.surfaceId, pdu.windowId, pdu.mappedWidth, pdu.mappedHeight, pdu.targetWidth, pdu.targetHeight);
if (context && context->MapSurfaceToScaledWindow)
{
@ -1311,7 +1311,6 @@ static UINT rdpgfx_recv_map_surface_to_scaled_window_pdu(RDPGFX_CHANNEL_CALLBACK
return error;
}
/**
* Function description
*

View File

@ -1066,7 +1066,7 @@ static UINT rdpgfx_send_map_surface_to_scaled_window_pdu(RdpgfxServerContext* co
const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* pdu)
{
wStream* s = rdpgfx_server_single_packet_new(
RDPGFX_CMDID_MAPSURFACETOWINDOW, 18);
RDPGFX_CMDID_MAPSURFACETOWINDOW, 26);
if (!s)
{
@ -1078,8 +1078,8 @@ static UINT rdpgfx_send_map_surface_to_scaled_window_pdu(RdpgfxServerContext* co
Stream_Write_UINT64(s, pdu->windowId); /* windowId (8 bytes) */
Stream_Write_UINT32(s, pdu->mappedWidth); /* mappedWidth (4 bytes) */
Stream_Write_UINT32(s, pdu->mappedHeight); /* mappedHeight (4 bytes) */
Stream_Write_UINT32(s, pdu->targetWidth);
Stream_Write_UINT32(s, pdu->targetHeight);
Stream_Write_UINT32(s, pdu->targetWidth); /* targetWidth (4 bytes) */
Stream_Write_UINT32(s, pdu->targetHeight); /* targetHeight (4 bytes) */
return rdpgfx_server_single_packet_send(context, s);
}
@ -1102,8 +1102,7 @@ static UINT rdpgfx_recv_frame_acknowledge_pdu(RdpgfxServerContext* context,
Stream_Read_UINT32(s, pdu.queueDepth); /* queueDepth (4 bytes) */
Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */
/* totalFramesDecoded (4 bytes) */
Stream_Read_UINT32(s, pdu.totalFramesDecoded);
Stream_Read_UINT32(s, pdu.totalFramesDecoded); /* totalFramesDecoded (4 bytes) */
if (context)
{
@ -1285,7 +1284,7 @@ static UINT rdpgfx_send_map_surface_to_scaled_output_pdu(RdpgfxServerContext* co
const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* pdu)
{
wStream* s = rdpgfx_server_single_packet_new(
RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT, 12);
RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT, 20);
if (!s)
{
@ -1297,8 +1296,8 @@ static UINT rdpgfx_send_map_surface_to_scaled_output_pdu(RdpgfxServerContext* co
Stream_Write_UINT16(s, 0); /* reserved (2 bytes). Must be 0 */
Stream_Write_UINT32(s, pdu->outputOriginX); /* outputOriginX (4 bytes) */
Stream_Write_UINT32(s, pdu->outputOriginY); /* outputOriginY (4 bytes) */
Stream_Write_UINT32(s, pdu->targetX);
Stream_Write_UINT32(s, pdu->targetY);
Stream_Write_UINT32(s, pdu->targetWidth); /* targetWidth (4 bytes) */
Stream_Write_UINT32(s, pdu->targetHeight); /* targetHeight (4 bytes) */
return rdpgfx_server_single_packet_send(context, s);
}

View File

@ -321,8 +321,8 @@ struct _RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU
UINT16 reserved;
UINT32 outputOriginX;
UINT32 outputOriginY;
UINT32 targetX;
UINT32 targetY;
UINT32 targetWidth;
UINT32 targetHeight;
};
typedef struct _RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU
RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU;