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