FreeRDP
dvc.h
1 
53 #ifndef FREERDP_DVC_H
54 #define FREERDP_DVC_H
55 
56 #include <freerdp/types.h>
57 #include <freerdp/addin.h>
58 #include <freerdp/settings.h>
59 
60 #ifdef __cplusplus
61 extern "C"
62 {
63 #endif
64 
65  typedef struct s_IWTSVirtualChannelManager IWTSVirtualChannelManager;
66  typedef struct s_IWTSListener IWTSListener;
67  typedef struct s_IWTSVirtualChannel IWTSVirtualChannel;
68 
69  typedef struct s_IWTSPlugin IWTSPlugin;
70  typedef struct s_IWTSListenerCallback IWTSListenerCallback;
71  typedef struct s_IWTSVirtualChannelCallback IWTSVirtualChannelCallback;
72 
74  {
75  /* Retrieves the listener-specific configuration. */
76  UINT (*GetConfiguration)(IWTSListener* pListener, void** ppPropertyBag);
77 
78  void* pInterface;
79  };
80 
82  {
83  /* Starts a write request on the channel. */
84  UINT(*Write)
85  (IWTSVirtualChannel* pChannel, ULONG cbSize, const BYTE* pBuffer, void* pReserved);
86  /* Closes the channel. */
87  UINT (*Close)(IWTSVirtualChannel* pChannel);
88  };
89 
91  {
92  /* Returns an instance of a listener object that listens on a specific
93  endpoint, or creates a static channel. */
94  UINT(*CreateListener)
95  (IWTSVirtualChannelManager* pChannelMgr, const char* pszChannelName, ULONG ulFlags,
96  IWTSListenerCallback* pListenerCallback, IWTSListener** ppListener);
97  /* Find the channel or ID to send data to a specific endpoint. */
98  UINT32 (*GetChannelId)(IWTSVirtualChannel* channel);
99  IWTSVirtualChannel* (*FindChannelById)(IWTSVirtualChannelManager* pChannelMgr,
100  UINT32 ChannelId);
101  const char* (*GetChannelName)(IWTSVirtualChannel* channel);
102  UINT (*DestroyListener)(IWTSVirtualChannelManager* pChannelMgr, IWTSListener* ppListener);
103  };
104 
106  {
107  /* Used for the first call that is made from the client to the plug-in. */
108  UINT (*Initialize)(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr);
109  /* Notifies the plug-in that the Remote Desktop Connection (RDC) client
110  has successfully connected to the Remote Desktop Session Host (RD
111  Session Host) server. */
112  UINT (*Connected)(IWTSPlugin* pPlugin);
113  /* Notifies the plug-in that the Remote Desktop Connection (RDC) client
114  has disconnected from the RD Session Host server. */
115  UINT (*Disconnected)(IWTSPlugin* pPlugin, DWORD dwDisconnectCode);
116  /* Notifies the plug-in that the Remote Desktop Connection (RDC) client
117  has terminated. */
118  UINT (*Terminated)(IWTSPlugin* pPlugin);
119 
120  UINT (*Attached)(IWTSPlugin* pPlugin);
121 
122  UINT (*Detached)(IWTSPlugin* pPlugin);
123 
124  /* Extended */
125 
126  void* pInterface;
127  };
128 
130  {
131  /* Accepts or denies a connection request for an incoming connection to
132  the associated listener. */
133  UINT(*OnNewChannelConnection)
134  (IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data,
135  BOOL* pbAccept, IWTSVirtualChannelCallback** ppCallback);
136 
137  void* pInterface;
138  };
139 
141  {
142  UINT(*OnDataReceived)
143  (IWTSVirtualChannelCallback* pChannelCallback,
145  UINT(*OnOpen)
146  (IWTSVirtualChannelCallback*
148  UINT(*OnClose)
149  (IWTSVirtualChannelCallback*
152  void* pInterface;
153  };
154 
155  /* The DVC Plugin entry points */
156  typedef struct rdp_context rdpContext; /* forward declaration, necessary to avoid
157  * circular includes */
158 
159  typedef struct S_IDRDYNVC_ENTRY_POINTS IDRDYNVC_ENTRY_POINTS;
161  {
162  UINT(*RegisterPlugin)
163  (IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name, IWTSPlugin* pPlugin);
164  IWTSPlugin* (*GetPlugin)(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name);
165  const ADDIN_ARGV* (*GetPluginData)(IDRDYNVC_ENTRY_POINTS* pEntryPoints);
166  rdpSettings* (*GetRdpSettings)(IDRDYNVC_ENTRY_POINTS* pEntryPoints);
167  rdpContext* (*GetRdpContext)(IDRDYNVC_ENTRY_POINTS* pEntryPoints);
168  };
169 
170  typedef UINT(VCAPITYPE* PDVC_PLUGIN_ENTRY)(IDRDYNVC_ENTRY_POINTS*);
171 
172  void* get_callback_by_name(const char* name, void** context);
173  void add_callback_by_name(const char* name, void* fkt, void* context);
174  void remove_callback_by_name(const char* name, void* context);
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif /* FREERDP_DVC_H */
Definition: dvc.h:161
IWTSVirtualChannelCallback wStream * data
Definition: dvc.h:144
IWTSVirtualChannelCallback * pChannelCallback
Definition: dvc.h:143