Changeset 43952 in vbox
- Timestamp:
- Nov 23, 2012 3:21:25 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/shflsvc.h
r39643 r43952 1339 1339 */ 1340 1340 1341 /** mapping is writable */ 1341 1342 #define SHFL_ADD_MAPPING_F_WRITABLE (RT_BIT_32(0)) 1343 /** mapping is automounted by the guest */ 1342 1344 #define SHFL_ADD_MAPPING_F_AUTOMOUNT (RT_BIT_32(1)) 1345 /** allow the guest to create symlinks */ 1343 1346 #define SHFL_ADD_MAPPING_F_CREATE_SYMLINKS (RT_BIT_32(2)) 1347 /** mapping is actually missing on the host */ 1348 #define SHFL_ADD_MAPPING_F_MISSING (RT_BIT_32(3)) 1344 1349 1345 1350 #define SHFL_CPARMS_ADD_MAPPING (3) -
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r41013 r43952 192 192 */ 193 193 int vbsfMappingsAdd(PSHFLSTRING pFolderName, PSHFLSTRING pMapName, 194 bool fWritable, bool fAutoMount, bool fSymlinksCreate )194 bool fWritable, bool fAutoMount, bool fSymlinksCreate, bool fMissing) 195 195 { 196 196 unsigned i; … … 237 237 FolderMapping[i].fAutoMount = fAutoMount; 238 238 FolderMapping[i].fSymlinksCreate = fSymlinksCreate; 239 FolderMapping[i].fMissing = fMissing; 239 240 240 241 /* Check if the host file system is case sensitive */ … … 318 319 MAPPING *pFolderMapping = vbsfMappingGetByRoot(root); 319 320 AssertReturn(pFolderMapping, NULL); 321 if (pFolderMapping->fMissing) 322 return NULL; 320 323 return pFolderMapping->pszFolderName; 321 324 } … … 460 463 AssertReturn(pFolderMapping, VERR_INVALID_PARAMETER); 461 464 462 if (pFolderMapping->fValid == true) 465 if ( pFolderMapping->fValid 466 && !pFolderMapping->fMissing) 463 467 *fWritable = pFolderMapping->fWritable; 464 468 else -
trunk/src/VBox/HostServices/SharedFolders/mappings.h
r39643 r43952 32 32 bool fAutoMount; /**< folder will be auto-mounted by the guest */ 33 33 bool fSymlinksCreate; /**< guest is able to create symlinks */ 34 bool fMissing; /**< mapping not invalid but host path does not exist. 35 Any guest operation on such a folder fails! */ 34 36 } MAPPING; 35 37 /** Pointer to a MAPPING structure. */ … … 41 43 42 44 int vbsfMappingsAdd(PSHFLSTRING pFolderName, PSHFLSTRING pMapName, 43 bool fWritable, bool fAutoMount, bool fCreateSymlinks );45 bool fWritable, bool fAutoMount, bool fCreateSymlinks, bool fMissing); 44 46 int vbsfMappingsRemove(PSHFLSTRING pMapName); 45 47 -
trunk/src/VBox/HostServices/SharedFolders/service.cpp
r39643 r43952 1314 1314 else 1315 1315 { 1316 LogRel((" Host path '%ls', map name '%ls', %s, automount=%s, create_symlinks=%s \n",1316 LogRel((" Host path '%ls', map name '%ls', %s, automount=%s, create_symlinks=%s, missing=%s\n", 1317 1317 ((SHFLSTRING *)paParms[0].u.pointer.addr)->String.ucs2, 1318 1318 ((SHFLSTRING *)paParms[1].u.pointer.addr)->String.ucs2, 1319 1319 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_WRITABLE) ? "writable" : "read-only", 1320 1320 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_AUTOMOUNT) ? "true" : "false", 1321 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_CREATE_SYMLINKS) ? "true" : "false")); 1321 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_CREATE_SYMLINKS) ? "true" : "false", 1322 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_MISSING) ? "true" : "false")); 1322 1323 1323 1324 /* Execute the function. */ … … 1325 1326 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_WRITABLE), 1326 1327 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_AUTOMOUNT), 1327 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_CREATE_SYMLINKS)); 1328 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_CREATE_SYMLINKS), 1329 RT_BOOL(fFlags & SHFL_ADD_MAPPING_F_MISSING)); 1328 1330 if (RT_SUCCESS(rc)) 1329 1331 { -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r43649 r43952 7357 7357 hostPathFull, 7358 7358 sizeof(hostPathFull)); 7359 7360 bool fMissing = false; 7359 7361 if (RT_FAILURE(vrc)) 7360 7362 return setError(E_INVALIDARG, … … 7362 7364 aData.m_strHostPath.c_str(), vrc); 7363 7365 if (!RTPathExists(hostPathFull)) 7364 return setError(E_INVALIDARG, 7365 tr("Shared folder path '%s' does not exist on the host"), 7366 aData.m_strHostPath.c_str()); 7366 fMissing = true; 7367 7367 7368 /* Check whether the path is full (absolute) */ 7368 7369 if (RTPathCompare(aData.m_strHostPath.c_str(), hostPathFull) != 0) … … 7410 7411 parms[2].u.uint32 = (aData.m_fWritable ? SHFL_ADD_MAPPING_F_WRITABLE : 0) 7411 7412 | (aData.m_fAutoMount ? SHFL_ADD_MAPPING_F_AUTOMOUNT : 0) 7412 | (fSymlinksCreate ? SHFL_ADD_MAPPING_F_CREATE_SYMLINKS : 0); 7413 | (fSymlinksCreate ? SHFL_ADD_MAPPING_F_CREATE_SYMLINKS : 0) 7414 | (fMissing ? SHFL_ADD_MAPPING_F_MISSING : 0) 7415 ; 7413 7416 7414 7417 vrc = m_pVMMDev->hgcmHostCall("VBoxSharedFolders", … … 7422 7425 tr("Could not create a shared folder '%s' mapped to '%s' (%Rrc)"), 7423 7426 strName.c_str(), aData.m_strHostPath.c_str(), vrc); 7427 7428 if (fMissing) 7429 return setError(E_INVALIDARG, 7430 tr("Shared folder path '%s' does not exist on the host"), 7431 aData.m_strHostPath.c_str()); 7424 7432 7425 7433 return S_OK;
Note:
See TracChangeset
for help on using the changeset viewer.