Merge pull request #3711 from hardening/monitor_layout

Misc fixes and improvements
This commit is contained in:
Bernhard Miklautz 2017-01-23 10:02:14 +01:00 committed by GitHub
commit ac815e29f1
3 changed files with 10 additions and 5 deletions

View File

@ -47,6 +47,7 @@ typedef BOOL (*psPeerCapabilities)(freerdp_peer* peer);
typedef BOOL (*psPeerPostConnect)(freerdp_peer* peer); typedef BOOL (*psPeerPostConnect)(freerdp_peer* peer);
typedef BOOL (*psPeerActivate)(freerdp_peer* peer); typedef BOOL (*psPeerActivate)(freerdp_peer* peer);
typedef BOOL (*psPeerLogon)(freerdp_peer* peer, SEC_WINNT_AUTH_IDENTITY* identity, BOOL automatic); typedef BOOL (*psPeerLogon)(freerdp_peer* peer, SEC_WINNT_AUTH_IDENTITY* identity, BOOL automatic);
typedef BOOL (*psPeerAdjustMonitorsLayout)(freerdp_peer* peer);
typedef int (*psPeerSendChannelData)(freerdp_peer* peer, UINT16 channelId, BYTE* data, int size); typedef int (*psPeerSendChannelData)(freerdp_peer* peer, UINT16 channelId, BYTE* data, int size);
typedef int (*psPeerReceiveChannelData)(freerdp_peer* peer, UINT16 channelId, BYTE* data, int size, typedef int (*psPeerReceiveChannelData)(freerdp_peer* peer, UINT16 channelId, BYTE* data, int size,
@ -61,6 +62,7 @@ typedef int (*psPeerVirtualChannelWrite)(freerdp_peer* peer, HANDLE hChannel, BY
typedef void* (*psPeerVirtualChannelGetData)(freerdp_peer* peer, HANDLE hChannel); typedef void* (*psPeerVirtualChannelGetData)(freerdp_peer* peer, HANDLE hChannel);
typedef int (*psPeerVirtualChannelSetData)(freerdp_peer* peer, HANDLE hChannel, void* data); typedef int (*psPeerVirtualChannelSetData)(freerdp_peer* peer, HANDLE hChannel, void* data);
struct rdp_freerdp_peer struct rdp_freerdp_peer
{ {
rdpContext* context; rdpContext* context;
@ -113,6 +115,7 @@ struct rdp_freerdp_peer
psPeerDrainOutputBuffer DrainOutputBuffer; psPeerDrainOutputBuffer DrainOutputBuffer;
psPeerHasMoreToRead HasMoreToRead; psPeerHasMoreToRead HasMoreToRead;
psPeerGetEventHandles GetEventHandles; psPeerGetEventHandles GetEventHandles;
psPeerAdjustMonitorsLayout AdjustMonitorsLayout;
}; };
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -365,11 +365,13 @@ BOOL rdp_server_accept_client_control_pdu(rdpRdp* rdp, wStream* s)
BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, wStream* s) BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, wStream* s)
{ {
rdpSettings *settings = rdp->settings; rdpSettings *settings = rdp->settings;
freerdp_peer *peer = rdp->context->peer;
if (!rdp_recv_client_font_list_pdu(s)) if (!rdp_recv_client_font_list_pdu(s))
return FALSE; return FALSE;
if (settings->SupportMonitorLayoutPdu && settings->MonitorCount) if (settings->SupportMonitorLayoutPdu && settings->MonitorCount && peer->AdjustMonitorsLayout &&
peer->AdjustMonitorsLayout(peer))
{ {
/* client supports the monitorLayout PDU, let's send him the monitors if any */ /* client supports the monitorLayout PDU, let's send him the monitors if any */
wStream *st; wStream *st;
@ -386,8 +388,6 @@ BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, wStream* s)
} }
r = rdp_send_data_pdu(rdp, st, DATA_PDU_TYPE_MONITOR_LAYOUT, 0); r = rdp_send_data_pdu(rdp, st, DATA_PDU_TYPE_MONITOR_LAYOUT, 0);
Stream_Free(st, TRUE);
if (!r) if (!r)
return FALSE; return FALSE;
} }

View File

@ -575,7 +575,7 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra)
{ {
WLog_ERR(TAG, WLog_ERR(TAG,
"peer_recv_callback: CONNECTION_STATE_LICENSING - license_send_valid_client_error_packet() fail"); "peer_recv_callback: CONNECTION_STATE_LICENSING - license_send_valid_client_error_packet() fail");
return FALSE; return -1;
} }
rdp_server_transition_to_state(rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE); rdp_server_transition_to_state(rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE);
@ -585,7 +585,9 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra)
case CONNECTION_STATE_CAPABILITIES_EXCHANGE: case CONNECTION_STATE_CAPABILITIES_EXCHANGE:
if (!rdp->AwaitCapabilities) if (!rdp->AwaitCapabilities)
{ {
IFCALL(client->Capabilities, client);
if (client->Capabilities && !client->Capabilities(client))
return -1;
if (!rdp_send_demand_active(rdp)) if (!rdp_send_demand_active(rdp))
{ {