1 | /* $Id: mappings.h 96407 2022-08-22 17:43:14Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Shared folders service - Mappings header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2022 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef VBOX_INCLUDED_SRC_SharedFolders_mappings_h
|
---|
29 | #define VBOX_INCLUDED_SRC_SharedFolders_mappings_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "shfl.h"
|
---|
35 | #include <VBox/shflsvc.h>
|
---|
36 |
|
---|
37 | typedef struct
|
---|
38 | {
|
---|
39 | char *pszFolderName; /**< Directory at the host to share with the guest. */
|
---|
40 | PSHFLSTRING pMapName; /**< Share name for the guest. */
|
---|
41 | uint32_t cMappings; /**< Number of mappings. */
|
---|
42 | bool fValid; /**< Mapping entry is used/valid. */
|
---|
43 | bool fHostCaseSensitive; /**< Host file name space is case-sensitive. */
|
---|
44 | bool fGuestCaseSensitive; /**< Guest file name space is case-sensitive. */
|
---|
45 | bool fWritable; /**< Folder is writable for the guest. */
|
---|
46 | PSHFLSTRING pAutoMountPoint; /**< Where the guest should try auto-mount the folder. */
|
---|
47 | bool fAutoMount; /**< Folder will be auto-mounted by the guest. */
|
---|
48 | bool fSymlinksCreate; /**< Guest is able to create symlinks. */
|
---|
49 | bool fMissing; /**< Mapping not invalid but host path does not exist.
|
---|
50 | Any guest operation on such a folder fails! */
|
---|
51 | bool fPlaceholder; /**< Mapping does not exist in the VM settings but the guest
|
---|
52 | still has. fMissing is always true for this mapping. */
|
---|
53 | bool fLoadedRootId; /**< Set if vbsfMappingLoaded has found this mapping already. */
|
---|
54 | } MAPPING;
|
---|
55 | /** Pointer to a MAPPING structure. */
|
---|
56 | typedef MAPPING *PMAPPING;
|
---|
57 |
|
---|
58 | void vbsfMappingInit(void);
|
---|
59 |
|
---|
60 | bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping);
|
---|
61 |
|
---|
62 | int vbsfMappingsAdd(const char *pszFolderName, PSHFLSTRING pMapName, bool fWritable,
|
---|
63 | bool fAutoMount, PSHFLSTRING pAutoMountPoint, bool fCreateSymlinks, bool fMissing, bool fPlaceholder);
|
---|
64 | int vbsfMappingsRemove(PSHFLSTRING pMapName);
|
---|
65 |
|
---|
66 | int vbsfMappingsQuery(PSHFLCLIENTDATA pClient, bool fOnlyAutoMounts, PSHFLMAPPING pMappings, uint32_t *pcMappings);
|
---|
67 | int vbsfMappingsQueryName(PSHFLCLIENTDATA pClient, SHFLROOT root, SHFLSTRING *pString);
|
---|
68 | int vbsfMappingsQueryWritable(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fWritable);
|
---|
69 | int vbsfMappingsQueryAutoMount(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fAutoMount);
|
---|
70 | int vbsfMappingsQuerySymlinksCreate(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fSymlinksCreate);
|
---|
71 | int vbsfMappingsQueryInfo(PSHFLCLIENTDATA pClient, SHFLROOT root, PSHFLSTRING pNameBuf, PSHFLSTRING pMntPtBuf,
|
---|
72 | uint64_t *pfFlags, uint32_t *puVersion);
|
---|
73 |
|
---|
74 | int vbsfMapFolder(PSHFLCLIENTDATA pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter,
|
---|
75 | bool fCaseSensitive, SHFLROOT *pRoot);
|
---|
76 | int vbsfUnmapFolder(PSHFLCLIENTDATA pClient, SHFLROOT root);
|
---|
77 |
|
---|
78 | int vbsfMappingsWaitForChanges(PSHFLCLIENTDATA pClient, VBOXHGCMCALLHANDLE hCall, PVBOXHGCMSVCPARM pParm, bool fRestored);
|
---|
79 | int vbsfMappingsCancelChangesWaits(PSHFLCLIENTDATA pClient);
|
---|
80 |
|
---|
81 | const char* vbsfMappingsQueryHostRoot(SHFLROOT root);
|
---|
82 | int vbsfMappingsQueryHostRootEx(SHFLROOT hRoot, const char **ppszRoot, uint32_t *pcbRootLen);
|
---|
83 | bool vbsfIsGuestMappingCaseSensitive(SHFLROOT root);
|
---|
84 | bool vbsfIsHostMappingCaseSensitive(SHFLROOT root);
|
---|
85 |
|
---|
86 | void vbsfMappingLoadingStart(void);
|
---|
87 | int vbsfMappingLoaded(MAPPING const *pLoadedMapping, SHFLROOT root);
|
---|
88 | void vbsfMappingLoadingDone(void);
|
---|
89 | PMAPPING vbsfMappingGetByRoot(SHFLROOT root);
|
---|
90 |
|
---|
91 | #endif /* !VBOX_INCLUDED_SRC_SharedFolders_mappings_h */
|
---|
92 |
|
---|