FreeRDP
libfreerdp/core/client.h
1 
20 #ifndef FREERDP_LIB_CORE_CLIENT_H
21 #define FREERDP_LIB_CORE_CLIENT_H
22 
23 #include <winpr/crt.h>
24 #include <winpr/stream.h>
25 #include <winpr/wtsapi.h>
26 
27 #include <freerdp/freerdp.h>
28 #include <freerdp/constants.h>
29 
30 #include <freerdp/svc.h>
31 #include <freerdp/peer.h>
32 #include <freerdp/addin.h>
33 #include <freerdp/api.h>
34 
35 #include <freerdp/client/channels.h>
36 #include <freerdp/client/drdynvc.h>
37 #include <freerdp/channels/channels.h>
38 
39 #ifndef CHANNEL_MAX_COUNT
40 #define CHANNEL_MAX_COUNT 30
41 #endif
42 
43 typedef struct
44 {
45  PVIRTUALCHANNELENTRY entry;
46  PVIRTUALCHANNELENTRYEX entryEx;
47  PCHANNEL_INIT_EVENT_FN pChannelInitEventProc;
48  PCHANNEL_INIT_EVENT_EX_FN pChannelInitEventProcEx;
49  void* pInitHandle;
50  void* lpUserParam;
52 
53 typedef struct
54 {
55  char name[CHANNEL_NAME_LEN + 1];
56  int OpenHandle;
57  int options;
58  int flags;
59  void* pInterface;
60  rdpChannels* channels;
61  void* lpUserParam;
62  PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc;
63  PCHANNEL_OPEN_EVENT_EX_FN pChannelOpenEventProcEx;
65 
66 typedef struct
67 {
68  void* Data;
69  UINT32 DataLength;
70  void* UserData;
71  CHANNEL_OPEN_DATA* pChannelOpenData;
73 
80 typedef struct
81 {
82  rdpChannels* channels;
83  void* pInterface;
85 
87 {
88  int clientDataCount;
89  CHANNEL_CLIENT_DATA clientDataList[CHANNEL_MAX_COUNT];
90 
91  int openDataCount;
92  CHANNEL_OPEN_DATA openDataList[CHANNEL_MAX_COUNT];
93 
94  int initDataCount;
95  CHANNEL_INIT_DATA initDataList[CHANNEL_MAX_COUNT];
96 
97  /* control for entry into MyVirtualChannelInit */
98  int can_call_init;
99 
100  /* true once freerdp_channels_post_connect is called */
101  BOOL connected;
102 
103  /* used for locating the channels for a given instance */
104  freerdp* instance;
105 
106  wMessageQueue* queue;
107 
108  DrdynvcClientContext* drdynvc;
109  CRITICAL_SECTION channelsLock;
110 
111  wHashTable* channelEvents;
112 };
113 
114 FREERDP_LOCAL void freerdp_channels_free(rdpChannels* channels);
115 
116 WINPR_ATTR_MALLOC(freerdp_channels_free, 1)
117 FREERDP_LOCAL rdpChannels* freerdp_channels_new(freerdp* instance);
118 
119 FREERDP_LOCAL UINT freerdp_channels_disconnect(rdpChannels* channels, freerdp* instance);
120 FREERDP_LOCAL void freerdp_channels_close(rdpChannels* channels, freerdp* instance);
121 
122 FREERDP_LOCAL void freerdp_channels_register_instance(rdpChannels* channels, freerdp* instance);
123 FREERDP_LOCAL UINT freerdp_channels_pre_connect(rdpChannels* channels, freerdp* instance);
124 FREERDP_LOCAL UINT freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance);
125 
127 FREERDP_LOCAL SSIZE_T freerdp_client_channel_get_registered_event_handles(rdpChannels* channels,
128  HANDLE* events,
129  DWORD count);
130 
131 #endif /* FREERDP_LIB_CORE_CLIENT_H */