VirtualBox

Ignore:
Timestamp:
Mar 10, 2008 4:01:58 PM (17 years ago)
Author:
vboxsync
Message:

UCS-2 -> UTF-16.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r7327 r7418  
    44804480    Log (("Adding shared folder '%ls' -> '%ls'\n", aName, aData.mHostPath.raw()));
    44814481
    4482     cbString = (RTStrUcs2Len (aData.mHostPath) + 1) * sizeof (RTUCS2);
     4482    cbString = (RTUtf16Len (aData.mHostPath) + 1) * sizeof (RTUTF16);
    44834483    if (cbString >= UINT16_MAX)
    44844484        return setError (E_INVALIDARG, tr ("The name is too long"));
     
    44884488
    44894489    pFolderName->u16Size   = (uint16_t)cbString;
    4490     pFolderName->u16Length = (uint16_t)cbString - sizeof(RTUCS2);
     4490    pFolderName->u16Length = (uint16_t)cbString - sizeof(RTUTF16);
    44914491
    44924492    parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
     
    44944494    parms[0].u.pointer.size = sizeof (SHFLSTRING) + (uint16_t)cbString;
    44954495
    4496     cbString = (RTStrUcs2Len (aName) + 1) * sizeof (RTUCS2);
     4496    cbString = (RTUtf16Len (aName) + 1) * sizeof (RTUTF16);
    44974497    if (cbString >= UINT16_MAX)
    44984498    {
     
    45054505
    45064506    pMapName->u16Size   = (uint16_t)cbString;
    4507     pMapName->u16Length = (uint16_t)cbString - sizeof (RTUCS2);
     4507    pMapName->u16Length = (uint16_t)cbString - sizeof (RTUTF16);
    45084508
    45094509    parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
     
    45514551    Log (("Removing shared folder '%ls'\n", aName));
    45524552
    4553     cbString = (RTStrUcs2Len (aName) + 1) * sizeof (RTUCS2);
     4553    cbString = (RTUtf16Len (aName) + 1) * sizeof (RTUTF16);
    45544554    if (cbString >= UINT16_MAX)
    45554555        return setError (E_INVALIDARG, tr ("The name is too long"));
     
    45594559
    45604560    pMapName->u16Size   = (uint16_t)cbString;
    4561     pMapName->u16Length = (uint16_t)cbString - sizeof (RTUCS2);
     4561    pMapName->u16Length = (uint16_t)cbString - sizeof (RTUTF16);
    45624562
    45634563    parms.type = VBOX_HGCM_SVC_PARM_PTR;
     
    61216121    BSTR            str = NULL;
    61226122    *phrc = S_OK;
    6123 #define STR_CONV()  do { rc = RTStrUcs2ToUtf8(&psz, str); RC_CHECK(); } while (0)
     6123#define STR_CONV()  do { rc = RTUtf16ToUtf8(str, &psz); RC_CHECK(); } while (0)
    61246124#define STR_FREE()  do { if (str) { SysFreeString(str); str = NULL; } if (psz) { RTStrFree(psz); psz = NULL; } } while (0)
    61256125#define RC_CHECK()  do { if (VBOX_FAILURE(rc)) { AssertMsgFailed(("rc=%Vrc\n", rc)); STR_FREE(); return rc; } } while (0)
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