2011-12-12 10:12:16 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2012-10-16 01:03:34 +04:00
|
|
|
* Server Channels
|
2011-12-12 10:12:16 +04:00
|
|
|
*
|
|
|
|
* Copyright 2011-2012 Vic Lee
|
2012-10-16 01:03:34 +04:00
|
|
|
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2011-12-12 10:12:16 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WTSVC_H
|
|
|
|
#define __WTSVC_H
|
|
|
|
|
|
|
|
#include <freerdp/freerdp.h>
|
2011-12-12 17:07:23 +04:00
|
|
|
#include <freerdp/utils/stream.h>
|
2011-12-12 10:12:16 +04:00
|
|
|
#include <freerdp/utils/list.h>
|
2012-06-25 12:41:59 +04:00
|
|
|
#include <freerdp/utils/debug.h>
|
2011-12-12 12:42:42 +04:00
|
|
|
#include <freerdp/utils/wait_obj.h>
|
2011-12-12 10:12:16 +04:00
|
|
|
#include <freerdp/channels/wtsvc.h>
|
|
|
|
|
2012-09-19 01:33:52 +04:00
|
|
|
#include <winpr/synch.h>
|
|
|
|
|
2012-06-25 12:41:59 +04:00
|
|
|
#ifdef WITH_DEBUG_DVC
|
|
|
|
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
|
2011-12-12 10:12:16 +04:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
RDP_PEER_CHANNEL_TYPE_SVC = 0,
|
2012-06-24 19:35:32 +04:00
|
|
|
RDP_PEER_CHANNEL_TYPE_DVC = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
DRDYNVC_STATE_NONE = 0,
|
|
|
|
DRDYNVC_STATE_INITIALIZED = 1,
|
|
|
|
DRDYNVC_STATE_READY = 2
|
2011-12-12 10:12:16 +04:00
|
|
|
};
|
|
|
|
|
2012-06-25 12:41:59 +04:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
DVC_OPEN_STATE_NONE = 0,
|
|
|
|
DVC_OPEN_STATE_SUCCEEDED = 1,
|
|
|
|
DVC_OPEN_STATE_FAILED = 2,
|
|
|
|
DVC_OPEN_STATE_CLOSED = 3
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct rdp_peer_channel rdpPeerChannel;
|
|
|
|
struct rdp_peer_channel
|
2011-12-12 10:12:16 +04:00
|
|
|
{
|
2011-12-12 12:42:42 +04:00
|
|
|
WTSVirtualChannelManager* vcm;
|
2011-12-12 10:12:16 +04:00
|
|
|
freerdp_peer* client;
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 channel_id;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16 channel_type;
|
|
|
|
UINT16 index;
|
2011-12-12 17:07:23 +04:00
|
|
|
|
|
|
|
STREAM* receive_data;
|
|
|
|
struct wait_obj* receive_event;
|
|
|
|
LIST* receive_queue;
|
2012-09-19 01:33:52 +04:00
|
|
|
HANDLE mutex;
|
2012-06-25 12:41:59 +04:00
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE dvc_open_state;
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 dvc_total_length;
|
2012-06-25 12:41:59 +04:00
|
|
|
};
|
2011-12-12 10:12:16 +04:00
|
|
|
|
2011-12-12 12:42:42 +04:00
|
|
|
struct WTSVirtualChannelManager
|
|
|
|
{
|
|
|
|
freerdp_peer* client;
|
|
|
|
struct wait_obj* send_event;
|
|
|
|
LIST* send_queue;
|
2012-09-19 01:33:52 +04:00
|
|
|
HANDLE mutex;
|
2011-12-12 17:07:23 +04:00
|
|
|
|
|
|
|
rdpPeerChannel* drdynvc_channel;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE drdynvc_state;
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 dvc_channel_id_seq;
|
2012-06-25 12:41:59 +04:00
|
|
|
LIST* dvc_channel_list;
|
2011-12-12 12:42:42 +04:00
|
|
|
};
|
|
|
|
|
2011-12-12 10:12:16 +04:00
|
|
|
#endif /* __WTSVC_H */
|