Changeset 85520 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jul 29, 2020 11:38:05 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropTarget.cpp
r85472 r85520 30 30 #include <iprt/path.h> 31 31 #include <iprt/utf16.h> 32 #include <iprt/uri.h> 32 33 #include <VBox/log.h> 33 34 … … 389 390 /* First, get the file count. */ 390 391 /** @todo Does this work on Windows 2000 / NT4? */ 391 char *pszFiles = NULL;392 uint32_t cchFiles = 0;392 char *pszFiles = NULL; 393 size_t cchFiles = 0; 393 394 UINT cFiles = DragQueryFile(hDrop, UINT32_MAX /* iFile */, NULL /* lpszFile */, 0 /* cchFile */); 394 395 … … 454 455 if (RT_SUCCESS(rc)) 455 456 { 456 rc = RTStrAAppendExN(&pszFiles, 1 /* cPairs */, pszFileUtf8, cchFileUtf8); 457 if (RT_SUCCESS(rc)) 458 cchFiles += cchFileUtf8; 457 char *pszFileURI = RTUriFileCreate(pszFileUtf8); 458 if (pszFileURI) 459 { 460 const size_t cchFileURI = RTStrNLen(pszFileURI, RTPATH_MAX); 461 rc = RTStrAAppendExN(&pszFiles, 1 /* cPairs */, pszFileURI, cchFileURI); 462 if (RT_SUCCESS(rc)) 463 cchFiles += cchFileURI; 464 465 RTStrFree(pszFileURI); 466 } 467 else 468 rc = VERR_NO_MEMORY; 459 469 } 460 470 } … … 465 475 RTStrFree(pszFileUtf8); 466 476 467 if (RT_FAILURE(rc))468 break;469 470 /* Add separation between filenames.471 * Note: Also do this for the last element of the list. */472 rc = RTStrAAppendExN(&pszFiles, 1 /* cPairs */, DND_PATH_SEPARATOR, 2 /* Bytes */);473 477 if (RT_SUCCESS(rc)) 474 cchFiles += 2; /* Include \r\n */ 478 { 479 /* Add separation between filenames. 480 * Note: Also do this for the last element of the list. */ 481 rc = RTStrAAppendExN(&pszFiles, 1 /* cPairs */, DND_PATH_SEPARATOR, 2 /* Bytes */); 482 if (RT_SUCCESS(rc)) 483 cchFiles += 2; /* Include \r\n */ 484 } 475 485 } 476 486 … … 478 488 { 479 489 cchFiles += 1; /* Add string termination. */ 480 uint32_t cbFiles = cchFiles * sizeof(char); 481 482 LogFlowFunc(("cFiles=%u, cchFiles=%RU32, cbFiles=%RU32, pszFiles=0x%p\n", 490 491 const size_t cbFiles = cchFiles * sizeof(char); 492 493 LogFlowFunc(("cFiles=%u, cchFiles=%zu, cbFiles=%zu, pszFiles=0x%p\n", 483 494 cFiles, cchFiles, cbFiles, pszFiles)); 484 495
Note:
See TracChangeset
for help on using the changeset viewer.