/* client is asking from info about a file */ int clipboard_process_file_request(struct stream *s, int clip_msg_status, int clip_msg_len) { int streamId; int lindex; int dwFlags; int nPositionLow; int cbRequested; //int clipDataId; log_debug("clipboard_process_file_request:"); //g_hexdump(s->p, clip_msg_len); in_uint32_le(s, streamId); in_uint32_le(s, lindex); in_uint32_le(s, dwFlags); in_uint32_le(s, nPositionLow); in_uint8s(s, 4); /* nPositionHigh */ in_uint32_le(s, cbRequested); //in_uint32_le(s, clipDataId); /* options, used when locking */ if (dwFlags & CB_FILECONTENTS_SIZE) { clipboard_send_file_size(streamId, lindex); } if (dwFlags & CB_FILECONTENTS_RANGE) { clipboard_send_file_data(streamId, lindex, nPositionLow, cbRequested); } return 0; }
/* this is callback from trans obj returns error */ static int APP_CC xrdp_mm_chan_data_in(struct trans* trans) { struct xrdp_mm* self = (struct xrdp_mm *)NULL; struct stream* s = (struct stream *)NULL; int id = 0; int size = 0; int error = 0; if (trans == 0) { return 1; } self = (struct xrdp_mm*)(trans->callback_data); s = trans_get_in_s(trans); if (s == 0) { return 1; } in_uint32_le(s, id); in_uint32_le(s, size); error = trans_force_read(trans, size - 8); if (error == 0) { /* here, the entire message block is read in, process it */ error = xrdp_mm_chan_process_msg(self, trans, s); } return error; }
void rdp_process_virtualchannel_capset(rdpRdp * rdp, STREAM s) { uint32 virtualChannelCompressionFlags; uint32 virtualChannelChunkSize; in_uint32_le(s, virtualChannelCompressionFlags); /* virtual channel compression flags */ in_uint32_le(s, virtualChannelChunkSize); /* VCChunkSize */ }
/* server requested info about the file and this is the response it's either the file size or file data */ int clipboard_process_file_response(struct stream *s, int clip_msg_status, int clip_msg_len) { int streamId; int file_size; log_debug("clipboard_process_file_response:"); if (g_file_request_sent_type == CB_FILECONTENTS_SIZE) { g_file_request_sent_type = 0; in_uint32_le(s, streamId); in_uint32_le(s, file_size); log_debug("clipboard_process_file_response: streamId %d " "file_size %d", streamId, file_size); xfuse_file_contents_size(streamId, file_size); } else if (g_file_request_sent_type == CB_FILECONTENTS_RANGE) { g_file_request_sent_type = 0; in_uint32_le(s, streamId); xfuse_file_contents_range(streamId, s->p, clip_msg_len - 4); } else { log_error("clipboard_process_file_response: error"); g_file_request_sent_type = 0; } return 0; }
/* returns error */ int DEFAULT_CC my_trans_data_in(struct trans* trans) { struct stream* s; int id; int size; int error; if (trans == 0) { return 0; } if (trans != g_con_trans) { return 1; } log_message(&log_conf, LOG_LEVEL_DEBUG, "chansrv[my_trans_data_in]: " "my_trans_data_in:"); s = trans_get_in_s(trans); in_uint32_le(s, id); in_uint32_le(s, size); error = trans_force_read(trans, size - 8); if (error == 0) { /* here, the entire message block is read in, process it */ error = process_message(); } return error; }
int APP_CC dev_redir_client_name(struct stream* s) { log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_data_in]: new message: PAKID_CORE_CLIENT_NAME"); int hostname_size; in_uint32_le(s, use_unicode); in_uint32_le(s, hostname_size); /* flag not use */ in_uint32_le(s, hostname_size); if (hostname_size < 1) { log_message(&log_conf, LOG_LEVEL_ERROR, "rdpdr channel[dev_redir_data_in]: no hostname specified"); return 1; } if (use_unicode == 1) { log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_data_in]: unicode is used"); in_unistr(s, hostname, sizeof(hostname), hostname_size); } else { in_uint8a(s, hostname, hostname_size); } log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_data_in]: hostname : '%s'",hostname); if (g_strlen(hostname) >0) { dev_redir_confirm_clientID_request(); } return 0; }
/* returns error */ int DEFAULT_CC my_trans_data_in(struct trans *trans) { struct stream *s = (struct stream *)NULL; int id = 0; int size = 0; int error = 0; if (trans == 0) { return 0; } if (trans != g_con_trans) { return 1; } LOGM((LOG_LEVEL_DEBUG, "my_trans_data_in:")); s = trans_get_in_s(trans); in_uint32_le(s, id); in_uint32_le(s, size); error = trans_force_read(trans, size - 8); if (error == 0) { /* here, the entire message block is read in, process it */ error = process_message(); } return error; }
/* returns error */ static int APP_CC process_message(void) { struct stream *s = (struct stream *)NULL; int size = 0; int id = 0; int rv = 0; char *next_msg = (char *)NULL; if (g_con_trans == 0) { return 1; } s = trans_get_in_s(g_con_trans); if (s == 0) { return 1; } rv = 0; while (s_check_rem(s, 8)) { next_msg = s->p; in_uint32_le(s, id); in_uint32_le(s, size); next_msg += size; switch (id) { case 1: /* init */ rv = process_message_init(s); break; case 3: /* channel setup */ rv = process_message_channel_setup(s); break; case 5: /* channel data */ rv = process_message_channel_data(s); break; case 7: /* channel data response */ rv = process_message_channel_data_response(s); break; default: LOGM((LOG_LEVEL_ERROR, "process_message: error in process_message ", "unknown msg %d", id)); break; } if (rv != 0) { break; } s->p = next_msg; } return rv; }
static void cliprdr_process(STREAM s) { uint16 type, status; uint32 length, format; uint8 *data; in_uint16_le(s, type); in_uint16_le(s, status); in_uint32_le(s, length); data = s->p; DEBUG_CLIPBOARD(("CLIPRDR recv: type=%d, status=%d, length=%d\n", type, status, length)); if (status == CLIPRDR_ERROR) { switch (type) { case CLIPRDR_FORMAT_ACK: /* FIXME: We seem to get this when we send an announce while the server is still processing a paste. Try sending another announce. */ cliprdr_send_native_format_announce(last_formats, last_formats_length); break; case CLIPRDR_DATA_RESPONSE: ui_clip_request_failed(); break; default: DEBUG_CLIPBOARD(("CLIPRDR error (type=%d)\n", type)); } return; } switch (type) { case CLIPRDR_CONNECT: ui_clip_sync(); break; case CLIPRDR_FORMAT_ANNOUNCE: ui_clip_format_announce(data, length); cliprdr_send_packet(CLIPRDR_FORMAT_ACK, CLIPRDR_RESPONSE, NULL, 0); return; case CLIPRDR_FORMAT_ACK: break; case CLIPRDR_DATA_REQUEST: in_uint32_le(s, format); ui_clip_request_data(format); break; case CLIPRDR_DATA_RESPONSE: ui_clip_handle_data(data, length); break; case 7: /* TODO: W2K3 SP1 sends this on connect with a value of 1 */ break; default: unimpl("CLIPRDR packet type %d\n", type); } }
/* Process a Licensing packet */ void licence_process(rdpLicence * licence, STREAM s) { uint8 tag; uint16 wMsgSize; uint8* license_start = s->p; /* Licensing Preamble */ in_uint8(s, tag); /* bMsgType */ in_uint8s(s, 1); /* Ignoring bVersion */ in_uint16_le(s, wMsgSize); /* Now pointing at LicensingMessage */ switch (tag) { case LICENSE_REQUEST: DEBUG("LICENSE_REQUEST\n"); licence_process_request(licence, s); ASSERT(s->p == license_start + wMsgSize); break; case LICENSE_PLATFORM_CHALLENGE: DEBUG("LICENCE PLATFORM_CHALLENGE\n"); licence_process_platform_challenge(licence, s); break; case NEW_LICENSE: DEBUG("NEW_LICENSE\n"); licence_process_new_license(licence, s); break; case UPGRADE_LICENSE: DEBUG("UPGRADE_LICENSE\n"); break; case LICENCE_ERROR_ALERT: DEBUG("LICENCE ERROR_ALERT - assuming it is a license grant\n"); { uint32 dwErrorCode, dwStateTransition; uint32 wBlobType, wBlobLen; in_uint32_le(s, dwErrorCode); in_uint32_le(s, dwStateTransition); DEBUG("dwErrorCode %x dwStateTransition %x\n", dwErrorCode, dwStateTransition); in_uint16_le(s, wBlobType); in_uint16_le(s, wBlobLen); DEBUG("bbErrorInfo: wBlobType %x wBlobLen %x\n", wBlobType, wBlobLen); /* hexdump(s->p, wBlobLen); */ } licence->licence_issued = True; /* TODO ... */ break; default: ui_unimpl(licence->sec->rdp->inst, "Unknown licence tag 0x%x\n", tag); } s->p = license_start + wMsgSize; /* FIXME: Shouldn't be necessary if parsed properly */ ASSERT(s->p <= s->end); }
/* return error */ static int APP_CC process_server_paint_rect_shmem(struct mod *mod, struct stream *s) { int rv; int x; int y; int cx; int cy; int flags; int frame_id; int shmem_id; int shmem_offset; int width; int height; int srcx; int srcy; char *bmpdata; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_uint32_le(s, flags); in_uint32_le(s, frame_id); in_uint32_le(s, shmem_id); in_uint32_le(s, shmem_offset); in_uint16_le(s, width); in_uint16_le(s, height); in_sint16_le(s, srcx); in_sint16_le(s, srcy); bmpdata = 0; if (flags == 0) /* screen */ { if (mod->screen_shmem_id == 0) { mod->screen_shmem_id = shmem_id; mod->screen_shmem_pixels = g_shmat(mod->screen_shmem_id); } if (mod->screen_shmem_pixels != 0) { bmpdata = mod->screen_shmem_pixels + shmem_offset; } } if (bmpdata != 0) { rv = mod->server_paint_rect(mod, x, y, cx, cy, bmpdata, width, height, srcx, srcy); } else { rv = 1; } send_paint_rect_ack(mod, flags, x, y, cx, cy, frame_id); return rv; }
int APP_CC dev_redir_devicelist_announce(struct stream* s) { int device_list_count, device_id, device_type, device_data_length; int i; char dos_name[9] = {0}; int handle; log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " " new message: PAKID_CORE_DEVICELIST_ANNOUNCE"); in_uint32_le(s, device_list_count); /* DeviceCount */ log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " "%i device(s) declared", device_list_count); /* device list */ for( i=0 ; i<device_list_count ; i++) { in_uint32_le(s, device_type); log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " "device type: %i", device_type); in_uint32_le(s, device_id); log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " "device id: %i", device_id); in_uint8a(s,dos_name,8) log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " "dos name: '%s'", dos_name); in_uint32_le(s, device_data_length); log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " "data length: %i", device_data_length); switch(device_type) { case RDPDR_DTYP_PRINT : log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " "Add printer device"); handle = printer_dev_add(s, device_data_length, device_id, dos_name); if (handle != 1) { device_list[device_count].device_id = device_id; device_list[device_count].device_type = RDPDR_DTYP_PRINT; device_count++; dev_redir_device_list_reply(handle); break; } log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " "Enable to add printer device"); break; case RDPDR_DTYP_FILESYSTEM : log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_devicelist_announce]: " "Add filesystem device"); break; } } return 0; }
int APP_CC dev_redir_clientID_confirm(struct stream* s) { log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_data_in]: new message: PAKID_CORE_CLIENTID_CONFIRM"); in_uint16_le(s, vers_major); in_uint32_le(s, vers_minor); in_uint32_le(s, client_id); log_message(&log_conf, LOG_LEVEL_DEBUG, "rdpdr channel[dev_redir_data_in]: version : %i:%i, client_id : %i", vers_major, vers_minor, client_id); return 0; }
void APP_CC xrdp_emt_process_results(struct xrdp_rdp* self, struct xrdp_emt* emt, struct stream* s) { int time_delta; int byte_count; int current_time = g_time3(); int current_rtt = current_time - emt->stop_time; in_uint32_le(s, time_delta); in_uint32_le(s, byte_count); emt->total_delta += time_delta; emt->total_byte_count += byte_count; if (emt->total_byte_count > LONG_MAX) { emt->total_byte_count = emt->total_byte_count / emt->total_delta; emt->total_delta = 1; } if (byte_count > 1000) { if (emt->total_delta == 0) { self->session->bandwidth = byte_count / 0.9; } else { self->session->bandwidth = emt->total_byte_count/emt->total_delta; // Ko/s } } if (emt->time_processing < 2) { if (self->session->base_RTT > current_rtt) { self->session->base_RTT = current_rtt; } if (self->session->average_RTT == 0) { self->session->average_RTT = current_rtt; } else { self->session->average_RTT = (self->session->average_RTT + current_rtt) / 2; } } printf("bandwidth: %i Ko/s\n", self->session->bandwidth); printf("base RTT: %i ms\n", self->session->base_RTT); printf("average RTT: %i ms\n", self->session->average_RTT); self->session->network_stat_updated = true; }
/* software decode */ int surface_cmd(rdpRdp * rdp, STREAM s) { int cmdType; int frameAction; int frameId; int destLeft; int destTop; int destRight; int destBottom; int bpp; int codecID; int width; int height; int bitmapDataLength; //printf("surface_cmd: size %d\n", s->end - s->p); //hexdump(s->p, 1024); frameId = 0; while (s->p < s->end) { in_uint16_le(s, cmdType); //printf(" surface_cmd: %d\n", cmdType); switch (cmdType) { case 4: /* CMDTYPE_FRAME_MARKER */ in_uint16_le(s, frameAction); in_uint32_le(s, frameId); //printf(" surface_cmd: CMDTYPE_FRAME_MARKER %d %d\n", frameAction, frameId); if (frameAction == 1) { rdp_send_frame_ack(rdp, frameId); } break; case 6: /* CMDTYPE_STREAM_SURFACE_BITS */ in_uint16_le(s, destLeft); in_uint16_le(s, destTop); in_uint16_le(s, destRight); in_uint16_le(s, destBottom); in_uint8(s, bpp); in_uint8s(s, 2); in_uint8(s, codecID); in_uint16_le(s, width); in_uint16_le(s, height); in_uint32_le(s, bitmapDataLength); in_uint8s(s, bitmapDataLength); //printf(" surface_cmd: CMDTYPE_STREAM_SURFACE_BITS " // "id %d width %d height %d bpp %d size %d\n", // codecID, width, height, bpp, bitmapDataLength); break; } } return 0; }
/* return error */ static int APP_CC process_server_set_hints(struct mod *mod, struct stream *s) { int rv; int hints; int mask; in_uint32_le(s, hints); in_uint32_le(s, mask); rv = mod->server_set_hints(mod, hints, mask); return rv; }
void channel_process(STREAM s, uint16 mcs_channel) { uint32 length, flags; uint32 thislength; VCHANNEL *channel = NULL; unsigned int i; STREAM in; for (i = 0; i < g_num_channels; i++) { channel = &g_channels[i]; if (channel->mcs_id == mcs_channel) break; } if (i >= g_num_channels) return; in_uint32_le(s, length); in_uint32_le(s, flags); if ((flags & CHANNEL_FLAG_FIRST) && (flags & CHANNEL_FLAG_LAST)) { /* single fragment - pass straight up */ channel->process(s); } else { /* add fragment to defragmentation buffer */ in = &channel->in; if (flags & CHANNEL_FLAG_FIRST) { if (length > in->size) { in->data = (uint8 *) xrealloc(in->data, length); in->size = length; } in->p = in->data; } thislength = MIN(s->end - s->p, in->data + in->size - in->p); memcpy(in->p, s->p, thislength); in->p += thislength; if (flags & CHANNEL_FLAG_LAST) { in->end = in->p; in->p = in->data; channel->process(in); } } }
/* return error */ static int APP_CC process_server_composite(struct mod *mod, struct stream *s) { int rv; int srcidx; int srcformat; int srcwidth; int srcrepeat; int transform[10]; int mskflags; int mskidx; int mskformat; int mskwidth; int mskrepeat; int op; int srcx; int srcy; int mskx; int msky; int dstx; int dsty; int width; int height; int dstformat; in_uint16_le(s, srcidx); in_uint32_le(s, srcformat); in_uint16_le(s, srcwidth); in_uint8(s, srcrepeat); g_memcpy(transform, s->p, 40); in_uint8s(s, 40); in_uint8(s, mskflags); in_uint16_le(s, mskidx); in_uint32_le(s, mskformat); in_uint16_le(s, mskwidth); in_uint8(s, mskrepeat); in_uint8(s, op); in_sint16_le(s, srcx); in_sint16_le(s, srcy); in_sint16_le(s, mskx); in_sint16_le(s, msky); in_sint16_le(s, dstx); in_sint16_le(s, dsty); in_uint16_le(s, width); in_uint16_le(s, height); in_uint32_le(s, dstformat); rv = mod->server_composite(mod, srcidx, srcformat, srcwidth, srcrepeat, transform, mskflags, mskidx, mskformat, mskwidth, mskrepeat, op, srcx, srcy, mskx, msky, dstx, dsty, width, height, dstformat); return rv; }
/* returns error */ static int APP_CC process_message(void) { struct stream* s; int size; int id; int rv; char* next_msg; if (g_con_trans == 0) { return 1; } s = trans_get_in_s(g_con_trans); if (s == 0) { return 1; } rv = 0; while (s_check_rem(s, 8)) { next_msg = s->p; in_uint32_le(s, id); in_uint32_le(s, size); next_msg += size; switch (id) { case 1: /* init */ rv = process_message_init(s); break; case 3: /* channel setup */ rv = process_message_channel_setup(s); break; case 5: /* channel data */ rv = process_message_channel_data(s); break; case 7: /* channel data response */ rv = process_message_channel_data_response(s); break; default: log_message(&log_conf, LOG_LEVEL_DEBUG, "chansrv[process_message]: " "unknown msg %d", id); break; } if (rv != 0) { break; } s->p = next_msg; } return rv; }
void rdp_process_draw_gdiplus_capset(rdpRdp * rdp, STREAM s) { uint32 drawGDIPlusSupportLevel; uint32 gdipVersion; uint32 drawGdiplusCacheLevel; in_uint32_le(s, drawGDIPlusSupportLevel); /* drawGDIPlusSupportLevel */ in_uint32_le(s, gdipVersion); /* gdipVersion, build number for the GDI+ 1.1 subsystem */ in_uint32_le(s, drawGdiplusCacheLevel); /* drawGdiplusCacheLevel */ rdp_process_gdiplus_cache_entries(rdp, s); /* gdipCacheEntries */ rdp_process_gdiplus_cache_chunk_size(rdp, s); /* gdipCacheChunkSize */ rdp_process_gdiplus_image_cache_properties(rdp, s); /* gdipImageCacheProperties */ }
static int APP_CC rail_process_notify_event(struct stream *s, int size) { int window_id; int notify_id; int message; LOG(10, ("chansrv::rail_process_notify_event:")); in_uint32_le(s, window_id); in_uint32_le(s, notify_id); in_uint32_le(s, message); LOG(10, (" window_id 0x%8.8x notify_id 0x%8.8x message 0x%8.8x", window_id, notify_id, message)); return 0; }
void vchan_process(rdpChannels * chan, STREAM s, int mcs_id) { int length; int total_length; int flags; char * data; in_uint32_le(s, total_length); in_uint32_le(s, flags); length = (int) (s->end - s->p); data = (char *) (s->p); s->p += length; ui_channel_data(chan->mcs->sec->rdp->inst, mcs_id, data, length, flags, total_length); }
/* Respond to a demand active PDU */ static void process_demand_active(STREAM s) { uint8 type; uint16 len_src_descriptor, len_combined_caps; in_uint32_le(s, g_rdp_shareid); in_uint16_le(s, len_src_descriptor); in_uint16_le(s, len_combined_caps); in_uint8s(s, len_src_descriptor); DEBUG(("DEMAND_ACTIVE(id=0x%x)\n", g_rdp_shareid)); rdp_process_server_caps(s, len_combined_caps); rdp_send_confirm_active(); rdp_send_synchronise(); rdp_send_control(RDP_CTL_COOPERATE); rdp_send_control(RDP_CTL_REQUEST_CONTROL); rdp_recv(&type); /* RDP_PDU_SYNCHRONIZE */ rdp_recv(&type); /* RDP_CTL_COOPERATE */ rdp_recv(&type); /* RDP_CTL_GRANT_CONTROL */ rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, g_numlock_sync ? ui_get_numlock_state(read_keyboard_state()) : 0, 0); if (g_use_rdp5) { rdp_enum_bmpcache2(); rdp_send_fonts(3); } else { rdp_send_fonts(1); rdp_send_fonts(2); } rdp_recv(&type); /* RDP_PDU_UNKNOWN 0x28 (Fonts?) */ reset_order_state(); }
/* Process a desktop save order */ static void process_desksave(STREAM s, DESKSAVE_ORDER * os, uint32 present, BOOL delta) { int width, height; if (present & 0x01) in_uint32_le(s, os->offset); if (present & 0x02) rdp_in_coord(s, &os->left, delta); if (present & 0x04) rdp_in_coord(s, &os->top, delta); if (present & 0x08) rdp_in_coord(s, &os->right, delta); if (present & 0x10) rdp_in_coord(s, &os->bottom, delta); if (present & 0x20) in_uint8(s, os->action); DEBUG(("DESKSAVE(l=%d,t=%d,r=%d,b=%d,off=%d,op=%d)\n", os->left, os->top, os->right, os->bottom, os->offset, os->action)); width = os->right - os->left + 1; height = os->bottom - os->top + 1; if (os->action == 0) ui_desktop_save(os->offset, os->left, os->top, width, height); else ui_desktop_restore(os->offset, os->left, os->top, width, height); }
/* Process a disconnect PDU */ void process_disconnect_pdu(STREAM s, uint32 * ext_disc_reason) { in_uint32_le(s, *ext_disc_reason); DEBUG(("Received disconnect PDU\n")); }
/* Process a new licence packet */ static void licence_process_new_license(STREAM s) { RDSSL_RC4 crypt_key; uint32 length; int i; in_uint8s(s, 2); // Skip license binary blob type in_uint16_le(s, length); if (!s_check_rem(s, length)) return; rdssl_rc4_set_key(&crypt_key, g_licence_key, 16); rdssl_rc4_crypt(&crypt_key, s->p, s->p, length); /* Parse NEW_LICENSE_INFO block */ in_uint8s(s, 4); // skip dwVersion /* Skip strings, Scope, CompanyName and ProductId to get to the LicenseInfo which we store in license blob. */ length = 0; for (i = 0; i < 4; i++) { in_uint8s(s, length); in_uint32_le(s, length); if (!s_check_rem(s, length)) return; } g_licence_issued = True; save_licence(s->p, length); }
static int rdpup_recv_msg(struct stream* s) { int len; int rv; rv = 1; if (s != 0) { init_stream(s, 4); rv = rdpup_recv(s->data, 4); if (rv == 0) { in_uint32_le(s, len); if (len > 3) { init_stream(s, len); rv = rdpup_recv(s->data, len - 4); } } } if (rv != 0) { rdpLog("error in rdpup_recv_msg\n"); } return rv; }
/* return error */ static int APP_CC process_server_window_show(struct mod* mod, struct stream* s) { int window_id; int rv; int flags; struct rail_window_state_order rwso; g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, window_id); in_uint32_le(s, flags); in_uint32_le(s, rwso.show_state); mod->server_window_new_update(mod, window_id, &rwso, flags); rv = 0; return rv; }
/* returns error data coming in from the channel handler, send it to the client */ static int APP_CC xrdp_mm_trans_process_channel_data(struct xrdp_mm* self, struct trans* trans) { struct stream* s = (struct stream *)NULL; int size = 0; int total_size = 0; int chan_id = 0; int chan_flags = 0; int rv = 0; s = trans_get_in_s(trans); if (s == 0) { return 1; } in_uint16_le(s, chan_id); in_uint16_le(s, chan_flags); in_uint16_le(s, size); in_uint32_le(s, total_size); rv = xrdp_mm_trans_send_channel_data_response(self, trans); if (rv == 0) { rv = libxrdp_send_to_channel(self->wm->session, chan_id, s->p, size, total_size, chan_flags); } return rv; }
/* return error */ static int APP_CC process_server_paint_rect(struct mod *mod, struct stream *s) { int rv; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata; int width; int height; int srcx; int srcy; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_uint32_le(s, len_bmpdata); in_uint8p(s, bmpdata, len_bmpdata); in_uint16_le(s, width); in_uint16_le(s, height); in_sint16_le(s, srcx); in_sint16_le(s, srcy); rv = mod->server_paint_rect(mod, x, y, cx, cy, bmpdata, width, height, srcx, srcy); return rv; }