[55401] | 1 | /* $Id: VBoxGuestLibSharedFolders.h 72627 2018-06-20 13:53:28Z vboxsync $ */
|
---|
[1] | 2 | /** @file
|
---|
[21211] | 3 | * VBoxGuestLib - Central calls header.
|
---|
[1] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[72627] | 7 | * Copyright (C) 2006-2018 Oracle Corporation
|
---|
[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 |
|
---|
[58203] | 31 | #ifndef ___VBox_VBoxGuestLibSharedFolders_h_
|
---|
| 32 | #define ___VBox_VBoxGuestLibSharedFolders_h_
|
---|
[1] | 33 |
|
---|
| 34 | #include <VBox/VBoxGuestLib.h>
|
---|
| 35 | #include <VBox/shflsvc.h>
|
---|
| 36 |
|
---|
[68670] | 37 | #ifndef IN_RING0
|
---|
| 38 | # error "ring-0 only"
|
---|
| 39 | #endif
|
---|
| 40 |
|
---|
[58203] | 41 | RT_C_DECLS_BEGIN
|
---|
| 42 |
|
---|
[58204] | 43 |
|
---|
| 44 | /** @addtogroup grp_vboxguest_lib_r0
|
---|
| 45 | * @{
|
---|
| 46 | */
|
---|
| 47 |
|
---|
[58196] | 48 | typedef struct VBGLSFCLIENT
|
---|
[1] | 49 | {
|
---|
[58198] | 50 | HGCMCLIENTID idClient;
|
---|
[1] | 51 | VBGLHGCMHANDLE handle;
|
---|
[58196] | 52 | } VBGLSFCLIENT;
|
---|
| 53 | typedef VBGLSFCLIENT *PVBGLSFCLIENT;
|
---|
[1] | 54 |
|
---|
[58196] | 55 | typedef struct VBGLSFMAP
|
---|
[1] | 56 | {
|
---|
| 57 | SHFLROOT root;
|
---|
[58196] | 58 | } VBGLSFMAP, *PVBGLSFMAP;
|
---|
[1] | 59 |
|
---|
[58195] | 60 | DECLVBGL(int) VbglR0SfInit(void);
|
---|
| 61 | DECLVBGL(void) VbglR0SfTerm(void);
|
---|
[58196] | 62 | DECLVBGL(int) VbglR0SfConnect(PVBGLSFCLIENT pClient);
|
---|
| 63 | DECLVBGL(void) VbglR0SfDisconnect(PVBGLSFCLIENT pClient);
|
---|
[1] | 64 |
|
---|
[58196] | 65 | DECLVBGL(int) VbglR0SfQueryMappings(PVBGLSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
|
---|
[1] | 66 |
|
---|
[58196] | 67 | DECLVBGL(int) VbglR0SfQueryMapName(PVBGLSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
|
---|
[1] | 68 |
|
---|
[4708] | 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
|
---|
[33540] | 84 | * VINF_SUCCESS unless an exceptional condition occurs - out of
|
---|
[4708] | 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 | */
|
---|
[58196] | 92 | DECLVBGL(int) VbglR0SfCreate(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
|
---|
[1] | 93 |
|
---|
[58196] | 94 | DECLVBGL(int) VbglR0SfClose(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE Handle);
|
---|
| 95 | DECLVBGL(int) VbglR0SfRemove(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags);
|
---|
| 96 | DECLVBGL(int) VbglR0SfRename(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags);
|
---|
| 97 | DECLVBGL(int) VbglR0SfFlush(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile);
|
---|
[1] | 98 |
|
---|
[58196] | 99 | DECLVBGL(int) VbglR0SfRead(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
|
---|
| 100 | DECLVBGL(int) VbglR0SfReadPageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
|
---|
[58195] | 101 | uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
|
---|
[58196] | 102 | DECLVBGL(int) VbglR0SfWrite(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
|
---|
[58195] | 103 | uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
|
---|
[58196] | 104 | DECLVBGL(int) VbglR0SfWritePhysCont(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
|
---|
[58195] | 105 | uint32_t *pcbBuffer, RTCCPHYS PhysBuffer);
|
---|
[58196] | 106 | DECLVBGL(int) VbglR0SfWritePageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
|
---|
[58195] | 107 | uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
|
---|
[1] | 108 |
|
---|
[58196] | 109 | DECLVBGL(int) VbglR0SfLock(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
|
---|
[1] | 110 |
|
---|
[58196] | 111 | DECLVBGL(int) VbglR0SfDirInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
|
---|
[58204] | 112 | uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
|
---|
[58196] | 113 | DECLVBGL(int) VbglR0SfFsInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
|
---|
[1] | 114 |
|
---|
[58196] | 115 | DECLVBGL(int) VbglR0SfMapFolder(PVBGLSFCLIENT pClient, PSHFLSTRING szFolderName, PVBGLSFMAP pMap);
|
---|
| 116 | DECLVBGL(int) VbglR0SfUnmapFolder(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap);
|
---|
| 117 | DECLVBGL(int) VbglR0SfSetUtf8(PVBGLSFCLIENT pClient);
|
---|
[1] | 118 |
|
---|
[58196] | 119 | DECLVBGL(int) VbglR0SfReadLink(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer);
|
---|
| 120 | DECLVBGL(int) VbglR0SfSymlink(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PSHFLFSOBJINFO pBuffer);
|
---|
| 121 | DECLVBGL(int) VbglR0SfSetSymlinks(PVBGLSFCLIENT pClient);
|
---|
[33439] | 122 |
|
---|
[58204] | 123 | /** @} */
|
---|
| 124 |
|
---|
[58203] | 125 | RT_C_DECLS_END
|
---|
[33994] | 126 |
|
---|
[58203] | 127 | #endif
|
---|
| 128 |
|
---|