VirtualBox

Changeset 39189 in vbox


Ignore:
Timestamp:
Nov 3, 2011 2:23:26 PM (13 years ago)
Author:
vboxsync
Message:

usb/win: get rid of utf8->ansi string conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp

    r38785 r39189  
    327327    for (; pDrList; pDrList = pDrList->pNext)
    328328    {
    329         LPSTR *lppszString = NULL;
     329        char ** lppszString = NULL;
    330330        if (pConInfo->DeviceDescriptor.iManufacturer && pDrList->iDr == pConInfo->DeviceDescriptor.iManufacturer)
    331331        {
    332             lppszString = (LPSTR*)&pDev->pszManufacturer;
     332            lppszString = (char**)&pDev->pszManufacturer;
    333333        }
    334334        else if (pConInfo->DeviceDescriptor.iProduct && pDrList->iDr == pConInfo->DeviceDescriptor.iProduct)
    335335        {
    336             lppszString = (LPSTR*)&pDev->pszProduct;
     336            lppszString = (char**)&pDev->pszProduct;
    337337        }
    338338        else if (pConInfo->DeviceDescriptor.iSerialNumber && pDrList->iDr == pConInfo->DeviceDescriptor.iSerialNumber)
    339339        {
    340             lppszString = (LPSTR*)&pDev->pszSerialNumber;
     340            lppszString = (char**)&pDev->pszSerialNumber;
    341341        }
    342342
    343343        if (lppszString)
    344344        {
    345             char *pStringUTF8 = NULL;
    346345/** @todo r=bird: This code is making bad asumptions that strings are sane and
    347346 *  that stuff succeeds:
    348347 *  http://vbox.innotek.de/pipermail/vbox-dev/2011-August/004516.html
    349348 *
    350  *  Also, why is this code converting stuff to the ANSI code page?!?  If
    351  *  That's somehow required, the reason must be documented since all strings in
    352  *  VBox are UTF-8 unless explicitly stated otherwise! */
    353             RTUtf16ToUtf8((PCRTUTF16)pDrList->StrDr.bString, &pStringUTF8);
    354             RTStrUtf8ToCurrentCP(lppszString, pStringUTF8);
    355             RTStrFree(pStringUTF8);
     349 *  */
     350            RTUtf16ToUtf8((PCRTUTF16)pDrList->StrDr.bString, lppszString);
    356351            if (pDrList->iDr == pConInfo->DeviceDescriptor.iSerialNumber)
    357352            {
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