FreeRDP
settings_types.h
1 
24 #ifndef FREERDP_SETTINGS_TYPES_H
25 #define FREERDP_SETTINGS_TYPES_H
26 
27 #include <winpr/timezone.h>
28 #include <winpr/wlog.h>
29 
30 #include <freerdp/api.h>
31 #include <freerdp/config.h>
32 #include <freerdp/types.h>
33 #include <freerdp/redirection.h>
34 
35 #include <freerdp/crypto/certificate.h>
36 #include <freerdp/crypto/privatekey.h>
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
47 /* Surface Commands Flags */
48 #define SURFCMDS_SET_SURFACE_BITS 0x00000002
49 #define SURFCMDS_FRAME_MARKER 0x00000010
50 #define SURFCMDS_STREAM_SURFACE_BITS 0x00000040
52 /* RAIL Support Level */
53 #define RAIL_LEVEL_SUPPORTED 0x00000001
54 #define RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED 0x00000002
55 #define RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED 0x00000004
56 #define RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED 0x00000008
57 #define RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED 0x00000010
58 #define RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED 0x00000020
59 #define RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED 0x00000040
60 #define RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED 0x00000080
61 
62 /* Performance Flags */
63 #define PERF_FLAG_NONE 0x00000000
64 #define PERF_DISABLE_WALLPAPER 0x00000001
65 #define PERF_DISABLE_FULLWINDOWDRAG 0x00000002
66 #define PERF_DISABLE_MENUANIMATIONS 0x00000004
67 #define PERF_DISABLE_THEMING 0x00000008
68 #define PERF_DISABLE_CURSOR_SHADOW 0x00000020
69 #define PERF_DISABLE_CURSORSETTINGS 0x00000040
70 #define PERF_ENABLE_FONT_SMOOTHING 0x00000080
71 #define PERF_ENABLE_DESKTOP_COMPOSITION 0x00000100
72 
73 /* Connection Types */
74 #define CONNECTION_TYPE_INVALID \
75  0x00
79 #define CONNECTION_TYPE_MODEM 0x01
80 #define CONNECTION_TYPE_BROADBAND_LOW 0x02
81 #define CONNECTION_TYPE_SATELLITE 0x03
82 #define CONNECTION_TYPE_BROADBAND_HIGH 0x04
83 #define CONNECTION_TYPE_WAN 0x05
84 #define CONNECTION_TYPE_LAN 0x06
85 #define CONNECTION_TYPE_AUTODETECT 0x07
86 
87 /* Client to Server (CS) data blocks */
88 #define CS_CORE 0xC001
89 #define CS_SECURITY 0xC002
90 #define CS_NET 0xC003
91 #define CS_CLUSTER 0xC004
92 #define CS_MONITOR 0xC005
93 #define CS_MCS_MSGCHANNEL 0xC006
94 #define CS_MONITOR_EX 0xC008
95 #define CS_UNUSED1 0xC00C
96 #define CS_MULTITRANSPORT 0xC00A
97 
98 /* Server to Client (SC) data blocks */
99 #define SC_CORE 0x0C01
100 #define SC_SECURITY 0x0C02
101 #define SC_NET 0x0C03
102 #define SC_MCS_MSGCHANNEL 0x0C04
103 #define SC_MULTITRANSPORT 0x0C08
104 
105  /* RDP versions, see
106  * [MS-RDPBCGR] 2.2.1.3.2 Client Core Data (TS_UD_CS_CORE)
107  * [MS-RDPBCGR] 2.2.1.4.2 Server Core Data (TS_UD_SC_CORE)
108  */
109  typedef enum
110  {
111  RDP_VERSION_4 = 0x00080001,
112  RDP_VERSION_5_PLUS = 0x00080004,
113  RDP_VERSION_10_0 = 0x00080005,
114  RDP_VERSION_10_1 = 0x00080006,
115  RDP_VERSION_10_2 = 0x00080007,
116  RDP_VERSION_10_3 = 0x00080008,
117  RDP_VERSION_10_4 = 0x00080009,
118  RDP_VERSION_10_5 = 0x0008000a,
119  RDP_VERSION_10_6 = 0x0008000b,
120  RDP_VERSION_10_7 = 0x0008000C,
121  RDP_VERSION_10_8 = 0x0008000D,
122  RDP_VERSION_10_9 = 0x0008000E,
123  RDP_VERSION_10_10 = 0x0008000F,
124  RDP_VERSION_10_11 = 0x00080010,
125  RDP_VERSION_10_12 = 0x00080011
126  } RDP_VERSION;
127 
128 /* Color depth */
129 #define RNS_UD_COLOR_4BPP 0xCA00
130 #define RNS_UD_COLOR_8BPP 0xCA01
131 #define RNS_UD_COLOR_16BPP_555 0xCA02
132 #define RNS_UD_COLOR_16BPP_565 0xCA03
133 #define RNS_UD_COLOR_24BPP 0xCA04
134 
135 /* Secure Access Sequence */
136 #define RNS_UD_SAS_DEL 0xAA03
137 
138 /* Supported Color Depths */
139 #define RNS_UD_24BPP_SUPPORT 0x0001
140 #define RNS_UD_16BPP_SUPPORT 0x0002
141 #define RNS_UD_15BPP_SUPPORT 0x0004
142 #define RNS_UD_32BPP_SUPPORT 0x0008
143 
144 /* Audio Mode */
145 #define AUDIO_MODE_REDIRECT 0 /* Bring to this computer */
146 #define AUDIO_MODE_PLAY_ON_SERVER 1 /* Leave at remote computer */
147 #define AUDIO_MODE_NONE 2 /* Do not play */
148 
149 /* Early Capability Flags (Client to Server) */
150 #define RNS_UD_CS_SUPPORT_ERRINFO_PDU 0x0001
151 #define RNS_UD_CS_WANT_32BPP_SESSION 0x0002
152 #define RNS_UD_CS_SUPPORT_STATUSINFO_PDU 0x0004
153 #define RNS_UD_CS_STRONG_ASYMMETRIC_KEYS 0x0008
154 #define RNS_UD_CS_RELATIVE_MOUSE_INPUT 0x0010
155 #define RNS_UD_CS_VALID_CONNECTION_TYPE 0x0020
156 #define RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU 0x0040
157 #define RNS_UD_CS_SUPPORT_NETCHAR_AUTODETECT 0x0080
158 #define RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL 0x0100
159 #define RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE 0x0200
160 #define RNS_UD_CS_SUPPORT_HEARTBEAT_PDU 0x0400
161 #define RNS_UD_CS_SUPPORT_SKIP_CHANNELJOIN 0x0800
162 
163 /* Early Capability Flags (Server to Client) */
164 #define RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V1 0x00000001
165 #define RNS_UD_SC_DYNAMIC_DST_SUPPORTED 0x00000002
166 #define RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V2 0x00000004
167 #define RNS_UD_SC_SKIP_CHANNELJOIN_SUPPORTED 0x00000008
168 
169 /* Cluster Information Flags */
170 #define REDIRECTION_SUPPORTED 0x00000001
171 #define REDIRECTED_SESSIONID_FIELD_VALID 0x00000002
172 #define REDIRECTED_SMARTCARD 0x00000040
173 
174 #define ServerSessionRedirectionVersionMask 0x0000003c
175 #define REDIRECTION_VERSION1 0x00
176 #define REDIRECTION_VERSION2 0x01
177 #define REDIRECTION_VERSION3 0x02
178 #define REDIRECTION_VERSION4 0x03
179 #define REDIRECTION_VERSION5 0x04
180 #define REDIRECTION_VERSION6 0x05
181 
182 #define MONITOR_PRIMARY 0x00000001
183 
184 /* Encryption Methods */
185 #define ENCRYPTION_METHOD_NONE 0x00000000
186 #define ENCRYPTION_METHOD_40BIT 0x00000001
187 #define ENCRYPTION_METHOD_128BIT 0x00000002
188 #define ENCRYPTION_METHOD_56BIT 0x00000008
189 #define ENCRYPTION_METHOD_FIPS 0x00000010
190 
191 /* Encryption Levels */
192 #define ENCRYPTION_LEVEL_NONE 0x00000000
193 #define ENCRYPTION_LEVEL_LOW 0x00000001
194 #define ENCRYPTION_LEVEL_CLIENT_COMPATIBLE 0x00000002
195 #define ENCRYPTION_LEVEL_HIGH 0x00000003
196 #define ENCRYPTION_LEVEL_FIPS 0x00000004
197 
198 /* Multitransport Types */
199 #define TRANSPORT_TYPE_UDP_FECR 0x00000001
200 #define TRANSPORT_TYPE_UDP_FECL 0x00000004
201 #define TRANSPORT_TYPE_UDP_PREFERRED 0x00000100
202 #define SOFTSYNC_TCP_TO_UDP 0x00000200
203 
204 /* Static Virtual Channel Options */
205 #define CHANNEL_OPTION_INITIALIZED 0x80000000
206 #define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000
207 #define CHANNEL_OPTION_ENCRYPT_SC 0x20000000
208 #define CHANNEL_OPTION_ENCRYPT_CS 0x10000000
209 #define CHANNEL_OPTION_PRI_HIGH 0x08000000
210 #define CHANNEL_OPTION_PRI_MED 0x04000000
211 #define CHANNEL_OPTION_PRI_LOW 0x02000000
212 #define CHANNEL_OPTION_COMPRESS_RDP 0x00800000
213 #define CHANNEL_OPTION_COMPRESS 0x00400000
214 #define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000
215 #define CHANNEL_REMOTE_CONTROL_PERSISTENT 0x00100000
216 
217 /* Virtual Channel Capability Flags */
218 #define VCCAPS_NO_COMPR 0x00000000
219 #define VCCAPS_COMPR_SC 0x00000001
220 #define VCCAPS_COMPR_CS_8K 0x00000002
221 
222 /* Large Pointer Support Flags */
223 #define LARGE_POINTER_FLAG_96x96 0x00000001
224 #define LARGE_POINTER_FLAG_384x384 0x00000002
225 
226 /* Auto Reconnect Version */
227 #define AUTO_RECONNECT_VERSION_1 0x00000001
228 
229 /* Cookie Lengths */
230 #define MSTSC_COOKIE_MAX_LENGTH 9
231 #define DEFAULT_COOKIE_MAX_LENGTH 0xFF
232 
233  /* General capability set */
234 #define TS_CAPS_PROTOCOLVERSION 0x200
236 /* Order Support */
237 #define NEG_DSTBLT_INDEX 0x00
238 #define NEG_PATBLT_INDEX 0x01
239 #define NEG_SCRBLT_INDEX 0x02
240 #define NEG_MEMBLT_INDEX 0x03
241 #define NEG_MEM3BLT_INDEX 0x04
242 #define NEG_ATEXTOUT_INDEX 0x05
243 #define NEG_AEXTTEXTOUT_INDEX 0x06 /* Must be ignored */
244 #define NEG_DRAWNINEGRID_INDEX 0x07 /* Must be ignored */
245 #define NEG_LINETO_INDEX 0x08
246 #define NEG_MULTI_DRAWNINEGRID_INDEX 0x09
247 #define NEG_OPAQUE_RECT_INDEX 0x0A /* Must be ignored */
248 #define NEG_SAVEBITMAP_INDEX 0x0B
249 #define NEG_WTEXTOUT_INDEX 0x0C /* Must be ignored */
250 #define NEG_MEMBLT_V2_INDEX 0x0D /* Must be ignored */
251 #define NEG_MEM3BLT_V2_INDEX 0x0E /* Must be ignored */
252 #define NEG_MULTIDSTBLT_INDEX 0x0F
253 #define NEG_MULTIPATBLT_INDEX 0x10
254 #define NEG_MULTISCRBLT_INDEX 0x11
255 #define NEG_MULTIOPAQUERECT_INDEX 0x12
256 #define NEG_FAST_INDEX_INDEX 0x13
257 #define NEG_POLYGON_SC_INDEX 0x14
258 #define NEG_POLYGON_CB_INDEX 0x15
259 #define NEG_POLYLINE_INDEX 0x16
260 #define NEG_UNUSED23_INDEX 0x17 /* Must be ignored */
261 #define NEG_FAST_GLYPH_INDEX 0x18
262 #define NEG_ELLIPSE_SC_INDEX 0x19
263 #define NEG_ELLIPSE_CB_INDEX 0x1A
264 #define NEG_GLYPH_INDEX_INDEX 0x1B
265 #define NEG_GLYPH_WEXTTEXTOUT_INDEX 0x1C /* Must be ignored */
266 #define NEG_GLYPH_WLONGTEXTOUT_INDEX 0x1D /* Must be ignored */
267 #define NEG_GLYPH_WLONGEXTTEXTOUT_INDEX 0x1E /* Must be ignored */
268 #define NEG_UNUSED31_INDEX 0x1F /* Must be ignored */
269 
270 /* Glyph Support Level */
271 #define GLYPH_SUPPORT_NONE 0x0000
272 #define GLYPH_SUPPORT_PARTIAL 0x0001
273 #define GLYPH_SUPPORT_FULL 0x0002
274 #define GLYPH_SUPPORT_ENCODE 0x0003
275 
276 /* Gateway Usage Method */
277 #define TSC_PROXY_MODE_NONE_DIRECT 0x0
278 #define TSC_PROXY_MODE_DIRECT 0x1
279 #define TSC_PROXY_MODE_DETECT 0x2
280 #define TSC_PROXY_MODE_DEFAULT 0x3
281 #define TSC_PROXY_MODE_NONE_DETECT 0x4
282 
283 /* Gateway Credentials Source */
284 #define TSC_PROXY_CREDS_MODE_USERPASS 0x0
285 #define TSC_PROXY_CREDS_MODE_SMARTCARD 0x1
286 #define TSC_PROXY_CREDS_MODE_ANY 0x2
287 
288 /* Keyboard Hook */
289 #define KEYBOARD_HOOK_LOCAL 0
290 #define KEYBOARD_HOOK_REMOTE 1
291 #define KEYBOARD_HOOK_FULLSCREEN_ONLY 2
292 
293  typedef struct
294  {
295  UINT32 Length;
296  LPWSTR Address;
298 
299 /* Logon Error Info */
300 #define LOGON_MSG_DISCONNECT_REFUSED 0xFFFFFFF9
301 #define LOGON_MSG_NO_PERMISSION 0xFFFFFFFA
302 #define LOGON_MSG_BUMP_OPTIONS 0xFFFFFFFB
303 #define LOGON_MSG_RECONNECT_OPTIONS 0xFFFFFFFC
304 #define LOGON_MSG_SESSION_TERMINATE 0xFFFFFFFD
305 #define LOGON_MSG_SESSION_CONTINUE 0xFFFFFFFE
306 
307 #define LOGON_FAILED_BAD_PASSWORD 0x00000000
308 #define LOGON_FAILED_UPDATE_PASSWORD 0x00000001
309 #define LOGON_FAILED_OTHER 0x00000002
310 #define LOGON_WARNING 0x00000003
311 
312 /* Server Status Info */
313 #define STATUS_FINDING_DESTINATION 0x00000401
314 #define STATUS_LOADING_DESTINATION 0x00000402
315 #define STATUS_BRINGING_SESSION_ONLINE 0x00000403
316 #define STATUS_REDIRECTING_TO_DESTINATION 0x00000404
317 #define STATUS_VM_LOADING 0x00000501
318 #define STATUS_VM_WAKING 0x00000502
319 #define STATUS_VM_BOOTING 0x00000503
320 
321 /* Compression Flags */
322 #define PACKET_COMPR_TYPE_8K 0x00
323 #define PACKET_COMPR_TYPE_64K 0x01
324 #define PACKET_COMPR_TYPE_RDP6 0x02
325 #define PACKET_COMPR_TYPE_RDP61 0x03
326 #define PACKET_COMPR_TYPE_RDP8 0x04
327 
328 /* Desktop Rotation Flags */
329 #define ORIENTATION_LANDSCAPE 0
330 #define ORIENTATION_PORTRAIT 90
331 #define ORIENTATION_LANDSCAPE_FLIPPED 180
332 #define ORIENTATION_PORTRAIT_FLIPPED 270
333 
334 /* Clipboard feature mask */
335 #define CLIPRDR_FLAG_LOCAL_TO_REMOTE 0x01
336 #define CLIPRDR_FLAG_LOCAL_TO_REMOTE_FILES 0x02
337 #define CLIPRDR_FLAG_REMOTE_TO_LOCAL 0x10
338 #define CLIPRDR_FLAG_REMOTE_TO_LOCAL_FILES 0x20
339 
340 #define CLIPRDR_FLAG_DEFAULT_MASK \
341  (CLIPRDR_FLAG_LOCAL_TO_REMOTE | CLIPRDR_FLAG_LOCAL_TO_REMOTE_FILES | \
342  CLIPRDR_FLAG_REMOTE_TO_LOCAL | CLIPRDR_FLAG_REMOTE_TO_LOCAL_FILES)
343 
344  /* ARC_CS_PRIVATE_PACKET */
345  typedef struct
346  {
347  UINT32 cbLen;
348  UINT32 version;
349  UINT32 logonId;
350  BYTE securityVerifier[16];
352 
353  /* ARC_SC_PRIVATE_PACKET */
354  typedef struct
355  {
356  UINT32 cbLen;
357  UINT32 version;
358  UINT32 logonId;
359  BYTE arcRandomBits[16];
361 
362  /* Channels */
363 
364  typedef struct
365  {
366  int argc;
367  char** argv;
368  } ADDIN_ARGV;
369 
370  /* Extensions */
371 
372  struct rdp_ext_set
373  {
374  char name[256]; /* plugin name or path */
375  void* data; /* plugin data */
376  };
377 
378  /* Bitmap Cache */
379 
380  typedef struct
381  {
382  UINT16 numEntries;
383  UINT16 maxSize;
385 
386  typedef struct
387  {
388  UINT32 numEntries;
389  BOOL persistent;
391 
392  /* Glyph Cache */
393 
394  typedef struct
395  {
396  UINT16 cacheEntries;
397  UINT16 cacheMaximumCellSize;
399 
400  /* Monitors */
401 
402  typedef struct
403  {
404  INT32 left;
405  INT32 top;
406  INT32 right;
407  INT32 bottom;
408  UINT32 flags;
409  } MONITOR_DEF;
410 
411  typedef struct
412  {
413  UINT32 physicalWidth;
414  UINT32 physicalHeight;
415  UINT32 orientation;
416  UINT32 desktopScaleFactor;
417  UINT32 deviceScaleFactor;
419 
420  typedef struct
421  {
422  INT32 x;
423  INT32 y;
424  INT32 width;
425  INT32 height;
426  UINT32 is_primary;
427  UINT32 orig_screen;
428  MONITOR_ATTRIBUTES attributes;
429  } rdpMonitor;
430 
431 /* Device Redirection */
432 #define RDPDR_DTYP_SERIAL 0x00000001
433 #define RDPDR_DTYP_PARALLEL 0x00000002
434 #define RDPDR_DTYP_PRINT 0x00000004
435 #define RDPDR_DTYP_FILESYSTEM 0x00000008
436 #define RDPDR_DTYP_SMARTCARD 0x00000020
437 
438  typedef struct
439  {
440  UINT32 Id;
441  UINT32 Type;
442  char* Name;
443  } RDPDR_DEVICE;
444 
445  typedef struct
446  {
447  RDPDR_DEVICE device;
448  char* Path;
449  BOOL automount;
450  } RDPDR_DRIVE;
451 
452  typedef struct
453  {
454  RDPDR_DEVICE device;
455  char* DriverName;
456  BOOL IsDefault;
457  } RDPDR_PRINTER;
458 
459  typedef struct
460  {
461  RDPDR_DEVICE device;
462  } RDPDR_SMARTCARD;
463 
464  typedef struct
465  {
466  RDPDR_DEVICE device;
467  char* Path;
468  char* Driver;
469  char* Permissive;
470  } RDPDR_SERIAL;
471 
472  typedef struct
473  {
474  RDPDR_DEVICE device;
475  char* Path;
476  } RDPDR_PARALLEL;
477 
478 #define PROXY_TYPE_NONE 0
479 #define PROXY_TYPE_HTTP 1
480 #define PROXY_TYPE_SOCKS 2
481 #define PROXY_TYPE_IGNORE 0xFFFF
482 
483 /* ThreadingFlags */
484 #define THREADING_FLAGS_DISABLE_THREADS 0x00000001
485 
486  enum rdp_settings_type
487  {
488  RDP_SETTINGS_TYPE_BOOL,
489  RDP_SETTINGS_TYPE_UINT16,
490  RDP_SETTINGS_TYPE_INT16,
491  RDP_SETTINGS_TYPE_UINT32,
492  RDP_SETTINGS_TYPE_INT32,
493  RDP_SETTINGS_TYPE_UINT64,
494  RDP_SETTINGS_TYPE_INT64,
495  RDP_SETTINGS_TYPE_STRING,
496  RDP_SETTINGS_TYPE_POINTER
497  };
498 
502 #define FREERDP_SETTINGS_SERVER_MODE 0x00000001
503 
504 #ifdef __cplusplus
505 }
506 #endif
507 
510 #endif /* FREERDP_SETTINGS_TYPES_H */