Changeset 74715 in vbox
- Timestamp:
- Oct 9, 2018 11:56:08 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/VBox/GuestHost/DragAndDrop.h (modified) (1 diff)
-
src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/DragAndDrop.h
r74714 r74715 268 268 #define DNDURILIST_FLAGS_LAZY RT_BIT(3) 269 269 270 /** Mask of all valid DnD URI list flags. */ 271 #define DNDURILIST_FLAGS_VALID_MASK UINT32_C(0xF) 272 270 273 class DnDURIList 271 274 { -
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
r74714 r74715 339 339 { 340 340 AssertPtrReturn(pszURI, VERR_INVALID_POINTER); 341 341 AssertReturn(!(fFlags & ~DNDURILIST_FLAGS_VALID_MASK), VERR_INVALID_FLAGS); 342 342 /** @todo Check for string termination? */ 343 #ifdef DEBUG_andy 344 LogFlowFunc(("pszPath=%s, fFlags=0x%x\n", pszURI, fFlags)); 345 #endif 346 int rc = VINF_SUCCESS; 347 348 /* Query the path component of a file URI. If this hasn't a 349 * file scheme NULL is returned. */ 350 char *pszSrcPath = RTUriFilePath(pszURI); 351 if (pszSrcPath) 343 344 RTURIPARSED Parsed; 345 int rc = RTUriParse(pszURI, &Parsed); 346 if (RT_FAILURE(rc)) 347 return rc; 348 349 char *pszSrcPath = NULL; 350 351 /* file://host.example.com/path/to/file.txt */ 352 const char *pszParsedAuthority = RTUriParsedAuthority(pszURI, &Parsed); 353 if ( pszParsedAuthority 354 && pszParsedAuthority[0] != '\0') /* Authority present? */ 355 { 356 const char *pszParsedPath = RTUriParsedPath(pszURI, &Parsed); 357 if (pszParsedPath) 358 { 359 /* Always use UNIXy paths internally. */ 360 if (RTStrAPrintf(&pszSrcPath, "//%s%s", pszParsedAuthority, pszParsedPath) == -1) 361 rc = VERR_NO_MEMORY; 362 } 363 else 364 rc = VERR_INVALID_PARAMETER; 365 } 366 else 367 { 368 pszSrcPath = RTUriFilePath(pszURI); 369 if (!pszSrcPath) 370 rc = VERR_INVALID_PARAMETER; 371 } 372 373 LogFlowFunc(("pszURI=%s, fFlags=0x%x -> pszParsedAuthority=%s, pszSrcPath=%s, rc=%Rrc\n", 374 pszURI, fFlags, pszParsedAuthority ? pszParsedAuthority : "<None>", pszSrcPath, rc)); 375 376 if (RT_SUCCESS(rc)) 352 377 { 353 378 /* Add the path to our internal file list (recursive in … … 366 391 m_lstRoot.append(pszDstPath); 367 392 368 LogFlowFunc(("psz FilePath=%s, pszFileName=%s, pszRoot=%s\n",393 LogFlowFunc(("pszSrcPath=%s, pszFileName=%s, pszRoot=%s\n", 369 394 pszSrcPath, pszFileName, pszDstPath)); 370 395 … … 376 401 else 377 402 rc = VERR_INVALID_PARAMETER; 378 379 RTStrFree(pszSrcPath); 380 } 381 else 382 rc = VERR_INVALID_PARAMETER; 403 } 404 405 RTStrFree(pszSrcPath); 383 406 384 407 LogFlowFuncLeaveRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.

