1 | /* $Id: SharedClipboard-uri.h 79350 2019-06-26 09:27:21Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Shared Clipboard - Shared URI functions between host and guest.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef VBOX_INCLUDED_GuestHost_SharedClipboard_uri_h
|
---|
28 | #define VBOX_INCLUDED_GuestHost_SharedClipboard_uri_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <map>
|
---|
34 |
|
---|
35 | #include <iprt/assert.h>
|
---|
36 | #include <iprt/critsect.h>
|
---|
37 | #include <iprt/fs.h>
|
---|
38 | #include <iprt/list.h>
|
---|
39 |
|
---|
40 | #include <iprt/cpp/list.h>
|
---|
41 | #include <iprt/cpp/ministring.h>
|
---|
42 |
|
---|
43 | #include <VBox/GuestHost/SharedClipboard.h>
|
---|
44 | #include <VBox/HostServices/VBoxClipboardSvc.h>
|
---|
45 |
|
---|
46 | /** Clipboard area ID. A valid area is >= 1.
|
---|
47 | * If 0 is specified, the last (most recent) area is meant.
|
---|
48 | * Set to UINT32_MAX if not initialized. */
|
---|
49 | typedef uint32_t SHAREDCLIPBOARDAREAID;
|
---|
50 |
|
---|
51 | /** Defines a non-initialized (nil) clipboard area. */
|
---|
52 | #define NIL_SHAREDCLIPBOARDAREAID UINT32_MAX
|
---|
53 |
|
---|
54 | /** SharedClipboardArea open flags. */
|
---|
55 | typedef uint32_t SHAREDCLIPBOARDAREAOPENFLAGS;
|
---|
56 |
|
---|
57 | /** No clipboard area open flags specified. */
|
---|
58 | #define SHAREDCLIPBOARDAREA_OPEN_FLAGS_NONE 0
|
---|
59 | /** The clipboard area must not exist yet. */
|
---|
60 | #define SHAREDCLIPBOARDAREA_OPEN_FLAGS_MUST_NOT_EXIST RT_BIT(0)
|
---|
61 | /** Mask of all valid clipboard area open flags. */
|
---|
62 | #define SHAREDCLIPBOARDAREA_OPEN_FLAGS_VALID_MASK 0x1
|
---|
63 |
|
---|
64 | /** SharedClipboardURIObject flags. */
|
---|
65 | typedef uint32_t SHAREDCLIPBOARDURIOBJECTFLAGS;
|
---|
66 |
|
---|
67 | /** No flags specified. */
|
---|
68 | #define SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE 0
|
---|
69 |
|
---|
70 | /** Mask of all valid Shared Clipboard URI object flags. */
|
---|
71 | #define SHAREDCLIPBOARDURIOBJECT_FLAGS_VALID_MASK UINT32_C(0x0)
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Class for handling Shared Clipboard URI objects.
|
---|
75 | * This class abstracts the access and handling objects when performing Shared Clipboard actions.
|
---|
76 | */
|
---|
77 | class SharedClipboardURIObject
|
---|
78 | {
|
---|
79 | public:
|
---|
80 |
|
---|
81 | /**
|
---|
82 | * Enumeration for specifying an URI object type.
|
---|
83 | */
|
---|
84 | enum Type
|
---|
85 | {
|
---|
86 | /** Unknown type, do not use. */
|
---|
87 | Type_Unknown = 0,
|
---|
88 | /** Object is a file. */
|
---|
89 | Type_File,
|
---|
90 | /** Object is a directory. */
|
---|
91 | Type_Directory,
|
---|
92 | /** The usual 32-bit hack. */
|
---|
93 | Type_32Bit_Hack = 0x7fffffff
|
---|
94 | };
|
---|
95 |
|
---|
96 | enum Storage
|
---|
97 | {
|
---|
98 | Storage_Unknown = 0,
|
---|
99 | Storage_Local,
|
---|
100 | Storage_Temporary,
|
---|
101 | /** The usual 32-bit hack. */
|
---|
102 | Storage_32Bit_Hack = 0x7fffffff
|
---|
103 | };
|
---|
104 |
|
---|
105 | /**
|
---|
106 | * Enumeration for specifying an URI object view
|
---|
107 | * for representing its data accordingly.
|
---|
108 | */
|
---|
109 | enum View
|
---|
110 | {
|
---|
111 | /** Unknown view, do not use. */
|
---|
112 | View_Unknown = 0,
|
---|
113 | /** Handle data from the source point of view. */
|
---|
114 | View_Source,
|
---|
115 | /** Handle data from the destination point of view. */
|
---|
116 | View_Target,
|
---|
117 | /** The usual 32-bit hack. */
|
---|
118 | View_Dest_32Bit_Hack = 0x7fffffff
|
---|
119 | };
|
---|
120 |
|
---|
121 | SharedClipboardURIObject(void);
|
---|
122 | SharedClipboardURIObject(Type type, const RTCString &strSrcPathAbs = "", const RTCString &strDstPathAbs = "");
|
---|
123 | virtual ~SharedClipboardURIObject(void);
|
---|
124 |
|
---|
125 | public:
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * Returns the given absolute source path of the object.
|
---|
129 | *
|
---|
130 | * @return Absolute source path of the object.
|
---|
131 | */
|
---|
132 | const RTCString &GetSourcePathAbs(void) const { return m_strSrcPathAbs; }
|
---|
133 |
|
---|
134 | /**
|
---|
135 | * Returns the given, absolute destination path of the object.
|
---|
136 | *
|
---|
137 | * @return Absolute destination path of the object.
|
---|
138 | */
|
---|
139 | const RTCString &GetDestPathAbs(void) const { return m_strTgtPathAbs; }
|
---|
140 |
|
---|
141 | RTFMODE GetMode(void) const;
|
---|
142 |
|
---|
143 | uint64_t GetProcessed(void) const;
|
---|
144 |
|
---|
145 | uint64_t GetSize(void) const;
|
---|
146 |
|
---|
147 | /**
|
---|
148 | * Returns the object's type.
|
---|
149 | *
|
---|
150 | * @return The object's type.
|
---|
151 | */
|
---|
152 | Type GetType(void) const { return m_enmType; }
|
---|
153 |
|
---|
154 | /**
|
---|
155 | * Returns the object's view.
|
---|
156 | *
|
---|
157 | * @return The object's view.
|
---|
158 | */
|
---|
159 | View GetView(void) const { return m_enmView; }
|
---|
160 |
|
---|
161 | public:
|
---|
162 |
|
---|
163 | int SetSize(uint64_t cbSize);
|
---|
164 |
|
---|
165 | public:
|
---|
166 |
|
---|
167 | void Close(void);
|
---|
168 | bool IsComplete(void) const;
|
---|
169 | bool IsOpen(void) const;
|
---|
170 | int OpenDirectory(View enmView, uint32_t fCreate = 0, RTFMODE fMode = 0);
|
---|
171 | int OpenDirectoryEx(const RTCString &strPathAbs, View enmView,
|
---|
172 | uint32_t fCreate = 0, RTFMODE fMode = 0,
|
---|
173 | SHAREDCLIPBOARDURIOBJECTFLAGS fFlags = SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE);
|
---|
174 | int OpenFile(View enmView, uint64_t fOpen = 0, RTFMODE fMode = 0);
|
---|
175 | int OpenFileEx(const RTCString &strPathAbs, View enmView,
|
---|
176 | uint64_t fOpen = 0, RTFMODE fMode = 0,
|
---|
177 | SHAREDCLIPBOARDURIOBJECTFLAGS fFlags = SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE);
|
---|
178 | int QueryInfo(View enmView);
|
---|
179 | int Read(void *pvBuf, size_t cbBuf, uint32_t *pcbRead);
|
---|
180 | void Reset(void);
|
---|
181 | int SetDirectoryData(const RTCString &strPathAbs, View enmView, uint32_t fOpen = 0, RTFMODE fMode = 0,
|
---|
182 | SHAREDCLIPBOARDURIOBJECTFLAGS fFlags = SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE);
|
---|
183 | int SetFileData(const RTCString &strPathAbs, View enmView, uint64_t fOpen = 0, RTFMODE fMode = 0,
|
---|
184 | SHAREDCLIPBOARDURIOBJECTFLAGS fFlags = SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE);
|
---|
185 | int Write(const void *pvBuf, size_t cbBuf, uint32_t *pcbWritten);
|
---|
186 |
|
---|
187 | public:
|
---|
188 |
|
---|
189 | static int RebaseURIPath(RTCString &strPath, const RTCString &strBaseOld = "", const RTCString &strBaseNew = "");
|
---|
190 |
|
---|
191 | protected:
|
---|
192 |
|
---|
193 | void closeInternal(void);
|
---|
194 | int setDirectoryDataInternal(const RTCString &strPathAbs, View enmView, uint32_t fCreate = 0, RTFMODE fMode = 0,
|
---|
195 | SHAREDCLIPBOARDURIOBJECTFLAGS fFlags = SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE);
|
---|
196 | int setFileDataInternal(const RTCString &strPathAbs, View enmView, uint64_t fOpen = 0, RTFMODE fMode = 0,
|
---|
197 | SHAREDCLIPBOARDURIOBJECTFLAGS fFlags = SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE);
|
---|
198 | int queryInfoInternal(View enmView);
|
---|
199 |
|
---|
200 | protected:
|
---|
201 |
|
---|
202 | /** The object's type. */
|
---|
203 | Type m_enmType;
|
---|
204 | /** The object's view. */
|
---|
205 | View m_enmView;
|
---|
206 | /** Where the object is being stored to. */
|
---|
207 | Storage m_enmStorage;
|
---|
208 | /** Absolute path (base) for the source. */
|
---|
209 | RTCString m_strSrcPathAbs;
|
---|
210 | /** Absolute path (base) for the target. */
|
---|
211 | RTCString m_strTgtPathAbs;
|
---|
212 | /** Saved SHAREDCLIPBOARDURIOBJECT_FLAGS. */
|
---|
213 | uint32_t m_fFlags;
|
---|
214 | /** Requested file mode.
|
---|
215 | * Note: The actual file mode of an opened file will be in objInfo. */
|
---|
216 | RTFMODE m_fModeRequested;
|
---|
217 |
|
---|
218 | /** Union containing data depending on the object's type. */
|
---|
219 | union
|
---|
220 | {
|
---|
221 | /** Structure containing members for objects that
|
---|
222 | * are files. */
|
---|
223 | struct
|
---|
224 | {
|
---|
225 | /** File handle. */
|
---|
226 | RTFILE hFile;
|
---|
227 | /** File system object information of this file. */
|
---|
228 | RTFSOBJINFO objInfo;
|
---|
229 | /** Requested file open flags. */
|
---|
230 | uint32_t fOpenRequested;
|
---|
231 | /** Bytes to proces for reading/writing. */
|
---|
232 | uint64_t cbToProcess;
|
---|
233 | /** Bytes processed reading/writing. */
|
---|
234 | uint64_t cbProcessed;
|
---|
235 | } File;
|
---|
236 | struct
|
---|
237 | {
|
---|
238 | /** Directory handle. */
|
---|
239 | RTDIR hDir;
|
---|
240 | /** File system object information of this directory. */
|
---|
241 | RTFSOBJINFO objInfo;
|
---|
242 | /** Requested directory creation flags. */
|
---|
243 | uint32_t fCreateRequested;
|
---|
244 | } Dir;
|
---|
245 | } u;
|
---|
246 | };
|
---|
247 |
|
---|
248 | /**
|
---|
249 | * Enumeration for specifying a clipboard area object type.
|
---|
250 | */
|
---|
251 | typedef enum _SHAREDCLIPBOARDAREAOBJTYPE
|
---|
252 | {
|
---|
253 | /** Unknown object type; do not use. */
|
---|
254 | SHAREDCLIPBOARDAREAOBJTYPE_UNKNOWN = 0,
|
---|
255 | /** Object is a directory. */
|
---|
256 | SHAREDCLIPBOARDAREAOBJTYPE_DIR,
|
---|
257 | /** Object is a file. */
|
---|
258 | SHAREDCLIPBOARDAREAOBJTYPE_FILE,
|
---|
259 | /** The usual 32-bit hack. */
|
---|
260 | SHAREDCLIPBOARDAREAOBJTYPE__32Bit_Hack = 0x7fffffff
|
---|
261 | } SHAREDCLIPBOARDAREAOBJTYPE;
|
---|
262 |
|
---|
263 | /** Defines a clipboard area object state. */
|
---|
264 | typedef uint32_t SHAREDCLIPBOARDAREAOBJSTATE;
|
---|
265 |
|
---|
266 | /** No object state set. */
|
---|
267 | #define SHAREDCLIPBOARDAREAOBJSTATE_NONE 0
|
---|
268 | /** The object is considered as being complete (e.g. serialized). */
|
---|
269 | #define SHAREDCLIPBOARDAREAOBJSTATE_COMPLETE RT_BIT(0)
|
---|
270 |
|
---|
271 | /**
|
---|
272 | * Lightweight structure to keep a clipboard area object's state.
|
---|
273 | *
|
---|
274 | * Note: We don't want to use the ClipboardURIObject class here, as this
|
---|
275 | * is too heavy for this purpose.
|
---|
276 | */
|
---|
277 | typedef struct _SHAREDCLIPBOARDAREAOBJ
|
---|
278 | {
|
---|
279 | SHAREDCLIPBOARDAREAOBJTYPE enmType;
|
---|
280 | SHAREDCLIPBOARDAREAOBJSTATE fState;
|
---|
281 | } SHAREDCLIPBOARDAREAOBJ, *PSHAREDCLIPBOARDAREAOBJ;
|
---|
282 |
|
---|
283 | /**
|
---|
284 | * Class for maintaining a Shared Clipboard area
|
---|
285 | * on the host or guest. This will contain all received files & directories
|
---|
286 | * for a single Shared Clipboard operation.
|
---|
287 | *
|
---|
288 | * In case of a failed Shared Clipboard operation this class can also
|
---|
289 | * perform a gentle rollback if required.
|
---|
290 | */
|
---|
291 | class SharedClipboardArea
|
---|
292 | {
|
---|
293 | public:
|
---|
294 |
|
---|
295 | SharedClipboardArea(void);
|
---|
296 | SharedClipboardArea(const char *pszPath, SHAREDCLIPBOARDAREAID uID = NIL_SHAREDCLIPBOARDAREAID,
|
---|
297 | SHAREDCLIPBOARDAREAOPENFLAGS fFlags = SHAREDCLIPBOARDAREA_OPEN_FLAGS_NONE);
|
---|
298 | virtual ~SharedClipboardArea(void);
|
---|
299 |
|
---|
300 | public:
|
---|
301 |
|
---|
302 | uint32_t AddRef(void);
|
---|
303 | uint32_t Release(void);
|
---|
304 |
|
---|
305 | int Lock(void);
|
---|
306 | int Unlock(void);
|
---|
307 |
|
---|
308 | int AddObject(const char *pszPath, const SHAREDCLIPBOARDAREAOBJ &Obj);
|
---|
309 | int GetObject(const char *pszPath, PSHAREDCLIPBOARDAREAOBJ pObj);
|
---|
310 |
|
---|
311 | int Close(void);
|
---|
312 | bool IsOpen(void) const;
|
---|
313 | int OpenEx(const char *pszPath, SHAREDCLIPBOARDAREAID uID = NIL_SHAREDCLIPBOARDAREAID,
|
---|
314 | SHAREDCLIPBOARDAREAOPENFLAGS fFlags = SHAREDCLIPBOARDAREA_OPEN_FLAGS_NONE);
|
---|
315 | int OpenTemp(SHAREDCLIPBOARDAREAID uID = NIL_SHAREDCLIPBOARDAREAID,
|
---|
316 | SHAREDCLIPBOARDAREAOPENFLAGS fFlags = SHAREDCLIPBOARDAREA_OPEN_FLAGS_NONE);
|
---|
317 | SHAREDCLIPBOARDAREAID GetID(void) const;
|
---|
318 | const char *GetDirAbs(void) const;
|
---|
319 | uint32_t GetRefCount(void);
|
---|
320 | int Reopen(void);
|
---|
321 | int Reset(bool fDeleteContent);
|
---|
322 | int Rollback(void);
|
---|
323 |
|
---|
324 | public:
|
---|
325 |
|
---|
326 | static int PathConstruct(const char *pszBase, SHAREDCLIPBOARDAREAID uID, char *pszPath, size_t cbPath);
|
---|
327 |
|
---|
328 | protected:
|
---|
329 |
|
---|
330 | int initInternal(void);
|
---|
331 | int destroyInternal(void);
|
---|
332 | int closeInternal(void);
|
---|
333 |
|
---|
334 | protected:
|
---|
335 |
|
---|
336 | typedef std::map<RTCString, SHAREDCLIPBOARDAREAOBJ> SharedClipboardAreaFsObjMap;
|
---|
337 |
|
---|
338 | /** Creation timestamp (in ms). */
|
---|
339 | uint64_t m_tsCreatedMs;
|
---|
340 | /** Number of references to this instance. */
|
---|
341 | volatile uint32_t m_cRefs;
|
---|
342 | /** Critical section for serializing access. */
|
---|
343 | RTCRITSECT m_CritSect;
|
---|
344 | /** Open flags. */
|
---|
345 | uint32_t m_fOpen;
|
---|
346 | /** Directory handle for root clipboard directory. */
|
---|
347 | RTDIR m_hDir;
|
---|
348 | /** Absolute path to root clipboard directory. */
|
---|
349 | RTCString m_strPathAbs;
|
---|
350 | /** List for holding created directories in the case of a rollback. */
|
---|
351 | SharedClipboardAreaFsObjMap m_mapObj;
|
---|
352 | /** Associated clipboard area ID. */
|
---|
353 | SHAREDCLIPBOARDAREAID m_uID;
|
---|
354 | };
|
---|
355 |
|
---|
356 | int SharedClipboardPathSanitizeFilename(char *pszPath, size_t cbPath);
|
---|
357 | int SharedClipboardPathSanitize(char *pszPath, size_t cbPath);
|
---|
358 |
|
---|
359 | /** SharedClipboardURIList flags. */
|
---|
360 | typedef uint32_t SHAREDCLIPBOARDURILISTFLAGS;
|
---|
361 |
|
---|
362 | /** No flags specified. */
|
---|
363 | #define SHAREDCLIPBOARDURILIST_FLAGS_NONE 0
|
---|
364 | /** Keep the original paths, don't convert paths to relative ones. */
|
---|
365 | #define SHAREDCLIPBOARDURILIST_FLAGS_ABSOLUTE_PATHS RT_BIT(0)
|
---|
366 | /** Resolve all symlinks. */
|
---|
367 | #define SHAREDCLIPBOARDURILIST_FLAGS_RESOLVE_SYMLINKS RT_BIT(1)
|
---|
368 | /** Keep the files + directory entries open while
|
---|
369 | * being in this list. */
|
---|
370 | #define SHAREDCLIPBOARDURILIST_FLAGS_KEEP_OPEN RT_BIT(2)
|
---|
371 | /** Lazy loading: Only enumerate sub directories when needed.
|
---|
372 | ** @todo Implement lazy loading. */
|
---|
373 | #define SHAREDCLIPBOARDURILIST_FLAGS_LAZY RT_BIT(3)
|
---|
374 |
|
---|
375 | /** Mask of all valid Shared Clipboard URI list flags. */
|
---|
376 | #define SHAREDCLIPBOARDURILIST_FLAGS_VALID_MASK UINT32_C(0xF)
|
---|
377 |
|
---|
378 | class SharedClipboardURIList
|
---|
379 | {
|
---|
380 | public:
|
---|
381 |
|
---|
382 | SharedClipboardURIList(void);
|
---|
383 | virtual ~SharedClipboardURIList(void);
|
---|
384 |
|
---|
385 | public:
|
---|
386 |
|
---|
387 | int AppendNativePath(const char *pszPath, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
388 | int AppendNativePathsFromList(const char *pszNativePaths, size_t cbNativePaths, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
389 | int AppendNativePathsFromList(const RTCList<RTCString> &lstNativePaths, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
390 | int AppendURIObject(SharedClipboardURIObject *pObject);
|
---|
391 | int AppendURIPath(const char *pszURI, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
392 | int AppendURIPathsFromList(const char *pszURIPaths, size_t cbURIPaths, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
393 | int AppendURIPathsFromList(const RTCList<RTCString> &lstURI, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
394 |
|
---|
395 | void Clear(void);
|
---|
396 | SharedClipboardURIObject *At(size_t i) const { return m_lstTree.at(i); }
|
---|
397 | SharedClipboardURIObject *First(void) const { return m_lstTree.first(); }
|
---|
398 | bool IsEmpty(void) const { return m_lstTree.isEmpty(); }
|
---|
399 | void RemoveFirst(void);
|
---|
400 | int SetFromURIData(const void *pvData, size_t cbData, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
401 |
|
---|
402 | RTCString GetRootEntries(const RTCString &strPathBase = "", const RTCString &strSeparator = "\r\n") const;
|
---|
403 | uint64_t GetRootCount(void) const { return m_lstRoot.size(); }
|
---|
404 | uint64_t GetTotalCount(void) const { return m_cTotal; }
|
---|
405 | uint64_t GetTotalBytes(void) const { return m_cbTotal; }
|
---|
406 |
|
---|
407 | protected:
|
---|
408 |
|
---|
409 | int appendEntry(const char *pcszSource, const char *pcszTarget, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
410 | int appendObject(SharedClipboardURIObject *pObject);
|
---|
411 | int appendPathRecursive(const char *pcszSrcPath, const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase, SHAREDCLIPBOARDURILISTFLAGS fFlags);
|
---|
412 |
|
---|
413 | protected:
|
---|
414 |
|
---|
415 | /** List of all top-level file/directory entries.
|
---|
416 | * Note: All paths are kept internally as UNIX paths for
|
---|
417 | * easier conversion/handling! */
|
---|
418 | RTCList<RTCString> m_lstRoot;
|
---|
419 | /** List of all URI objects added. The list's content
|
---|
420 | * might vary depending on how the objects are being
|
---|
421 | * added (lazy or not). */
|
---|
422 | RTCList<SharedClipboardURIObject *> m_lstTree;
|
---|
423 | /** Total number of all URI objects. */
|
---|
424 | uint64_t m_cTotal;
|
---|
425 | /** Total size of all URI objects, that is, the file
|
---|
426 | * size of all objects (in bytes).
|
---|
427 | * Note: Do *not* size_t here, as we also want to support large files
|
---|
428 | * on 32-bit guests. */
|
---|
429 | uint64_t m_cbTotal;
|
---|
430 | };
|
---|
431 |
|
---|
432 | int SharedClipboardURIDataHdrAlloc(PVBOXCLIPBOARDDATAHDR *ppDataHdr);
|
---|
433 | void SharedClipboardURIDataHdrFree(PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
434 | PVBOXCLIPBOARDDATAHDR SharedClipboardURIDataHdrDup(PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
435 | uint32_t SharedClipboardURIDataHdrGetMetaDataSize(PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
436 | int SharedClipboardURIDataHdrInit(PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
437 | void SharedClipboardURIDataHdrDestroy(PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
438 | void SharedClipboardURIDataHdrFree(PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
439 | void SharedClipboardURIDataHdrReset(PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
440 | bool SharedClipboardURIDataHdrIsValid(PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
441 |
|
---|
442 | int SharedClipboardURIDataChunkAlloc(PVBOXCLIPBOARDDATACHUNK *ppDataChunk);
|
---|
443 | void SharedClipboardURIDataChunkFree(PVBOXCLIPBOARDDATACHUNK pDataChunk);
|
---|
444 | PVBOXCLIPBOARDDATACHUNK SharedClipboardURIDataChunkDup(PVBOXCLIPBOARDDATACHUNK pDataChunk);
|
---|
445 | int SharedClipboardURIDataChunkInit(PVBOXCLIPBOARDDATACHUNK pDataChunk);
|
---|
446 | void SharedClipboardURIDataChunkDestroy(PVBOXCLIPBOARDDATACHUNK pDataChunk);
|
---|
447 | bool SharedClipboardURIDataChunkIsValid(PVBOXCLIPBOARDDATACHUNK pDataChunk);
|
---|
448 |
|
---|
449 | int SharedClipboardURIDirDataAlloc(PVBOXCLIPBOARDDIRDATA *ppDirData);
|
---|
450 | void SharedClipboardURIDirDataFree(PVBOXCLIPBOARDDIRDATA pDirData);
|
---|
451 | int SharedClipboardURIDirDataInit(PVBOXCLIPBOARDDIRDATA pDirData);
|
---|
452 | void SharedClipboardURIDirDataDestroy(PVBOXCLIPBOARDDIRDATA pDirData);
|
---|
453 | PVBOXCLIPBOARDDIRDATA SharedClipboardURIDirDataDup(PVBOXCLIPBOARDDIRDATA pDirData);
|
---|
454 | bool SharedClipboardURIDirDataIsValid(PVBOXCLIPBOARDDIRDATA pDirData);
|
---|
455 |
|
---|
456 | int SharedClipboardURIFileHdrInit(PVBOXCLIPBOARDFILEHDR pFileHdr);
|
---|
457 | void SharedClipboardURIFileHdrDestroy(PVBOXCLIPBOARDFILEHDR pFileHdr);
|
---|
458 | void SharedClipboardURIFileHdrFree(PVBOXCLIPBOARDFILEHDR pFileHdr);
|
---|
459 | PVBOXCLIPBOARDFILEHDR SharedClipboardURIFileHdrDup(PVBOXCLIPBOARDFILEHDR pFileHdr);
|
---|
460 | bool SharedClipboardURIFileHdrIsValid(PVBOXCLIPBOARDFILEHDR pFileHdr, PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
461 |
|
---|
462 | void SharedClipboardURIFileDataDestroy(PVBOXCLIPBOARDFILEDATA pFileData);
|
---|
463 | PVBOXCLIPBOARDFILEDATA SharedClipboardURIFileDataDup(PVBOXCLIPBOARDFILEDATA pFileData);
|
---|
464 | bool SharedClipboardURIFileDataIsValid(PVBOXCLIPBOARDFILEDATA pFileData, PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
465 |
|
---|
466 | /** Specifies a meta data format. */
|
---|
467 | typedef uint32_t SHAREDCLIPBOARDMETADATAFMT;
|
---|
468 |
|
---|
469 | /**
|
---|
470 | * Enumeration of meta data formats.
|
---|
471 | */
|
---|
472 | typedef enum _SHAREDCLIPBOARDMETADATAFMTENUM
|
---|
473 | {
|
---|
474 | /** Unknown meta data format; do not use. */
|
---|
475 | SHAREDCLIPBOARDMETADATAFMT_UNKNOWN = 0,
|
---|
476 | /** Meta data is an URI list.
|
---|
477 | * UTF-8 format with Unix path separators. Each URI entry is separated by "\r\n". */
|
---|
478 | SHAREDCLIPBOARDMETADATAFMT_URI_LIST = 1
|
---|
479 | } SHAREDCLIPBOARDMETADATAFMTENUM;
|
---|
480 |
|
---|
481 | /**
|
---|
482 | * Structure for maintaining meta data format data.
|
---|
483 | */
|
---|
484 | typedef struct _SHAREDCLIPBOARDMETADATAFMTDATA
|
---|
485 | {
|
---|
486 | /** Meta data format version. */
|
---|
487 | uint32_t uVer;
|
---|
488 | /** Actual meta data format data. */
|
---|
489 | void *pvFmt;
|
---|
490 | /** Size of meta data format data (in bytes). */
|
---|
491 | uint32_t cbFmt;
|
---|
492 | } SHAREDCLIPBOARDMETADATAFMTDATA, *PSHAREDCLIPBOARDMETADATAFMTDATA;
|
---|
493 |
|
---|
494 | /**
|
---|
495 | * Structure for keeping Shared Clipboard meta data.
|
---|
496 | * The actual format of the meta data depends on the format set in enmFmt.
|
---|
497 | */
|
---|
498 | typedef struct _SHAREDCLIPBOARDMETADATA
|
---|
499 | {
|
---|
500 | /** Format of the data. */
|
---|
501 | SHAREDCLIPBOARDMETADATAFMT enmFmt;
|
---|
502 | /** Actual meta data block. */
|
---|
503 | void *pvMeta;
|
---|
504 | /** Total size (in bytes) of the allocated meta data block .*/
|
---|
505 | uint32_t cbMeta;
|
---|
506 | /** How many bytes are being used in the meta data block. */
|
---|
507 | uint32_t cbUsed;
|
---|
508 | /** Current reading offset (in bytes). */
|
---|
509 | uint32_t cbOffRead;
|
---|
510 | } SHAREDCLIPBOARDMETADATA, *PSHAREDCLIPBOARDMETADATA;
|
---|
511 |
|
---|
512 | int SharedClipboardMetaDataInit(PSHAREDCLIPBOARDMETADATA pMeta, SHAREDCLIPBOARDMETADATAFMT enmFmt);
|
---|
513 | void SharedClipboardMetaDataDestroy(PSHAREDCLIPBOARDMETADATA pMeta);
|
---|
514 | void SharedClipboardMetaDataFree(PSHAREDCLIPBOARDMETADATA pMeta);
|
---|
515 | int SharedClipboardMetaDataAdd(PSHAREDCLIPBOARDMETADATA pMeta, const void *pvDataAdd, uint32_t cbDataAdd);
|
---|
516 | int SharedClipboardMetaDataConvertToFormat(const void *pvData, size_t cbData, SHAREDCLIPBOARDMETADATAFMT enmFmt,
|
---|
517 | void **ppvData, uint32_t *pcbData);
|
---|
518 | int SharedClipboardMetaDataRead(PSHAREDCLIPBOARDMETADATA pMeta, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead);
|
---|
519 | int SharedClipboardMetaDataResize(PSHAREDCLIPBOARDMETADATA pMeta, uint32_t cbNewSize);
|
---|
520 | size_t SharedClipboardMetaDataGetFree(PSHAREDCLIPBOARDMETADATA pMeta);
|
---|
521 | size_t SharedClipboardMetaDataGetUsed(PSHAREDCLIPBOARDMETADATA pMeta);
|
---|
522 | size_t SharedClipboardMetaDataGetSize(PSHAREDCLIPBOARDMETADATA pMeta);
|
---|
523 | void *SharedClipboardMetaDataMutableRaw(PSHAREDCLIPBOARDMETADATA pMeta);
|
---|
524 | const void *SharedClipboardMetaDataRaw(PSHAREDCLIPBOARDMETADATA pMeta);
|
---|
525 |
|
---|
526 | /**
|
---|
527 | * Enumeration specifying an URI transfer direction.
|
---|
528 | */
|
---|
529 | typedef enum _SHAREDCLIPBOARDURITRANSFERDIR
|
---|
530 | {
|
---|
531 | /** Unknown transfer directory. */
|
---|
532 | SHAREDCLIPBOARDURITRANSFERDIR_UNKNOWN = 0,
|
---|
533 | /** Read transfer (from source). */
|
---|
534 | SHAREDCLIPBOARDURITRANSFERDIR_READ,
|
---|
535 | /** Write transfer (to target). */
|
---|
536 | SHAREDCLIPBOARDURITRANSFERDIR_WRITE,
|
---|
537 | /** The usual 32-bit hack. */
|
---|
538 | SHAREDCLIPBOARDURITRANSFERDIR__32BIT_HACK = 0x7fffffff
|
---|
539 | } SHAREDCLIPBOARDURITRANSFERDIR;
|
---|
540 |
|
---|
541 | struct _SHAREDCLIPBOARDURITRANSFER;
|
---|
542 | typedef struct _SHAREDCLIPBOARDURITRANSFER SHAREDCLIPBOARDURITRANSFER;
|
---|
543 |
|
---|
544 | /**
|
---|
545 | * Structure for handling a single URI object context.
|
---|
546 | */
|
---|
547 | typedef struct _SHAREDCLIPBOARDCLIENTURIOBJCTX
|
---|
548 | {
|
---|
549 | SHAREDCLIPBOARDURITRANSFER *pTransfer;
|
---|
550 | /** Pointer to current object being processed. */
|
---|
551 | SharedClipboardURIObject *pObj;
|
---|
552 | } SHAREDCLIPBOARDCLIENTURIOBJCTX, *PSHAREDCLIPBOARDCLIENTURIOBJCTX;
|
---|
553 |
|
---|
554 | /**
|
---|
555 | * Enumeration specifying an URI transfer status.
|
---|
556 | */
|
---|
557 | typedef enum _SHAREDCLIPBOARDURITRANSFERSTATUS
|
---|
558 | {
|
---|
559 | /** No status set. */
|
---|
560 | SHAREDCLIPBOARDURITRANSFERSTATUS_NONE = 0,
|
---|
561 | /** The transfer has been announced but is not running yet. */
|
---|
562 | SHAREDCLIPBOARDURITRANSFERSTATUS_ANNOUNCED,
|
---|
563 | /** The transfer is active and running. */
|
---|
564 | SHAREDCLIPBOARDURITRANSFERSTATUS_RUNNING
|
---|
565 | } SHAREDCLIPBOARDURITRANSFERSTATUS;
|
---|
566 |
|
---|
567 | /**
|
---|
568 | * Structure for maintaining an URI transfer state.
|
---|
569 | * Everything in here will be part of a saved state (later).
|
---|
570 | */
|
---|
571 | typedef struct _SHAREDCLIPBOARDURITRANSFERSTATE
|
---|
572 | {
|
---|
573 | /** The transfer's current status. */
|
---|
574 | SHAREDCLIPBOARDURITRANSFERSTATUS enmStatus;
|
---|
575 | /** The transfer's direction. */
|
---|
576 | SHAREDCLIPBOARDURITRANSFERDIR enmDir;
|
---|
577 | /** The transfer's source. */
|
---|
578 | SHAREDCLIPBOARDSOURCE enmSource;
|
---|
579 | bool fHostMsgSendHeader;
|
---|
580 | /** The transfer's cached data header.
|
---|
581 | * Can be NULL if no header has been received yet. */
|
---|
582 | PVBOXCLIPBOARDDATAHDR pHeader;
|
---|
583 | bool fHostMsgSendMetaDataHdr;
|
---|
584 | bool fHostMsgSendMetaDataChunk;
|
---|
585 | /** The transfer's cached meta data.
|
---|
586 | * Can be NULL if no meta data has been received yet. */
|
---|
587 | PSHAREDCLIPBOARDMETADATA pMeta;
|
---|
588 | /** Context of current object being handled. */
|
---|
589 | SHAREDCLIPBOARDCLIENTURIOBJCTX ObjCtx;
|
---|
590 | } SHAREDCLIPBOARDURITRANSFERSTATE, *PSHAREDCLIPBOARDURITRANSFERSTATE;
|
---|
591 |
|
---|
592 | struct _SHAREDCLIPBOARDURITRANSFER;
|
---|
593 | typedef struct _SHAREDCLIPBOARDURITRANSFER *PSHAREDCLIPBOARDURITRANSFER;
|
---|
594 |
|
---|
595 | typedef struct _SHAREDCLIPBOARDPROVIDERCTX
|
---|
596 | {
|
---|
597 | PSHAREDCLIPBOARDURITRANSFER pTransfer;
|
---|
598 | void *pvUser;
|
---|
599 | } SHAREDCLIPBOARDPROVIDERCTX, *PSHAREDCLIPBOARDPROVIDERCTX;
|
---|
600 |
|
---|
601 | #define SHAREDCLIPBOARDPROVIDERFUNCDECL(a_Name, ...) \
|
---|
602 | typedef DECLCALLBACK(int) RT_CONCAT(FNSHAREDCLIPBOARDPROVIDER, a_Name)(PSHAREDCLIPBOARDPROVIDERCTX, __VA_ARGS__); \
|
---|
603 | typedef RT_CONCAT(FNSHAREDCLIPBOARDPROVIDER, a_Name) RT_CONCAT(*PFNSHAREDCLIPBOARDPROVIDER, a_Name);
|
---|
604 |
|
---|
605 | #define SHAREDCLIPBOARDPROVIDERFUNCDECLVOID(a_Name) \
|
---|
606 | typedef DECLCALLBACK(int) RT_CONCAT(FNSHAREDCLIPBOARDPROVIDER, a_Name)(PSHAREDCLIPBOARDPROVIDERCTX); \
|
---|
607 | typedef RT_CONCAT(FNSHAREDCLIPBOARDPROVIDER, a_Name) RT_CONCAT(*PFNSHAREDCLIPBOARDPROVIDER, a_Name);
|
---|
608 |
|
---|
609 | #define SHAREDCLIPBOARDPROVIDERFUNCMEMBER(a_Name, a_Member) \
|
---|
610 | RT_CONCAT(PFNSHAREDCLIPBOARDPROVIDER, a_Name) a_Member;
|
---|
611 |
|
---|
612 | SHAREDCLIPBOARDPROVIDERFUNCDECLVOID(PREPARE)
|
---|
613 | SHAREDCLIPBOARDPROVIDERFUNCDECL(READDATAHDR, PVBOXCLIPBOARDDATAHDR *ppDataHdr)
|
---|
614 | SHAREDCLIPBOARDPROVIDERFUNCDECL(WRITEDATAHDR, const PVBOXCLIPBOARDDATAHDR pDataHdr)
|
---|
615 | SHAREDCLIPBOARDPROVIDERFUNCDECL(READDATACHUNK, const PVBOXCLIPBOARDDATAHDR pDataHdr, void *pvChunk, uint32_t cbChunk, uint32_t fFlags, uint32_t *pcbRead)
|
---|
616 | SHAREDCLIPBOARDPROVIDERFUNCDECL(WRITEDATACHUNK, const PVBOXCLIPBOARDDATAHDR pDataHdr, const void *pvChunk, uint32_t cbChunk, uint32_t fFlags, uint32_t *pcbWritten)
|
---|
617 | SHAREDCLIPBOARDPROVIDERFUNCDECL(READOBJHDR, PVBOXCLIPBOARDOBJHDR *ppObjHdr)
|
---|
618 | SHAREDCLIPBOARDPROVIDERFUNCDECL(READDIRECTORY, PVBOXCLIPBOARDDIRDATA *ppDirData)
|
---|
619 | SHAREDCLIPBOARDPROVIDERFUNCDECL(WRITEDIRECTORY, const PVBOXCLIPBOARDDIRDATA pDirData)
|
---|
620 | SHAREDCLIPBOARDPROVIDERFUNCDECL(READFILEHDR, PVBOXCLIPBOARDFILEHDR *ppFileHdr);
|
---|
621 | SHAREDCLIPBOARDPROVIDERFUNCDECL(WRITEFILEHDR, const PVBOXCLIPBOARDFILEHDR pFileHdr);
|
---|
622 | SHAREDCLIPBOARDPROVIDERFUNCDECL(READFILEDATA, void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead)
|
---|
623 | SHAREDCLIPBOARDPROVIDERFUNCDECL(WRITEFILEDATA, void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten)
|
---|
624 | SHAREDCLIPBOARDPROVIDERFUNCDECLVOID(RESET)
|
---|
625 |
|
---|
626 | typedef struct _SHAREDCLIPBOARDPROVIDERINTERFACE
|
---|
627 | {
|
---|
628 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(PREPARE, pfnPrepare);
|
---|
629 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(READDATAHDR, pfnReadDataHdr);
|
---|
630 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(WRITEDATAHDR, pfnWriteDataHdr);
|
---|
631 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(WRITEDATACHUNK, pfnWriteDataChunk);
|
---|
632 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(READDATACHUNK, pfnReadDataChunk);
|
---|
633 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(READOBJHDR, pfnReadObjHdr);
|
---|
634 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(READDIRECTORY, pfnReadDirectory);
|
---|
635 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(WRITEDIRECTORY, pfnWriteDirectory);
|
---|
636 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(READFILEHDR, pfnReadFileHdr);
|
---|
637 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(WRITEFILEHDR, pfnWriteFileHdr);
|
---|
638 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(READFILEDATA, pfnReadFileData);
|
---|
639 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(WRITEFILEDATA, pfnWriteFileData);
|
---|
640 | SHAREDCLIPBOARDPROVIDERFUNCMEMBER(RESET, pfnReset);
|
---|
641 | } SHAREDCLIPBOARDPROVIDERINTERFACE, *PSHAREDCLIPBOARDPROVIDERINTERFACE;
|
---|
642 |
|
---|
643 | /**
|
---|
644 | * Structure for the Shared Clipboard provider creation context.
|
---|
645 | */
|
---|
646 | typedef struct _SHAREDCLIPBOARDPROVIDERCREATIONCTX
|
---|
647 | {
|
---|
648 | /** Specifies what the source of the provider is. */
|
---|
649 | SHAREDCLIPBOARDSOURCE enmSource;
|
---|
650 | SHAREDCLIPBOARDPROVIDERINTERFACE Interface;
|
---|
651 | void *pvUser;
|
---|
652 | union
|
---|
653 | {
|
---|
654 | struct
|
---|
655 | {
|
---|
656 | /** HGCM client ID to use. */
|
---|
657 | uint32_t uClientID;
|
---|
658 | } VbglR3;
|
---|
659 | struct
|
---|
660 | {
|
---|
661 | SharedClipboardArea *pArea;
|
---|
662 | } HostService;
|
---|
663 | } u;
|
---|
664 | } SHAREDCLIPBOARDPROVIDERCREATIONCTX, *PSHAREDCLIPBOARDPROVIDERCREATIONCTX;
|
---|
665 |
|
---|
666 | /**
|
---|
667 | * Structure for read parameters.
|
---|
668 | */
|
---|
669 | typedef struct _SHAREDCLIPBOARDPROVIDERREADPARMS
|
---|
670 | {
|
---|
671 | union
|
---|
672 | {
|
---|
673 | struct
|
---|
674 | {
|
---|
675 | } HostService;
|
---|
676 | } u;
|
---|
677 | } SHAREDCLIPBOARDPROVIDERREADPARMS, *PSHAREDCLIPBOARDPROVIDERREADPARMS;
|
---|
678 |
|
---|
679 | /**
|
---|
680 | * Structure for write parameters.
|
---|
681 | */
|
---|
682 | typedef struct _SHAREDCLIPBOARDPROVIDERWRITEPARMS
|
---|
683 | {
|
---|
684 | union
|
---|
685 | {
|
---|
686 | struct
|
---|
687 | {
|
---|
688 | uint32_t uMsg;
|
---|
689 | uint32_t cParms;
|
---|
690 | VBOXHGCMSVCPARM *paParms;
|
---|
691 | } HostService;
|
---|
692 | } u;
|
---|
693 | } SHAREDCLIPBOARDPROVIDERWRITEPARMS, *PSHAREDCLIPBOARDPROVIDERWRITEPARMS;
|
---|
694 |
|
---|
695 | #if 0
|
---|
696 | /**
|
---|
697 | * Interface class acting as a lightweight proxy for abstracting reading / writing clipboard data.
|
---|
698 | *
|
---|
699 | * This is needed because various implementations can run on the host *or* on the guest side,
|
---|
700 | * requiring different methods for handling the actual data.
|
---|
701 | */
|
---|
702 | class SharedClipboardProvider
|
---|
703 | {
|
---|
704 |
|
---|
705 | public:
|
---|
706 |
|
---|
707 | static SharedClipboardProvider *Create(PSHAREDCLIPBOARDPROVIDERCREATIONCTX pCtx);
|
---|
708 |
|
---|
709 | virtual ~SharedClipboardProvider(void);
|
---|
710 |
|
---|
711 | public:
|
---|
712 |
|
---|
713 | uint32_t AddRef(void);
|
---|
714 | uint32_t Release(void);
|
---|
715 |
|
---|
716 | public:
|
---|
717 |
|
---|
718 | void SetCallbacks(PSHAREDCLIPBOARDPROVIDERCALLBACKS pCallbacks);
|
---|
719 |
|
---|
720 | public: /* Interface to be implemented. */
|
---|
721 |
|
---|
722 | virtual int Prepare(void);
|
---|
723 |
|
---|
724 | virtual int ReadDataHdr(PVBOXCLIPBOARDDATAHDR *ppDataHdr);
|
---|
725 | virtual int WriteDataHdr(const PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
726 |
|
---|
727 | virtual int ReadDataChunk(const PVBOXCLIPBOARDDATAHDR pDataHdr, void *pvChunk, uint32_t cbChunk, uint32_t fFlags = 0,
|
---|
728 | uint32_t *pcbRead = NULL);
|
---|
729 | virtual int WriteDataChunk(const PVBOXCLIPBOARDDATAHDR pDataHdr, const void *pvChunk, uint32_t cbChunk, uint32_t fFlags = 0,
|
---|
730 | uint32_t *pcbWritten = NULL);
|
---|
731 |
|
---|
732 | virtual int ReadDirectory(PVBOXCLIPBOARDDIRDATA *ppDirData);
|
---|
733 | virtual int WriteDirectory(const PVBOXCLIPBOARDDIRDATA pDirData);
|
---|
734 |
|
---|
735 | virtual int ReadFileHdr(PVBOXCLIPBOARDFILEHDR *ppFileHdr);
|
---|
736 | virtual int WriteFileHdr(const PVBOXCLIPBOARDFILEHDR pFileHdr);
|
---|
737 |
|
---|
738 | virtual int ReadFileData(void *pvData, uint32_t cbData, uint32_t fFlags = 0, uint32_t *pcbRead = NULL);
|
---|
739 | virtual int WriteFileData(void *pvData, uint32_t cbData, uint32_t fFlags = 0, uint32_t *pcbWritten = NULL);
|
---|
740 |
|
---|
741 | virtual void Reset(void);
|
---|
742 |
|
---|
743 | public: /* Optional callback handling. */
|
---|
744 |
|
---|
745 | /*virtual int SetCallbacks();*/
|
---|
746 |
|
---|
747 | virtual int OnRead(PSHAREDCLIPBOARDPROVIDERREADPARMS pParms);
|
---|
748 | virtual int OnWrite(PSHAREDCLIPBOARDPROVIDERWRITEPARMS pParms);
|
---|
749 |
|
---|
750 | protected:
|
---|
751 |
|
---|
752 | SharedClipboardProvider(void);
|
---|
753 |
|
---|
754 | protected:
|
---|
755 |
|
---|
756 | /**
|
---|
757 | * Structure for maintaining an internal event.
|
---|
758 | */
|
---|
759 | struct Event
|
---|
760 | {
|
---|
761 | Event(uint32_t uMsg);
|
---|
762 | virtual ~Event();
|
---|
763 |
|
---|
764 | void *DataAdopt(void);
|
---|
765 | uint32_t DataSize(void);
|
---|
766 | void *DataRaw(void);
|
---|
767 | void Reset(void);
|
---|
768 | int SetData(const void *pvData, uint32_t cbData);
|
---|
769 | int Wait(RTMSINTERVAL uTimeoutMs);
|
---|
770 |
|
---|
771 | /** The event's associated message ID (guest function number). */
|
---|
772 | uint32_t mMsg;
|
---|
773 | /** The event's own event semaphore. */
|
---|
774 | RTSEMEVENT mEvent;
|
---|
775 | /** User-provided data buffer associated to this event. Optional. */
|
---|
776 | void *mpvData;
|
---|
777 | /** Size (in bytes) of user-provided data buffer associated to this event. */
|
---|
778 | uint32_t mcbData;
|
---|
779 | };
|
---|
780 |
|
---|
781 | /** Map of events; the key is the guest function number (VBOX_SHARED_CLIPBOARD_GUEST_FN_XXX). */
|
---|
782 | typedef std::map<uint32_t, Event *> EventMap;
|
---|
783 |
|
---|
784 | int eventRegister(uint32_t uMsg);
|
---|
785 | int eventUnregister(uint32_t uMsg);
|
---|
786 | int eventUnregisterAll(void);
|
---|
787 | int eventSignal(uint32_t uMsg);
|
---|
788 | int eventWait(uint32_t uMsg, PFNSSHAREDCLIPBOARDPROVIDERCALLBACK pfnCallback, RTMSINTERVAL uTimeoutMs,
|
---|
789 | void **ppvData, uint32_t *pcbData = NULL);
|
---|
790 | SharedClipboardProvider::Event *eventGet(uint32_t uMsg);
|
---|
791 |
|
---|
792 | protected:
|
---|
793 |
|
---|
794 | /** Number of references to this instance. */
|
---|
795 | volatile uint32_t m_cRefs;
|
---|
796 | /** The provider's transfer direction. */
|
---|
797 | SHAREDCLIPBOARDURITRANSFERDIR m_enmDir;
|
---|
798 | /** The provider's callback table. */
|
---|
799 | SHAREDCLIPBOARDPROVIDERCALLBACKS m_Callbacks;
|
---|
800 | /** Default timeout (in ms) for waiting for events. */
|
---|
801 | RTMSINTERVAL m_uTimeoutMs;
|
---|
802 | /** Map of (internal) events to provide asynchronous reads / writes. */
|
---|
803 | EventMap m_mapEvents;
|
---|
804 | };
|
---|
805 |
|
---|
806 | /**
|
---|
807 | * Shared Clipboard provider implementation for VbglR3 (guest side).
|
---|
808 | */
|
---|
809 | class SharedClipboardProviderVbglR3 : protected SharedClipboardProvider
|
---|
810 | {
|
---|
811 | friend class SharedClipboardProvider;
|
---|
812 |
|
---|
813 | public:
|
---|
814 |
|
---|
815 | virtual ~SharedClipboardProviderVbglR3(void);
|
---|
816 |
|
---|
817 | public:
|
---|
818 |
|
---|
819 | int ReadDataHdr(PVBOXCLIPBOARDDATAHDR *ppDataHdr);
|
---|
820 | int WriteDataHdr(const PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
821 |
|
---|
822 | int ReadDataChunk(const PVBOXCLIPBOARDDATAHDR pDataHdr, void *pvChunk, uint32_t cbChunk, uint32_t fFlags = 0,
|
---|
823 | uint32_t *pcbRead = NULL);
|
---|
824 | int WriteDataChunk(const PVBOXCLIPBOARDDATAHDR pDataHdr, const void *pvChunk, uint32_t cbChunk, uint32_t fFlags = 0,
|
---|
825 | uint32_t *pcbWritten = NULL);
|
---|
826 |
|
---|
827 | int ReadDirectory(PVBOXCLIPBOARDDIRDATA *ppDirData);
|
---|
828 | int WriteDirectory(const PVBOXCLIPBOARDDIRDATA pDirData);
|
---|
829 |
|
---|
830 | int ReadFileHdr(PVBOXCLIPBOARDFILEHDR *ppFileHdr);
|
---|
831 | int WriteFileHdr(const PVBOXCLIPBOARDFILEHDR pFileHdr);
|
---|
832 |
|
---|
833 | int ReadFileData(void *pvData, uint32_t cbData, uint32_t fFlags = 0, uint32_t *pcbRead = NULL);
|
---|
834 | int WriteFileData(void *pvData, uint32_t cbData, uint32_t fFlags = 0, uint32_t *pcbWritten = NULL);
|
---|
835 |
|
---|
836 | void Reset(void);
|
---|
837 |
|
---|
838 | protected:
|
---|
839 |
|
---|
840 | SharedClipboardProviderVbglR3(uint32_t uClientID);
|
---|
841 |
|
---|
842 | /** HGCM client ID to use. */
|
---|
843 | uint32_t m_uClientID;
|
---|
844 | };
|
---|
845 |
|
---|
846 | #ifdef VBOX_WITH_SHARED_CLIPBOARD_HOST
|
---|
847 | /**
|
---|
848 | * Shared Clipboard provider implementation for host service (host side).
|
---|
849 | */
|
---|
850 | class SharedClipboardProviderHostService : protected SharedClipboardProvider
|
---|
851 | {
|
---|
852 | friend class SharedClipboardProvider;
|
---|
853 |
|
---|
854 | public:
|
---|
855 |
|
---|
856 | virtual ~SharedClipboardProviderHostService();
|
---|
857 |
|
---|
858 | public:
|
---|
859 |
|
---|
860 | int Prepare(void);
|
---|
861 |
|
---|
862 | int ReadDataHdr(PVBOXCLIPBOARDDATAHDR *ppDataHdr);
|
---|
863 | int WriteDataHdr(const PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
864 |
|
---|
865 | int ReadDataChunk(const PVBOXCLIPBOARDDATAHDR pDataHdr, void *pvChunk, uint32_t cbChunk, uint32_t fFlags = 0,
|
---|
866 | uint32_t *pcbRead = NULL);
|
---|
867 | int WriteDataChunk(const PVBOXCLIPBOARDDATAHDR pDataHdr, const void *pvChunk, uint32_t cbChunk, uint32_t fFlags = 0,
|
---|
868 | uint32_t *pcbWritten = NULL);
|
---|
869 |
|
---|
870 | int ReadDirectory(PVBOXCLIPBOARDDIRDATA *ppDirData);
|
---|
871 | int WriteDirectory(const PVBOXCLIPBOARDDIRDATA pDirData);
|
---|
872 |
|
---|
873 | int ReadFileHdr(PVBOXCLIPBOARDFILEHDR *ppFileHdr);
|
---|
874 | int WriteFileHdr(const PVBOXCLIPBOARDFILEHDR pFileHdr);
|
---|
875 |
|
---|
876 | int ReadFileData(void *pvData, uint32_t cbData, uint32_t fFlags = 0, uint32_t *pcbRead = NULL);
|
---|
877 | int WriteFileData(void *pvData, uint32_t cbData, uint32_t fFlags = 0, uint32_t *pcbWritten = NULL);
|
---|
878 |
|
---|
879 | void Reset(void);
|
---|
880 |
|
---|
881 | public:
|
---|
882 |
|
---|
883 | int OnWrite(PSHAREDCLIPBOARDPROVIDERWRITEPARMS pParms);
|
---|
884 |
|
---|
885 | protected:
|
---|
886 |
|
---|
887 | SharedClipboardProviderHostService(SharedClipboardArea *pArea);
|
---|
888 |
|
---|
889 | protected:
|
---|
890 |
|
---|
891 | /** Pointer to associated clipboard area. */
|
---|
892 | SharedClipboardArea *m_pArea;
|
---|
893 | };
|
---|
894 | #endif /* VBOX_WITH_SHARED_CLIPBOARD_HOST */
|
---|
895 | #endif
|
---|
896 |
|
---|
897 | struct _SHAREDCLIPBOARDURITRANSFER;
|
---|
898 | typedef _SHAREDCLIPBOARDURITRANSFER *PSHAREDCLIPBOARDURITRANSFER;
|
---|
899 |
|
---|
900 | /**
|
---|
901 | * Structure for storing URI transfer callback data.
|
---|
902 | */
|
---|
903 | typedef struct _SHAREDCLIPBOARDURITRANSFERCALLBACKDATA
|
---|
904 | {
|
---|
905 | /** Pointer to related URI transfer. */
|
---|
906 | PSHAREDCLIPBOARDURITRANSFER pTransfer;
|
---|
907 | /** Saved user pointer. */
|
---|
908 | void *pvUser;
|
---|
909 | } SHAREDCLIPBOARDURITRANSFERCALLBACKDATA, *PSHAREDCLIPBOARDURITRANSFERCALLBACKDATA;
|
---|
910 |
|
---|
911 | #define SHAREDCLIPBOARDTRANSFERCALLBACKDECLVOID(a_Name) \
|
---|
912 | typedef DECLCALLBACK(void) RT_CONCAT(FNSHAREDCLIPBOARDCALLBACK, a_Name)(PSHAREDCLIPBOARDURITRANSFERCALLBACKDATA pData); \
|
---|
913 | typedef RT_CONCAT(FNSHAREDCLIPBOARDCALLBACK, a_Name) RT_CONCAT(*PFNSHAREDCLIPBOARDCALLBACK, a_Name);
|
---|
914 |
|
---|
915 | #define SHAREDCLIPBOARDTRANSFERCALLBACKDECL(a_Name, ...) \
|
---|
916 | typedef DECLCALLBACK(void) RT_CONCAT(FNSHAREDCLIPBOARDCALLBACK, a_Name)(PSHAREDCLIPBOARDURITRANSFERCALLBACKDATA pData, __VA_ARGS__); \
|
---|
917 | typedef RT_CONCAT(FNSHAREDCLIPBOARDCALLBACK, a_Name) RT_CONCAT(*PFNSHAREDCLIPBOARDCALLBACK, a_Name);
|
---|
918 |
|
---|
919 | #define SHAREDCLIPBOARDTRANSFERCALLBACKMEMBER(a_Name, a_Member) \
|
---|
920 | RT_CONCAT(PFNSHAREDCLIPBOARDCALLBACK, a_Name) a_Member;
|
---|
921 |
|
---|
922 | SHAREDCLIPBOARDTRANSFERCALLBACKDECLVOID(TRANSFERPREPARE)
|
---|
923 | SHAREDCLIPBOARDTRANSFERCALLBACKDECLVOID(TRANSFERSTARTED)
|
---|
924 | SHAREDCLIPBOARDTRANSFERCALLBACKDECLVOID(DATAHDRCOMPLETE)
|
---|
925 | SHAREDCLIPBOARDTRANSFERCALLBACKDECLVOID(DATACHUNKCOMPLETE)
|
---|
926 | SHAREDCLIPBOARDTRANSFERCALLBACKDECLVOID(TRANSFERCANCELED)
|
---|
927 | SHAREDCLIPBOARDTRANSFERCALLBACKDECL (TRANSFERCOMPLETE, int rc)
|
---|
928 | SHAREDCLIPBOARDTRANSFERCALLBACKDECL (TRANSFERERROR, int rc)
|
---|
929 |
|
---|
930 | /**
|
---|
931 | * Structure acting as a function callback table for URI transfers.
|
---|
932 | * All callbacks are optional and therefore can be NULL.
|
---|
933 | */
|
---|
934 | typedef struct _SHAREDCLIPBOARDURITRANSFERCALLBACKS
|
---|
935 | {
|
---|
936 | /** Saved user pointer. */
|
---|
937 | void *pvUser;
|
---|
938 | /** Function pointer, called when the transfer is going to be prepared. */
|
---|
939 | SHAREDCLIPBOARDTRANSFERCALLBACKMEMBER(TRANSFERPREPARE, pfnTransferPrepare);
|
---|
940 | /** Function pointer, called when the transfer has been started. */
|
---|
941 | SHAREDCLIPBOARDTRANSFERCALLBACKMEMBER(TRANSFERSTARTED, pfnTransferStarted);
|
---|
942 | /** Function pointer, called when reading / writing the meta data header is complete. */
|
---|
943 | SHAREDCLIPBOARDTRANSFERCALLBACKMEMBER(DATAHDRCOMPLETE, pfnDataHeaderComplete);
|
---|
944 | /** Function pointer, called when reading / writing the meta data is complete. */
|
---|
945 | SHAREDCLIPBOARDTRANSFERCALLBACKMEMBER(DATACHUNKCOMPLETE, pfnDataComplete);
|
---|
946 | /** Function pointer, called when the transfer is complete. */
|
---|
947 | SHAREDCLIPBOARDTRANSFERCALLBACKMEMBER(TRANSFERCOMPLETE, pfnTransferComplete);
|
---|
948 | /** Function pointer, called when the transfer has been canceled. */
|
---|
949 | SHAREDCLIPBOARDTRANSFERCALLBACKMEMBER(TRANSFERCANCELED, pfnTransferCanceled);
|
---|
950 | /** Function pointer, called when transfer resulted in an unrecoverable error. */
|
---|
951 | SHAREDCLIPBOARDTRANSFERCALLBACKMEMBER(TRANSFERERROR, pfnTransferError);
|
---|
952 | } SHAREDCLIPBOARDURITRANSFERCALLBACKS, *PSHAREDCLIPBOARDURITRANSFERCALLBACKS;
|
---|
953 |
|
---|
954 | /**
|
---|
955 | * Structure for thread-related members for a single URI transfer.
|
---|
956 | */
|
---|
957 | typedef struct _SHAREDCLIPBOARDURITRANSFERTHREAD
|
---|
958 | {
|
---|
959 | /** Thread handle for the reading / writing thread.
|
---|
960 | * Can be NIL_RTTHREAD if not being used. */
|
---|
961 | RTTHREAD hThread;
|
---|
962 | /** Thread started indicator. */
|
---|
963 | volatile bool fStarted;
|
---|
964 | /** Thread cancelled flag / indicator. */
|
---|
965 | volatile bool fCancelled;
|
---|
966 | } SHAREDCLIPBOARDURITRANSFERTHREAD, *PSHAREDCLIPBOARDURITRANSFERTHREAD;
|
---|
967 |
|
---|
968 | /**
|
---|
969 | * Structure for maintaining a single URI transfer.
|
---|
970 | *
|
---|
971 | ** @todo Not yet thread safe.
|
---|
972 | */
|
---|
973 | typedef struct _SHAREDCLIPBOARDURITRANSFER
|
---|
974 | {
|
---|
975 | /** The node member for using this struct in a RTList. */
|
---|
976 | RTLISTNODE Node;
|
---|
977 | /** Critical section for serializing access. */
|
---|
978 | RTCRITSECT CritSect;
|
---|
979 | /** The transfer's state (for SSM, later). */
|
---|
980 | SHAREDCLIPBOARDURITRANSFERSTATE State;
|
---|
981 | /** The transfer's own (local) area, if any (can be NULL if not needed).
|
---|
982 | * The area itself has a clipboard area ID assigned.
|
---|
983 | * On the host this area ID gets shared (maintained / locked) across all VMs via VBoxSVC. */
|
---|
984 | SharedClipboardArea *pArea;
|
---|
985 | /** The URI list for this transfer. */
|
---|
986 | SharedClipboardURIList *pURIList;
|
---|
987 | SHAREDCLIPBOARDPROVIDERCTX ProviderCtx;
|
---|
988 | /** The transfer's provider interface. */
|
---|
989 | SHAREDCLIPBOARDPROVIDERINTERFACE ProviderIface;
|
---|
990 | /** The transfer's (optional) callback table. */
|
---|
991 | SHAREDCLIPBOARDURITRANSFERCALLBACKS Callbacks;
|
---|
992 | /** Opaque pointer to implementation-specific parameters. */
|
---|
993 | void *pvUser;
|
---|
994 | /** Size (in bytes) of implementation-specific parameters. */
|
---|
995 | size_t cbUser;
|
---|
996 | /** Contains thread-related attributes. */
|
---|
997 | SHAREDCLIPBOARDURITRANSFERTHREAD Thread;
|
---|
998 | } SHAREDCLIPBOARDURITRANSFER, *PSHAREDCLIPBOARDURITRANSFER;
|
---|
999 |
|
---|
1000 | /**
|
---|
1001 | * Structure for keeping URI clipboard information around.
|
---|
1002 | */
|
---|
1003 | typedef struct _SHAREDCLIPBOARDURICTX
|
---|
1004 | {
|
---|
1005 | /** Critical section for serializing access. */
|
---|
1006 | RTCRITSECT CritSect;
|
---|
1007 | /** List of active transfers.
|
---|
1008 | * Use a list or something lateron. */
|
---|
1009 | RTLISTANCHOR List;
|
---|
1010 | /** Number of running (concurrent) transfers.
|
---|
1011 | * At the moment we only support only one transfer per client at a time. */
|
---|
1012 | uint32_t cRunning;
|
---|
1013 | /** Maximum Number of running (concurrent) transfers.
|
---|
1014 | * At the moment we only support only one transfer per client at a time. */
|
---|
1015 | uint32_t cMaxRunning;
|
---|
1016 | #ifdef DEBUG
|
---|
1017 | uint32_t cTransfer;
|
---|
1018 | #endif
|
---|
1019 | } SHAREDCLIPBOARDURICTX, *PSHAREDCLIPBOARDURICTX;
|
---|
1020 |
|
---|
1021 | int SharedClipboardURIObjCtxInit(PSHAREDCLIPBOARDCLIENTURIOBJCTX pObjCtx);
|
---|
1022 | void SharedClipboardURIObjCtxDestroy(PSHAREDCLIPBOARDCLIENTURIOBJCTX pObjCtx);
|
---|
1023 | SharedClipboardURIObject *SharedClipboardURIObjCtxGetObj(PSHAREDCLIPBOARDCLIENTURIOBJCTX pObjCtx);
|
---|
1024 | bool SharedClipboardURIObjCtxIsValid(PSHAREDCLIPBOARDCLIENTURIOBJCTX pObjCtx);
|
---|
1025 |
|
---|
1026 | int SharedClipboardURITransferCreate(SHAREDCLIPBOARDURITRANSFERDIR enmDir, SHAREDCLIPBOARDSOURCE enmSource, PSHAREDCLIPBOARDURITRANSFER *ppTransfer);
|
---|
1027 | int SharedClipboardURITransferDestroy(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1028 | int SharedClipboardURITransferPrepare(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1029 | int SharedClipboardURITransferProviderCreate(PSHAREDCLIPBOARDURITRANSFER pTransfer,
|
---|
1030 | PSHAREDCLIPBOARDPROVIDERCREATIONCTX pCreationCtx);
|
---|
1031 | void SharedClipboardURITransferReset(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1032 | SharedClipboardArea *SharedClipboardURITransferGetArea(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1033 | PSHAREDCLIPBOARDCLIENTURIOBJCTX SharedClipboardURITransferGetCurrentObjCtx(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1034 | const SharedClipboardURIObject *SharedClipboardURITransferGetCurrentObject(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1035 | SharedClipboardURIList *SharedClipboardURITransferGetList(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1036 | SharedClipboardURIObject *SharedClipboardURITransferGetObject(PSHAREDCLIPBOARDURITRANSFER pTransfer, uint64_t uIdx);
|
---|
1037 | SHAREDCLIPBOARDSOURCE SharedClipboardURITransferGetSource(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1038 | SHAREDCLIPBOARDURITRANSFERSTATUS SharedClipboardURITransferGetStatus(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1039 | int SharedClipboardURITransferRun(PSHAREDCLIPBOARDURITRANSFER pTransfer, bool fAsync);
|
---|
1040 | void SharedClipboardURITransferSetCallbacks(PSHAREDCLIPBOARDURITRANSFER pTransfer,
|
---|
1041 | PSHAREDCLIPBOARDURITRANSFERCALLBACKS pCallbacks);
|
---|
1042 | int SharedClipboardURITransferSetDataHeader(PSHAREDCLIPBOARDURITRANSFER pTransfer, PVBOXCLIPBOARDDATAHDR pDataHdr);
|
---|
1043 | int SharedClipboardURITransferSetDataChunk(PSHAREDCLIPBOARDURITRANSFER pTransfer, PVBOXCLIPBOARDDATACHUNK pDataChunk);
|
---|
1044 |
|
---|
1045 | int SharedClipboardURITransferMetaDataAdd(PSHAREDCLIPBOARDURITRANSFER pTransfer, const void *pvMeta, uint32_t cbMeta);
|
---|
1046 | bool SharedClipboardURITransferMetaDataIsComplete(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1047 | int SharedClipboardURITransferMetaDataRead(PSHAREDCLIPBOARDURITRANSFER pTransfer, uint32_t *pcbRead);
|
---|
1048 | int SharedClipboardURITransferMetaDataWrite(PSHAREDCLIPBOARDURITRANSFER pTransfer, uint32_t *pcbWritten);
|
---|
1049 |
|
---|
1050 | int SharedClipboardURITransferRead(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1051 | int SharedClipboardURITransferReadObjects(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1052 |
|
---|
1053 | int SharedClipboardURITransferWrite(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1054 | int SharedClipboardURITransferWriteObjects(PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1055 |
|
---|
1056 | int SharedClipboardURICtxInit(PSHAREDCLIPBOARDURICTX pURI);
|
---|
1057 | void SharedClipboardURICtxDestroy(PSHAREDCLIPBOARDURICTX pURI);
|
---|
1058 | void SharedClipboardURICtxReset(PSHAREDCLIPBOARDURICTX pURI);
|
---|
1059 | PSHAREDCLIPBOARDURITRANSFER SharedClipboardURICtxGetTransfer(PSHAREDCLIPBOARDURICTX pURI, uint32_t uIdx);
|
---|
1060 | uint32_t SharedClipboardURICtxGetRunningTransfers(PSHAREDCLIPBOARDURICTX pURI);
|
---|
1061 | void SharedClipboardURICtxTransfersCleanup(PSHAREDCLIPBOARDURICTX pURI);
|
---|
1062 | bool SharedClipboardURICtxTransfersMaximumReached(PSHAREDCLIPBOARDURICTX pURI);
|
---|
1063 | int SharedClipboardURICtxTransferAdd(PSHAREDCLIPBOARDURICTX pURI, PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1064 | int SharedClipboardURICtxTransferRemove(PSHAREDCLIPBOARDURICTX pURI, PSHAREDCLIPBOARDURITRANSFER pTransfer);
|
---|
1065 |
|
---|
1066 | bool SharedClipboardMIMEHasFileURLs(const char *pcszFormat, size_t cchFormatMax);
|
---|
1067 | bool SharedClipboardMIMENeedsCache(const char *pcszFormat, size_t cchFormatMax);
|
---|
1068 |
|
---|
1069 | #endif /* !VBOX_INCLUDED_GuestHost_SharedClipboard_uri_h */
|
---|
1070 |
|
---|