rdp: add a callback for ServerStatusInfo

This commit is contained in:
David Fort 2019-01-29 10:33:06 +01:00
parent 05d9d89796
commit 53c74beadc
5 changed files with 43 additions and 5 deletions

View File

@ -139,6 +139,20 @@ enum SURFCMD_FRAMEACTION
SURFACECMD_FRAMEACTION_END = 0x0001
};
/** @brief status code as in 2.2.5.2 Server Status Info PDU */
enum
{
TS_STATUS_FINDING_DESTINATION = 0x00000401,
TS_STATUS_LOADING_DESTINATION = 0x00000402,
TS_STATUS_BRINGING_SESSION_ONLINE = 0x00000403,
TS_STATUS_REDIRECTING_TO_DESTINATION = 0x00000404,
TS_STATUS_VM_LOADING = 0x00000501,
TS_STATUS_VM_WAKING = 0x00000502,
TS_STATUS_VM_STARTING = 0x00000503,
TS_STATUS_VM_STARTING_MONITORING = 0x00000504,
TS_STATUS_VM_RETRYING_MONITORING = 0x00000505
};
struct _SURFACE_FRAME
{
UINT32 frameId;
@ -180,6 +194,7 @@ typedef BOOL (*pSurfaceFrameAcknowledge)(rdpContext* context, UINT32 frameId);
typedef BOOL (*pSaveSessionInfo)(rdpContext* context, UINT32 type, void* data);
typedef BOOL (*pSetKeyboardImeStatus)(rdpContext* context, UINT16 imeId, UINT32 imeState,
UINT32 imeConvMode);
typedef BOOL (*pServerStatusInfo)(rdpContext* context, UINT32 status);
struct rdp_update
{
@ -216,7 +231,8 @@ struct rdp_update
pSurfaceFrameBits SurfaceFrameBits; /* 67 */
pSurfaceFrameAcknowledge SurfaceFrameAcknowledge; /* 68 */
pSaveSessionInfo SaveSessionInfo; /* 69 */
UINT32 paddingE[80 - 70]; /* 70 */
pServerStatusInfo ServerStatusInfo; /* 70 */
UINT32 paddingE[80 - 71]; /* 71 */
/* internal */

View File

@ -1461,3 +1461,17 @@ BOOL rdp_send_save_session_info(rdpContext* context, UINT32 type, void* data)
return status;
}
BOOL rdp_send_server_status_info(rdpContext* context, UINT32 status)
{
wStream* s;
rdpRdp* rdp = context->rdp;
s = rdp_data_pdu_init(rdp);
if (!s)
return FALSE;
Stream_Write_UINT32(s, status);
return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_STATUS_INFO, rdp->mcs->userId);;
}

View File

@ -62,8 +62,8 @@ FREERDP_LOCAL void rdp_write_auto_reconnect_cookie(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_recv_client_info(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_send_client_info(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_recv_save_session_info(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_send_save_session_info(rdpContext* context, UINT32 type,
void* data);
FREERDP_LOCAL BOOL rdp_send_save_session_info(rdpContext* context, UINT32 type, void* data);
FREERDP_LOCAL BOOL rdp_send_server_status_info(rdpContext* context, UINT32 status);
FREERDP_LOCAL char* rdp_info_package_flags_description(UINT32 flags);

View File

@ -765,6 +765,10 @@ static BOOL rdp_recv_server_status_info_pdu(rdpRdp* rdp, wStream* s)
return FALSE;
Stream_Read_UINT32(s, statusCode); /* statusCode (4 bytes) */
if (rdp->update->ServerStatusInfo)
return rdp->update->ServerStatusInfo(rdp->context, statusCode);
return TRUE;
}

View File

@ -2094,6 +2094,8 @@ void update_register_server_callbacks(rdpUpdate* update)
update->SetKeyboardIndicators = update_send_set_keyboard_indicators;
update->SetKeyboardImeStatus = update_send_set_keyboard_ime_status;
update->SaveSessionInfo = rdp_send_save_session_info;
update->ServerStatusInfo = rdp_send_server_status_info;
update->primary->DstBlt = update_send_dstblt;
update->primary->PatBlt = update_send_patblt;
update->primary->ScrBlt = update_send_scrblt;
@ -2101,6 +2103,7 @@ void update_register_server_callbacks(rdpUpdate* update)
update->primary->LineTo = update_send_line_to;
update->primary->MemBlt = update_send_memblt;
update->primary->GlyphIndex = update_send_glyph_index;
update->secondary->CacheBitmap = update_send_cache_bitmap;
update->secondary->CacheBitmapV2 = update_send_cache_bitmap_v2;
update->secondary->CacheBitmapV3 = update_send_cache_bitmap_v3;
@ -2108,9 +2111,10 @@ void update_register_server_callbacks(rdpUpdate* update)
update->secondary->CacheGlyph = update_send_cache_glyph;
update->secondary->CacheGlyphV2 = update_send_cache_glyph_v2;
update->secondary->CacheBrush = update_send_cache_brush;
update->altsec->CreateOffscreenBitmap =
update_send_create_offscreen_bitmap_order;
update->altsec->CreateOffscreenBitmap = update_send_create_offscreen_bitmap_order;
update->altsec->SwitchSurface = update_send_switch_surface_order;
update->pointer->PointerSystem = update_send_pointer_system;
update->pointer->PointerPosition = update_send_pointer_position;
update->pointer->PointerColor = update_send_pointer_color;