server: add desktop resize support.

This commit is contained in:
Vic Lee 2011-09-06 17:19:16 +08:00
parent ccebb5bb3d
commit 1cb5a73922
5 changed files with 37 additions and 3 deletions

View File

@ -226,9 +226,7 @@ boolean rdp_send_server_font_map_pdu(rdpRdp* rdp)
stream_write_uint16(s, FONTLIST_FIRST | FONTLIST_LAST); /* mapFlags (2 bytes) */
stream_write_uint16(s, 4); /* entrySize (2 bytes) */
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_MAP, rdp->mcs->user_id);
return True;
return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_MAP, rdp->mcs->user_id);
}
boolean rdp_recv_deactivate_all(rdpRdp* rdp, STREAM* s)
@ -244,6 +242,19 @@ boolean rdp_recv_deactivate_all(rdpRdp* rdp, STREAM* s)
return True;
}
boolean rdp_send_deactivate_all(rdpRdp* rdp)
{
STREAM* s;
s = rdp_pdu_init(rdp);
stream_write_uint32(s, rdp->settings->share_id); /* shareId (4 bytes) */
stream_write_uint16(s, 1); /* lengthSourceDescriptor (2 bytes) */
stream_write_uint8(s, 0); /* sourceDescriptor (should be 0x00) */
return rdp_send_pdu(rdp, s, PDU_TYPE_DEACTIVATE_ALL, rdp->mcs->user_id);
}
boolean rdp_server_accept_client_control_pdu(rdpRdp* rdp, STREAM* s)
{
uint16 action;

View File

@ -39,6 +39,7 @@
#define FONTLIST_LAST 0x0002
boolean rdp_recv_deactivate_all(rdpRdp* rdp, STREAM* s);
boolean rdp_send_deactivate_all(rdpRdp* rdp);
boolean rdp_recv_server_synchronize_pdu(rdpRdp* rdp, STREAM* s);
boolean rdp_send_server_synchronize_pdu(rdpRdp* rdp);

View File

@ -485,3 +485,16 @@ boolean rdp_server_accept_confirm_active(rdpRdp* rdp, STREAM* s)
return True;
}
boolean rdp_server_reactivate(rdpRdp* rdp)
{
if (!rdp_send_deactivate_all(rdp))
return False;
rdp->state = CONNECTION_STATE_LICENSE;
if (!rdp_send_demand_active(rdp))
return False;
return True;
}

View File

@ -59,5 +59,6 @@ boolean rdp_server_accept_mcs_attach_user_request(rdpRdp* rdp, STREAM* s);
boolean rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, STREAM* s);
boolean rdp_server_accept_client_info(rdpRdp* rdp, STREAM* s);
boolean rdp_server_accept_confirm_active(rdpRdp* rdp, STREAM* s);
boolean rdp_server_reactivate(rdpRdp* rdp);
#endif /* __CONNECTION_H */

View File

@ -345,6 +345,13 @@ static void update_send_synchronize(rdpUpdate* update)
fastpath_send_update_pdu(rdp->fastpath, s);
}
static void update_send_desktop_resize(rdpUpdate* update)
{
rdpRdp* rdp = (rdpRdp*)update->rdp;
rdp_server_reactivate(rdp);
}
static void update_send_pointer_system(rdpUpdate* update, POINTER_SYSTEM_UPDATE* pointer_system)
{
rdpRdp* rdp = (rdpRdp*)update->rdp;
@ -365,6 +372,7 @@ void update_register_server_callbacks(rdpUpdate* update)
update->BeginPaint = update_begin_paint;
update->EndPaint = update_end_paint;
update->Synchronize = update_send_synchronize;
update->DesktopResize = update_send_desktop_resize;
update->PointerSystem = update_send_pointer_system;
update->SurfaceBits = update_send_surface_bits;
update->SurfaceCommand = update_send_surface_command;