2
Copyright (c) 2010 Vic Lee
4
Permission is hereby granted, free of charge, to any person obtaining a
5
copy of this software and associated documentation files (the "Software"),
6
to deal in the Software without restriction, including without limitation
7
the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
and/or sell copies of the Software, and to permit persons to whom the
9
Software is furnished to do so, subject to the following conditions:
11
The above copyright notice and this permission notice shall be included
12
in all copies or substantial portions of the Software.
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
DEALINGS IN THE SOFTWARE.
25
DVC Plugin API: See the original MS DVC Client API:
26
http://msdn.microsoft.com/en-us/library/bb540880%28v=VS.85%29.aspx
28
The FreeRDP DVC Plugin API is a simulation of the MS DVC Client API in C.
29
The main difference is that every interface method must take an instance
30
pointer as the first parameter.
34
Implemented by DRDYNVC:
35
o IWTSVirtualChannelManager
39
Implemented by DVC plugin:
41
o IWTSListenerCallback
42
o IWTSVirtualChannelCallback
44
A basic DVC plugin implementation:
46
The plugin entry point, which creates and initializes a new IWTSPlugin
48
2. IWTSPlugin.Initialize:
49
Call IWTSVirtualChannelManager.CreateListener with a newly created
50
IWTSListenerCallback instance
51
3. IWTSListenerCallback.OnNewChannelConnection:
52
Create IWTSVirtualChannelCallback instance if the new channel is accepted
2
* FreeRDP: A Remote Desktop Protocol client.
3
* Dynamic Virtual Channel Interface
5
* Copyright 2010-2011 Vic Lee
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* You may obtain a copy of the License at
11
* http://www.apache.org/licenses/LICENSE-2.0
13
* Unless required by applicable law or agreed to in writing, software
14
* distributed under the License is distributed on an "AS IS" BASIS,
15
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
* See the License for the specific language governing permissions and
17
* limitations under the License.
21
* DVC Plugin API: See the original MS DVC Client API:
22
* http://msdn.microsoft.com/en-us/library/bb540880%28v=VS.85%29.aspx
24
* The FreeRDP DVC Plugin API is a simulation of the MS DVC Client API in C.
25
* The main difference is that every interface method must take an instance
26
* pointer as the first parameter.
30
* Implemented by DRDYNVC:
31
* o IWTSVirtualChannelManager
33
* o IWTSVirtualChannel
35
* Implemented by DVC plugin:
37
* o IWTSListenerCallback
38
* o IWTSVirtualChannelCallback
40
* A basic DVC plugin implementation:
42
* The plugin entry point, which creates and initializes a new IWTSPlugin
44
* 2. IWTSPlugin.Initialize:
45
* Call IWTSVirtualChannelManager.CreateListener with a newly created
46
* IWTSListenerCallback instance
47
* 3. IWTSListenerCallback.OnNewChannelConnection:
48
* Create IWTSVirtualChannelCallback instance if the new channel is accepted
55
51
#ifndef __FREERDP_DVC_H
56
52
#define __FREERDP_DVC_H
54
#include <freerdp/types.h>
58
56
typedef struct _IWTSVirtualChannelManager IWTSVirtualChannelManager;
59
57
typedef struct _IWTSListener IWTSListener;
60
58
typedef struct _IWTSVirtualChannel IWTSVirtualChannel;
66
64
struct _IWTSListener
68
66
/* Retrieves the listener-specific configuration. */
69
int (*GetConfiguration) (IWTSListener * pListener,
70
void ** ppPropertyBag);
67
int (*GetConfiguration) (IWTSListener* pListener,
68
void** ppPropertyBag);
73
71
struct _IWTSVirtualChannel
75
73
/* Starts a write request on the channel. */
76
int (*Write) (IWTSVirtualChannel * pChannel,
74
int (*Write) (IWTSVirtualChannel* pChannel,
80
78
/* Closes the channel. */
81
int (*Close) (IWTSVirtualChannel * pChannel);
79
int (*Close) (IWTSVirtualChannel* pChannel);
84
82
struct _IWTSVirtualChannelManager
86
84
/* Returns an instance of a listener object that listens on a specific
87
85
endpoint, or creates a static channel. */
88
int (*CreateListener) (IWTSVirtualChannelManager * pChannelMgr,
89
const char * pszChannelName,
86
int (*CreateListener) (IWTSVirtualChannelManager* pChannelMgr,
87
const char* pszChannelName,
91
IWTSListenerCallback * pListenerCallback,
92
IWTSListener ** ppListener);
89
IWTSListenerCallback* pListenerCallback,
90
IWTSListener** ppListener);
91
/* Push a virtual channel event.
92
This is a FreeRDP extension to standard MS API. */
93
int (*PushEvent) (IWTSVirtualChannelManager* pChannelMgr,
97
/* Used for the first call that is made from the client to the plug-in. */
98
int (*Initialize) (IWTSPlugin * pPlugin,
99
IWTSVirtualChannelManager * pChannelMgr);
100
/* Notifies the plug-in that the Remote Desktop Connection (RDC) client
99
/* Used for the first call that is made from the client to the plug-in. */
100
int (*Initialize) (IWTSPlugin* pPlugin,
101
IWTSVirtualChannelManager* pChannelMgr);
102
/* Notifies the plug-in that the Remote Desktop Connection (RDC) client
101
103
has successfully connected to the Remote Desktop Session Host (RD
102
104
Session Host) server. */
103
int (*Connected) (IWTSPlugin * pPlugin);
105
int (*Connected) (IWTSPlugin* pPlugin);
104
106
/* Notifies the plug-in that the Remote Desktop Connection (RDC) client
105
107
has disconnected from the RD Session Host server. */
106
int (*Disconnected) (IWTSPlugin * pPlugin,
108
int (*Disconnected) (IWTSPlugin* pPlugin,
107
109
uint32 dwDisconnectCode);
108
110
/* Notifies the plug-in that the Remote Desktop Connection (RDC) client
109
111
has terminated. */
110
int (*Terminated) (IWTSPlugin * pPlugin);
112
int (*Terminated) (IWTSPlugin* pPlugin);
113
115
struct _IWTSListenerCallback
115
117
/* Accepts or denies a connection request for an incoming connection to
116
118
the associated listener. */
117
int (*OnNewChannelConnection) (IWTSListenerCallback * pListenerCallback,
118
IWTSVirtualChannel * pChannel,
121
IWTSVirtualChannelCallback ** ppCallback);
119
int (*OnNewChannelConnection) (IWTSListenerCallback* pListenerCallback,
120
IWTSVirtualChannel* pChannel,
123
IWTSVirtualChannelCallback** ppCallback);
124
126
struct _IWTSVirtualChannelCallback
126
128
/* Notifies the user about data that is being received. */
127
int (*OnDataReceived) (IWTSVirtualChannelCallback * pChannelCallback,
129
int (*OnDataReceived) (IWTSVirtualChannelCallback* pChannelCallback,
130
132
/* Notifies the user that the channel has been closed. */
131
int (*OnClose) (IWTSVirtualChannelCallback * pChannelCallback);
133
int (*OnClose) (IWTSVirtualChannelCallback* pChannelCallback);
134
136
/* The DVC Plugin entry points */
135
137
typedef struct _IDRDYNVC_ENTRY_POINTS IDRDYNVC_ENTRY_POINTS;
136
138
struct _IDRDYNVC_ENTRY_POINTS
138
int (*RegisterPlugin) (IDRDYNVC_ENTRY_POINTS * pEntryPoints,
139
IWTSPlugin * pPlugin);
140
int (*RegisterPlugin) (IDRDYNVC_ENTRY_POINTS* pEntryPoints,
141
const char* name, IWTSPlugin* pPlugin);
142
IWTSPlugin* (*GetPlugin) (IDRDYNVC_ENTRY_POINTS* pEntryPoints,
144
RDP_PLUGIN_DATA* (*GetPluginData) (IDRDYNVC_ENTRY_POINTS* pEntryPoints);
142
typedef int (*PDVC_PLUGIN_ENTRY) (IDRDYNVC_ENTRY_POINTS *);
147
typedef int (*PDVC_PLUGIN_ENTRY) (IDRDYNVC_ENTRY_POINTS*);