2011-07-19 10:07:15 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-07-19 10:07:15 +04:00
|
|
|
* Dynamic Virtual Channel Manager
|
|
|
|
*
|
|
|
|
* Copyright 2010-2011 Vic Lee
|
|
|
|
*
|
|
|
|
* 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 __DVCMAN_H
|
|
|
|
#define __DVCMAN_H
|
|
|
|
|
|
|
|
#include <freerdp/dvc.h>
|
2012-11-20 07:31:15 +04:00
|
|
|
#include <freerdp/addin.h>
|
|
|
|
|
2013-05-14 00:07:42 +04:00
|
|
|
#include <winpr/collections.h>
|
|
|
|
|
2011-07-19 10:07:15 +04:00
|
|
|
#include "drdynvc_main.h"
|
|
|
|
|
2013-05-14 00:07:42 +04:00
|
|
|
#define MAX_PLUGINS 32
|
|
|
|
|
|
|
|
struct _DVCMAN
|
|
|
|
{
|
|
|
|
IWTSVirtualChannelManager iface;
|
|
|
|
|
|
|
|
drdynvcPlugin* drdynvc;
|
|
|
|
|
|
|
|
const char* plugin_names[MAX_PLUGINS];
|
|
|
|
IWTSPlugin* plugins[MAX_PLUGINS];
|
|
|
|
int num_plugins;
|
|
|
|
|
|
|
|
IWTSListener* listeners[MAX_PLUGINS];
|
|
|
|
int num_listeners;
|
|
|
|
|
|
|
|
wArrayList* channels;
|
|
|
|
};
|
|
|
|
typedef struct _DVCMAN DVCMAN;
|
|
|
|
|
|
|
|
struct _DVCMAN_LISTENER
|
|
|
|
{
|
|
|
|
IWTSListener iface;
|
|
|
|
|
|
|
|
DVCMAN* dvcman;
|
|
|
|
char* channel_name;
|
|
|
|
UINT32 flags;
|
|
|
|
IWTSListenerCallback* listener_callback;
|
|
|
|
};
|
|
|
|
typedef struct _DVCMAN_LISTENER DVCMAN_LISTENER;
|
|
|
|
|
|
|
|
struct _DVCMAN_ENTRY_POINTS
|
|
|
|
{
|
|
|
|
IDRDYNVC_ENTRY_POINTS iface;
|
|
|
|
|
|
|
|
DVCMAN* dvcman;
|
|
|
|
ADDIN_ARGV* args;
|
|
|
|
};
|
|
|
|
typedef struct _DVCMAN_ENTRY_POINTS DVCMAN_ENTRY_POINTS;
|
|
|
|
|
|
|
|
struct _DVCMAN_CHANNEL
|
|
|
|
{
|
|
|
|
IWTSVirtualChannel iface;
|
|
|
|
|
2013-05-20 23:23:54 +04:00
|
|
|
int status;
|
2013-05-14 00:07:42 +04:00
|
|
|
DVCMAN* dvcman;
|
2013-05-20 23:23:54 +04:00
|
|
|
void* pInterface;
|
2013-05-14 00:07:42 +04:00
|
|
|
UINT32 channel_id;
|
2013-05-20 23:23:54 +04:00
|
|
|
char* channel_name;
|
2013-05-14 00:07:42 +04:00
|
|
|
IWTSVirtualChannelCallback* channel_callback;
|
|
|
|
|
|
|
|
wStream* dvc_data;
|
|
|
|
HANDLE dvc_chan_mutex;
|
|
|
|
};
|
|
|
|
typedef struct _DVCMAN_CHANNEL DVCMAN_CHANNEL;
|
|
|
|
|
2011-07-19 10:07:15 +04:00
|
|
|
IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin);
|
2012-11-20 07:31:15 +04:00
|
|
|
int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args);
|
2011-07-19 10:07:15 +04:00
|
|
|
void dvcman_free(IWTSVirtualChannelManager* pChannelMgr);
|
|
|
|
int dvcman_init(IWTSVirtualChannelManager* pChannelMgr);
|
2012-10-09 11:26:39 +04:00
|
|
|
int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, const char* ChannelName);
|
|
|
|
int dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId);
|
|
|
|
int dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, UINT32 length);
|
|
|
|
int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, BYTE* data, UINT32 data_size);
|
2011-07-19 10:07:15 +04:00
|
|
|
|
2013-05-14 00:07:42 +04:00
|
|
|
void* dvcman_get_channel_interface_by_name(IWTSVirtualChannelManager* pChannelMgr, const char* ChannelName);
|
|
|
|
|
2011-07-19 10:07:15 +04:00
|
|
|
#endif
|
2012-10-03 00:54:14 +04:00
|
|
|
|