VirtualBox

source: vbox/trunk/include/VBox/VBoxGuestLibSharedFolders.h@ 73768

Last change on this file since 73768 was 72627, checked in by vboxsync, 6 years ago

Additions: relicence components needed for Linux shared folders to MIT.
bugref:9109: Shared folders: update to match in-kernel code more closely
This change makes the code on which the Linux kernel shared folder patch is
based MIT-licenced, so that the version in the Linux kernel can be too. This
would make it easier to move code back and forth.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.8 KB
Line 
1/* $Id: VBoxGuestLibSharedFolders.h 72627 2018-06-20 13:53:28Z vboxsync $ */
2/** @file
3 * VBoxGuestLib - Central calls header.
4 */
5
6/*
7 * Copyright (C) 2006-2018 Oracle Corporation
8 *
9 * Permission is hereby granted, free of charge, to any person
10 * obtaining a copy of this software and associated documentation
11 * files (the "Software"), to deal in the Software without
12 * restriction, including without limitation the rights to use,
13 * copy, modify, merge, publish, distribute, sublicense, and/or sell
14 * copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following
16 * conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
29 */
30
31#ifndef ___VBox_VBoxGuestLibSharedFolders_h_
32#define ___VBox_VBoxGuestLibSharedFolders_h_
33
34#include <VBox/VBoxGuestLib.h>
35#include <VBox/shflsvc.h>
36
37#ifndef IN_RING0
38# error "ring-0 only"
39#endif
40
41RT_C_DECLS_BEGIN
42
43
44/** @addtogroup grp_vboxguest_lib_r0
45 * @{
46 */
47
48typedef struct VBGLSFCLIENT
49{
50 HGCMCLIENTID idClient;
51 VBGLHGCMHANDLE handle;
52} VBGLSFCLIENT;
53typedef VBGLSFCLIENT *PVBGLSFCLIENT;
54
55typedef struct VBGLSFMAP
56{
57 SHFLROOT root;
58} VBGLSFMAP, *PVBGLSFMAP;
59
60DECLVBGL(int) VbglR0SfInit(void);
61DECLVBGL(void) VbglR0SfTerm(void);
62DECLVBGL(int) VbglR0SfConnect(PVBGLSFCLIENT pClient);
63DECLVBGL(void) VbglR0SfDisconnect(PVBGLSFCLIENT pClient);
64
65DECLVBGL(int) VbglR0SfQueryMappings(PVBGLSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
66
67DECLVBGL(int) VbglR0SfQueryMapName(PVBGLSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
68
69/**
70 * Create a new file or folder or open an existing one in a shared folder. Proxies
71 * to vbsfCreate in the host shared folder service.
72 *
73 * @returns IPRT status code, but see note below
74 * @param pClient Host-guest communication connection
75 * @param pMap The mapping for the shared folder in which the file
76 * or folder is to be created
77 * @param pParsedPath The path of the file or folder relative to the shared
78 * folder
79 * @param pCreateParms Parameters for file/folder creation. See the
80 * structure description in shflsvc.h
81 * @retval pCreateParms See the structure description in shflsvc.h
82 *
83 * @note This function reports errors as follows. The return value is always
84 * VINF_SUCCESS unless an exceptional condition occurs - out of
85 * memory, invalid arguments, etc. If the file or folder could not be
86 * opened or created, pCreateParms->Handle will be set to
87 * SHFL_HANDLE_NIL on return. In this case the value in
88 * pCreateParms->Result provides information as to why (e.g.
89 * SHFL_FILE_EXISTS). pCreateParms->Result is also set on success
90 * as additional information.
91 */
92DECLVBGL(int) VbglR0SfCreate(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
93
94DECLVBGL(int) VbglR0SfClose(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE Handle);
95DECLVBGL(int) VbglR0SfRemove(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags);
96DECLVBGL(int) VbglR0SfRename(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags);
97DECLVBGL(int) VbglR0SfFlush(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile);
98
99DECLVBGL(int) VbglR0SfRead(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
100DECLVBGL(int) VbglR0SfReadPageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
101 uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
102DECLVBGL(int) VbglR0SfWrite(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
103 uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
104DECLVBGL(int) VbglR0SfWritePhysCont(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
105 uint32_t *pcbBuffer, RTCCPHYS PhysBuffer);
106DECLVBGL(int) VbglR0SfWritePageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
107 uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
108
109DECLVBGL(int) VbglR0SfLock(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
110
111DECLVBGL(int) VbglR0SfDirInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
112 uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
113DECLVBGL(int) VbglR0SfFsInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
114
115DECLVBGL(int) VbglR0SfMapFolder(PVBGLSFCLIENT pClient, PSHFLSTRING szFolderName, PVBGLSFMAP pMap);
116DECLVBGL(int) VbglR0SfUnmapFolder(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap);
117DECLVBGL(int) VbglR0SfSetUtf8(PVBGLSFCLIENT pClient);
118
119DECLVBGL(int) VbglR0SfReadLink(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer);
120DECLVBGL(int) VbglR0SfSymlink(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PSHFLFSOBJINFO pBuffer);
121DECLVBGL(int) VbglR0SfSetSymlinks(PVBGLSFCLIENT pClient);
122
123/** @} */
124
125RT_C_DECLS_END
126
127#endif
128
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use