Changeset 99802 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- May 16, 2023 12:05:16 AM (20 months ago)
- Location:
- trunk/src/VBox/HostServices/SharedFolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/VBoxSharedFoldersSvc.cpp
r98103 r99802 359 359 pFolderName->u16Size, pFolderName->u16Length, cb)); 360 360 361 rc = RTUtf16ToUtf8(pFolderName->String.u cs2, &pszFolderName);361 rc = RTUtf16ToUtf8(pFolderName->String.utf16, &pszFolderName); 362 362 RTMemFree(pFolderName); 363 363 AssertRCReturn(rc, rc); … … 433 433 { 434 434 LogRel(("SharedFolders host service: %Rrc loading %d [%ls] -> [%s]\n", 435 rc, i, pMapName->String.u cs2, pszFolderName));435 rc, i, pMapName->String.utf16, pszFolderName)); 436 436 } 437 437 … … 1070 1070 else 1071 1071 Log(("SharedFolders host service: request to map folder '%ls'\n", 1072 ((PSHFLSTRING)paParms[0].u.pointer.addr)->String.u cs2));1072 ((PSHFLSTRING)paParms[0].u.pointer.addr)->String.utf16)); 1073 1073 1074 1074 /* Verify parameter count and types. */ … … 1106 1106 && paParms[0].u.pointer.size >= sizeof(SHFLSTRING) 1107 1107 && pszMapName->u16Length >= 2 1108 && pszMapName->String.u cs2[pszMapName->u16Length / 2 - 1] == 0x0000)1108 && pszMapName->String.utf16[pszMapName->u16Length / 2 - 1] == 0x0000) 1109 1109 { 1110 1110 pszMapName->u16Length -= 2; … … 1731 1731 1732 1732 char *pszHostPath; 1733 rc = RTUtf16ToUtf8(pHostPath->String.u cs2, &pszHostPath);1733 rc = RTUtf16ToUtf8(pHostPath->String.utf16, &pszHostPath); 1734 1734 if (RT_SUCCESS(rc)) 1735 1735 { … … 1760 1760 Log(("SharedFolders host service: svcCall: SHFL_FN_REMOVE_MAPPING\n")); 1761 1761 LogRel(("SharedFolders host service: Removing host mapping '%ls'\n", 1762 ((SHFLSTRING *)paParms[0].u.pointer.addr)->String.u cs2));1762 ((SHFLSTRING *)paParms[0].u.pointer.addr)->String.utf16)); 1763 1763 1764 1764 /* Verify parameter count and types. */ -
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r98103 r99802 183 183 */ 184 184 LogRel2(("SharedFolders: mapping a placeholder for '%ls' -> '%s'\n", 185 pLoadedMapping->pMapName->String.u cs2, pLoadedMapping->pszFolderName));185 pLoadedMapping->pMapName->String.utf16, pLoadedMapping->pszFolderName)); 186 186 return vbsfMappingsAdd(pLoadedMapping->pszFolderName, pLoadedMapping->pMapName, 187 187 pLoadedMapping->fWritable, pLoadedMapping->fAutoMount, pLoadedMapping->pAutoMountPoint, … … 214 214 else 215 215 LogRel(("SharedFolders: Warning! No free root ID entry for mapping #%u: %ls [%s]\n", iMapping, 216 g_FolderMapping[iMapping].pMapName->String.u cs2, g_FolderMapping[iMapping].pszFolderName));216 g_FolderMapping[iMapping].pMapName->String.utf16, g_FolderMapping[iMapping].pszFolderName)); 217 217 } 218 218 } … … 225 225 if (iMapping != SHFL_ROOT_NIL) 226 226 LogRel2(("SharedFolders: idRoot %u: iMapping #%u: %ls [%s]\n", idRoot, iMapping, 227 g_FolderMapping[iMapping].pMapName->String.u cs2, g_FolderMapping[iMapping].pszFolderName));227 g_FolderMapping[iMapping].pMapName->String.utf16, g_FolderMapping[iMapping].pszFolderName)); 228 228 } 229 229 } … … 268 268 && !g_FolderMapping[i].fPlaceholder) /* Don't allow mapping placeholders. */ 269 269 { 270 if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.u cs2, pwszName))270 if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.utf16, pwszName)) 271 271 { 272 272 SHFLROOT root = vbsfMappingGetRootFromIndex(i); … … 346 346 Assert(pszFolderName && pMapName); 347 347 348 Log(("vbsfMappingsAdd %ls\n", pMapName->String.u cs2));348 Log(("vbsfMappingsAdd %ls\n", pMapName->String.utf16)); 349 349 350 350 /* Check for duplicates, ignoring placeholders to give the GUI to change stuff at runtime. */ … … 358 358 && !g_FolderMapping[i].fPlaceholder) 359 359 { 360 if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.u cs2, pMapName->String.ucs2))360 if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.utf16, pMapName->String.utf16)) 361 361 { 362 AssertMsgFailed(("vbsfMappingsAdd: %ls mapping already exists!!\n", pMapName->String.u cs2));362 AssertMsgFailed(("vbsfMappingsAdd: %ls mapping already exists!!\n", pMapName->String.utf16)); 363 363 return VERR_ALREADY_EXISTS; 364 364 } … … 414 414 if (i == SHFL_MAX_MAPPINGS) 415 415 { 416 AssertLogRelMsgFailed(("vbsfMappingsAdd: no more room to add mapping %s to %ls!!\n", pszFolderName, pMapName->String.u cs2));416 AssertLogRelMsgFailed(("vbsfMappingsAdd: no more room to add mapping %s to %ls!!\n", pszFolderName, pMapName->String.utf16)); 417 417 return VERR_TOO_MUCH_DATA; 418 418 } 419 419 420 420 Log(("vbsfMappingsAdd: added mapping %s to %ls (slot %u, root %u)\n", 421 pszFolderName, pMapName->String.u cs2, i, vbsfMappingGetRootFromIndex(i)));421 pszFolderName, pMapName->String.utf16, i, vbsfMappingGetRootFromIndex(i))); 422 422 return VINF_SUCCESS; 423 423 } … … 436 436 { 437 437 Assert(pMapName); 438 Log(("vbsfMappingsRemove %ls\n", pMapName->String.u cs2));438 Log(("vbsfMappingsRemove %ls\n", pMapName->String.utf16)); 439 439 440 440 /* … … 448 448 if (g_FolderMapping[i].fValid == true) 449 449 { 450 if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.u cs2, pMapName->String.ucs2))450 if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.utf16, pMapName->String.utf16)) 451 451 { 452 452 if (g_FolderMapping[i].cMappings != 0) 453 453 { 454 LogRel2(("SharedFolders: removing '%ls' -> '%s'%s, which is still used by the guest\n", pMapName->String.u cs2,454 LogRel2(("SharedFolders: removing '%ls' -> '%s'%s, which is still used by the guest\n", pMapName->String.utf16, 455 455 g_FolderMapping[i].pszFolderName, g_FolderMapping[i].fPlaceholder ? " (again)" : "")); 456 456 g_FolderMapping[i].fMissing = true; … … 463 463 /* pMapName can be the same as g_FolderMapping[i].pMapName when 464 464 * called from vbsfUnmapFolder, log it before deallocating the memory. */ 465 Log(("vbsfMappingsRemove: mapping %ls removed\n", pMapName->String.u cs2));465 Log(("vbsfMappingsRemove: mapping %ls removed\n", pMapName->String.utf16)); 466 466 bool fSame = g_FolderMapping[i].pMapName == pMapName; 467 467 … … 621 621 { 622 622 pString->u16Length = pFolderMapping->pMapName->u16Length; 623 memcpy(pString->String.u cs2, pFolderMapping->pMapName->String.ucs2,623 memcpy(pString->String.utf16, pFolderMapping->pMapName->String.utf16, 624 624 pFolderMapping->pMapName->u16Size); 625 625 rc = VINF_SUCCESS; … … 786 786 787 787 if (BIT_FLAG(pClient->fu32Flags, SHFL_CF_UTF8)) 788 {789 788 Log(("vbsfMapFolder %s\n", pszMapName->String.utf8)); 790 }791 789 else 792 { 793 Log(("vbsfMapFolder %ls\n", pszMapName->String.ucs2)); 794 } 790 Log(("vbsfMapFolder %ls\n", pszMapName->String.utf16)); 795 791 796 792 AssertMsgReturn(wcDelimiter == '/' || wcDelimiter == '\\', … … 825 821 else 826 822 { 827 pFolderMapping = vbsfMappingGetByName(pszMapName->String.u cs2, pRoot);823 pFolderMapping = vbsfMappingGetByName(pszMapName->String.utf16, pRoot); 828 824 } 829 825 … … 901 897 Assert(pFolderMapping->fMissing); 902 898 LogRel2(("SharedFolders: unmapping placeholder '%ls' -> '%s'\n", 903 pFolderMapping->pMapName->String.u cs2, pFolderMapping->pszFolderName));899 pFolderMapping->pMapName->String.utf16, pFolderMapping->pszFolderName)); 904 900 vbsfMappingsRemove(pFolderMapping->pMapName); 905 901 } -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r99775 r99802 266 266 else 267 267 { 268 LogRel2(("SharedFolders: GuestToHost 0x%RX32 [%.*ls]->[%s] %Rrc\n", fu32PathFlags, pPath->u16Length / 2, &pPath->String.u cs2[0], pszHostPath, rc));268 LogRel2(("SharedFolders: GuestToHost 0x%RX32 [%.*ls]->[%s] %Rrc\n", fu32PathFlags, pPath->u16Length / 2, &pPath->String.utf16[0], pszHostPath, rc)); 269 269 } 270 270 … … 1060 1060 1061 1061 /* Build a host full path for the given path, handle file name case issues (if the guest 1062 * expects case-insensitive paths but the host is case-sensitive) and convert u cs2to utf8 if1062 * expects case-insensitive paths but the host is case-sensitive) and convert utf16 to utf8 if 1063 1063 * necessary. 1064 1064 */ … … 1675 1675 { 1676 1676 /* Build a host full path for the given path 1677 * and convert u cs2to utf8 if necessary.1677 * and convert utf16 to utf8 if necessary. 1678 1678 */ 1679 1679 char *pszFullPath = NULL; … … 1787 1787 else 1788 1788 { 1789 pSFDEntry->name.String.u cs2[0] = 0;1790 pwszString = pSFDEntry->name.String.u cs2;1789 pSFDEntry->name.String.utf16[0] = 0; 1790 pwszString = pSFDEntry->name.String.utf16; 1791 1791 int rc2 = RTStrToUtf16Ex(pDirEntry->szName, RTSTR_MAX, &pwszString, pDirEntry->cbName+1, NULL); 1792 1792 AssertRC(rc2); … … 1817 1817 } 1818 1818 #endif 1819 pSFDEntry->name.u16Length = (uint32_t)RTUtf16Len(pSFDEntry->name.String.u cs2) * 2;1819 pSFDEntry->name.u16Length = (uint32_t)RTUtf16Len(pSFDEntry->name.String.utf16) * 2; 1820 1820 pSFDEntry->name.u16Size = pSFDEntry->name.u16Length + 2; 1821 1821 1822 1822 Log(("SHFL: File name size %d\n", pSFDEntry->name.u16Size)); 1823 Log(("SHFL: File name %ls\n", &pSFDEntry->name.String.u cs2));1823 Log(("SHFL: File name %ls\n", &pSFDEntry->name.String.utf16)); 1824 1824 1825 1825 // adjust cbNeeded (it was overestimated before) … … 1878 1878 /* Build a host full path for the given path, handle file name case issues 1879 1879 * (if the guest expects case-insensitive paths but the host is 1880 * case-sensitive) and convert u cs2to utf8 if necessary.1880 * case-sensitive) and convert utf16 to utf8 if necessary. 1881 1881 */ 1882 1882 char *pszFullPath = NULL; … … 2194 2194 2195 2195 ShflStringInitBuffer(&Buf.Dummy, sizeof(Buf)); 2196 Buf.Dummy.String.u cs2[0] = '\0';2196 Buf.Dummy.String.utf16[0] = '\0'; 2197 2197 rc = vbsfBuildFullPath(pClient, root, &Buf.Dummy, sizeof(Buf), &pszFullPath, NULL); 2198 2198 … … 2410 2410 { 2411 2411 /* 2412 * Build a host full path for the given path and convert u cs2to utf8 if necessary.2412 * Build a host full path for the given path and convert utf16 to utf8 if necessary. 2413 2413 */ 2414 2414 char *pszFullPath = NULL; … … 2488 2488 2489 2489 /* Build a host full path for the given path 2490 * and convert u cs2to utf8 if necessary.2490 * and convert utf16 to utf8 if necessary. 2491 2491 */ 2492 2492 char *pszFullPathSrc = NULL; -
trunk/src/VBox/HostServices/SharedFolders/vbsfpath.cpp
r98103 r99802 491 491 uint32_t cwcSrc = 0; 492 492 PRTUTF16 pwszSrc = NULL; 493 rc = vbsfNormalizeStringDarwin(&pGuestString->String.u cs2[0],493 rc = vbsfNormalizeStringDarwin(&pGuestString->String.utf16[0], 494 494 pGuestString->u16Length / sizeof(RTUTF16), 495 495 &pwszSrc, &cwcSrc); 496 496 #else 497 497 uint32_t const cwcSrc = pGuestString->u16Length / sizeof(RTUTF16); 498 PCRTUTF16 const pwszSrc = &pGuestString->String.u cs2[0];498 PCRTUTF16 const pwszSrc = &pGuestString->String.utf16[0]; 499 499 #endif 500 500
Note:
See TracChangeset
for help on using the changeset viewer.