Changeset 31052 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jul 23, 2010 12:10:41 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63977
- Location:
- trunk/src/VBox/HostServices/SharedFolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r31002 r31052 37 37 } 38 38 39 int vbsfMappingLoaded (const MAPPING *pLoadedMapping, SHFLROOT root)39 int vbsfMappingLoaded(const PMAPPING pLoadedMapping, SHFLROOT root) 40 40 { 41 41 /* Mapping loaded from the saved state with the index. Which means … … 173 173 * We are always executed from one specific HGCM thread. So thread safe. 174 174 */ 175 int vbsfMappingsAdd 176 uint32_t fWritable, uint32_tfAutoMount)175 int vbsfMappingsAdd(PSHFLSTRING pFolderName, PSHFLSTRING pMapName, 176 uint32_t fWritable, uint32_t fAutoMount) 177 177 { 178 178 unsigned i; … … 255 255 } 256 256 257 int vbsfMappingsRemove 257 int vbsfMappingsRemove(PSHFLSTRING pMapName) 258 258 { 259 259 unsigned i; … … 294 294 } 295 295 296 PCRTUTF16 vbsfMappingsQueryHostRoot 296 PCRTUTF16 vbsfMappingsQueryHostRoot(SHFLROOT root, uint32_t *pcbRoot) 297 297 { 298 298 MAPPING *pFolderMapping = vbsfMappingGetByRoot(root); … … 307 307 } 308 308 309 bool vbsfIsGuestMappingCaseSensitive 309 bool vbsfIsGuestMappingCaseSensitive(SHFLROOT root) 310 310 { 311 311 MAPPING *pFolderMapping = vbsfMappingGetByRoot(root); … … 319 319 } 320 320 321 bool vbsfIsHostMappingCaseSensitive 321 bool vbsfIsHostMappingCaseSensitive(SHFLROOT root) 322 322 { 323 323 MAPPING *pFolderMapping = vbsfMappingGetByRoot(root); … … 331 331 } 332 332 333 int vbsfMappingsQuery (SHFLCLIENTDATA *pClient, SHFLMAPPING *pMappings, uint32_t *pcMappings) 333 /** 334 * Note: If pMappings/*pcMappings is smaller than the actual amount of mappings 335 * that *could* have been returned *pcMappings contains the required buffer size 336 * so that the caller can retry the operation if wanted. 337 */ 338 int vbsfMappingsQuery(PSHFLCLIENTDATA pClient, PSHFLMAPPING pMappings, uint32_t *pcMappings) 334 339 { 335 340 int rc = VINF_SUCCESS; 336 uint32_t cMaxMappings = RT_MIN(*pcMappings, SHFL_MAX_MAPPINGS); 341 342 uint32_t cMappings = 0; /* Will contain actual valid mappings. */ 343 uint32_t idx = 0; /* Current index in mappings buffer. */ 337 344 338 345 LogFlow(("vbsfMappingsQuery: pClient = %p, pMappings = %p, pcMappings = %p, *pcMappings = %d\n", 339 346 pClient, pMappings, pcMappings, *pcMappings)); 340 347 341 *pcMappings = 0; 342 for (uint32_t i=0;i<cMaxMappings;i++) 348 for (uint32_t i = 0; i < SHFL_MAX_MAPPINGS; i++) 343 349 { 344 350 MAPPING *pFolderMapping = vbsfMappingGetByRoot(i); … … 346 352 && pFolderMapping->fValid == true) 347 353 { 348 /* Skip mappings which are not marked for auto-mounting if 349 * the SHFL_MF_AUTOMOUNT flag ist set. */ 350 if ( (pClient->fu32Flags & SHFL_MF_AUTOMOUNT) 351 && !pFolderMapping->fAutoMount) 352 continue; 353 354 pMappings[*pcMappings].u32Status = SHFL_MS_NEW; 355 pMappings[*pcMappings].root = i; 356 *pcMappings = *pcMappings + 1; 357 } 358 } 354 if (idx < *pcMappings) 355 { 356 /* Skip mappings which are not marked for auto-mounting if 357 * the SHFL_MF_AUTOMOUNT flag ist set. */ 358 if ( (pClient->fu32Flags & SHFL_MF_AUTOMOUNT) 359 && !pFolderMapping->fAutoMount) 360 continue; 361 362 pMappings[idx].u32Status = SHFL_MS_NEW; 363 pMappings[idx].root = i; 364 idx++; 365 } 366 cMappings++; 367 } 368 } 369 370 /* Return actual number of mappings, regardless whether the handed in 371 * mapping buffer was big enough. */ 372 *pcMappings = cMappings; 373 359 374 LogFlow(("vbsfMappingsQuery: return rc = %Rrc\n", rc)); 360 375 return rc; 361 376 } 362 377 363 int vbsfMappingsQueryName (SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pString)378 int vbsfMappingsQueryName(PSHFLCLIENTDATA pClient, SHFLROOT root, SHFLSTRING *pString) 364 379 { 365 380 int rc = VINF_SUCCESS; … … 394 409 } 395 410 396 int vbsfMappingsQueryWritable (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable)411 int vbsfMappingsQueryWritable(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fWritable) 397 412 { 398 413 int rc = VINF_SUCCESS; … … 417 432 } 418 433 419 int vbsfMappingsQueryAutoMount (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fAutoMount)434 int vbsfMappingsQueryAutoMount(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fAutoMount) 420 435 { 421 436 int rc = VINF_SUCCESS; … … 440 455 } 441 456 442 int vbsfMapFolder (SHFLCLIENTDATA *pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter, bool fCaseSensitive, SHFLROOT *pRoot) 457 int vbsfMapFolder(PSHFLCLIENTDATA pClient, PSHFLSTRING pszMapName, 458 RTUTF16 delimiter, bool fCaseSensitive, SHFLROOT *pRoot) 443 459 { 444 460 MAPPING *pFolderMapping = NULL; … … 490 506 } 491 507 492 int vbsfUnmapFolder (SHFLCLIENTDATA *pClient, SHFLROOT root)508 int vbsfUnmapFolder(PSHFLCLIENTDATA pClient, SHFLROOT root) 493 509 { 494 510 int rc = VINF_SUCCESS; -
trunk/src/VBox/HostServices/SharedFolders/mappings.h
r31002 r31052 31 31 bool fWritable; 32 32 bool fAutoMount; 33 } MAPPING, *PMAPPING; 33 } MAPPING; 34 /** Pointer to a MAPPING structure. */ 35 typedef MAPPING *PMAPPING; 34 36 35 37 void vbsfMappingInit(void); … … 40 42 int vbsfMappingsRemove(PSHFLSTRING pMapName); 41 43 42 int vbsfMappingsQuery( SHFLCLIENTDATA *pClient, SHFLMAPPING *pMappings, uint32_t *pcMappings);43 int vbsfMappingsQueryName( SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pString);44 int vbsfMappingsQueryWritable( SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable);44 int vbsfMappingsQuery(PSHFLCLIENTDATA pClient, PSHFLMAPPING pMappings, uint32_t *pcMappings); 45 int vbsfMappingsQueryName(PSHFLCLIENTDATA pClient, SHFLROOT root, SHFLSTRING *pString); 46 int vbsfMappingsQueryWritable(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fWritable); 45 47 46 int vbsfMapFolder( SHFLCLIENTDATA *pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter, bool fCaseSensitive, SHFLROOT *pRoot);47 int vbsfUnmapFolder( SHFLCLIENTDATA *pClient, SHFLROOT root);48 int vbsfMapFolder(PSHFLCLIENTDATA pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter, bool fCaseSensitive, SHFLROOT *pRoot); 49 int vbsfUnmapFolder(PSHFLCLIENTDATA pClient, SHFLROOT root); 48 50 49 PCRTUTF16 vbsfMappingsQueryHostRoot 50 bool vbsfIsGuestMappingCaseSensitive 51 bool vbsfIsHostMappingCaseSensitive 51 PCRTUTF16 vbsfMappingsQueryHostRoot(SHFLROOT root, uint32_t *pcbRoot); 52 bool vbsfIsGuestMappingCaseSensitive(SHFLROOT root); 53 bool vbsfIsHostMappingCaseSensitive(SHFLROOT root); 52 54 53 int vbsfMappingLoaded (const MAPPING *pLoadedMapping, SHFLROOT root);54 MAPPING *vbsfMappingGetByRoot(SHFLROOT root);55 int vbsfMappingLoaded(const PMAPPING pLoadedMapping, SHFLROOT root); 56 PMAPPING vbsfMappingGetByRoot(SHFLROOT root); 55 57 56 58 #endif /* !___MAPPINGS_H */ -
trunk/src/VBox/HostServices/SharedFolders/service.cpp
r31002 r31052 4 4 5 5 /* 6 * Copyright (C) 2006-20 07Oracle Corporation6 * Copyright (C) 2006-2010 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 327 327 if (RT_SUCCESS(rc)) 328 328 { 329 /* Report that there are more mappings to get if 330 * handed in buffer is too small. */ 331 if (paParms[1].u.uint32 < cMappings) 332 rc = VINF_BUFFER_OVERFLOW; 333 329 334 /* Update parameters. */ 330 335 paParms[1].u.uint32 = cMappings; -
trunk/src/VBox/HostServices/SharedFolders/shfl.h
r28800 r31052 4 4 5 5 /* 6 * Copyright (C) 2006-20 07Oracle Corporation6 * Copyright (C) 2006-2010 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 46 46 /** Client flags */ 47 47 uint32_t fu32Flags; 48 48 /** Path delimiter. */ 49 49 RTUTF16 PathDelimiter; 50 50 } SHFLCLIENTDATA; 51 51 /** Pointer to a SHFLCLIENTDATA structure. */ 52 typedef SHFLCLIENTDATA *PSHFLCLIENTDATA; 52 53 53 54 #endif /* !___SHFL_H */
Note:
See TracChangeset
for help on using the changeset viewer.