static int process_DATA(drdynvcPlugin * plugin, uint32 ChannelId, char * data, int data_size) { int error = 0; if (plugin->dvc_data) { /* Fragmented data */ if (plugin->dvc_data_pos + (uint32) data_size > plugin->dvc_data_size) { LLOGLN(0, ("process_DATA: data exceeding declared length!")); free(plugin->dvc_data); plugin->dvc_data = NULL; return 1; } memcpy(plugin->dvc_data + plugin->dvc_data_pos, data, data_size); plugin->dvc_data_pos += (uint32) data_size; if (plugin->dvc_data_pos >= plugin->dvc_data_size) { error = dvcman_receive_channel_data(plugin->channel_mgr, ChannelId, plugin->dvc_data, plugin->dvc_data_size); free(plugin->dvc_data); plugin->dvc_data = NULL; } } else { error = dvcman_receive_channel_data(plugin->channel_mgr, ChannelId, data, (uint32) data_size); } return error; }
static int drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); DEBUG_DVC("ChannelId=%d", ChannelId); return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, s); }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); WLog_DBG(TAG, "process_data: Sp=%d cbChId=%d, ChannelId=%d", Sp, cbChId, ChannelId); return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, s); }
static int drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s) { uint32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); DEBUG_DVC("ChannelId=%d", ChannelId); return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, stream_get_tail(s), stream_get_left(s)); }
static int drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* data_in, int in_length) { int pos; uint32 ChannelId; ChannelId = drdynvc_read_variable_uint(data_in, cbChId); pos = stream_get_pos(data_in); DEBUG_DVC("ChannelId=%d", ChannelId); return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, stream_get_tail(data_in), in_length - pos); }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT32 ChannelId; if (Stream_GetRemainingLength(s) < drdynvc_cblen_to_bytes(cbChId)) return ERROR_INVALID_DATA; ChannelId = drdynvc_read_variable_uint(s, cbChId); WLog_Print(drdynvc->log, WLOG_TRACE, "process_data: Sp=%d cbChId=%d, ChannelId=%"PRIu32"", Sp, cbChId, ChannelId); return dvcman_receive_channel_data(drdynvc, drdynvc->channel_mgr, ChannelId, s); }
static int drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s) { uint32 ChannelId; uint32 Length; int error; ChannelId = drdynvc_read_variable_uint(s, cbChId); Length = drdynvc_read_variable_uint(s, Sp); DEBUG_DVC("ChannelId=%d Length=%d", ChannelId, Length); error = dvcman_receive_channel_data_first(drdynvc->channel_mgr, ChannelId, Length); if (error) return error; return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, stream_get_tail(s), stream_get_left(s)); }
static int drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { int status; UINT32 Length; UINT32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); Length = drdynvc_read_variable_uint(s, Sp); DEBUG_DVC("ChannelId=%d Length=%d", ChannelId, Length); status = dvcman_receive_channel_data_first(drdynvc->channel_mgr, ChannelId, Length); if (status) return status; return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, s); }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT status; UINT32 Length; UINT32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); Length = drdynvc_read_variable_uint(s, Sp); WLog_DBG(TAG, "process_data_first: Sp=%d cbChId=%d, ChannelId=%d Length=%d", Sp, cbChId, ChannelId, Length); status = dvcman_receive_channel_data_first(drdynvc->channel_mgr, ChannelId, Length); if (status) return status; return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, s); }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT status; UINT32 Length; UINT32 ChannelId; if (Stream_GetRemainingLength(s) < drdynvc_cblen_to_bytes(cbChId) + drdynvc_cblen_to_bytes(Sp)) return ERROR_INVALID_DATA; ChannelId = drdynvc_read_variable_uint(s, cbChId); Length = drdynvc_read_variable_uint(s, Sp); WLog_Print(drdynvc->log, WLOG_DEBUG, "process_data_first: Sp=%d cbChId=%d, ChannelId=%"PRIu32" Length=%"PRIu32"", Sp, cbChId, ChannelId, Length); status = dvcman_receive_channel_data_first(drdynvc, drdynvc->channel_mgr, ChannelId, Length); if (status) return status; return dvcman_receive_channel_data(drdynvc, drdynvc->channel_mgr, ChannelId, s); }