Changeset 6382 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jan 18, 2008 5:37:39 PM (17 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedFolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r6379 r6382 28 28 * 29 29 */ 30 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName , uint32_t fWritable)30 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName) 31 31 { 32 32 int i; … … 73 73 FolderMapping[i].fValid = true; 74 74 FolderMapping[i].cMappings = 0; 75 FolderMapping[i].fWritable = fWritable;76 75 77 76 /* Check if the host file system is case sensitive */ … … 233 232 } 234 233 235 int vbsfMappingsQueryWritable (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable)236 {237 int rc = VINF_SUCCESS;238 239 LogFlow(("vbsfMappingsQueryWritable: pClient = %p, root = %d\n",240 pClient, root));241 242 if (root >= SHFL_MAX_MAPPINGS)243 return VERR_INVALID_PARAMETER;244 245 if (FolderMapping[root].fValid == true)246 *fWritable = FolderMapping[root].fWritable;247 else248 rc = VERR_FILE_NOT_FOUND;249 250 LogFlow(("vbsfMappingsQuery:Writable return rc = %Vrc\n", rc));251 252 return rc;253 }254 255 234 static int vbsfQueryMappingIndex (PRTUTF16 utf16Name, size_t *pIndex) 256 235 { -
trunk/src/VBox/HostServices/SharedFolders/mappings.h
r6379 r6382 31 31 bool fHostCaseSensitive; 32 32 bool fGuestCaseSensitive; 33 bool fWritable;34 33 } MAPPING, *PMAPPING; 35 34 … … 38 37 bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping); 39 38 40 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName , uint32_t fWritable);39 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName); 41 40 int vbsfMappingsRemove (PSHFLSTRING pMapName); 42 41 43 42 int vbsfMappingsQuery (SHFLCLIENTDATA *pClient, SHFLMAPPING *pMappings, uint32_t *pcMappings); 44 43 int vbsfMappingsQueryName (SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pString); 45 int vbsfMappingsQueryWritable (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable);46 44 47 45 int vbsfMapFolder (SHFLCLIENTDATA *pClient, PSHFLSTRING pszMapName, RTUCS2 delimiter, bool fCaseSensitive, SHFLROOT *pRoot); -
trunk/src/VBox/HostServices/SharedFolders/service.cpp
r6379 r6382 1097 1097 else if ( paParms[0].type != VBOX_HGCM_SVC_PARM_PTR /* host folder name */ 1098 1098 || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* guest map name */ 1099 || paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* fWritable */1100 1099 ) 1101 1100 { … … 1109 1108 SHFLSTRING *pMapName = (SHFLSTRING *)paParms[1].u.pointer.addr; 1110 1109 uint32_t cbStringMap = paParms[1].u.pointer.size; 1111 uint32_t fWritable = paParms[2].u.uint32;1112 1110 1113 1111 /* Verify parameters values. */ … … 1123 1121 { 1124 1122 /* Execute the function. */ 1125 rc = vbsfMappingsAdd (pFolderName, pMapName , fWritable);1123 rc = vbsfMappingsAdd (pFolderName, pMapName); 1126 1124 1127 1125 if (VBOX_SUCCESS(rc)) -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r6379 r6382 1018 1018 } 1019 1019 } 1020 1021 /* write access requested? */1022 if (pParms->CreateFlags & ( SHFL_CF_ACT_REPLACE_IF_EXISTS1023 | SHFL_CF_ACT_OVERWRITE_IF_EXISTS1024 | SHFL_CF_ACT_CREATE_IF_NEW1025 | SHFL_CF_ACCESS_WRITE))1026 {1027 /* is the guest allowed to write to this share? */1028 bool fWritable;1029 rc = vbsfMappingsQueryWritable (pClient, root, &fWritable);1030 if (RT_FAILURE(rc) || !fWritable)1031 return VERR_WRITE_PROTECT;1032 }1033 1034 1020 if (BIT_FLAG(pParms->CreateFlags, SHFL_CF_DIRECTORY)) 1035 1021 {
Note:
See TracChangeset
for help on using the changeset viewer.