1 | /* $Id: VBoxGuestLibSharedFolders.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxGuestLib - Central calls header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
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_INCLUDED_VBoxGuestLibSharedFolders_h
|
---|
32 | #define VBOX_INCLUDED_VBoxGuestLibSharedFolders_h
|
---|
33 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
34 | # pragma once
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #include <VBox/VBoxGuestLib.h>
|
---|
38 | #include <VBox/shflsvc.h>
|
---|
39 |
|
---|
40 | #ifndef IN_RING0
|
---|
41 | # error "ring-0 only"
|
---|
42 | #endif
|
---|
43 |
|
---|
44 | RT_C_DECLS_BEGIN
|
---|
45 |
|
---|
46 |
|
---|
47 | /** @addtogroup grp_vboxguest_lib_r0
|
---|
48 | * @{
|
---|
49 | */
|
---|
50 |
|
---|
51 | typedef struct VBGLSFCLIENT
|
---|
52 | {
|
---|
53 | HGCMCLIENTID idClient;
|
---|
54 | VBGLHGCMHANDLE handle;
|
---|
55 | } VBGLSFCLIENT;
|
---|
56 | typedef VBGLSFCLIENT *PVBGLSFCLIENT;
|
---|
57 |
|
---|
58 | typedef struct VBGLSFMAP
|
---|
59 | {
|
---|
60 | SHFLROOT root;
|
---|
61 | } VBGLSFMAP, *PVBGLSFMAP;
|
---|
62 |
|
---|
63 | DECLVBGL(int) VbglR0SfInit(void);
|
---|
64 | DECLVBGL(void) VbglR0SfTerm(void);
|
---|
65 | DECLVBGL(int) VbglR0SfConnect(PVBGLSFCLIENT pClient);
|
---|
66 | DECLVBGL(void) VbglR0SfDisconnect(PVBGLSFCLIENT pClient);
|
---|
67 |
|
---|
68 | DECLVBGL(int) VbglR0SfQueryMappings(PVBGLSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
|
---|
69 |
|
---|
70 | DECLVBGL(int) VbglR0SfQueryMapName(PVBGLSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * Create a new file or folder or open an existing one in a shared folder. Proxies
|
---|
74 | * to vbsfCreate in the host shared folder service.
|
---|
75 | *
|
---|
76 | * @returns IPRT status code, but see note below
|
---|
77 | * @param pClient Host-guest communication connection
|
---|
78 | * @param pMap The mapping for the shared folder in which the file
|
---|
79 | * or folder is to be created
|
---|
80 | * @param pParsedPath The path of the file or folder relative to the shared
|
---|
81 | * folder
|
---|
82 | * @param pCreateParms Parameters for file/folder creation. See the
|
---|
83 | * structure description in shflsvc.h
|
---|
84 | * @retval pCreateParms See the structure description in shflsvc.h
|
---|
85 | *
|
---|
86 | * @note This function reports errors as follows. The return value is always
|
---|
87 | * VINF_SUCCESS unless an exceptional condition occurs - out of
|
---|
88 | * memory, invalid arguments, etc. If the file or folder could not be
|
---|
89 | * opened or created, pCreateParms->Handle will be set to
|
---|
90 | * SHFL_HANDLE_NIL on return. In this case the value in
|
---|
91 | * pCreateParms->Result provides information as to why (e.g.
|
---|
92 | * SHFL_FILE_EXISTS). pCreateParms->Result is also set on success
|
---|
93 | * as additional information.
|
---|
94 | */
|
---|
95 | DECLVBGL(int) VbglR0SfCreate(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
|
---|
96 |
|
---|
97 | DECLVBGL(int) VbglR0SfClose(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE Handle);
|
---|
98 | DECLVBGL(int) VbglR0SfRemove(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags);
|
---|
99 | DECLVBGL(int) VbglR0SfRename(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags);
|
---|
100 | DECLVBGL(int) VbglR0SfFlush(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile);
|
---|
101 |
|
---|
102 | DECLVBGL(int) VbglR0SfRead(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
|
---|
103 | DECLVBGL(int) VbglR0SfReadPageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
|
---|
104 | uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
|
---|
105 | DECLVBGL(int) VbglR0SfWrite(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
|
---|
106 | uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
|
---|
107 | DECLVBGL(int) VbglR0SfWritePhysCont(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
|
---|
108 | uint32_t *pcbBuffer, RTCCPHYS PhysBuffer);
|
---|
109 | DECLVBGL(int) VbglR0SfWritePageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
|
---|
110 | uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
|
---|
111 |
|
---|
112 | DECLVBGL(int) VbglR0SfLock(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
|
---|
113 |
|
---|
114 | DECLVBGL(int) VbglR0SfDirInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
|
---|
115 | uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
|
---|
116 | DECLVBGL(int) VbglR0SfFsInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
|
---|
117 |
|
---|
118 | DECLVBGL(int) VbglR0SfMapFolder(PVBGLSFCLIENT pClient, PSHFLSTRING szFolderName, PVBGLSFMAP pMap);
|
---|
119 | DECLVBGL(int) VbglR0SfUnmapFolder(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap);
|
---|
120 | DECLVBGL(int) VbglR0SfSetUtf8(PVBGLSFCLIENT pClient);
|
---|
121 |
|
---|
122 | DECLVBGL(int) VbglR0SfReadLink(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer);
|
---|
123 | DECLVBGL(int) VbglR0SfSymlink(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PSHFLFSOBJINFO pBuffer);
|
---|
124 | DECLVBGL(int) VbglR0SfSetSymlinks(PVBGLSFCLIENT pClient);
|
---|
125 |
|
---|
126 | /** @} */
|
---|
127 |
|
---|
128 | RT_C_DECLS_END
|
---|
129 |
|
---|
130 | #endif /* !VBOX_INCLUDED_VBoxGuestLibSharedFolders_h */
|
---|
131 |
|
---|