1 | /* $Id: mappings.h 76570 2019-01-01 04:36:36Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Shared folders service - Mappings header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-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 | #ifndef VBOX_INCLUDED_SRC_SharedFolders_mappings_h
|
---|
19 | #define VBOX_INCLUDED_SRC_SharedFolders_mappings_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include "shfl.h"
|
---|
25 | #include <VBox/shflsvc.h>
|
---|
26 |
|
---|
27 | typedef struct
|
---|
28 | {
|
---|
29 | char *pszFolderName; /**< Directory at the host to share with the guest. */
|
---|
30 | PSHFLSTRING pMapName; /**< Share name for the guest. */
|
---|
31 | uint32_t cMappings; /**< Number of mappings. */
|
---|
32 | bool fValid; /**< Mapping entry is used/valid. */
|
---|
33 | bool fHostCaseSensitive; /**< Host file name space is case-sensitive. */
|
---|
34 | bool fGuestCaseSensitive; /**< Guest file name space is case-sensitive. */
|
---|
35 | bool fWritable; /**< Folder is writable for the guest. */
|
---|
36 | PSHFLSTRING pAutoMountPoint; /**< Where the guest should try auto-mount the folder. */
|
---|
37 | bool fAutoMount; /**< Folder will be auto-mounted by the guest. */
|
---|
38 | bool fSymlinksCreate; /**< Guest is able to create symlinks. */
|
---|
39 | bool fMissing; /**< Mapping not invalid but host path does not exist.
|
---|
40 | Any guest operation on such a folder fails! */
|
---|
41 | bool fPlaceholder; /**< Mapping does not exist in the VM settings but the guest
|
---|
42 | still has. fMissing is always true for this mapping. */
|
---|
43 | bool fLoadedRootId; /**< Set if vbsfMappingLoaded has found this mapping already. */
|
---|
44 | } MAPPING;
|
---|
45 | /** Pointer to a MAPPING structure. */
|
---|
46 | typedef MAPPING *PMAPPING;
|
---|
47 |
|
---|
48 | void vbsfMappingInit(void);
|
---|
49 |
|
---|
50 | bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping);
|
---|
51 |
|
---|
52 | int vbsfMappingsAdd(const char *pszFolderName, PSHFLSTRING pMapName, bool fWritable,
|
---|
53 | bool fAutoMount, PSHFLSTRING pAutoMountPoint, bool fCreateSymlinks, bool fMissing, bool fPlaceholder);
|
---|
54 | int vbsfMappingsRemove(PSHFLSTRING pMapName);
|
---|
55 |
|
---|
56 | int vbsfMappingsQuery(PSHFLCLIENTDATA pClient, bool fOnlyAutoMounts, PSHFLMAPPING pMappings, uint32_t *pcMappings);
|
---|
57 | int vbsfMappingsQueryName(PSHFLCLIENTDATA pClient, SHFLROOT root, SHFLSTRING *pString);
|
---|
58 | int vbsfMappingsQueryWritable(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fWritable);
|
---|
59 | int vbsfMappingsQueryAutoMount(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fAutoMount);
|
---|
60 | int vbsfMappingsQuerySymlinksCreate(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fSymlinksCreate);
|
---|
61 | int vbsfMappingsQueryInfo(PSHFLCLIENTDATA pClient, SHFLROOT root, PSHFLSTRING pNameBuf, PSHFLSTRING pMntPtBuf,
|
---|
62 | uint64_t *pfFlags, uint32_t *puVersion);
|
---|
63 |
|
---|
64 | int vbsfMapFolder(PSHFLCLIENTDATA pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter,
|
---|
65 | bool fCaseSensitive, SHFLROOT *pRoot);
|
---|
66 | int vbsfUnmapFolder(PSHFLCLIENTDATA pClient, SHFLROOT root);
|
---|
67 |
|
---|
68 | int vbsfMappingsWaitForChanges(PSHFLCLIENTDATA pClient, VBOXHGCMCALLHANDLE hCall, PVBOXHGCMSVCPARM pParm, bool fRestored);
|
---|
69 | int vbsfMappingsCancelChangesWaits(PSHFLCLIENTDATA pClient);
|
---|
70 |
|
---|
71 | const char* vbsfMappingsQueryHostRoot(SHFLROOT root);
|
---|
72 | int vbsfMappingsQueryHostRootEx(SHFLROOT hRoot, const char **ppszRoot, uint32_t *pcbRootLen);
|
---|
73 | bool vbsfIsGuestMappingCaseSensitive(SHFLROOT root);
|
---|
74 | bool vbsfIsHostMappingCaseSensitive(SHFLROOT root);
|
---|
75 |
|
---|
76 | int vbsfMappingLoaded(MAPPING const *pLoadedMapping, SHFLROOT root);
|
---|
77 | PMAPPING vbsfMappingGetByRoot(SHFLROOT root);
|
---|
78 |
|
---|
79 | #endif /* !VBOX_INCLUDED_SRC_SharedFolders_mappings_h */
|
---|
80 |
|
---|