[75380] | 1 | /* $Id: mappings.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
[3338] | 2 | /** @file
|
---|
[75380] | 3 | * Shared folders service - Mappings header.
|
---|
[3338] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[3338] | 8 | *
|
---|
[96407] | 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
|
---|
[3338] | 26 | */
|
---|
| 27 |
|
---|
[76570] | 28 | #ifndef VBOX_INCLUDED_SRC_SharedFolders_mappings_h
|
---|
| 29 | #define VBOX_INCLUDED_SRC_SharedFolders_mappings_h
|
---|
[76526] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[3338] | 33 |
|
---|
| 34 | #include "shfl.h"
|
---|
| 35 | #include <VBox/shflsvc.h>
|
---|
| 36 |
|
---|
| 37 | typedef struct
|
---|
| 38 | {
|
---|
[75380] | 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. */
|
---|
[75407] | 53 | bool fLoadedRootId; /**< Set if vbsfMappingLoaded has found this mapping already. */
|
---|
[31052] | 54 | } MAPPING;
|
---|
| 55 | /** Pointer to a MAPPING structure. */
|
---|
| 56 | typedef MAPPING *PMAPPING;
|
---|
[3338] | 57 |
|
---|
[21172] | 58 | void vbsfMappingInit(void);
|
---|
[3338] | 59 |
|
---|
| 60 | bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping);
|
---|
| 61 |
|
---|
[75380] | 62 | int vbsfMappingsAdd(const char *pszFolderName, PSHFLSTRING pMapName, bool fWritable,
|
---|
| 63 | bool fAutoMount, PSHFLSTRING pAutoMountPoint, bool fCreateSymlinks, bool fMissing, bool fPlaceholder);
|
---|
[31002] | 64 | int vbsfMappingsRemove(PSHFLSTRING pMapName);
|
---|
[3338] | 65 |
|
---|
[75407] | 66 | int vbsfMappingsQuery(PSHFLCLIENTDATA pClient, bool fOnlyAutoMounts, PSHFLMAPPING pMappings, uint32_t *pcMappings);
|
---|
[31052] | 67 | int vbsfMappingsQueryName(PSHFLCLIENTDATA pClient, SHFLROOT root, SHFLSTRING *pString);
|
---|
| 68 | int vbsfMappingsQueryWritable(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fWritable);
|
---|
[39643] | 69 | int vbsfMappingsQueryAutoMount(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fAutoMount);
|
---|
| 70 | int vbsfMappingsQuerySymlinksCreate(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fSymlinksCreate);
|
---|
[75407] | 71 | int vbsfMappingsQueryInfo(PSHFLCLIENTDATA pClient, SHFLROOT root, PSHFLSTRING pNameBuf, PSHFLSTRING pMntPtBuf,
|
---|
| 72 | uint64_t *pfFlags, uint32_t *puVersion);
|
---|
[3338] | 73 |
|
---|
[39643] | 74 | int vbsfMapFolder(PSHFLCLIENTDATA pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter,
|
---|
| 75 | bool fCaseSensitive, SHFLROOT *pRoot);
|
---|
[31052] | 76 | int vbsfUnmapFolder(PSHFLCLIENTDATA pClient, SHFLROOT root);
|
---|
[3338] | 77 |
|
---|
[75407] | 78 | int vbsfMappingsWaitForChanges(PSHFLCLIENTDATA pClient, VBOXHGCMCALLHANDLE hCall, PVBOXHGCMSVCPARM pParm, bool fRestored);
|
---|
| 79 | int vbsfMappingsCancelChangesWaits(PSHFLCLIENTDATA pClient);
|
---|
| 80 |
|
---|
[39607] | 81 | const char* vbsfMappingsQueryHostRoot(SHFLROOT root);
|
---|
[56962] | 82 | int vbsfMappingsQueryHostRootEx(SHFLROOT hRoot, const char **ppszRoot, uint32_t *pcbRootLen);
|
---|
[31052] | 83 | bool vbsfIsGuestMappingCaseSensitive(SHFLROOT root);
|
---|
| 84 | bool vbsfIsHostMappingCaseSensitive(SHFLROOT root);
|
---|
[3338] | 85 |
|
---|
[78903] | 86 | void vbsfMappingLoadingStart(void);
|
---|
| 87 | int vbsfMappingLoaded(MAPPING const *pLoadedMapping, SHFLROOT root);
|
---|
| 88 | void vbsfMappingLoadingDone(void);
|
---|
[31052] | 89 | PMAPPING vbsfMappingGetByRoot(SHFLROOT root);
|
---|
[21172] | 90 |
|
---|
[76570] | 91 | #endif /* !VBOX_INCLUDED_SRC_SharedFolders_mappings_h */
|
---|
[7429] | 92 |
|
---|