VirtualBox

Changeset 99802 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
May 16, 2023 12:05:16 AM (20 months ago)
Author:
vboxsync
Message:

*: Adjustments necessary for dropping -Zc:wchar_t- on windows and instead let the C++ compiler use the native wchar_t type.

Location:
trunk/src/VBox/HostServices/SharedFolders
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/VBoxSharedFoldersSvc.cpp

    r98103 r99802  
    359359                                                        pFolderName->u16Size, pFolderName->u16Length, cb));
    360360
    361                 rc = RTUtf16ToUtf8(pFolderName->String.ucs2, &pszFolderName);
     361                rc = RTUtf16ToUtf8(pFolderName->String.utf16, &pszFolderName);
    362362                RTMemFree(pFolderName);
    363363                AssertRCReturn(rc, rc);
     
    433433            {
    434434                LogRel(("SharedFolders host service: %Rrc loading %d [%ls] -> [%s]\n",
    435                         rc, i, pMapName->String.ucs2, pszFolderName));
     435                        rc, i, pMapName->String.utf16, pszFolderName));
    436436            }
    437437
     
    10701070            else
    10711071                Log(("SharedFolders host service: request to map folder '%ls'\n",
    1072                      ((PSHFLSTRING)paParms[0].u.pointer.addr)->String.ucs2));
     1072                     ((PSHFLSTRING)paParms[0].u.pointer.addr)->String.utf16));
    10731073
    10741074            /* Verify parameter count and types. */
     
    11061106                        && paParms[0].u.pointer.size >= sizeof(SHFLSTRING)
    11071107                        && pszMapName->u16Length >= 2
    1108                         && pszMapName->String.ucs2[pszMapName->u16Length / 2 - 1] == 0x0000)
     1108                        && pszMapName->String.utf16[pszMapName->u16Length / 2 - 1] == 0x0000)
    11091109                    {
    11101110                        pszMapName->u16Length -= 2;
     
    17311731
    17321732                char *pszHostPath;
    1733                 rc = RTUtf16ToUtf8(pHostPath->String.ucs2, &pszHostPath);
     1733                rc = RTUtf16ToUtf8(pHostPath->String.utf16, &pszHostPath);
    17341734                if (RT_SUCCESS(rc))
    17351735                {
     
    17601760        Log(("SharedFolders host service: svcCall: SHFL_FN_REMOVE_MAPPING\n"));
    17611761        LogRel(("SharedFolders host service: Removing host mapping '%ls'\n",
    1762                 ((SHFLSTRING *)paParms[0].u.pointer.addr)->String.ucs2));
     1762                ((SHFLSTRING *)paParms[0].u.pointer.addr)->String.utf16));
    17631763
    17641764        /* Verify parameter count and types. */
  • trunk/src/VBox/HostServices/SharedFolders/mappings.cpp

    r98103 r99802  
    183183     */
    184184    LogRel2(("SharedFolders: mapping a placeholder for '%ls' -> '%s'\n",
    185               pLoadedMapping->pMapName->String.ucs2, pLoadedMapping->pszFolderName));
     185              pLoadedMapping->pMapName->String.utf16, pLoadedMapping->pszFolderName));
    186186    return vbsfMappingsAdd(pLoadedMapping->pszFolderName, pLoadedMapping->pMapName,
    187187                           pLoadedMapping->fWritable, pLoadedMapping->fAutoMount, pLoadedMapping->pAutoMountPoint,
     
    214214                else
    215215                    LogRel(("SharedFolders: Warning! No free root ID entry for mapping #%u: %ls [%s]\n", iMapping,
    216                             g_FolderMapping[iMapping].pMapName->String.ucs2, g_FolderMapping[iMapping].pszFolderName));
     216                            g_FolderMapping[iMapping].pMapName->String.utf16, g_FolderMapping[iMapping].pszFolderName));
    217217            }
    218218        }
     
    225225            if (iMapping != SHFL_ROOT_NIL)
    226226                LogRel2(("SharedFolders: idRoot %u: iMapping #%u: %ls [%s]\n", idRoot, iMapping,
    227                          g_FolderMapping[iMapping].pMapName->String.ucs2, g_FolderMapping[iMapping].pszFolderName));
     227                         g_FolderMapping[iMapping].pMapName->String.utf16, g_FolderMapping[iMapping].pszFolderName));
    228228        }
    229229}
     
    268268            && !g_FolderMapping[i].fPlaceholder) /* Don't allow mapping placeholders. */
    269269        {
    270             if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.ucs2, pwszName))
     270            if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.utf16, pwszName))
    271271            {
    272272                SHFLROOT root = vbsfMappingGetRootFromIndex(i);
     
    346346    Assert(pszFolderName && pMapName);
    347347
    348     Log(("vbsfMappingsAdd %ls\n", pMapName->String.ucs2));
     348    Log(("vbsfMappingsAdd %ls\n", pMapName->String.utf16));
    349349
    350350    /* Check for duplicates, ignoring placeholders to give the GUI to change stuff at runtime. */
     
    358358                && !g_FolderMapping[i].fPlaceholder)
    359359            {
    360                 if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.ucs2, pMapName->String.ucs2))
     360                if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.utf16, pMapName->String.utf16))
    361361                {
    362                     AssertMsgFailed(("vbsfMappingsAdd: %ls mapping already exists!!\n", pMapName->String.ucs2));
     362                    AssertMsgFailed(("vbsfMappingsAdd: %ls mapping already exists!!\n", pMapName->String.utf16));
    363363                    return VERR_ALREADY_EXISTS;
    364364                }
     
    414414    if (i == SHFL_MAX_MAPPINGS)
    415415    {
    416         AssertLogRelMsgFailed(("vbsfMappingsAdd: no more room to add mapping %s to %ls!!\n", pszFolderName, pMapName->String.ucs2));
     416        AssertLogRelMsgFailed(("vbsfMappingsAdd: no more room to add mapping %s to %ls!!\n", pszFolderName, pMapName->String.utf16));
    417417        return VERR_TOO_MUCH_DATA;
    418418    }
    419419
    420420    Log(("vbsfMappingsAdd: added mapping %s to %ls (slot %u, root %u)\n",
    421          pszFolderName, pMapName->String.ucs2, i, vbsfMappingGetRootFromIndex(i)));
     421         pszFolderName, pMapName->String.utf16, i, vbsfMappingGetRootFromIndex(i)));
    422422    return VINF_SUCCESS;
    423423}
     
    436436{
    437437    Assert(pMapName);
    438     Log(("vbsfMappingsRemove %ls\n", pMapName->String.ucs2));
     438    Log(("vbsfMappingsRemove %ls\n", pMapName->String.utf16));
    439439
    440440    /*
     
    448448        if (g_FolderMapping[i].fValid == true)
    449449        {
    450             if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.ucs2, pMapName->String.ucs2))
     450            if (!RTUtf16LocaleICmp(g_FolderMapping[i].pMapName->String.utf16, pMapName->String.utf16))
    451451            {
    452452                if (g_FolderMapping[i].cMappings != 0)
    453453                {
    454                     LogRel2(("SharedFolders: removing '%ls' -> '%s'%s, which is still used by the guest\n", pMapName->String.ucs2,
     454                    LogRel2(("SharedFolders: removing '%ls' -> '%s'%s, which is still used by the guest\n", pMapName->String.utf16,
    455455                             g_FolderMapping[i].pszFolderName, g_FolderMapping[i].fPlaceholder ? " (again)" : ""));
    456456                    g_FolderMapping[i].fMissing = true;
     
    463463                    /* pMapName can be the same as g_FolderMapping[i].pMapName when
    464464                     * called from vbsfUnmapFolder, log it before deallocating the memory. */
    465                     Log(("vbsfMappingsRemove: mapping %ls removed\n", pMapName->String.ucs2));
     465                    Log(("vbsfMappingsRemove: mapping %ls removed\n", pMapName->String.utf16));
    466466                    bool fSame = g_FolderMapping[i].pMapName == pMapName;
    467467
     
    621621                {
    622622                    pString->u16Length = pFolderMapping->pMapName->u16Length;
    623                     memcpy(pString->String.ucs2, pFolderMapping->pMapName->String.ucs2,
     623                    memcpy(pString->String.utf16, pFolderMapping->pMapName->String.utf16,
    624624                           pFolderMapping->pMapName->u16Size);
    625625                    rc = VINF_SUCCESS;
     
    786786
    787787    if (BIT_FLAG(pClient->fu32Flags, SHFL_CF_UTF8))
    788     {
    789788        Log(("vbsfMapFolder %s\n", pszMapName->String.utf8));
    790     }
    791789    else
    792     {
    793         Log(("vbsfMapFolder %ls\n", pszMapName->String.ucs2));
    794     }
     790        Log(("vbsfMapFolder %ls\n", pszMapName->String.utf16));
    795791
    796792    AssertMsgReturn(wcDelimiter == '/' || wcDelimiter == '\\',
     
    825821    else
    826822    {
    827         pFolderMapping = vbsfMappingGetByName(pszMapName->String.ucs2, pRoot);
     823        pFolderMapping = vbsfMappingGetByName(pszMapName->String.utf16, pRoot);
    828824    }
    829825
     
    901897        Assert(pFolderMapping->fMissing);
    902898        LogRel2(("SharedFolders: unmapping placeholder '%ls' -> '%s'\n",
    903                 pFolderMapping->pMapName->String.ucs2, pFolderMapping->pszFolderName));
     899                pFolderMapping->pMapName->String.utf16, pFolderMapping->pszFolderName));
    904900        vbsfMappingsRemove(pFolderMapping->pMapName);
    905901    }
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r99775 r99802  
    266266    else
    267267    {
    268         LogRel2(("SharedFolders: GuestToHost 0x%RX32 [%.*ls]->[%s] %Rrc\n", fu32PathFlags, pPath->u16Length / 2, &pPath->String.ucs2[0], pszHostPath, rc));
     268        LogRel2(("SharedFolders: GuestToHost 0x%RX32 [%.*ls]->[%s] %Rrc\n", fu32PathFlags, pPath->u16Length / 2, &pPath->String.utf16[0], pszHostPath, rc));
    269269    }
    270270
     
    10601060
    10611061    /* 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 ucs2 to utf8 if
     1062     * expects case-insensitive paths but the host is case-sensitive) and convert utf16 to utf8 if
    10631063     * necessary.
    10641064     */
     
    16751675        {
    16761676            /* Build a host full path for the given path
    1677              * and convert ucs2 to utf8 if necessary.
     1677             * and convert utf16 to utf8 if necessary.
    16781678             */
    16791679            char *pszFullPath = NULL;
     
    17871787        else
    17881788        {
    1789             pSFDEntry->name.String.ucs2[0] = 0;
    1790             pwszString = pSFDEntry->name.String.ucs2;
     1789            pSFDEntry->name.String.utf16[0] = 0;
     1790            pwszString = pSFDEntry->name.String.utf16;
    17911791            int rc2 = RTStrToUtf16Ex(pDirEntry->szName, RTSTR_MAX, &pwszString, pDirEntry->cbName+1, NULL);
    17921792            AssertRC(rc2);
     
    18171817            }
    18181818#endif
    1819             pSFDEntry->name.u16Length = (uint32_t)RTUtf16Len(pSFDEntry->name.String.ucs2) * 2;
     1819            pSFDEntry->name.u16Length = (uint32_t)RTUtf16Len(pSFDEntry->name.String.utf16) * 2;
    18201820            pSFDEntry->name.u16Size = pSFDEntry->name.u16Length + 2;
    18211821
    18221822            Log(("SHFL: File name size %d\n", pSFDEntry->name.u16Size));
    1823             Log(("SHFL: File name %ls\n", &pSFDEntry->name.String.ucs2));
     1823            Log(("SHFL: File name %ls\n", &pSFDEntry->name.String.utf16));
    18241824
    18251825            // adjust cbNeeded (it was overestimated before)
     
    18781878    /* Build a host full path for the given path, handle file name case issues
    18791879     * (if the guest expects case-insensitive paths but the host is
    1880      * case-sensitive) and convert ucs2 to utf8 if necessary.
     1880     * case-sensitive) and convert utf16 to utf8 if necessary.
    18811881     */
    18821882    char *pszFullPath = NULL;
     
    21942194
    21952195    ShflStringInitBuffer(&Buf.Dummy, sizeof(Buf));
    2196     Buf.Dummy.String.ucs2[0] = '\0';
     2196    Buf.Dummy.String.utf16[0] = '\0';
    21972197    rc = vbsfBuildFullPath(pClient, root, &Buf.Dummy, sizeof(Buf), &pszFullPath, NULL);
    21982198
     
    24102410    {
    24112411        /*
    2412          * Build a host full path for the given path and convert ucs2 to utf8 if necessary.
     2412         * Build a host full path for the given path and convert utf16 to utf8 if necessary.
    24132413         */
    24142414        char *pszFullPath = NULL;
     
    24882488
    24892489    /* Build a host full path for the given path
    2490      * and convert ucs2 to utf8 if necessary.
     2490     * and convert utf16 to utf8 if necessary.
    24912491     */
    24922492    char *pszFullPathSrc = NULL;
  • trunk/src/VBox/HostServices/SharedFolders/vbsfpath.cpp

    r98103 r99802  
    491491        uint32_t cwcSrc  = 0;
    492492        PRTUTF16 pwszSrc = NULL;
    493         rc = vbsfNormalizeStringDarwin(&pGuestString->String.ucs2[0],
     493        rc = vbsfNormalizeStringDarwin(&pGuestString->String.utf16[0],
    494494                                       pGuestString->u16Length / sizeof(RTUTF16),
    495495                                       &pwszSrc, &cwcSrc);
    496496#else
    497497        uint32_t  const cwcSrc  = pGuestString->u16Length / sizeof(RTUTF16);
    498         PCRTUTF16 const pwszSrc = &pGuestString->String.ucs2[0];
     498        PCRTUTF16 const pwszSrc = &pGuestString->String.utf16[0];
    499499#endif
    500500
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette