[55401] | 1 | /* $Id: VBoxGuestLibSharedFolders.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
[1] | 2 | /** @file
|
---|
[21211] | 3 | * VBoxGuestLib - Central calls header.
|
---|
[1] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[1] | 8 | *
|
---|
[72627] | 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:
|
---|
[8155] | 17 | *
|
---|
[72627] | 18 | * The above copyright notice and this permission notice shall be
|
---|
| 19 | * included in all copies or substantial portions of the Software.
|
---|
[26425] | 20 | *
|
---|
[72627] | 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.
|
---|
[1] | 29 | */
|
---|
| 30 |
|
---|
[76558] | 31 | #ifndef VBOX_INCLUDED_VBoxGuestLibSharedFolders_h
|
---|
| 32 | #define VBOX_INCLUDED_VBoxGuestLibSharedFolders_h
|
---|
[76507] | 33 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 34 | # pragma once
|
---|
| 35 | #endif
|
---|
[1] | 36 |
|
---|
| 37 | #include <VBox/VBoxGuestLib.h>
|
---|
| 38 | #include <VBox/shflsvc.h>
|
---|
| 39 |
|
---|
[68670] | 40 | #ifndef IN_RING0
|
---|
| 41 | # error "ring-0 only"
|
---|
| 42 | #endif
|
---|
| 43 |
|
---|
[58203] | 44 | RT_C_DECLS_BEGIN
|
---|
| 45 |
|
---|
[58204] | 46 |
|
---|
| 47 | /** @addtogroup grp_vboxguest_lib_r0
|
---|
| 48 | * @{
|
---|
| 49 | */
|
---|
| 50 |
|
---|
[58196] | 51 | typedef struct VBGLSFCLIENT
|
---|
[1] | 52 | {
|
---|
[58198] | 53 | HGCMCLIENTID idClient;
|
---|
[1] | 54 | VBGLHGCMHANDLE handle;
|
---|
[58196] | 55 | } VBGLSFCLIENT;
|
---|
| 56 | typedef VBGLSFCLIENT *PVBGLSFCLIENT;
|
---|
[1] | 57 |
|
---|
[58196] | 58 | typedef struct VBGLSFMAP
|
---|
[1] | 59 | {
|
---|
| 60 | SHFLROOT root;
|
---|
[58196] | 61 | } VBGLSFMAP, *PVBGLSFMAP;
|
---|
[1] | 62 |
|
---|
[58195] | 63 | DECLVBGL(int) VbglR0SfInit(void);
|
---|
| 64 | DECLVBGL(void) VbglR0SfTerm(void);
|
---|
[58196] | 65 | DECLVBGL(int) VbglR0SfConnect(PVBGLSFCLIENT pClient);
|
---|
| 66 | DECLVBGL(void) VbglR0SfDisconnect(PVBGLSFCLIENT pClient);
|
---|
[1] | 67 |
|
---|
[58196] | 68 | DECLVBGL(int) VbglR0SfQueryMappings(PVBGLSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
|
---|
[1] | 69 |
|
---|
[58196] | 70 | DECLVBGL(int) VbglR0SfQueryMapName(PVBGLSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
|
---|
[1] | 71 |
|
---|
[4708] | 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
|
---|
[33540] | 87 | * VINF_SUCCESS unless an exceptional condition occurs - out of
|
---|
[4708] | 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 | */
|
---|
[58196] | 95 | DECLVBGL(int) VbglR0SfCreate(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
|
---|
[1] | 96 |
|
---|
[58196] | 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);
|
---|
[1] | 101 |
|
---|
[58196] | 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,
|
---|
[58195] | 104 | uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
|
---|
[58196] | 105 | DECLVBGL(int) VbglR0SfWrite(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
|
---|
[58195] | 106 | uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
|
---|
[58196] | 107 | DECLVBGL(int) VbglR0SfWritePhysCont(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
|
---|
[58195] | 108 | uint32_t *pcbBuffer, RTCCPHYS PhysBuffer);
|
---|
[58196] | 109 | DECLVBGL(int) VbglR0SfWritePageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
|
---|
[58195] | 110 | uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
|
---|
[1] | 111 |
|
---|
[58196] | 112 | DECLVBGL(int) VbglR0SfLock(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
|
---|
[1] | 113 |
|
---|
[58196] | 114 | DECLVBGL(int) VbglR0SfDirInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
|
---|
[58204] | 115 | uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
|
---|
[58196] | 116 | DECLVBGL(int) VbglR0SfFsInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
|
---|
[1] | 117 |
|
---|
[58196] | 118 | DECLVBGL(int) VbglR0SfMapFolder(PVBGLSFCLIENT pClient, PSHFLSTRING szFolderName, PVBGLSFMAP pMap);
|
---|
| 119 | DECLVBGL(int) VbglR0SfUnmapFolder(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap);
|
---|
| 120 | DECLVBGL(int) VbglR0SfSetUtf8(PVBGLSFCLIENT pClient);
|
---|
[1] | 121 |
|
---|
[58196] | 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);
|
---|
[33439] | 125 |
|
---|
[58204] | 126 | /** @} */
|
---|
| 127 |
|
---|
[58203] | 128 | RT_C_DECLS_END
|
---|
[33994] | 129 |
|
---|
[76585] | 130 | #endif /* !VBOX_INCLUDED_VBoxGuestLibSharedFolders_h */
|
---|
[58203] | 131 |
|
---|