Changeset 100265 in vbox
- Timestamp:
- Jun 23, 2023 1:50:43 PM (22 months ago)
- svn:sync-xref-src-repo-rev:
- 157980
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers-provider-local.cpp
r100204 r100265 317 317 } 318 318 319 static int shClTransferListEntryQueryFsInfo(PSHCLLISTENTRY pListEntry, PSHCLFSOBJINFO pFsObjInfo) 320 { 319 /** 320 * Queries information about a local list entry. 321 * 322 * @returns VBox status code. 323 * @param pszPathRootAbs Absolute root path to use for the entry. 324 * @param pListEntry List entry to query information for. 325 * @param pFsObjInfo Where to store the queried information on success. 326 */ 327 static int shClTransferListEntryQueryFsInfo(const char *pszPathRootAbs, PSHCLLISTENTRY pListEntry, PSHCLFSOBJINFO pFsObjInfo) 328 { 329 AssertPtrReturn(pszPathRootAbs, VERR_INVALID_POINTER); 321 330 AssertPtrReturn(pListEntry, VERR_INVALID_POINTER); 322 331 323 const char *pcszSrcPathAbs = pListEntry->pszName; 324 AssertPtrReturn(pcszSrcPathAbs, VERR_INVALID_POINTER); 325 326 int rc; 327 328 /* Make sure that we only advertise relative source paths, not absolute ones. */ 329 char *pszFileName = RTPathFilename(pcszSrcPathAbs); 330 if (pszFileName) 331 { 332 Assert(pszFileName >= pcszSrcPathAbs); 333 size_t cchDstBase = pszFileName - pcszSrcPathAbs; 334 const char *pszDstPath = &pcszSrcPathAbs[cchDstBase]; 335 336 LogFlowFunc(("pcszSrcPathAbs=%s, pszDstPath=%s\n", pcszSrcPathAbs, pszDstPath)); 337 338 RTFSOBJINFO fsObjInfo; 339 rc = RTPathQueryInfo(pcszSrcPathAbs, &fsObjInfo, RTFSOBJATTRADD_NOTHING); 340 if (RT_SUCCESS(rc)) 341 rc = ShClFsObjInfoFromIPRT(pFsObjInfo, &fsObjInfo); 342 } 343 else 344 rc = VERR_INVALID_POINTER; 332 const char *pszSrcPathAbs = RTPathJoinA(pszPathRootAbs, pListEntry->pszName); 333 AssertPtrReturn(pszSrcPathAbs, VERR_NO_MEMORY); 334 335 RTFSOBJINFO fsObjInfo; 336 int rc = RTPathQueryInfo(pszSrcPathAbs, &fsObjInfo, RTFSOBJATTRADD_NOTHING); 337 if (RT_SUCCESS(rc)) 338 rc = ShClFsObjInfoFromIPRT(pFsObjInfo, &fsObjInfo); 345 339 346 340 return rc; … … 358 352 { 359 353 AssertBreakStmt(pEntry->cbInfo == sizeof(SHCLFSOBJINFO), rc = VERR_WRONG_ORDER); 360 rc = shClTransferListEntryQueryFsInfo(p Entry, (PSHCLFSOBJINFO)pEntry->pvInfo);354 rc = shClTransferListEntryQueryFsInfo(pCtx->pTransfer->pszPathRootAbs, pEntry, (PSHCLFSOBJINFO)pEntry->pvInfo); 361 355 if (RT_FAILURE(rc)) /* Currently this is an all-or-nothing op. */ 362 356 break;
Note:
See TracChangeset
for help on using the changeset viewer.