FreeRDP
channels/cliprdr.h
1 
20 #ifndef FREERDP_CHANNEL_CLIPRDR_H
21 #define FREERDP_CHANNEL_CLIPRDR_H
22 
23 #include <freerdp/api.h>
24 #include <freerdp/types.h>
25 #include <freerdp/utils/cliprdr_utils.h>
26 
27 #include <winpr/shell.h>
28 
33 #define CLIPRDR_CHANNEL_NAME "cliprdr"
34 #define CLIPRDR_SVC_CHANNEL_NAME "cliprdr"
35 
36 /* CLIPRDR_HEADER.msgType */
37 typedef enum
38 {
39  CB_MONITOR_READY = 0x0001,
40  CB_FORMAT_LIST = 0x0002,
41  CB_FORMAT_LIST_RESPONSE = 0x0003,
42  CB_FORMAT_DATA_REQUEST = 0x0004,
43  CB_FORMAT_DATA_RESPONSE = 0x0005,
44  CB_TEMP_DIRECTORY = 0x0006,
45  CB_CLIP_CAPS = 0x0007,
46  CB_FILECONTENTS_REQUEST = 0x0008,
47  CB_FILECONTENTS_RESPONSE = 0x0009,
48  CB_LOCK_CLIPDATA = 0x000A,
49  CB_UNLOCK_CLIPDATA = 0x000B
50 } CliprdrMsgType;
51 
52 /* CLIPRDR_HEADER.msgFlags */
53 #define CB_RESPONSE_OK 0x0001
54 #define CB_RESPONSE_FAIL 0x0002
55 #define CB_ASCII_NAMES 0x0004
56 
57 /* CLIPRDR_CAPS_SET.capabilitySetType */
58 #define CB_CAPSTYPE_GENERAL 0x0001
59 
60 /* CLIPRDR_GENERAL_CAPABILITY.lengthCapability */
61 #define CB_CAPSTYPE_GENERAL_LEN 12
62 
63 /* CLIPRDR_GENERAL_CAPABILITY.version */
64 #define CB_CAPS_VERSION_1 0x00000001
65 #define CB_CAPS_VERSION_2 0x00000002
66 
67 /* CLIPRDR_GENERAL_CAPABILITY.generalFlags */
68 #define CB_USE_LONG_FORMAT_NAMES 0x00000002
69 #define CB_STREAM_FILECLIP_ENABLED 0x00000004
70 #define CB_FILECLIP_NO_FILE_PATHS 0x00000008
71 #define CB_CAN_LOCK_CLIPDATA 0x00000010
72 #define CB_HUGE_FILE_SUPPORT_ENABLED 0x00000020
73 
74 /* File Contents Request Flags */
75 #define FILECONTENTS_SIZE 0x00000001
76 #define FILECONTENTS_RANGE 0x00000002
77 
78 #ifdef __cplusplus
79 extern "C"
80 {
81 #endif
82 
83  /* Special Clipboard Response Formats */
84 
85  typedef struct
86  {
87  UINT32 mappingMode;
88  UINT32 xExt;
89  UINT32 yExt;
90  UINT32 metaFileSize;
91  BYTE* metaFileData;
93 
94  /* Clipboard Messages */
95 
96  typedef struct
97  {
98  UINT16 msgType;
99  UINT16 msgFlags;
100  UINT32 dataLen;
101  } CLIPRDR_HEADER;
102 
103  typedef struct
104  {
105  UINT16 capabilitySetType;
106  UINT16 capabilitySetLength;
108 
109  typedef struct
110  {
111  UINT16 capabilitySetType;
112  UINT16 capabilitySetLength;
113 
114  UINT32 version;
115  UINT32 generalFlags;
117 
118  typedef struct
119  {
120  CLIPRDR_HEADER common;
121 
122  UINT32 cCapabilitiesSets;
123  CLIPRDR_CAPABILITY_SET* capabilitySets;
125 
126  typedef struct
127  {
128  CLIPRDR_HEADER common;
130 
131  typedef struct
132  {
133  CLIPRDR_HEADER common;
134 
135  char szTempDir[520];
137 
138  typedef struct
139  {
140  UINT32 formatId;
141  char* formatName;
142  } CLIPRDR_FORMAT;
143 
144  typedef struct
145  {
146  CLIPRDR_HEADER common;
147 
148  UINT32 numFormats;
149  CLIPRDR_FORMAT* formats;
151 
152  typedef struct
153  {
154  CLIPRDR_HEADER common;
156 
157  typedef struct
158  {
159  CLIPRDR_HEADER common;
160 
161  UINT32 clipDataId;
163 
164  typedef struct
165  {
166  CLIPRDR_HEADER common;
167 
168  UINT32 clipDataId;
170 
171  typedef struct
172  {
173  CLIPRDR_HEADER common;
174 
175  UINT32 requestedFormatId;
177 
178  typedef struct
179  {
180  CLIPRDR_HEADER common;
181 
182  const BYTE* requestedFormatData;
184 
185  typedef struct
186  {
187  CLIPRDR_HEADER common;
188 
189  UINT32 streamId;
190  UINT32 listIndex;
191  UINT32 dwFlags;
192  UINT32 nPositionLow;
193  UINT32 nPositionHigh;
194  UINT32 cbRequested;
195  BOOL haveClipDataId;
196  UINT32 clipDataId;
198 
199  typedef struct
200  {
201  CLIPRDR_HEADER common;
202 
203  UINT32 streamId;
204  UINT32 cbRequested;
205  const BYTE* requestedData;
207 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif /* FREERDP_CHANNEL_CLIPRDR_H */