1 | /* $Id: VBoxSharedClipboardSvc-utils.cpp 78652 2019-05-22 09:58:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Shared Clipboard Service - Host service utility functions.
|
---|
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 |
|
---|
18 |
|
---|
19 | /*********************************************************************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *********************************************************************************************************************************/
|
---|
22 | #define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
|
---|
23 | #include <VBox/HostServices/VBoxClipboardSvc.h>
|
---|
24 | #include <VBox/HostServices/VBoxClipboardExt.h>
|
---|
25 |
|
---|
26 | #include <iprt/path.h>
|
---|
27 |
|
---|
28 |
|
---|
29 | bool VBoxSvcClipboardDataHdrIsValid(PVBOXCLIPBOARDDATAHDR pData)
|
---|
30 | {
|
---|
31 | RT_NOREF(pData);
|
---|
32 | return true; /** @todo Implement this. */
|
---|
33 | }
|
---|
34 |
|
---|
35 | bool VBoxSvcClipboardDataChunkIsValid(VBOXCLIPBOARDDATACHUNK pData)
|
---|
36 | {
|
---|
37 | RT_NOREF(pData);
|
---|
38 | return true; /** @todo Implement this. */
|
---|
39 | }
|
---|
40 |
|
---|
41 | bool VBoxSvcClipboardDirDataIsValid(PVBOXCLIPBOARDDIRDATA pData)
|
---|
42 | {
|
---|
43 | if ( !pData->cbPath
|
---|
44 | || pData->cbPath > RTPATH_MAX)
|
---|
45 | return false;
|
---|
46 |
|
---|
47 | if (!RTStrIsValidEncoding(pData->pszPath))
|
---|
48 | return false;
|
---|
49 |
|
---|
50 | return true;
|
---|
51 | }
|
---|
52 |
|
---|
53 | bool VBoxSvcClipboardFileHdrIsValid(PVBOXCLIPBOARDFILEHDR pFileHdr, PVBOXCLIPBOARDDATAHDR pDataHdr)
|
---|
54 | {
|
---|
55 | if ( !pFileHdr->cbFilePath
|
---|
56 | || pFileHdr->cbFilePath > RTPATH_MAX)
|
---|
57 | return false;
|
---|
58 |
|
---|
59 | if (!RTStrIsValidEncoding(pFileHdr->pszFilePath))
|
---|
60 | return false;
|
---|
61 |
|
---|
62 | if (pFileHdr->cbSize > pDataHdr->cbTotal)
|
---|
63 | return false;
|
---|
64 |
|
---|
65 | return true;
|
---|
66 | }
|
---|
67 |
|
---|
68 | bool VBoxSvcClipboardFileDataIsValid(PVBOXCLIPBOARDFILEDATA pData, PVBOXCLIPBOARDDATAHDR pDataHdr)
|
---|
69 | {
|
---|
70 | RT_NOREF(pData, pDataHdr);
|
---|
71 | return true;
|
---|
72 | }
|
---|