VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedFolders/mappings.h@ 103068

Last change on this file since 103068 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/* $Id: mappings.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * Shared folders service - Mappings header.
4 */
5
6/*
7 * Copyright (C) 2006-2023 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
37typedef 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. */
56typedef MAPPING *PMAPPING;
57
58void vbsfMappingInit(void);
59
60bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping);
61
62int vbsfMappingsAdd(const char *pszFolderName, PSHFLSTRING pMapName, bool fWritable,
63 bool fAutoMount, PSHFLSTRING pAutoMountPoint, bool fCreateSymlinks, bool fMissing, bool fPlaceholder);
64int vbsfMappingsRemove(PSHFLSTRING pMapName);
65
66int vbsfMappingsQuery(PSHFLCLIENTDATA pClient, bool fOnlyAutoMounts, PSHFLMAPPING pMappings, uint32_t *pcMappings);
67int vbsfMappingsQueryName(PSHFLCLIENTDATA pClient, SHFLROOT root, SHFLSTRING *pString);
68int vbsfMappingsQueryWritable(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fWritable);
69int vbsfMappingsQueryAutoMount(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fAutoMount);
70int vbsfMappingsQuerySymlinksCreate(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fSymlinksCreate);
71int vbsfMappingsQueryInfo(PSHFLCLIENTDATA pClient, SHFLROOT root, PSHFLSTRING pNameBuf, PSHFLSTRING pMntPtBuf,
72 uint64_t *pfFlags, uint32_t *puVersion);
73
74int vbsfMapFolder(PSHFLCLIENTDATA pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter,
75 bool fCaseSensitive, SHFLROOT *pRoot);
76int vbsfUnmapFolder(PSHFLCLIENTDATA pClient, SHFLROOT root);
77
78int vbsfMappingsWaitForChanges(PSHFLCLIENTDATA pClient, VBOXHGCMCALLHANDLE hCall, PVBOXHGCMSVCPARM pParm, bool fRestored);
79int vbsfMappingsCancelChangesWaits(PSHFLCLIENTDATA pClient);
80
81const char* vbsfMappingsQueryHostRoot(SHFLROOT root);
82int vbsfMappingsQueryHostRootEx(SHFLROOT hRoot, const char **ppszRoot, uint32_t *pcbRootLen);
83bool vbsfIsGuestMappingCaseSensitive(SHFLROOT root);
84bool vbsfIsHostMappingCaseSensitive(SHFLROOT root);
85
86void vbsfMappingLoadingStart(void);
87int vbsfMappingLoaded(MAPPING const *pLoadedMapping, SHFLROOT root);
88void vbsfMappingLoadingDone(void);
89PMAPPING vbsfMappingGetByRoot(SHFLROOT root);
90
91#endif /* !VBOX_INCLUDED_SRC_SharedFolders_mappings_h */
92
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette