Respond to DYNVC_CLOSE like described in MS-RDPEDYC

This commit is contained in:
Giacomo Rombaut 2013-09-13 15:22:10 +02:00
parent 8baa04e7e5
commit 0729f3b780

View File

@ -284,11 +284,28 @@ static int drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStr
static int drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) static int drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s)
{ {
UINT32 ChannelId; UINT32 ChannelId;
wStream* data_out;
int value;
int error;
ChannelId = drdynvc_read_variable_uint(s, cbChId); ChannelId = drdynvc_read_variable_uint(s, cbChId);
DEBUG_DVC("ChannelId=%d", ChannelId); DEBUG_DVC("ChannelId=%d", ChannelId);
dvcman_close_channel(drdynvc->channel_mgr, ChannelId); dvcman_close_channel(drdynvc->channel_mgr, ChannelId);
data_out = Stream_New(NULL, 4);
value = (CLOSE_REQUEST_PDU << 4) | (cbChId & 0x02);
Stream_Write_UINT8(data_out, value);
drdynvc_write_variable_uint(data_out, ChannelId);
error = svc_plugin_send((rdpSvcPlugin*) drdynvc, data_out);
if (error != CHANNEL_RC_OK)
{
DEBUG_WARN("VirtualChannelWrite failed %d", error);
return 1;
}
drdynvc->channel_error = error;
return 0; return 0;
} }