VirtualBox

Ignore:
Timestamp:
Sep 23, 2010 12:57:52 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66148
Message:

com/string: Remove bool conversion operator and other convenience error operators. They are hiding programming errors (like incorrect empty string checks, and in one case a free of the wrong pointer).

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp

    r32709 r32718  
    256256static HRESULT NewUniqueKey(ComPtr<IMachine> pMachine, const char *pszKeyBase, Utf8Str &rKey)
    257257{
     258    Bstr KeyBase(pszKeyBase);
    258259    Bstr Keys;
    259     HRESULT hrc = pMachine->GetExtraData(Bstr(pszKeyBase), Keys.asOutParam());
     260    HRESULT hrc = pMachine->GetExtraData(KeyBase.raw(), Keys.asOutParam());
    260261    if (FAILED(hrc))
    261262        return hrc;
     
    265266    {
    266267        rKey = "1";
    267         return pMachine->SetExtraData(Bstr(pszKeyBase), Bstr("1"));
     268        return pMachine->SetExtraData(KeyBase.raw(), Bstr(rKey).raw());
    268269    }
    269270
     
    290291            rKey = szKey;
    291292            Utf8StrFmt NewKeysUtf8("%s %s", pszKeys, szKey);
    292             return pMachine->SetExtraData(Bstr(pszKeyBase), Bstr(NewKeysUtf8));
     293            return pMachine->SetExtraData(KeyBase.raw(),
     294                                          Bstr(NewKeysUtf8).raw());
    293295        }
    294296    }
     
    376378static HRESULT SetString(ComPtr<IMachine> pMachine, const char *pszKeyBase, const char *pszKey, const char *pszAttribute, const char *pszValue)
    377379{
    378     HRESULT hrc = pMachine->SetExtraData(Bstr(Utf8StrFmt("%s/%s/%s", pszKeyBase, pszKey, pszAttribute)), Bstr(pszValue));
     380    HRESULT hrc = pMachine->SetExtraData(BstrFmt("%s/%s/%s", pszKeyBase,
     381                                                 pszKey, pszAttribute).raw(),
     382                                         Bstr(pszValue).raw());
    379383    if (FAILED(hrc))
    380384        RTMsgError("Failed to set '%s/%s/%s' to '%s'! hrc=%#x",
     
    432436    ComPtr<IMachine> machine;
    433437    /* assume it's a UUID */
    434     rc = aVirtualBox->GetMachine(Bstr(argv[0]), machine.asOutParam());
     438    rc = aVirtualBox->GetMachine(Bstr(argv[0]).raw(), machine.asOutParam());
    435439    if (FAILED(rc) || !machine)
    436440    {
    437441        /* must be a name */
    438         CHECK_ERROR_RET(aVirtualBox, FindMachine(Bstr(argv[0]), machine.asOutParam()), 1);
     442        CHECK_ERROR_RET(aVirtualBox, FindMachine(Bstr(argv[0]).raw(),
     443                                                 machine.asOutParam()), 1);
    439444    }
    440445
     
    14731478    {
    14741479        ComPtr<IMedium> hardDisk;
    1475         CHECK_ERROR(aVirtualBox, OpenMedium(Bstr(filename), DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam()));
     1480        CHECK_ERROR(aVirtualBox, OpenMedium(Bstr(filename).raw(),
     1481                                            DeviceType_HardDisk,
     1482                                            AccessMode_ReadWrite,
     1483                                            hardDisk.asOutParam()));
    14761484    }
    14771485
     
    18901898
    18911899    ComPtr<IMachine> ptrMachine;
    1892     HRESULT rc = aVirtualBox->GetMachine(Bstr(argv[0]), ptrMachine.asOutParam());
     1900    HRESULT rc = aVirtualBox->GetMachine(Bstr(argv[0]).raw(),
     1901                                         ptrMachine.asOutParam());
    18931902    if (FAILED(rc) || ptrMachine.isNull())
    1894         CHECK_ERROR_RET(aVirtualBox, FindMachine(Bstr(argv[0]), ptrMachine.asOutParam()), 1);
     1903        CHECK_ERROR_RET(aVirtualBox, FindMachine(Bstr(argv[0]).raw(),
     1904                                                 ptrMachine.asOutParam()), 1);
    18951905
    18961906    CHECK_ERROR_RET(ptrMachine, LockMachine(aSession, LockType_Shared), 1);
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r32701 r32718  
    7878    if (!Guid(machineuuid).isEmpty())
    7979    {
    80         CHECK_ERROR(a->virtualBox, GetMachine(machineuuid, machine.asOutParam()));
     80        CHECK_ERROR(a->virtualBox, GetMachine(machineuuid.raw(),
     81                                              machine.asOutParam()));
    8182    }
    8283    else
    8384    {
    84         CHECK_ERROR(a->virtualBox, FindMachine(machineuuid, machine.asOutParam()));
     85        CHECK_ERROR(a->virtualBox, FindMachine(machineuuid.raw(),
     86                                               machine.asOutParam()));
    8587        if (SUCCEEDED (rc))
    8688            machine->COMGETTER(Id)(machineuuid.asOutParam());
     
    329331                    if (a->argv[2])
    330332                    {
    331                         CHECK_ERROR_RET(adapter, COMSETTER(TraceFile)(Bstr(a->argv[2])), 1);
     333                        CHECK_ERROR_RET(adapter, COMSETTER(TraceFile)(Bstr(a->argv[2]).raw()), 1);
    332334                    }
    333335                    else
     
    430432                        CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1);
    431433                        if (a->argc == 4)
    432                             CHECK_ERROR_RET(adapter, COMSETTER(NATNetwork)(Bstr(a->argv[3])), 1);
     434                            CHECK_ERROR_RET(adapter, COMSETTER(NATNetwork)(Bstr(a->argv[3]).raw()), 1);
    433435                        CHECK_ERROR_RET(adapter, AttachToNAT(), 1);
    434436                    }
     
    443445                        }
    444446                        CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1);
    445                         CHECK_ERROR_RET(adapter, COMSETTER(HostInterface)(Bstr(a->argv[3])), 1);
     447                        CHECK_ERROR_RET(adapter, COMSETTER(HostInterface)(Bstr(a->argv[3]).raw()), 1);
    446448                        CHECK_ERROR_RET(adapter, AttachToBridgedInterface(), 1);
    447449                    }
     
    455457                        }
    456458                        CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1);
    457                         CHECK_ERROR_RET(adapter, COMSETTER(InternalNetwork)(Bstr(a->argv[3])), 1);
     459                        CHECK_ERROR_RET(adapter, COMSETTER(InternalNetwork)(Bstr(a->argv[3]).raw()), 1);
    458460                        CHECK_ERROR_RET(adapter, AttachToInternalNetwork(), 1);
    459461                    }
     
    468470                        }
    469471                        CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1);
    470                         CHECK_ERROR_RET(adapter, COMSETTER(HostInterface)(Bstr(a->argv[3])), 1);
     472                        CHECK_ERROR_RET(adapter, COMSETTER(HostInterface)(Bstr(a->argv[3]).raw()), 1);
    471473                        CHECK_ERROR_RET(adapter, AttachToHostOnlyInterface(), 1);
    472474                    }
     
    534536                    vrdpports = "0";
    535537                else
    536                     vrdpports = a->argv [2];
    537 
    538                 CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Ports)(vrdpports));
     538                    vrdpports = a->argv[2];
     539
     540                CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Ports)(vrdpports.raw()));
    539541            }
    540542        }
     
    571573            bool attach = !strcmp(a->argv[1], "usbattach");
    572574
    573             Bstr usbId = a->argv [2];
     575            Bstr usbId = a->argv[2];
    574576            if (Guid(usbId).isEmpty())
    575577            {
     
    582584                    CHECK_ERROR_BREAK(host, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll)));
    583585                    ComPtr <IHostUSBDevice> dev;
    584                     CHECK_ERROR_BREAK(host, FindUSBDeviceByAddress(Bstr(a->argv [2]), dev.asOutParam()));
     586                    CHECK_ERROR_BREAK(host, FindUSBDeviceByAddress(Bstr(a->argv[2]).raw(),
     587                                                                   dev.asOutParam()));
    585588                    CHECK_ERROR_BREAK(dev, COMGETTER(Id)(usbId.asOutParam()));
    586589                }
     
    590593                    CHECK_ERROR_BREAK(console, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll)));
    591594                    ComPtr <IUSBDevice> dev;
    592                     CHECK_ERROR_BREAK(console, FindUSBDeviceByAddress(Bstr(a->argv [2]),
    593                                                        dev.asOutParam()));
     595                    CHECK_ERROR_BREAK(console, FindUSBDeviceByAddress(Bstr(a->argv[2]).raw(),
     596                                                                      dev.asOutParam()));
    594597                    CHECK_ERROR_BREAK(dev, COMGETTER(Id)(usbId.asOutParam()));
    595598                }
     
    597600
    598601            if (attach)
    599                 CHECK_ERROR_BREAK(console, AttachUSBDevice(usbId));
     602                CHECK_ERROR_BREAK(console, AttachUSBDevice(usbId.raw()));
    600603            else
    601604            {
    602605                ComPtr <IUSBDevice> dev;
    603                 CHECK_ERROR_BREAK(console, DetachUSBDevice(usbId, dev.asOutParam()));
     606                CHECK_ERROR_BREAK(console, DetachUSBDevice(usbId.raw(),
     607                                                           dev.asOutParam()));
    604608            }
    605609        }
     
    647651            ComPtr<IGuest> guest;
    648652            CHECK_ERROR_BREAK(console, COMGETTER(Guest)(guest.asOutParam()));
    649             CHECK_ERROR_BREAK(guest, SetCredentials(Bstr(a->argv[2]), Bstr(a->argv[3]), Bstr(a->argv[4]), fAllowLocalLogon));
     653            CHECK_ERROR_BREAK(guest, SetCredentials(Bstr(a->argv[2]).raw(),
     654                                                    Bstr(a->argv[3]).raw(),
     655                                                    Bstr(a->argv[4]).raw(),
     656                                                    fAllowLocalLogon));
    650657        }
    651658#if 0 /* TODO: review & remove */
     
    836843
    837844            ComPtr<IProgress> progress;
    838             CHECK_ERROR_BREAK(console, Teleport(bstrHostname, uPort, bstrPassword, uMaxDowntime, progress.asOutParam()));
     845            CHECK_ERROR_BREAK(console, Teleport(bstrHostname.raw(), uPort,
     846                                                bstrPassword.raw(),
     847                                                uMaxDowntime,
     848                                                progress.asOutParam()));
    839849
    840850            if (cMsTimeout)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp

    r32701 r32718  
    258258
    259259    /* check the outcome */
    260     if (   !filename
     260    if (   filename.isEmpty()
    261261        || size == 0)
    262262        return errorSyntax(USAGE_CREATEHD, "Parameters --filename and --size are required");
     
    277277
    278278    ComPtr<IMedium> hardDisk;
    279     CHECK_ERROR(a->virtualBox, CreateHardDisk(format, filename, hardDisk.asOutParam()));
     279    CHECK_ERROR(a->virtualBox, CreateHardDisk(format.raw(), filename.raw(),
     280                                              hardDisk.asOutParam()));
    280281    if (SUCCEEDED(rc) && hardDisk)
    281282    {
     
    286287        if (!comment.isEmpty())
    287288        {
    288             CHECK_ERROR(hardDisk,COMSETTER(Description)(comment));
     289            CHECK_ERROR(hardDisk,COMSETTER(Description)(comment.raw()));
    289290        }
    290291
     
    416417
    417418    /* first guess is that it's a UUID */
    418     CHECK_ERROR(a->virtualBox, FindMedium(Bstr(FilenameOrUuid), DeviceType_HardDisk, hardDisk.asOutParam()));
     419    CHECK_ERROR(a->virtualBox, FindMedium(Bstr(FilenameOrUuid).raw(),
     420                                          DeviceType_HardDisk,
     421                                          hardDisk.asOutParam()));
    419422    if (FAILED(rc))
    420423        return 1;
     
    447450        {
    448451            unknown = true;
    449             rc = a->virtualBox->OpenMedium(Bstr(FilenameOrUuid), DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam());
     452            rc = a->virtualBox->OpenMedium(Bstr(FilenameOrUuid).raw(),
     453                                           DeviceType_HardDisk,
     454                                           AccessMode_ReadWrite,
     455                                           hardDisk.asOutParam());
    450456            if (rc == VBOX_E_FILE_ERROR)
    451457            {
     
    457463                    return 1;
    458464                }
    459                 CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs), DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam()));
     465                CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs).raw(),
     466                                                      DeviceType_HardDisk,
     467                                                      AccessMode_ReadWrite,
     468                                                      hardDisk.asOutParam()));
    460469            }
    461470        }
     
    487496        {
    488497            unknown = true;
    489             rc = a->virtualBox->OpenMedium(Bstr(FilenameOrUuid), DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam());
     498            rc = a->virtualBox->OpenMedium(Bstr(FilenameOrUuid).raw(),
     499                                           DeviceType_HardDisk,
     500                                           AccessMode_ReadWrite,
     501                                           hardDisk.asOutParam());
    490502            if (rc == VBOX_E_FILE_ERROR)
    491503            {
     
    497509                    return 1;
    498510                }
    499                 CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs), DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam()));
     511                CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs).raw(),
     512                                                      DeviceType_HardDisk,
     513                                                      AccessMode_ReadWrite,
     514                                                      hardDisk.asOutParam()));
    500515            }
    501516        }
     
    633648    bool fDstUnknown = false;
    634649
    635     rc = a->virtualBox->FindMedium(src, DeviceType_HardDisk, srcDisk.asOutParam());
     650    rc = a->virtualBox->FindMedium(src.raw(), DeviceType_HardDisk,
     651                                   srcDisk.asOutParam());
    636652    /* no? well, then it's an unknown image */
    637653    if (FAILED (rc))
    638654    {
    639         rc = a->virtualBox->OpenMedium(src, DeviceType_HardDisk, AccessMode_ReadWrite, srcDisk.asOutParam());
     655        rc = a->virtualBox->OpenMedium(src.raw(), DeviceType_HardDisk,
     656                                       AccessMode_ReadWrite,
     657                                       srcDisk.asOutParam());
    640658        if (rc == VBOX_E_FILE_ERROR)
    641659        {
     
    647665                return 1;
    648666            }
    649             CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs), DeviceType_HardDisk, AccessMode_ReadWrite, srcDisk.asOutParam()));
    650         }
    651         if (SUCCEEDED (rc))
     667            CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs).raw(),
     668                                                  DeviceType_HardDisk,
     669                                                  AccessMode_ReadWrite,
     670                                                  srcDisk.asOutParam()));
     671        }
     672        if (SUCCEEDED(rc))
    652673            fSrcUnknown = true;
    653674    }
     
    661682        if (fExisting)
    662683        {
    663             rc = a->virtualBox->FindMedium(dst, DeviceType_HardDisk, dstDisk.asOutParam());
     684            rc = a->virtualBox->FindMedium(dst.raw(), DeviceType_HardDisk,
     685                                           dstDisk.asOutParam());
    664686            /* no? well, then it's an unknown image */
    665             if (FAILED (rc))
     687            if (FAILED(rc))
    666688            {
    667                 rc = a->virtualBox->OpenMedium(dst, DeviceType_HardDisk, AccessMode_ReadWrite, dstDisk.asOutParam());
     689                rc = a->virtualBox->OpenMedium(dst.raw(), DeviceType_HardDisk,
     690                                               AccessMode_ReadWrite,
     691                                               dstDisk.asOutParam());
    668692                if (rc == VBOX_E_FILE_ERROR)
    669693                {
     
    675699                        return 1;
    676700                    }
    677                     CHECK_ERROR_BREAK(a->virtualBox, OpenMedium(Bstr(szFilenameAbs), DeviceType_HardDisk, AccessMode_ReadWrite, dstDisk.asOutParam()));
     701                    CHECK_ERROR_BREAK(a->virtualBox, OpenMedium(Bstr(szFilenameAbs).raw(),
     702                                                                DeviceType_HardDisk,
     703                                                                AccessMode_ReadWrite,
     704                                                                dstDisk.asOutParam()));
    678705                }
    679                 if (SUCCEEDED (rc))
     706                if (SUCCEEDED(rc))
    680707                    fDstUnknown = true;
    681708            }
     
    688715                CHECK_ERROR_BREAK(dstDisk, RefreshState(&state));
    689716            }
    690             CHECK_ERROR_BREAK(dstDisk, COMGETTER(Format) (format.asOutParam()));
     717            CHECK_ERROR_BREAK(dstDisk, COMGETTER(Format)(format.asOutParam()));
    691718        }
    692719        else
     
    694721            /* use the format of the source hard disk if unspecified */
    695722            if (format.isEmpty())
    696                 CHECK_ERROR_BREAK(srcDisk, COMGETTER(Format) (format.asOutParam()));
    697             CHECK_ERROR_BREAK(a->virtualBox, CreateHardDisk(format, dst, dstDisk.asOutParam()));
     723                CHECK_ERROR_BREAK(srcDisk, COMGETTER(Format)(format.asOutParam()));
     724            CHECK_ERROR_BREAK(a->virtualBox, CreateHardDisk(format.raw(),
     725                                                            dst.raw(),
     726                                                            dstDisk.asOutParam()));
    698727        }
    699728
     
    895924        cbRead = 0;
    896925        cbToRead = cbFile - offFile >= (uint64_t)cbBuffer ?
    897                             cbBuffer : (size_t) (cbFile - offFile);
     926                            cbBuffer : (size_t)(cbFile - offFile);
    898927        rc = RTFileRead(File, pvBuf, cbToRead, &cbRead);
    899928        if (RT_FAILURE(rc) || !cbRead)
     
    10241053
    10251054    /* check for required options */
    1026     if (!server || !target)
     1055    if (server.isEmpty() || target.isEmpty())
    10271056        return errorSyntax(USAGE_ADDISCSIDISK, "Parameters --server and --target are required");
    10281057
     
    10361065        if (lun.isEmpty() || lun == "0" || lun == "enc0")
    10371066        {
    1038             CHECK_ERROR_BREAK (a->virtualBox,
    1039                 CreateHardDisk(Bstr ("iSCSI"),
    1040                                BstrFmt ("%ls|%ls", server.raw(), target.raw()),
    1041                                hardDisk.asOutParam()));
     1067            CHECK_ERROR_BREAK(a->virtualBox, CreateHardDisk(Bstr("iSCSI").raw(),
     1068                                                            BstrFmt("%ls|%ls",
     1069                                                                    server.raw(),
     1070                                                                    target.raw()).raw(),
     1071                                                            hardDisk.asOutParam()));
    10421072        }
    10431073        else
    10441074        {
    1045             CHECK_ERROR_BREAK (a->virtualBox,
    1046                 CreateHardDisk(Bstr ("iSCSI"),
    1047                                BstrFmt ("%ls|%ls|%ls", server.raw(), target.raw(), lun.raw()),
    1048                                hardDisk.asOutParam()));
     1075            CHECK_ERROR_BREAK(a->virtualBox, CreateHardDisk(Bstr("iSCSI").raw(),
     1076                                                            BstrFmt("%ls|%ls|%ls",
     1077                                                                    server.raw(),
     1078                                                                    target.raw(),
     1079                                                                    lun.raw()).raw(),
     1080                                                            hardDisk.asOutParam()));
    10491081        }
    10501082        if (FAILED(rc)) break;
    10511083
    10521084        if (!port.isEmpty())
    1053             server = BstrFmt ("%ls:%ls", server.raw(), port.raw());
     1085            server = BstrFmt("%ls:%ls", server.raw(), port.raw());
    10541086
    10551087        com::SafeArray <BSTR> names;
    10561088        com::SafeArray <BSTR> values;
    10571089
    1058         Bstr ("TargetAddress").detachTo (names.appendedRaw());
    1059         server.detachTo (values.appendedRaw());
    1060         Bstr ("TargetName").detachTo (names.appendedRaw());
    1061         target.detachTo (values.appendedRaw());
     1090        Bstr("TargetAddress").detachTo(names.appendedRaw());
     1091        server.detachTo(values.appendedRaw());
     1092        Bstr("TargetName").detachTo(names.appendedRaw());
     1093        target.detachTo(values.appendedRaw());
    10621094
    10631095        if (!lun.isEmpty())
    10641096        {
    1065             Bstr ("LUN").detachTo (names.appendedRaw());
    1066             lun.detachTo (values.appendedRaw());
     1097            Bstr("LUN").detachTo(names.appendedRaw());
     1098            lun.detachTo(values.appendedRaw());
    10671099        }
    10681100        if (!username.isEmpty())
    10691101        {
    1070             Bstr ("InitiatorUsername").detachTo (names.appendedRaw());
    1071             username.detachTo (values.appendedRaw());
     1102            Bstr("InitiatorUsername").detachTo(names.appendedRaw());
     1103            username.detachTo(values.appendedRaw());
    10721104        }
    10731105        if (!password.isEmpty())
    10741106        {
    1075             Bstr ("InitiatorSecret").detachTo (names.appendedRaw());
    1076             password.detachTo (values.appendedRaw());
     1107            Bstr("InitiatorSecret").detachTo(names.appendedRaw());
     1108            password.detachTo(values.appendedRaw());
    10771109        }
    10781110
     
    10811113        // value does more harm than good, as the initiator name is supposed
    10821114        // to identify a particular initiator uniquely.
    1083 //        Bstr ("InitiatorName").detachTo (names.appendedRaw());
    1084 //        Bstr ("iqn.2008-04.com.sun.virtualbox.initiator").detachTo (values.appendedRaw());
     1115//        Bstr("InitiatorName").detachTo(names.appendedRaw());
     1116//        Bstr("iqn.2008-04.com.sun.virtualbox.initiator").detachTo(values.appendedRaw());
    10851117
    10861118        /// @todo add --targetName and --targetPassword options
     
    10881120        if (fIntNet)
    10891121        {
    1090             Bstr ("HostIPStack").detachTo (names.appendedRaw());
    1091             Bstr ("0").detachTo (values.appendedRaw());
    1092         }
    1093 
    1094         CHECK_ERROR_BREAK (hardDisk,
    1095             SetProperties (ComSafeArrayAsInParam (names),
    1096                            ComSafeArrayAsInParam (values)));
     1122            Bstr("HostIPStack").detachTo(names.appendedRaw());
     1123            Bstr("0").detachTo(values.appendedRaw());
     1124        }
     1125
     1126        CHECK_ERROR_BREAK(hardDisk, SetProperties(ComSafeArrayAsInParam(names),
     1127                                                  ComSafeArrayAsInParam(values)));
    10971128
    10981129        if (DiskType != MediumType_Normal)
     
    11611192    bool unknown = false;
    11621193    /* first guess is that it's a UUID */
    1163     rc = a->virtualBox->FindMedium(Bstr(FilenameOrUuid), DeviceType_HardDisk, hardDisk.asOutParam());
     1194    rc = a->virtualBox->FindMedium(Bstr(FilenameOrUuid).raw(),
     1195                                   DeviceType_HardDisk,
     1196                                   hardDisk.asOutParam());
    11641197    /* no? well, then it's an unkwnown image */
    1165     if (FAILED (rc))
    1166     {
    1167         rc = a->virtualBox->OpenMedium(Bstr(FilenameOrUuid), DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam());
     1198    if (FAILED(rc))
     1199    {
     1200        rc = a->virtualBox->OpenMedium(Bstr(FilenameOrUuid).raw(),
     1201                                       DeviceType_HardDisk,
     1202                                       AccessMode_ReadWrite,
     1203                                       hardDisk.asOutParam());
    11681204        if (rc == VBOX_E_FILE_ERROR)
    11691205        {
     
    11751211                return 1;
    11761212            }
    1177             CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs), DeviceType_HardDisk, AccessMode_ReadWrite, hardDisk.asOutParam()));
    1178         }
    1179         if (SUCCEEDED (rc))
     1213            CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs).raw(),
     1214                                                  DeviceType_HardDisk,
     1215                                                  AccessMode_ReadWrite,
     1216                                                  hardDisk.asOutParam()));
     1217        }
     1218        if (SUCCEEDED(rc))
    11801219            unknown = true;
    11811220    }
     
    11931232        /// @todo NEWMEDIA print the full state value
    11941233        MediumState_T state;
    1195         CHECK_ERROR_BREAK (hardDisk, RefreshState(&state));
     1234        CHECK_ERROR_BREAK(hardDisk, RefreshState(&state));
    11961235        RTPrintf("Accessible:           %s\n", state != MediumState_Inaccessible ? "yes" : "no");
    11971236
     
    11991238        {
    12001239            Bstr err;
    1201             CHECK_ERROR_BREAK (hardDisk, COMGETTER(LastAccessError)(err.asOutParam()));
     1240            CHECK_ERROR_BREAK(hardDisk, COMGETTER(LastAccessError)(err.asOutParam()));
    12021241            RTPrintf("Access Error:         %lS\n", err.raw());
    12031242        }
     
    12051244        Bstr description;
    12061245        hardDisk->COMGETTER(Description)(description.asOutParam());
    1207         if (description)
     1246        if (!description.isEmpty())
    12081247        {
    12091248            RTPrintf("Description:          %lS\n", description.raw());
     
    12181257
    12191258        ComPtr <IMedium> parent;
    1220         hardDisk->COMGETTER(Parent) (parent.asOutParam());
     1259        hardDisk->COMGETTER(Parent)(parent.asOutParam());
    12211260
    12221261        MediumType_T type;
     
    14021441
    14031442    ComPtr<IMedium> pMedium;
    1404     rc = a->virtualBox->OpenMedium(Bstr(Filename), devType, AccessMode_ReadWrite, pMedium.asOutParam());
     1443    rc = a->virtualBox->OpenMedium(Bstr(Filename).raw(), devType,
     1444                                   AccessMode_ReadWrite, pMedium.asOutParam());
    14051445    if (rc == VBOX_E_FILE_ERROR)
    14061446    {
     
    14121452            return 1;
    14131453        }
    1414         CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs), devType, AccessMode_ReadWrite, pMedium.asOutParam()));
     1454        CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(szFilenameAbs).raw(),
     1455                                              devType, AccessMode_ReadWrite,
     1456                                              pMedium.asOutParam()));
    14151457    }
    14161458    if (SUCCEEDED(rc) && pMedium)
     
    14331475            Bstr ImageIdStr = BstrFmt("%RTuuid", &ImageId);
    14341476            Bstr ParentIdStr = BstrFmt("%RTuuid", &ParentId);
    1435             CHECK_ERROR(pMedium, SetIDs(fSetImageId, ImageIdStr, fSetParentId, ParentIdStr));
     1477            CHECK_ERROR(pMedium, SetIDs(fSetImageId, ImageIdStr.raw(),
     1478                                        fSetParentId, ParentIdStr.raw()));
    14361479        }
    14371480    }
     
    15251568
    15261569    if (cmd == CMD_DISK)
    1527         CHECK_ERROR(a->virtualBox, FindMedium(Bstr(FilenameOrUuid), DeviceType_HardDisk, medium.asOutParam()));
     1570        CHECK_ERROR(a->virtualBox, FindMedium(Bstr(FilenameOrUuid).raw(),
     1571                                              DeviceType_HardDisk,
     1572                                              medium.asOutParam()));
    15281573    else if (cmd == CMD_DVD)
    1529         CHECK_ERROR(a->virtualBox, FindMedium(Bstr(FilenameOrUuid), DeviceType_DVD, medium.asOutParam()));
     1574        CHECK_ERROR(a->virtualBox, FindMedium(Bstr(FilenameOrUuid).raw(),
     1575                                              DeviceType_DVD,
     1576                                              medium.asOutParam()));
    15301577    else if (cmd == CMD_FLOPPY)
    1531         CHECK_ERROR(a->virtualBox, FindMedium(Bstr(FilenameOrUuid), DeviceType_Floppy, medium.asOutParam()));
     1578        CHECK_ERROR(a->virtualBox, FindMedium(Bstr(FilenameOrUuid).raw(),
     1579                                              DeviceType_Floppy,
     1580                                              medium.asOutParam()));
    15321581
    15331582    if (SUCCEEDED(rc) && medium)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r32712 r32718  
    131131    Utf8Str Utf8Cmd(a->argv[1]);
    132132    uint32_t uFlags = 0;
    133     com::SafeArray <BSTR> args;
    134     com::SafeArray <BSTR> env;
     133    com::SafeArray<CBSTR> args;
     134    com::SafeArray<CBSTR> env;
    135135    Utf8Str Utf8UserName;
    136136    Utf8Str Utf8Password;
     
    143143
    144144    /* Always use the actual command line as argv[0]. */
    145     args.push_back(Bstr(Utf8Cmd));
     145    args.push_back(Bstr(Utf8Cmd).raw());
    146146
    147147    /* Iterate through all possible commands (if available). */
     
    164164                {
    165165                    for (int j = 0; j < cArgs; j++)
    166                         args.push_back(Bstr(papszArg[j]));
     166                        args.push_back(Bstr(papszArg[j]).raw());
    167167
    168168                    RTGetOptArgvFree(papszArg);
     
    185185                {
    186186                    for (int j = 0; j < cArgs; j++)
    187                         env.push_back(Bstr(papszArg[j]));
     187                        env.push_back(Bstr(papszArg[j]).raw());
    188188
    189189                    RTGetOptArgvFree(papszArg);
     
    277277    ComPtr<IMachine> machine;
    278278    /* assume it's an UUID */
    279     HRESULT rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     279    HRESULT rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     280                                           machine.asOutParam());
    280281    if (FAILED(rc) || !machine)
    281282    {
    282283        /* must be a name */
    283         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     284        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     285                                               machine.asOutParam()));
    284286    }
    285287
     
    317319
    318320            /* Execute the process. */
    319             rc = guest->ExecuteProcess(Bstr(Utf8Cmd), uFlags,
    320                                        ComSafeArrayAsInParam(args), ComSafeArrayAsInParam(env),
    321                                        Bstr(Utf8UserName), Bstr(Utf8Password), u32TimeoutMS,
     321            rc = guest->ExecuteProcess(Bstr(Utf8Cmd).raw(), uFlags,
     322                                       ComSafeArrayAsInParam(args),
     323                                       ComSafeArrayAsInParam(env),
     324                                       Bstr(Utf8UserName).raw(),
     325                                       Bstr(Utf8Password).raw(), u32TimeoutMS,
    322326                                       &uPID, progress.asOutParam());
    323327            if (FAILED(rc))
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp

    r32712 r32718  
    8989    ComPtr<IMachine> machine;
    9090    /* assume it's a UUID */
    91     rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     91    rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     92                                   machine.asOutParam());
    9293    if (FAILED(rc) || !machine)
    9394    {
    9495        /* must be a name */
    95         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     96        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     97                                               machine.asOutParam()));
    9698    }
    9799    if (machine)
     
    106108        LONG64 i64Timestamp;
    107109        Bstr flags;
    108         CHECK_ERROR(machine, GetGuestProperty(Bstr(a->argv[1]), value.asOutParam(),
     110        CHECK_ERROR(machine, GetGuestProperty(Bstr(a->argv[1]).raw(),
     111                                              value.asOutParam(),
    109112                                              &i64Timestamp, flags.asOutParam()));
    110         if (!value)
     113        if (value.isEmpty())
    111114            RTPrintf("No value set!\n");
    112         if (value)
     115        else
    113116            RTPrintf("Value: %lS\n", value.raw());
    114         if (value && verbose)
     117        if (!value.isEmpty() && verbose)
    115118        {
    116119            RTPrintf("Timestamp: %lld\n", i64Timestamp);
     
    154157    ComPtr<IMachine> machine;
    155158    /* assume it's a UUID */
    156     rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     159    rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     160                                   machine.asOutParam());
    157161    if (FAILED(rc) || !machine)
    158162    {
    159163        /* must be a name */
    160         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     164        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     165                                               machine.asOutParam()));
    161166    }
    162167    if (machine)
     
    169174
    170175        if (!pszValue && !pszFlags)
    171             CHECK_ERROR(machine, SetGuestPropertyValue(Bstr(pszName), Bstr("")));
     176            CHECK_ERROR(machine, SetGuestPropertyValue(Bstr(pszName).raw(),
     177                                                       Bstr().raw()));
    172178        else if (!pszFlags)
    173             CHECK_ERROR(machine, SetGuestPropertyValue(Bstr(pszName), Bstr(pszValue)));
     179            CHECK_ERROR(machine, SetGuestPropertyValue(Bstr(pszName).raw(),
     180                                                       Bstr(pszValue).raw()));
    174181        else
    175             CHECK_ERROR(machine, SetGuestProperty(Bstr(pszName), Bstr(pszValue), Bstr(pszFlags)));
     182            CHECK_ERROR(machine, SetGuestProperty(Bstr(pszName).raw(),
     183                                                  Bstr(pszValue).raw(),
     184                                                  Bstr(pszFlags).raw()));
    176185
    177186        if (SUCCEEDED(rc))
     
    214223    ComPtr<IMachine> machine;
    215224    /* assume it's a UUID */
    216     HRESULT rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     225    HRESULT rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     226                                           machine.asOutParam());
    217227    if (FAILED(rc) || !machine)
    218228    {
    219229        /* must be a name */
    220         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     230        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     231                                               machine.asOutParam()));
    221232    }
    222233    if (machine)
     
    232243        com::SafeArray<LONG64> timestamps;
    233244        com::SafeArray<BSTR> flags;
    234         CHECK_ERROR(machine, EnumerateGuestProperties(Bstr(Utf8Patterns),
     245        CHECK_ERROR(machine, EnumerateGuestProperties(Bstr(Utf8Patterns).raw(),
    235246                                                      ComSafeArrayAsOutParam(names),
    236247                                                      ComSafeArrayAsOutParam(values),
     
    270281    ComPtr<IMachine> machine;
    271282    /* assume it's a UUID */
    272     HRESULT rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     283    HRESULT rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     284                                           machine.asOutParam());
    273285    if (FAILED(rc) || !machine)
    274286    {
    275287        /* must be a name */
    276         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     288        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     289                                               machine.asOutParam()));
    277290    }
    278291    if (!machine)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHostonly.cpp

    r32701 r32718  
    234234
    235235    ComPtr<IHostNetworkInterface> hif;
    236     CHECK_ERROR(host, FindHostNetworkInterfaceByName(name, hif.asOutParam()));
     236    CHECK_ERROR(host, FindHostNetworkInterfaceByName(name.raw(),
     237                                                     hif.asOutParam()));
    237238
    238239    if (FAILED(rc))
     
    248249            pNetmask = "255.255.255.0"; /* ?? */
    249250
    250         CHECK_ERROR(hif, EnableStaticIpConfig(Bstr(pIp), Bstr(pNetmask)));
     251        CHECK_ERROR(hif, EnableStaticIpConfig(Bstr(pIp).raw(),
     252                                              Bstr(pNetmask).raw()));
    251253    }
    252254    else if (pIpv6)
     
    265267
    266268        Bstr ipv6str(pIpv6);
    267         CHECK_ERROR(hif, EnableStaticIpConfigV6(ipv6str, (ULONG)uNetmasklengthv6));
     269        CHECK_ERROR(hif, EnableStaticIpConfigV6(ipv6str.raw(),
     270                                                (ULONG)uNetmasklengthv6));
    268271    }
    269272    else
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp

    r32701 r32718  
    248248            pszAbsFilePath = RTPathAbsDup(strOvfFilename.c_str());
    249249        ComPtr<IProgress> progressRead;
    250         CHECK_ERROR_BREAK(pAppliance, Read(Bstr(pszAbsFilePath), progressRead.asOutParam()));
     250        CHECK_ERROR_BREAK(pAppliance, Read(Bstr(pszAbsFilePath).raw(),
     251                                           progressRead.asOutParam()));
    251252        RTStrFree(pszAbsFilePath);
    252253
     
    831832                    ComPtr<IMachine> machine;
    832833                    /* assume it's a UUID */
    833                     rc = a->virtualBox->GetMachine(Bstr(strMachine), machine.asOutParam());
     834                    rc = a->virtualBox->GetMachine(Bstr(strMachine).raw(),
     835                                                   machine.asOutParam());
    834836                    if (FAILED(rc) || !machine)
    835837                    {
    836838                        /* must be a name */
    837                         CHECK_ERROR_BREAK(a->virtualBox, FindMachine(Bstr(strMachine), machine.asOutParam()));
     839                        CHECK_ERROR_BREAK(a->virtualBox, FindMachine(Bstr(strMachine).raw(),
     840                                                                     machine.asOutParam()));
    838841                    }
    839842
     
    910913                {
    911914                    if (itD->first == "product")
    912                         pVSD->AddDescription (VirtualSystemDescriptionType_Product, Bstr(itD->second), Bstr(itD->second));
     915                        pVSD->AddDescription(VirtualSystemDescriptionType_Product,
     916                                             Bstr(itD->second).raw(),
     917                                             Bstr(itD->second).raw());
    913918                    else if (itD->first == "producturl")
    914                         pVSD->AddDescription (VirtualSystemDescriptionType_ProductUrl, Bstr(itD->second), Bstr(itD->second));
     919                        pVSD->AddDescription(VirtualSystemDescriptionType_ProductUrl,
     920                                             Bstr(itD->second).raw(),
     921                                             Bstr(itD->second).raw());
    915922                    else if (itD->first == "vendor")
    916                         pVSD->AddDescription (VirtualSystemDescriptionType_Vendor, Bstr(itD->second), Bstr(itD->second));
     923                        pVSD->AddDescription(VirtualSystemDescriptionType_Vendor,
     924                                             Bstr(itD->second).raw(),
     925                                             Bstr(itD->second).raw());
    917926                    else if (itD->first == "vendorurl")
    918                         pVSD->AddDescription (VirtualSystemDescriptionType_VendorUrl, Bstr(itD->second), Bstr(itD->second));
     927                        pVSD->AddDescription(VirtualSystemDescriptionType_VendorUrl,
     928                                             Bstr(itD->second).raw(),
     929                                             Bstr(itD->second).raw());
    919930                    else if (itD->first == "version")
    920                         pVSD->AddDescription (VirtualSystemDescriptionType_Version, Bstr(itD->second), Bstr(itD->second));
     931                        pVSD->AddDescription(VirtualSystemDescriptionType_Version,
     932                                             Bstr(itD->second).raw(),
     933                                             Bstr(itD->second).raw());
    921934                    else if (itD->first == "eula")
    922                         pVSD->AddDescription (VirtualSystemDescriptionType_License, Bstr(itD->second), Bstr(itD->second));
     935                        pVSD->AddDescription(VirtualSystemDescriptionType_License,
     936                                             Bstr(itD->second).raw(),
     937                                             Bstr(itD->second).raw());
    923938                    else if (itD->first == "eulafile")
    924939                    {
     
    930945                        {
    931946                            Bstr bstrContent((char*)pvFile);
    932                             pVSD->AddDescription(VirtualSystemDescriptionType_License, bstrContent, bstrContent);
     947                            pVSD->AddDescription(VirtualSystemDescriptionType_License,
     948                                                 bstrContent.raw(),
     949                                                 bstrContent.raw());
    933950                            RTFileReadAllFree(pvFile, cbFile);
    934951                        }
     
    955972        else
    956973            pszAbsFilePath = RTPathAbsDup(strOutputFile.c_str());
    957         CHECK_ERROR_BREAK(pAppliance, Write(Bstr(strOvfFormat), fManifest, Bstr(pszAbsFilePath), progress.asOutParam()));
     974        CHECK_ERROR_BREAK(pAppliance, Write(Bstr(strOvfFormat).raw(),
     975                                            fManifest,
     976                                            Bstr(pszAbsFilePath).raw(),
     977                                            progress.asOutParam()));
    958978        RTStrFree(pszAbsFilePath);
    959979
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r32701 r32718  
    9797}
    9898
    99 static void makeTimeStr (char *s, int cb, int64_t millies)
     99static void makeTimeStr(char *s, int cb, int64_t millies)
    100100{
    101101    RTTIME t;
     
    104104    RTTimeSpecSetMilli(&ts, millies);
    105105
    106     RTTimeExplode (&t, &ts);
     106    RTTimeExplode(&t, &ts);
    107107
    108108    RTStrPrintf(s, cb, "%04d/%02d/%02d %02d:%02d:%02d UTC",
     
    119119#endif
    120120
    121 HRESULT showVMInfo (ComPtr<IVirtualBox> virtualBox,
    122                     ComPtr<IMachine> machine,
    123                     VMINFO_DETAILS details /*= VMINFO_NONE*/,
    124                     ComPtr<IConsole> console /*= ComPtr <IConsole> ()*/)
     121HRESULT showVMInfo(ComPtr<IVirtualBox> virtualBox,
     122                   ComPtr<IMachine> machine,
     123                   VMINFO_DETAILS details /*= VMINFO_NONE*/,
     124                   ComPtr<IConsole> console /*= ComPtr <IConsole> ()*/)
    125125{
    126126    HRESULT rc;
     
    195195    rc = machine->COMGETTER(OSTypeId)(osTypeId.asOutParam());
    196196    ComPtr<IGuestOSType> osType;
    197     rc = virtualBox->GetGuestOSType (osTypeId, osType.asOutParam());
     197    rc = virtualBox->GetGuestOSType(osTypeId.raw(), osType.asOutParam());
    198198    Bstr osName;
    199199    rc = osType->COMGETTER(Description)(osName.asOutParam());
     
    592592     */
    593593    com::SafeIfaceArray<IStorageController> storageCtls;
    594     CHECK_ERROR(machine, COMGETTER(StorageControllers)(ComSafeArrayAsOutParam (storageCtls)));
     594    CHECK_ERROR(machine, COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(storageCtls)));
    595595    for (size_t i = 0; i < storageCtls.size(); ++ i)
    596596    {
     
    676676            for (ULONG k = 0; k < cDevices; ++ k)
    677677            {
    678                 rc = machine->GetMedium(storageCtlName, i, k, medium.asOutParam());
     678                rc = machine->GetMedium(storageCtlName.raw(), i, k,
     679                                        medium.asOutParam());
    679680                if (SUCCEEDED(rc) && medium)
    680681                {
     
    682683                    ComPtr<IMediumAttachment> mediumAttach;
    683684
    684                     rc = machine->GetMediumAttachment(storageCtlName, i, k, mediumAttach.asOutParam());
     685                    rc = machine->GetMediumAttachment(storageCtlName.raw(),
     686                                                      i, k,
     687                                                      mediumAttach.asOutParam());
    685688                    if (SUCCEEDED(rc) && mediumAttach)
    686689                        mediumAttach->COMGETTER(Passthrough)(&fPassthrough);
     
    12921295        {
    12931296            ULONG xRes, yRes, bpp;
    1294             rc = display->GetScreenResolution (0, &xRes, &yRes, &bpp);
     1297            rc = display->GetScreenResolution(0, &xRes, &yRes, &bpp);
    12951298            if (rc == E_ACCESSDENIED)
    12961299                break; /* VM not powered up */
     
    14421445
    14431446                    BOOL bActive = FALSE;
    1444                     CHECK_ERROR_RET (DevPtr, COMGETTER (Active) (&bActive), rc);
     1447                    CHECK_ERROR_RET(DevPtr, COMGETTER(Active)(&bActive), rc);
    14451448                    if (details == VMINFO_MACHINEREADABLE)
    14461449                        RTPrintf("USBFilterActive%zu=\"%s\"\n", index + 1, bActive ? "on" : "off");
     
    14491452
    14501453                    Bstr bstr;
    1451                     CHECK_ERROR_RET (DevPtr, COMGETTER (Name) (bstr.asOutParam()), rc);
     1454                    CHECK_ERROR_RET(DevPtr, COMGETTER(Name)(bstr.asOutParam()), rc);
    14521455                    if (details == VMINFO_MACHINEREADABLE)
    14531456                        RTPrintf("USBFilterName%zu=\"%lS\"\n", index + 1, bstr.raw());
    14541457                    else
    14551458                        RTPrintf("Name:             %lS\n", bstr.raw());
    1456                     CHECK_ERROR_RET (DevPtr, COMGETTER (VendorId) (bstr.asOutParam()), rc);
     1459                    CHECK_ERROR_RET(DevPtr, COMGETTER(VendorId)(bstr.asOutParam()), rc);
    14571460                    if (details == VMINFO_MACHINEREADABLE)
    14581461                        RTPrintf("USBFilterVendorId%zu=\"%lS\"\n", index + 1, bstr.raw());
    14591462                    else
    14601463                        RTPrintf("VendorId:         %lS\n", bstr.raw());
    1461                     CHECK_ERROR_RET (DevPtr, COMGETTER (ProductId) (bstr.asOutParam()), rc);
     1464                    CHECK_ERROR_RET(DevPtr, COMGETTER(ProductId)(bstr.asOutParam()), rc);
    14621465                    if (details == VMINFO_MACHINEREADABLE)
    14631466                        RTPrintf("USBFilterProductId%zu=\"%lS\"\n", index + 1, bstr.raw());
    14641467                    else
    14651468                        RTPrintf("ProductId:        %lS\n", bstr.raw());
    1466                     CHECK_ERROR_RET (DevPtr, COMGETTER (Revision) (bstr.asOutParam()), rc);
     1469                    CHECK_ERROR_RET(DevPtr, COMGETTER(Revision)(bstr.asOutParam()), rc);
    14671470                    if (details == VMINFO_MACHINEREADABLE)
    14681471                        RTPrintf("USBFilterRevision%zu=\"%lS\"\n", index + 1, bstr.raw());
    14691472                    else
    14701473                        RTPrintf("Revision:         %lS\n", bstr.raw());
    1471                     CHECK_ERROR_RET (DevPtr, COMGETTER (Manufacturer) (bstr.asOutParam()), rc);
     1474                    CHECK_ERROR_RET(DevPtr, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
    14721475                    if (details == VMINFO_MACHINEREADABLE)
    14731476                        RTPrintf("USBFilterManufacturer%zu=\"%lS\"\n", index + 1, bstr.raw());
    14741477                    else
    14751478                        RTPrintf("Manufacturer:     %lS\n", bstr.raw());
    1476                     CHECK_ERROR_RET (DevPtr, COMGETTER (Product) (bstr.asOutParam()), rc);
     1479                    CHECK_ERROR_RET(DevPtr, COMGETTER(Product)(bstr.asOutParam()), rc);
    14771480                    if (details == VMINFO_MACHINEREADABLE)
    14781481                        RTPrintf("USBFilterProduct%zu=\"%lS\"\n", index + 1, bstr.raw());
    14791482                    else
    14801483                        RTPrintf("Product:          %lS\n", bstr.raw());
    1481                     CHECK_ERROR_RET (DevPtr, COMGETTER (Remote) (bstr.asOutParam()), rc);
     1484                    CHECK_ERROR_RET(DevPtr, COMGETTER(Remote)(bstr.asOutParam()), rc);
    14821485                    if (details == VMINFO_MACHINEREADABLE)
    14831486                        RTPrintf("USBFilterRemote%zu=\"%lS\"\n", index + 1, bstr.raw());
    14841487                    else
    14851488                        RTPrintf("Remote:           %lS\n", bstr.raw());
    1486                     CHECK_ERROR_RET (DevPtr, COMGETTER (SerialNumber) (bstr.asOutParam()), rc);
     1489                    CHECK_ERROR_RET(DevPtr, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
    14871490                    if (details == VMINFO_MACHINEREADABLE)
    14881491                        RTPrintf("USBFilterSerialNumber%zu=\"%lS\"\n", index + 1, bstr.raw());
     
    14921495                    {
    14931496                        ULONG fMaskedIfs;
    1494                         CHECK_ERROR_RET (DevPtr, COMGETTER (MaskedInterfaces) (&fMaskedIfs), rc);
     1497                        CHECK_ERROR_RET(DevPtr, COMGETTER(MaskedInterfaces)(&fMaskedIfs), rc);
    14951498                        if (fMaskedIfs)
    14961499                            RTPrintf("Masked Interfaces: %#010x\n", fMaskedIfs);
     
    15091512
    15101513                SafeIfaceArray <IHostUSBDevice> coll;
    1511                 CHECK_ERROR_RET (console, COMGETTER(RemoteUSBDevices) (ComSafeArrayAsOutParam(coll)), rc);
     1514                CHECK_ERROR_RET(console, COMGETTER(RemoteUSBDevices)(ComSafeArrayAsOutParam(coll)), rc);
    15121515
    15131516                if (coll.size() == 0)
     
    15241527                        /* Query info. */
    15251528                        Bstr id;
    1526                         CHECK_ERROR_RET (dev, COMGETTER(Id)(id.asOutParam()), rc);
     1529                        CHECK_ERROR_RET(dev, COMGETTER(Id)(id.asOutParam()), rc);
    15271530                        USHORT usVendorId;
    1528                         CHECK_ERROR_RET (dev, COMGETTER(VendorId)(&usVendorId), rc);
     1531                        CHECK_ERROR_RET(dev, COMGETTER(VendorId)(&usVendorId), rc);
    15291532                        USHORT usProductId;
    1530                         CHECK_ERROR_RET (dev, COMGETTER(ProductId)(&usProductId), rc);
     1533                        CHECK_ERROR_RET(dev, COMGETTER(ProductId)(&usProductId), rc);
    15311534                        USHORT bcdRevision;
    1532                         CHECK_ERROR_RET (dev, COMGETTER(Revision)(&bcdRevision), rc);
     1535                        CHECK_ERROR_RET(dev, COMGETTER(Revision)(&bcdRevision), rc);
    15331536
    15341537                        if (details == VMINFO_MACHINEREADABLE)
     
    15531556                        /* optional stuff. */
    15541557                        Bstr bstr;
    1555                         CHECK_ERROR_RET (dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
     1558                        CHECK_ERROR_RET(dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
    15561559                        if (!bstr.isEmpty())
    15571560                        {
     
    15611564                                RTPrintf("Manufacturer:       %lS\n", bstr.raw());
    15621565                        }
    1563                         CHECK_ERROR_RET (dev, COMGETTER(Product)(bstr.asOutParam()), rc);
     1566                        CHECK_ERROR_RET(dev, COMGETTER(Product)(bstr.asOutParam()), rc);
    15641567                        if (!bstr.isEmpty())
    15651568                        {
     
    15691572                                RTPrintf("Product:            %lS\n", bstr.raw());
    15701573                        }
    1571                         CHECK_ERROR_RET (dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
     1574                        CHECK_ERROR_RET(dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
    15721575                        if (!bstr.isEmpty())
    15731576                        {
     
    15771580                                RTPrintf("SerialNumber:       %lS\n", bstr.raw());
    15781581                        }
    1579                         CHECK_ERROR_RET (dev, COMGETTER(Address)(bstr.asOutParam()), rc);
     1582                        CHECK_ERROR_RET(dev, COMGETTER(Address)(bstr.asOutParam()), rc);
    15801583                        if (!bstr.isEmpty())
    15811584                        {
     
    15951598            {
    15961599                if (details != VMINFO_MACHINEREADABLE)
    1597                     RTPrintf ("Currently Attached USB Devices:\n\n");
     1600                    RTPrintf("Currently Attached USB Devices:\n\n");
    15981601
    15991602                SafeIfaceArray <IUSBDevice> coll;
    1600                 CHECK_ERROR_RET (console, COMGETTER(USBDevices) (ComSafeArrayAsOutParam(coll)), rc);
     1603                CHECK_ERROR_RET(console, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll)), rc);
    16011604
    16021605                if (coll.size() == 0)
     
    16131616                        /* Query info. */
    16141617                        Bstr id;
    1615                         CHECK_ERROR_RET (dev, COMGETTER(Id)(id.asOutParam()), rc);
     1618                        CHECK_ERROR_RET(dev, COMGETTER(Id)(id.asOutParam()), rc);
    16161619                        USHORT usVendorId;
    1617                         CHECK_ERROR_RET (dev, COMGETTER(VendorId)(&usVendorId), rc);
     1620                        CHECK_ERROR_RET(dev, COMGETTER(VendorId)(&usVendorId), rc);
    16181621                        USHORT usProductId;
    1619                         CHECK_ERROR_RET (dev, COMGETTER(ProductId)(&usProductId), rc);
     1622                        CHECK_ERROR_RET(dev, COMGETTER(ProductId)(&usProductId), rc);
    16201623                        USHORT bcdRevision;
    1621                         CHECK_ERROR_RET (dev, COMGETTER(Revision)(&bcdRevision), rc);
     1624                        CHECK_ERROR_RET(dev, COMGETTER(Revision)(&bcdRevision), rc);
    16221625
    16231626                        if (details == VMINFO_MACHINEREADABLE)
     
    16421645                        /* optional stuff. */
    16431646                        Bstr bstr;
    1644                         CHECK_ERROR_RET (dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
     1647                        CHECK_ERROR_RET(dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
    16451648                        if (!bstr.isEmpty())
    16461649                        {
     
    16501653                                RTPrintf("Manufacturer:       %lS\n", bstr.raw());
    16511654                        }
    1652                         CHECK_ERROR_RET (dev, COMGETTER(Product)(bstr.asOutParam()), rc);
     1655                        CHECK_ERROR_RET(dev, COMGETTER(Product)(bstr.asOutParam()), rc);
    16531656                        if (!bstr.isEmpty())
    16541657                        {
     
    16581661                                RTPrintf("Product:            %lS\n", bstr.raw());
    16591662                        }
    1660                         CHECK_ERROR_RET (dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
     1663                        CHECK_ERROR_RET(dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
    16611664                        if (!bstr.isEmpty())
    16621665                        {
     
    16661669                                RTPrintf("SerialNumber:       %lS\n", bstr.raw());
    16671670                        }
    1668                         CHECK_ERROR_RET (dev, COMGETTER(Address)(bstr.asOutParam()), rc);
     1671                        CHECK_ERROR_RET(dev, COMGETTER(Address)(bstr.asOutParam()), rc);
    16691672                        if (!bstr.isEmpty())
    16701673                        {
     
    17901793        ULONG   EncryptionStyle;
    17911794
    1792         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(Active)             (&Active), rc);
    1793         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(NumberOfClients)    (&NumberOfClients), rc);
    1794         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BeginTime)          (&BeginTime), rc);
    1795         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(EndTime)            (&EndTime), rc);
    1796         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesSent)          (&BytesSent), rc);
    1797         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesSentTotal)     (&BytesSentTotal), rc);
    1798         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesReceived)      (&BytesReceived), rc);
    1799         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesReceivedTotal) (&BytesReceivedTotal), rc);
    1800         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(User)               (User.asOutParam ()), rc);
    1801         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(Domain)             (Domain.asOutParam ()), rc);
    1802         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientName)         (ClientName.asOutParam ()), rc);
    1803         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientIP)           (ClientIP.asOutParam ()), rc);
    1804         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientVersion)      (&ClientVersion), rc);
    1805         CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(EncryptionStyle)    (&EncryptionStyle), rc);
     1795        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(Active)(&Active), rc);
     1796        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(NumberOfClients)(&NumberOfClients), rc);
     1797        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BeginTime)(&BeginTime), rc);
     1798        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(EndTime)(&EndTime), rc);
     1799        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesSent)(&BytesSent), rc);
     1800        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesSentTotal)(&BytesSentTotal), rc);
     1801        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesReceived)(&BytesReceived), rc);
     1802        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesReceivedTotal)(&BytesReceivedTotal), rc);
     1803        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(User)(User.asOutParam()), rc);
     1804        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(Domain)(Domain.asOutParam()), rc);
     1805        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientName)(ClientName.asOutParam()), rc);
     1806        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientIP)(ClientIP.asOutParam()), rc);
     1807        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientVersion)(&ClientVersion), rc);
     1808        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(EncryptionStyle)(&EncryptionStyle), rc);
    18061809
    18071810        if (details == VMINFO_MACHINEREADABLE)
     
    18211824            if (Active)
    18221825            {
    1823                 makeTimeStr (timestr, sizeof (timestr), BeginTime);
     1826                makeTimeStr(timestr, sizeof(timestr), BeginTime);
    18241827                if (details == VMINFO_MACHINEREADABLE)
    18251828                    RTPrintf("VRDPStartTime=\"%s\"\n", timestr);
     
    18291832            else
    18301833            {
    1831                 makeTimeStr (timestr, sizeof (timestr), BeginTime);
     1834                makeTimeStr(timestr, sizeof(timestr), BeginTime);
    18321835                if (details == VMINFO_MACHINEREADABLE)
    18331836                    RTPrintf("VRDPLastStartTime=\"%s\"\n", timestr);
    18341837                else
    18351838                    RTPrintf("Last started:       %s\n", timestr);
    1836                 makeTimeStr (timestr, sizeof (timestr), EndTime);
     1839                makeTimeStr(timestr, sizeof(timestr), EndTime);
    18371840                if (details == VMINFO_MACHINEREADABLE)
    18381841                    RTPrintf("VRDPLastEndTime=\"%s\"\n", timestr);
     
    19741977     */
    19751978    ComPtr<ISnapshot> snapshot;
    1976     rc = machine->GetSnapshot(Bstr(), snapshot.asOutParam());
     1979    rc = machine->GetSnapshot(Bstr().raw(), snapshot.asOutParam());
    19771980    if (SUCCEEDED(rc) && snapshot)
    19781981    {
     
    20702073    if (!Guid(VMNameOrUuid).isEmpty())
    20712074    {
    2072         CHECK_ERROR(a->virtualBox, GetMachine(uuid, machine.asOutParam()));
    2073     }
    2074     else
    2075     {
    2076         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(VMNameOrUuid), machine.asOutParam()));
     2075        CHECK_ERROR(a->virtualBox, GetMachine(uuid.raw(),
     2076                                              machine.asOutParam()));
     2077    }
     2078    else
     2079    {
     2080        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(VMNameOrUuid).raw(),
     2081                                               machine.asOutParam()));
    20772082        if (SUCCEEDED(rc))
    20782083            machine->COMGETTER(Id)(uuid.asOutParam());
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp

    r32701 r32718  
    111111        {
    112112            ComPtr <IMachine> machine;
    113             rc = aVirtualBox->FindMachine(Bstr(argv[0]), machine.asOutParam());
     113            rc = aVirtualBox->FindMachine(Bstr(argv[0]).raw(),
     114                                          machine.asOutParam());
    114115            if (SUCCEEDED (rc))
    115116            {
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp

    r32701 r32718  
    7070     * and the client's interpretation of relative paths. Remove after the API
    7171     * has been redesigned. */
    72     rc = a->virtualBox->OpenMachine(Bstr(a->argv[0]), machine.asOutParam());
     72    rc = a->virtualBox->OpenMachine(Bstr(a->argv[0]).raw(),
     73                                    machine.asOutParam());
    7374    if (rc == VBOX_E_FILE_ERROR)
    7475    {
     
    8081            return 1;
    8182        }
    82         CHECK_ERROR(a->virtualBox, OpenMachine(Bstr(szVMFileAbs), machine.asOutParam()));
     83        CHECK_ERROR(a->virtualBox, OpenMachine(Bstr(szVMFileAbs).raw(),
     84                                               machine.asOutParam()));
    8385    }
    8486    else if (FAILED(rc))
    85         CHECK_ERROR(a->virtualBox, OpenMachine(Bstr(a->argv[0]), machine.asOutParam()));
     87        CHECK_ERROR(a->virtualBox, OpenMachine(Bstr(a->argv[0]).raw(),
     88                                               machine.asOutParam()));
    8689    if (SUCCEEDED(rc))
    8790    {
     
    148151    ComPtr<IMachine> machine;
    149152    /* assume it's a UUID */
    150     rc = a->virtualBox->GetMachine(Guid(VMName).toUtf16(), machine.asOutParam());
     153    rc = a->virtualBox->GetMachine(Bstr(VMName).raw(), machine.asOutParam());
    151154    if (FAILED(rc) || !machine)
    152155    {
    153156        /* must be a name */
    154         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(VMName), machine.asOutParam()));
     157        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(VMName).raw(),
     158                                               machine.asOutParam()));
    155159    }
    156160    if (machine)
     
    230234
    231235    /* check for required options */
    232     if (name)
     236    if (name.isEmpty())
    233237        return errorSyntax(USAGE_CREATEVM, "Parameter --name is required");
    234238
     
    238242
    239243        CHECK_ERROR_BREAK(a->virtualBox,
    240                           CreateMachine(name,
    241                                         osTypeId,
    242                                         baseFolder,
    243                                         Guid(id).toUtf16(),
     244                          CreateMachine(name.raw(),
     245                                        osTypeId.raw(),
     246                                        baseFolder.raw(),
     247                                        Guid(id).toUtf16().raw(),
    244248                                        FALSE,
    245249                                        machine.asOutParam()));
     
    347351    ComPtr<IMachine> machine;
    348352    /* assume it's a UUID */
    349     rc = a->virtualBox->GetMachine(Guid(VMName).toUtf16(), machine.asOutParam());
     353    rc = a->virtualBox->GetMachine(Bstr(VMName).raw(), machine.asOutParam());
    350354    if (FAILED(rc) || !machine)
    351355    {
    352356        /* must be a name */
    353         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(VMName), machine.asOutParam()));
     357        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(VMName).raw(),
     358                                               machine.asOutParam()));
    354359    }
    355360    if (machine)
     
    368373#endif
    369374        ComPtr<IProgress> progress;
    370         CHECK_ERROR_RET(machine, LaunchVMProcess(a->session, sessionType, env, progress.asOutParam()), rc);
     375        CHECK_ERROR_RET(machine, LaunchVMProcess(a->session, sessionType.raw(),
     376                                                 env.raw(), progress.asOutParam()), rc);
    371377        RTPrintf("Waiting for the VM to power on...\n");
    372378        CHECK_ERROR_RET(progress, WaitForCompletion(-1), 1);
     
    406412    ComPtr<IMachine> machine;
    407413    /* assume it's a UUID */
    408     rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     414    rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     415                                   machine.asOutParam());
    409416    if (FAILED(rc) || !machine)
    410417    {
    411418        /* must be a name */
    412         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     419        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     420                                               machine.asOutParam()));
    413421    }
    414422    if (machine)
     
    440448    ComPtr<IMachine> machine;
    441449    /* assume it's a UUID */
    442     rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     450    rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     451                                   machine.asOutParam());
    443452    if (FAILED(rc) || !machine)
    444453    {
    445454        /* must be a name */
    446         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     455        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     456                                               machine.asOutParam()));
    447457    }
    448458    if (machine)
     
    456466                ComPtr<IConsole> console;
    457467                CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam()));
    458                 CHECK_ERROR_BREAK(console, AdoptSavedState(Bstr(a->argv[1])));
     468                CHECK_ERROR_BREAK(console, AdoptSavedState(Bstr(a->argv[1]).raw()));
    459469            } while (0);
    460470            CHECK_ERROR_BREAK(a->session, UnlockMachine());
     
    487497                Bstr bstrKey(aKeys[i]);
    488498                Bstr bstrValue;
    489                 CHECK_ERROR(a->virtualBox, GetExtraData(bstrKey, bstrValue.asOutParam()));
     499                CHECK_ERROR(a->virtualBox, GetExtraData(bstrKey.raw(),
     500                                                        bstrValue.asOutParam()));
    490501
    491502                RTPrintf("Key: %lS, Value: %lS\n", bstrKey.raw(), bstrValue.raw());
     
    495506        {
    496507            Bstr value;
    497             CHECK_ERROR(a->virtualBox, GetExtraData(Bstr(a->argv[1]), value.asOutParam()));
     508            CHECK_ERROR(a->virtualBox, GetExtraData(Bstr(a->argv[1]).raw(),
     509                                                    value.asOutParam()));
    498510            if (!value.isEmpty())
    499511                RTPrintf("Value: %lS\n", value.raw());
     
    506518        ComPtr<IMachine> machine;
    507519        /* assume it's a UUID */
    508         rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     520        rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     521                                       machine.asOutParam());
    509522        if (FAILED(rc) || !machine)
    510523        {
    511524            /* must be a name */
    512             CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     525            CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     526                                                   machine.asOutParam()));
    513527        }
    514528        if (machine)
     
    526540                    Bstr bstrKey(aKeys[i]);
    527541                    Bstr bstrValue;
    528                     CHECK_ERROR(machine, GetExtraData(bstrKey, bstrValue.asOutParam()));
     542                    CHECK_ERROR(machine, GetExtraData(bstrKey.raw(),
     543                                                      bstrValue.asOutParam()));
    529544
    530545                    RTPrintf("Key: %lS, Value: %lS\n", bstrKey.raw(), bstrValue.raw());
     
    534549            {
    535550                Bstr value;
    536                 CHECK_ERROR(machine, GetExtraData(Bstr(a->argv[1]), value.asOutParam()));
     551                CHECK_ERROR(machine, GetExtraData(Bstr(a->argv[1]).raw(),
     552                                                  value.asOutParam()));
    537553                if (!value.isEmpty())
    538554                    RTPrintf("Value: %lS\n", value.raw());
     
    555571    if (!strcmp(a->argv[0], "global"))
    556572    {
     573        /** @todo passing NULL is deprecated */
    557574        if (a->argc < 3)
    558             CHECK_ERROR(a->virtualBox, SetExtraData(Bstr(a->argv[1]), NULL));
     575            CHECK_ERROR(a->virtualBox, SetExtraData(Bstr(a->argv[1]).raw(),
     576                                                    NULL));
    559577        else if (a->argc == 3)
    560             CHECK_ERROR(a->virtualBox, SetExtraData(Bstr(a->argv[1]), Bstr(a->argv[2])));
     578            CHECK_ERROR(a->virtualBox, SetExtraData(Bstr(a->argv[1]).raw(),
     579                                                    Bstr(a->argv[2]).raw()));
    561580        else
    562581            return errorSyntax(USAGE_SETEXTRADATA, "Too many parameters");
     
    566585        ComPtr<IMachine> machine;
    567586        /* assume it's a UUID */
    568         rc = a->virtualBox->GetMachine(Bstr(a->argv[0]), machine.asOutParam());
     587        rc = a->virtualBox->GetMachine(Bstr(a->argv[0]).raw(),
     588                                       machine.asOutParam());
    569589        if (FAILED(rc) || !machine)
    570590        {
    571591            /* must be a name */
    572             CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     592            CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     593                                       machine.asOutParam()));
    573594        }
    574595        if (machine)
    575596        {
     597            /** @todo passing NULL is deprecated */
    576598            if (a->argc < 3)
    577                 CHECK_ERROR(machine, SetExtraData(Bstr(a->argv[1]), NULL));
     599                CHECK_ERROR(machine, SetExtraData(Bstr(a->argv[1]).raw(),
     600                                                  NULL));
    578601            else if (a->argc == 3)
    579                 CHECK_ERROR(machine, SetExtraData(Bstr(a->argv[1]), Bstr(a->argv[2])));
     602                CHECK_ERROR(machine, SetExtraData(Bstr(a->argv[1]).raw(),
     603                                                  Bstr(a->argv[2]).raw()));
    580604            else
    581605                return errorSyntax(USAGE_SETEXTRADATA, "Too many parameters");
     
    602626            CHECK_ERROR(systemProperties, COMSETTER(DefaultHardDiskFolder)(NULL));
    603627        else
    604             CHECK_ERROR(systemProperties, COMSETTER(DefaultHardDiskFolder)(Bstr(a->argv[1])));
     628            CHECK_ERROR(systemProperties, COMSETTER(DefaultHardDiskFolder)(Bstr(a->argv[1]).raw()));
    605629    }
    606630    else if (!strcmp(a->argv[0], "machinefolder"))
     
    610634            CHECK_ERROR(systemProperties, COMSETTER(DefaultMachineFolder)(NULL));
    611635        else
    612             CHECK_ERROR(systemProperties, COMSETTER(DefaultMachineFolder)(Bstr(a->argv[1])));
     636            CHECK_ERROR(systemProperties, COMSETTER(DefaultMachineFolder)(Bstr(a->argv[1]).raw()));
    613637    }
    614638    else if (!strcmp(a->argv[0], "vrdpauthlibrary"))
     
    618642            CHECK_ERROR(systemProperties, COMSETTER(RemoteDisplayAuthLibrary)(NULL));
    619643        else
    620             CHECK_ERROR(systemProperties, COMSETTER(RemoteDisplayAuthLibrary)(Bstr(a->argv[1])));
     644            CHECK_ERROR(systemProperties, COMSETTER(RemoteDisplayAuthLibrary)(Bstr(a->argv[1]).raw()));
    621645    }
    622646    else if (!strcmp(a->argv[0], "websrvauthlibrary"))
     
    626650            CHECK_ERROR(systemProperties, COMSETTER(WebServiceAuthLibrary)(NULL));
    627651        else
    628             CHECK_ERROR(systemProperties, COMSETTER(WebServiceAuthLibrary)(Bstr(a->argv[1])));
     652            CHECK_ERROR(systemProperties, COMSETTER(WebServiceAuthLibrary)(Bstr(a->argv[1]).raw()));
    629653    }
    630654    else if (!strcmp(a->argv[0], "loghistorycount"))
     
    653677    ComPtr<IMachine> machine;
    654678    /* assume it's a UUID */
    655     rc = a->virtualBox->GetMachine(Bstr(a->argv[1]), machine.asOutParam());
     679    rc = a->virtualBox->GetMachine(Bstr(a->argv[1]).raw(),
     680                                   machine.asOutParam());
    656681    if (FAILED(rc) || !machine)
    657682    {
    658683        /* must be a name */
    659         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[1]), machine.asOutParam()));
     684        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[1]).raw(),
     685                                               machine.asOutParam()));
    660686    }
    661687    if (!machine)
     
    731757            CHECK_ERROR_RET(a->session, COMGETTER(Console)(console.asOutParam()), 1);
    732758
    733             CHECK_ERROR(console, CreateSharedFolder(Bstr(name), Bstr(hostpath),
     759            CHECK_ERROR(console, CreateSharedFolder(Bstr(name).raw(),
     760                                                    Bstr(hostpath).raw(),
    734761                                                    fWritable, fAutoMount));
    735762            if (console)
     
    745772            a->session->COMGETTER(Machine)(machine.asOutParam());
    746773
    747             CHECK_ERROR(machine, CreateSharedFolder(Bstr(name), Bstr(hostpath),
     774            CHECK_ERROR(machine, CreateSharedFolder(Bstr(name).raw(),
     775                                                    Bstr(hostpath).raw(),
    748776                                                    fWritable, fAutoMount));
    749777            if (SUCCEEDED(rc))
     
    796824            CHECK_ERROR_RET(a->session, COMGETTER(Console)(console.asOutParam()), 1);
    797825
    798             CHECK_ERROR(console, RemoveSharedFolder(Bstr(name)));
     826            CHECK_ERROR(console, RemoveSharedFolder(Bstr(name).raw()));
    799827
    800828            if (console)
     
    809837            a->session->COMGETTER(Machine)(machine.asOutParam());
    810838
    811             CHECK_ERROR(machine, RemoveSharedFolder(Bstr(name)));
     839            CHECK_ERROR(machine, RemoveSharedFolder(Bstr(name).raw()));
    812840
    813841            /* commit and close the session */
     
    834862    Bstr uuid(a->argv[0]);
    835863    if (!Guid(a->argv[0]).isEmpty())
    836         CHECK_ERROR(a->virtualBox, GetMachine(uuid, machine.asOutParam()));
     864        CHECK_ERROR(a->virtualBox, GetMachine(uuid.raw(),
     865                                              machine.asOutParam()));
    837866    else
    838867    {
    839         CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()));
     868        CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     869                                               machine.asOutParam()));
    840870        if (SUCCEEDED(rc))
    841871            machine->COMGETTER(Id)(uuid.asOutParam());
     
    888918            {
    889919                if (fReset)
    890                     CHECK_ERROR(debugger, ResetStats(Bstr(pszPattern)));
     920                    CHECK_ERROR(debugger, ResetStats(Bstr(pszPattern).raw()));
    891921                else
    892922                {
    893923                    Bstr stats;
    894                     CHECK_ERROR(debugger, GetStats(Bstr(pszPattern), fWithDescriptions, stats.asOutParam()));
     924                    CHECK_ERROR(debugger, GetStats(Bstr(pszPattern).raw(),
     925                                                   fWithDescriptions,
     926                                                   stats.asOutParam()));
    895927                    if (SUCCEEDED(rc))
    896928                    {
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r32701 r32718  
    55
    66/*
    7  * Copyright (C) 2006-2009 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    308308    if (!Guid(machineuuid).isEmpty())
    309309    {
    310         CHECK_ERROR_RET(a->virtualBox, GetMachine(machineuuid, machine.asOutParam()), 1);
     310        CHECK_ERROR_RET(a->virtualBox, GetMachine(machineuuid.raw(),
     311                                                  machine.asOutParam()), 1);
    311312    }
    312313    else
    313314    {
    314         CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()), 1);
     315        CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     316                                                   machine.asOutParam()), 1);
    315317        machine->COMGETTER(Id)(machineuuid.asOutParam());
    316318    }
     
    333335            case MODIFYVM_NAME:
    334336            {
    335                 CHECK_ERROR(machine, COMSETTER(Name)(Bstr(ValueUnion.psz)));
     337                CHECK_ERROR(machine, COMSETTER(Name)(Bstr(ValueUnion.psz).raw()));
    336338                break;
    337339            }
     
    339341            {
    340342                ComPtr<IGuestOSType> guestOSType;
    341                 CHECK_ERROR(a->virtualBox, GetGuestOSType(Bstr(ValueUnion.psz), guestOSType.asOutParam()));
     343                CHECK_ERROR(a->virtualBox, GetGuestOSType(Bstr(ValueUnion.psz).raw(),
     344                                                          guestOSType.asOutParam()));
    342345                if (SUCCEEDED(rc) && guestOSType)
    343346                {
    344                     CHECK_ERROR(machine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz)));
     347                    CHECK_ERROR(machine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw()));
    345348                }
    346349                else
     
    554557            case MODIFYVM_BIOSLOGOIMAGEPATH:
    555558            {
    556                 CHECK_ERROR(biosSettings, COMSETTER(LogoImagePath)(Bstr(ValueUnion.psz)));
     559                CHECK_ERROR(biosSettings, COMSETTER(LogoImagePath)(Bstr(ValueUnion.psz).raw()));
    557560                break;
    558561            }
     
    651654                if (!strcmp(ValueUnion.psz, "none"))
    652655                {
    653                     machine->DetachDevice(bstrController, u1, u2);
     656                    machine->DetachDevice(bstrController.raw(), u1, u2);
    654657                }
    655658                else
    656659                {
    657660                    ComPtr<IMedium> hardDisk;
    658                     rc = a->virtualBox->FindMedium(Bstr(ValueUnion.psz), DeviceType_HardDisk, hardDisk.asOutParam());
     661                    rc = a->virtualBox->FindMedium(Bstr(ValueUnion.psz).raw(),
     662                                                   DeviceType_HardDisk,
     663                                                   hardDisk.asOutParam());
    659664                    if (FAILED(rc))
    660665                    {
    661666                        /* open the new hard disk object */
    662667                        CHECK_ERROR(a->virtualBox,
    663                                     OpenMedium(Bstr(ValueUnion.psz),
     668                                    OpenMedium(Bstr(ValueUnion.psz).raw(),
    664669                                               DeviceType_HardDisk,
    665670                                               AccessMode_ReadWrite,
     
    668673                    if (hardDisk)
    669674                    {
    670                         CHECK_ERROR(machine, AttachDevice(bstrController, u1, u2, DeviceType_HardDisk, hardDisk));
     675                        CHECK_ERROR(machine, AttachDevice(bstrController.raw(),
     676                                                          u1, u2,
     677                                                          DeviceType_HardDisk,
     678                                                          hardDisk));
    671679                    }
    672680                    else
     
    679687            {
    680688                ComPtr<IStorageController> storageController;
    681                 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("IDE Controller"),
     689                CHECK_ERROR(machine, GetStorageControllerByName(Bstr("IDE Controller").raw(),
    682690                                                                 storageController.asOutParam()));
    683691
     
    705713            {
    706714                ComPtr<IStorageController> SataCtl;
    707                 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), SataCtl.asOutParam()));
     715                CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA").raw(),
     716                                                                SataCtl.asOutParam()));
    708717
    709718                if (SUCCEEDED(rc))
     
    715724            {
    716725                ComPtr<IStorageController> SataCtl;
    717                 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), SataCtl.asOutParam()));
     726                CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA").raw(),
     727                                                                SataCtl.asOutParam()));
    718728
    719729                if (SUCCEEDED(rc) && ValueUnion.u32 > 0)
     
    727737                {
    728738                    ComPtr<IStorageController> ctl;
    729                     CHECK_ERROR(machine, AddStorageController(Bstr("SATA"), StorageBus_SATA, ctl.asOutParam()));
     739                    CHECK_ERROR(machine, AddStorageController(Bstr("SATA").raw(),
     740                                                              StorageBus_SATA,
     741                                                              ctl.asOutParam()));
    730742                    CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_IntelAhci));
    731743                }
    732744                else if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable"))
    733                     CHECK_ERROR(machine, RemoveStorageController(Bstr("SATA")));
     745                    CHECK_ERROR(machine, RemoveStorageController(Bstr("SATA").raw()));
    734746                else
    735747                    return errorArgument("Invalid --usb argument '%s'", ValueUnion.psz);
     
    741753                if (!strcmp(ValueUnion.psz, "none"))
    742754                {
    743                     rc = machine->DetachDevice(Bstr("LsiLogic"), GetOptState.uIndex, 0);
     755                    rc = machine->DetachDevice(Bstr("LsiLogic").raw(),
     756                                               GetOptState.uIndex, 0);
    744757                    if (FAILED(rc))
    745                         CHECK_ERROR(machine, DetachDevice(Bstr("BusLogic"), GetOptState.uIndex, 0));
     758                        CHECK_ERROR(machine, DetachDevice(Bstr("BusLogic").raw(),
     759                                                          GetOptState.uIndex, 0));
    746760                }
    747761                else
     
    749763                    /* first guess is that it's a UUID */
    750764                    ComPtr<IMedium> hardDisk;
    751                     rc = a->virtualBox->FindMedium(Bstr(ValueUnion.psz), DeviceType_HardDisk, hardDisk.asOutParam());
     765                    rc = a->virtualBox->FindMedium(Bstr(ValueUnion.psz).raw(),
     766                                                   DeviceType_HardDisk,
     767                                                   hardDisk.asOutParam());
    752768                    /* not successful? Then it must be a filename */
    753769                    if (FAILED(rc))
     
    755771                        /* open the new hard disk object */
    756772                        CHECK_ERROR(a->virtualBox,
    757                                     OpenMedium(Bstr(ValueUnion.psz),
     773                                    OpenMedium(Bstr(ValueUnion.psz).raw(),
    758774                                               DeviceType_HardDisk,
    759775                                               AccessMode_ReadWrite,
     
    762778                    if (hardDisk)
    763779                    {
    764                         rc = machine->AttachDevice(Bstr("LsiLogic"), GetOptState.uIndex, 0, DeviceType_HardDisk, hardDisk);
     780                        rc = machine->AttachDevice(Bstr("LsiLogic").raw(),
     781                                                   GetOptState.uIndex, 0,
     782                                                   DeviceType_HardDisk,
     783                                                   hardDisk);
    765784                        if (FAILED(rc))
    766785                            CHECK_ERROR(machine,
    767                                          AttachDevice(Bstr("BusLogic"),
    768                                                       GetOptState.uIndex, 0,
    769                                                       DeviceType_HardDisk, hardDisk));
     786                                        AttachDevice(Bstr("BusLogic").raw(),
     787                                                     GetOptState.uIndex, 0,
     788                                                     DeviceType_HardDisk,
     789                                                     hardDisk));
    770790                    }
    771791                    else
     
    781801                if (!RTStrICmp(ValueUnion.psz, "LsiLogic"))
    782802                {
    783                     rc = machine->RemoveStorageController(Bstr("BusLogic"));
     803                    rc = machine->RemoveStorageController(Bstr("BusLogic").raw());
    784804                    if (FAILED(rc))
    785                         CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic")));
     805                        CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic").raw()));
    786806
    787807                    CHECK_ERROR(machine,
    788                                  AddStorageController(Bstr("LsiLogic"),
     808                                 AddStorageController(Bstr("LsiLogic").raw(),
    789809                                                      StorageBus_SCSI,
    790810                                                      ctl.asOutParam()));
     
    795815                else if (!RTStrICmp(ValueUnion.psz, "BusLogic"))
    796816                {
    797                     rc = machine->RemoveStorageController(Bstr("LsiLogic"));
     817                    rc = machine->RemoveStorageController(Bstr("LsiLogic").raw());
    798818                    if (FAILED(rc))
    799                         CHECK_ERROR(machine, RemoveStorageController(Bstr("BusLogic")));
     819                        CHECK_ERROR(machine, RemoveStorageController(Bstr("BusLogic").raw()));
    800820
    801821                    CHECK_ERROR(machine,
    802                                  AddStorageController(Bstr("BusLogic"),
     822                                 AddStorageController(Bstr("BusLogic").raw(),
    803823                                                      StorageBus_SCSI,
    804824                                                      ctl.asOutParam()));
     
    818838                    ComPtr<IStorageController> ctl;
    819839
    820                     CHECK_ERROR(machine, AddStorageController(Bstr("BusLogic"), StorageBus_SCSI, ctl.asOutParam()));
     840                    CHECK_ERROR(machine, AddStorageController(Bstr("BusLogic").raw(),
     841                                                              StorageBus_SCSI,
     842                                                              ctl.asOutParam()));
    821843                    if (SUCCEEDED(rc))
    822844                        CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic));
     
    824846                else if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable"))
    825847                {
    826                     rc = machine->RemoveStorageController(Bstr("BusLogic"));
     848                    rc = machine->RemoveStorageController(Bstr("BusLogic").raw());
    827849                    if (FAILED(rc))
    828                         CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic")));
     850                        CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic").raw()));
    829851                }
    830852                break;
     
    833855            case MODIFYVM_DVDPASSTHROUGH: // deprecated
    834856            {
    835                 CHECK_ERROR(machine, PassthroughDevice(Bstr("IDE Controller"), 1, 0, !strcmp(ValueUnion.psz, "on")));
     857                CHECK_ERROR(machine, PassthroughDevice(Bstr("IDE Controller").raw(),
     858                                                       1, 0,
     859                                                       !strcmp(ValueUnion.psz, "on")));
    836860                break;
    837861            }
     
    852876                    ComPtr<IHost> host;
    853877                    CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam()));
    854                     rc = host->FindHostDVDDrive(Bstr(ValueUnion.psz + 5), dvdMedium.asOutParam());
     878                    rc = host->FindHostDVDDrive(Bstr(ValueUnion.psz + 5).raw(),
     879                                                dvdMedium.asOutParam());
    855880                    if (!dvdMedium)
    856881                    {
     
    863888                            break;
    864889                        }
    865                         rc = host->FindHostDVDDrive(Bstr(szPathReal), dvdMedium.asOutParam());
     890                        rc = host->FindHostDVDDrive(Bstr(szPathReal).raw(),
     891                                                    dvdMedium.asOutParam());
    866892                        if (!dvdMedium)
    867893                        {
     
    875901                {
    876902                    /* first assume it's a UUID */
    877                     rc = a->virtualBox->FindMedium(Bstr(ValueUnion.psz), DeviceType_DVD, dvdMedium.asOutParam());
     903                    rc = a->virtualBox->FindMedium(Bstr(ValueUnion.psz).raw(),
     904                                                   DeviceType_DVD,
     905                                                   dvdMedium.asOutParam());
    878906                    if (FAILED(rc) || !dvdMedium)
    879907                    {
     
    881909                        Bstr emptyUUID;
    882910                        CHECK_ERROR(a->virtualBox,
    883                                     OpenMedium(Bstr(ValueUnion.psz),
     911                                    OpenMedium(Bstr(ValueUnion.psz).raw(),
    884912                                               DeviceType_DVD,
    885913                                               AccessMode_ReadWrite,
     
    893921                }
    894922
    895                 /** @todo generalize this, allow arbitrary number of DVD drives
    896                  * and as a consequence multiple attachments and different
    897                  * storage controllers. */
    898923                if (dvdMedium)
    899924                    dvdMedium->COMGETTER(Id)(uuid.asOutParam());
    900                 CHECK_ERROR(machine, MountMedium(Bstr("IDE Controller"), 1, 0, uuid, FALSE /* aForce */));
     925                CHECK_ERROR(machine, MountMedium(Bstr("IDE Controller").raw(),
     926                                                 1, 0, uuid.raw(),
     927                                                 FALSE /* aForce */));
    901928                break;
    902929            }
     
    907934                ComPtr<IMedium> floppyMedium;
    908935                ComPtr<IMediumAttachment> floppyAttachment;
    909                 machine->GetMediumAttachment(Bstr("Floppy Controller"), 0, 0, floppyAttachment.asOutParam());
     936                machine->GetMediumAttachment(Bstr("Floppy Controller").raw(),
     937                                             0, 0, floppyAttachment.asOutParam());
    910938
    911939                /* disable? */
     
    914942                    /* disable the controller */
    915943                    if (floppyAttachment)
    916                         CHECK_ERROR(machine, DetachDevice(Bstr("Floppy Controller"), 0, 0));
     944                        CHECK_ERROR(machine, DetachDevice(Bstr("Floppy Controller").raw(),
     945                                                          0, 0));
    917946                }
    918947                else
     
    920949                    /* enable the controller */
    921950                    if (!floppyAttachment)
    922                         CHECK_ERROR(machine, AttachDevice(Bstr("Floppy Controller"), 0, 0, DeviceType_Floppy, NULL));
     951                        CHECK_ERROR(machine, AttachDevice(Bstr("Floppy Controller").raw(),
     952                                                          0, 0,
     953                                                          DeviceType_Floppy, NULL));
    923954
    924955                    /* unmount? */
     
    933964                        ComPtr<IHost> host;
    934965                        CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam()));
    935                         rc = host->FindHostFloppyDrive(Bstr(ValueUnion.psz + 5), floppyMedium.asOutParam());
     966                        rc = host->FindHostFloppyDrive(Bstr(ValueUnion.psz + 5).raw(),
     967                                                       floppyMedium.asOutParam());
    936968                        if (!floppyMedium)
    937969                        {
     
    944976                    {
    945977                        /* first assume it's a UUID */
    946                         rc = a->virtualBox->FindMedium(Bstr(ValueUnion.psz), DeviceType_Floppy, floppyMedium.asOutParam());
     978                        rc = a->virtualBox->FindMedium(Bstr(ValueUnion.psz).raw(),
     979                                                       DeviceType_Floppy,
     980                                                       floppyMedium.asOutParam());
    947981                        if (FAILED(rc) || !floppyMedium)
    948982                        {
     
    950984                            Bstr emptyUUID;
    951985                            CHECK_ERROR(a->virtualBox,
    952                                         OpenMedium(Bstr(ValueUnion.psz),
     986                                        OpenMedium(Bstr(ValueUnion.psz).raw(),
    953987                                                   DeviceType_Floppy,
    954988                                                   AccessMode_ReadWrite,
     
    962996                    }
    963997                    floppyMedium->COMGETTER(Id)(uuid.asOutParam());
    964                     CHECK_ERROR(machine, MountMedium(Bstr("Floppy Controller"), 0, 0, uuid, FALSE /* aForce */));
     998                    CHECK_ERROR(machine, MountMedium(Bstr("Floppy Controller").raw(),
     999                                                     0, 0, uuid.raw(),
     1000                                                     FALSE /* aForce */));
    9651001                }
    9661002                break;
     
    9741010                ASSERT(nic);
    9751011
    976                 CHECK_ERROR(nic, COMSETTER(TraceFile)(Bstr(ValueUnion.psz)));
     1012                CHECK_ERROR(nic, COMSETTER(TraceFile)(Bstr(ValueUnion.psz).raw()));
    9771013                break;
    9781014            }
     
    11411177                ASSERT(nic);
    11421178
     1179                /** @todo NULL string deprecated */
    11431180                /* remove it? */
    11441181                if (!strcmp(ValueUnion.psz, "none"))
     
    11481185                else
    11491186                {
    1150                     CHECK_ERROR(nic, COMSETTER(HostInterface)(Bstr(ValueUnion.psz)));
     1187                    CHECK_ERROR(nic, COMSETTER(HostInterface)(Bstr(ValueUnion.psz).raw()));
    11511188                }
    11521189                break;
     
    11601197                ASSERT(nic);
    11611198
     1199                /** @todo NULL string deprecated */
    11621200                /* remove it? */
    11631201                if (!strcmp(ValueUnion.psz, "none"))
     
    11671205                else
    11681206                {
    1169                     CHECK_ERROR(nic, COMSETTER(InternalNetwork)(Bstr(ValueUnion.psz)));
     1207                    CHECK_ERROR(nic, COMSETTER(InternalNetwork)(Bstr(ValueUnion.psz).raw()));
    11701208                }
    11711209                break;
     
    11801218                ASSERT(nic);
    11811219
     1220                /** @todo NULL string deprecated */
     1221                /* remove it? */
    11821222                if (!strcmp(ValueUnion.psz, "default"))
    11831223                {
     
    11861226                else
    11871227                {
    1188                     CHECK_ERROR(nic, COMSETTER(VDENetwork)(Bstr(ValueUnion.psz)));
     1228                    CHECK_ERROR(nic, COMSETTER(VDENetwork)(Bstr(ValueUnion.psz).raw()));
    11891229                }
    11901230                break;
     
    12051245                    psz = "";
    12061246
    1207                 CHECK_ERROR(driver, COMSETTER(Network)(Bstr(psz)));
     1247                CHECK_ERROR(driver, COMSETTER(Network)(Bstr(psz).raw()));
    12081248                break;
    12091249            }
     
    12181258
    12191259                CHECK_ERROR(nic, COMGETTER(NatDriver)(driver.asOutParam()));
    1220                 CHECK_ERROR(driver, COMSETTER(HostIP)(Bstr(ValueUnion.psz)));
     1260                CHECK_ERROR(driver, COMSETTER(HostIP)(Bstr(ValueUnion.psz).raw()));
    12211261                break;
    12221262            }
     
    13111351                        break;
    13121352                    }
    1313                     CHECK_ERROR(driver, AddRedirect(Bstr(strName), proto, Bstr(strHostIp),
    1314                             RTStrToUInt16(strHostPort), Bstr(strGuestIp), RTStrToUInt16(strGuestPort)));
     1353                    CHECK_ERROR(driver, AddRedirect(Bstr(strName).raw(), proto,
     1354                                        Bstr(strHostIp).raw(),
     1355                                        RTStrToUInt16(strHostPort),
     1356                                        Bstr(strGuestIp).raw(),
     1357                                        RTStrToUInt16(strGuestPort)));
    13151358                }
    13161359                else
     
    13211364                    if (RT_FAILURE(vrc))
    13221365                        return errorSyntax(USAGE_MODIFYVM, "Not enough parameters");
    1323                     CHECK_ERROR(driver, RemoveRedirect(Bstr(ValueUnion.psz)));
     1366                    CHECK_ERROR(driver, RemoveRedirect(Bstr(ValueUnion.psz).raw()));
    13241367                }
    13251368                break;
     
    13701413
    13711414                CHECK_ERROR(nic, COMGETTER(NatDriver)(driver.asOutParam()));
    1372                 CHECK_ERROR(driver, COMSETTER(TftpPrefix)(Bstr(ValueUnion.psz)));
     1415                CHECK_ERROR(driver, COMSETTER(TftpPrefix)(Bstr(ValueUnion.psz).raw()));
    13731416                break;
    13741417            }
     
    13831426
    13841427                CHECK_ERROR(nic, COMGETTER(NatDriver)(driver.asOutParam()));
    1385                 CHECK_ERROR(driver, COMSETTER(TftpBootFile)(Bstr(ValueUnion.psz)));
     1428                CHECK_ERROR(driver, COMSETTER(TftpBootFile)(Bstr(ValueUnion.psz).raw()));
    13861429                break;
    13871430            }
     
    13961439
    13971440                CHECK_ERROR(nic, COMGETTER(NatDriver)(driver.asOutParam()));
    1398                 CHECK_ERROR(driver, COMSETTER(TftpNextServer)(Bstr(ValueUnion.psz)));
     1441                CHECK_ERROR(driver, COMSETTER(TftpNextServer)(Bstr(ValueUnion.psz).raw()));
    13991442                break;
    14001443            }
     
    14511494                else
    14521495                {
    1453                     CHECK_ERROR(nic, COMSETTER(MACAddress)(Bstr(ValueUnion.psz)));
     1496                    CHECK_ERROR(nic, COMSETTER(MACAddress)(Bstr(ValueUnion.psz).raw()));
    14541497                }
    14551498                break;
     
    15581601                                           GetOptState.pDef->pszLong);
    15591602
    1560                     CHECK_ERROR(uart, COMSETTER(Path)(Bstr(ValueUnion.psz)));
     1603                    CHECK_ERROR(uart, COMSETTER(Path)(Bstr(ValueUnion.psz).raw()));
    15611604
    15621605                    if (!strcmp(pszMode, "server"))
     
    15771620                else
    15781621                {
    1579                     CHECK_ERROR(uart, COMSETTER(Path)(Bstr(ValueUnion.psz)));
     1622                    CHECK_ERROR(uart, COMSETTER(Path)(Bstr(ValueUnion.psz).raw()));
    15801623                    CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_HostDevice));
    15811624                }
     
    17651808
    17661809                if (!strcmp(ValueUnion.psz, "default"))
    1767                     CHECK_ERROR(vrdpServer, COMSETTER(Ports)(Bstr("0")));
    1768                 else
    1769                     CHECK_ERROR(vrdpServer, COMSETTER(Ports)(Bstr(ValueUnion.psz)));
     1810                    CHECK_ERROR(vrdpServer, COMSETTER(Ports)(Bstr("0").raw()));
     1811                else
     1812                    CHECK_ERROR(vrdpServer, COMSETTER(Ports)(Bstr(ValueUnion.psz).raw()));
    17701813                break;
    17711814            }
     
    17771820                ASSERT(vrdpServer);
    17781821
    1779                 CHECK_ERROR(vrdpServer, COMSETTER(NetAddress)(Bstr(ValueUnion.psz)));
     1822                CHECK_ERROR(vrdpServer, COMSETTER(NetAddress)(Bstr(ValueUnion.psz).raw()));
    17801823                break;
    17811824            }
     
    18811924                    CHECK_ERROR(machine, COMSETTER(SnapshotFolder)(NULL));
    18821925                else
    1883                     CHECK_ERROR(machine, COMSETTER(SnapshotFolder)(Bstr(ValueUnion.psz)));
     1926                    CHECK_ERROR(machine, COMSETTER(SnapshotFolder)(Bstr(ValueUnion.psz).raw()));
    18841927                break;
    18851928            }
     
    18991942            case MODIFYVM_TELEPORTER_ADDRESS:
    19001943            {
    1901                 CHECK_ERROR(machine, COMSETTER(TeleporterAddress)(Bstr(ValueUnion.psz)));
     1944                CHECK_ERROR(machine, COMSETTER(TeleporterAddress)(Bstr(ValueUnion.psz).raw()));
    19021945                break;
    19031946            }
     
    19051948            case MODIFYVM_TELEPORTER_PASSWORD:
    19061949            {
    1907                 CHECK_ERROR(machine, COMSETTER(TeleporterPassword)(Bstr(ValueUnion.psz)));
     1950                CHECK_ERROR(machine, COMSETTER(TeleporterPassword)(Bstr(ValueUnion.psz).raw()));
    19081951                break;
    19091952            }
     
    19301973            case MODIFYVM_FAULT_TOLERANCE_ADDRESS:
    19311974            {
    1932                 CHECK_ERROR(machine, COMSETTER(FaultToleranceAddress)(Bstr(ValueUnion.psz)));
     1975                CHECK_ERROR(machine, COMSETTER(FaultToleranceAddress)(Bstr(ValueUnion.psz).raw()));
    19331976                break;
    19341977            }
     
    19421985            case MODIFYVM_FAULT_TOLERANCE_PASSWORD:
    19431986            {
    1944                 CHECK_ERROR(machine, COMSETTER(FaultTolerancePassword)(Bstr(ValueUnion.psz)));
     1987                CHECK_ERROR(machine, COMSETTER(FaultTolerancePassword)(Bstr(ValueUnion.psz).raw()));
    19451988                break;
    19461989            }
     
    19541997            case MODIFYVM_HARDWARE_UUID:
    19551998            {
    1956                 CHECK_ERROR(machine, COMSETTER(HardwareUUID)(Bstr(ValueUnion.psz)));
     1999                CHECK_ERROR(machine, COMSETTER(HardwareUUID)(Bstr(ValueUnion.psz).raw()));
    19572000                break;
    19582001            }
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp

    r32701 r32718  
    55
    66/*
    7  * Copyright (C) 2006-2009 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    172172        // get root snapshot
    173173        ComPtr<ISnapshot> pSnapshot;
    174         CHECK_ERROR_BREAK(pMachine, GetSnapshot(Bstr(""), pSnapshot.asOutParam()));
     174        CHECK_ERROR_BREAK(pMachine, GetSnapshot(Bstr("").raw(), pSnapshot.asOutParam()));
    175175
    176176        // get current snapshot
     
    228228    ComPtr<IMachine> pMachine;
    229229    /* assume it's a UUID */
    230     rc = a->virtualBox->GetMachine(bstrMachine, pMachine.asOutParam());
     230    rc = a->virtualBox->GetMachine(bstrMachine.raw(), pMachine.asOutParam());
    231231    if (FAILED(rc) || !pMachine)
    232232    {
    233233        /* must be a name */
    234         CHECK_ERROR(a->virtualBox, FindMachine(bstrMachine, pMachine.asOutParam()));
     234        CHECK_ERROR(a->virtualBox, FindMachine(bstrMachine.raw(),
     235                                               pMachine.asOutParam()));
    235236    }
    236237    if (!pMachine)
     
    308309
    309310            ComPtr<IProgress> progress;
    310             CHECK_ERROR_BREAK(console, TakeSnapshot(name, desc, progress.asOutParam()));
     311            CHECK_ERROR_BREAK(console, TakeSnapshot(name.raw(), desc.raw(),
     312                                                    progress.asOutParam()));
    311313
    312314            rc = showProgress(progress);
     
    369371                // assume it's a UUID
    370372                bstrSnapGuid = a->argv[2];
    371                 if (FAILED(pMachine->GetSnapshot(bstrSnapGuid, pSnapshot.asOutParam())))
     373                if (FAILED(pMachine->GetSnapshot(bstrSnapGuid.raw(),
     374                                                 pSnapshot.asOutParam())))
    372375                {
    373376                    // then it must be a name
    374                     CHECK_ERROR_BREAK(pMachine, FindSnapshot(Bstr(a->argv[2]), pSnapshot.asOutParam()));
     377                    CHECK_ERROR_BREAK(pMachine, FindSnapshot(Bstr(a->argv[2]).raw(),
     378                                                             pSnapshot.asOutParam()));
    375379                    CHECK_ERROR_BREAK(pSnapshot, COMGETTER(Id)(bstrSnapGuid.asOutParam()));
    376380                }
     
    379383            if (fDelete)
    380384            {
    381                 CHECK_ERROR_BREAK(console, DeleteSnapshot(bstrSnapGuid, pProgress.asOutParam()));
     385                CHECK_ERROR_BREAK(console, DeleteSnapshot(bstrSnapGuid.raw(),
     386                                                          pProgress.asOutParam()));
    382387            }
    383388            else
     
    417422            {
    418423                /* assume it's a UUID */
    419                 rc = pMachine->GetSnapshot(Bstr(a->argv[2]), snapshot.asOutParam());
     424                rc = pMachine->GetSnapshot(Bstr(a->argv[2]).raw(),
     425                                           snapshot.asOutParam());
    420426                if (FAILED(rc) || !snapshot)
    421427                {
    422428                    /* then it must be a name */
    423                     CHECK_ERROR_BREAK(pMachine, FindSnapshot(Bstr(a->argv[2]), snapshot.asOutParam()));
     429                    CHECK_ERROR_BREAK(pMachine, FindSnapshot(Bstr(a->argv[2]).raw(),
     430                                                             snapshot.asOutParam()));
    424431                }
    425432            }
     
    439446                    }
    440447                    i++;
    441                     snapshot->COMSETTER(Name)(Bstr(a->argv[i]));
     448                    snapshot->COMSETTER(Name)(Bstr(a->argv[i]).raw());
    442449                }
    443450                else if (   !strcmp(a->argv[i], "--description")
     
    452459                    }
    453460                    i++;
    454                     snapshot->COMSETTER(Description)(Bstr(a->argv[i]));
     461                    snapshot->COMSETTER(Description)(Bstr(a->argv[i]).raw());
    455462                }
    456463                else
     
    476483
    477484            /* assume it's a UUID */
    478             rc = pMachine->GetSnapshot(Bstr(a->argv[2]), snapshot.asOutParam());
     485            rc = pMachine->GetSnapshot(Bstr(a->argv[2]).raw(),
     486                                       snapshot.asOutParam());
    479487            if (FAILED(rc) || !snapshot)
    480488            {
    481489                /* then it must be a name */
    482                 CHECK_ERROR_BREAK(pMachine, FindSnapshot(Bstr(a->argv[2]), snapshot.asOutParam()));
     490                CHECK_ERROR_BREAK(pMachine, FindSnapshot(Bstr(a->argv[2]).raw(),
     491                                                         snapshot.asOutParam()));
    483492            }
    484493
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp

    r31615 r32718  
    55
    66/*
    7  * Copyright (C) 2006-2009 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    164164    if (!Guid(machineuuid).isEmpty())
    165165    {
    166         CHECK_ERROR_RET(a->virtualBox, GetMachine(machineuuid, machine.asOutParam()), 1);
     166        CHECK_ERROR_RET(a->virtualBox, GetMachine(machineuuid.raw(),
     167                                                  machine.asOutParam()), 1);
    167168    }
    168169    else
    169170    {
    170         CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()), 1);
     171        CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     172                                                   machine.asOutParam()), 1);
    171173        machine->COMGETTER(Id)(machineuuid.asOutParam());
    172174    }
     
    200202
    201203    /* check if the storage controller is present */
    202     rc = machine->GetStorageControllerByName(Bstr(pszCtl), storageCtl.asOutParam());
     204    rc = machine->GetStorageControllerByName(Bstr(pszCtl).raw(),
     205                                             storageCtl.asOutParam());
    203206    if (FAILED(rc))
    204207    {
     
    226229    if (!RTStrICmp(pszMedium, "none"))
    227230    {
    228         CHECK_ERROR(machine, DetachDevice(Bstr(pszCtl), port, device));
     231        CHECK_ERROR(machine, DetachDevice(Bstr(pszCtl).raw(), port, device));
    229232    }
    230233    else if (!RTStrICmp(pszMedium, "emptydrive"))
     
    234237            ComPtr<IMediumAttachment> mediumAttachment;
    235238            DeviceType_T deviceType = DeviceType_Null;
    236             rc = machine->GetMediumAttachment(Bstr(pszCtl), port, device, mediumAttachment.asOutParam());
     239            rc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port, device,
     240                                              mediumAttachment.asOutParam());
    237241            if (SUCCEEDED(rc))
    238242            {
     
    243247                {
    244248                    /* just unmount the floppy/dvd */
    245                     CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, Bstr(""), fForceUnmount));
     249                    CHECK_ERROR(machine, MountMedium(Bstr(pszCtl).raw(), port,
     250                                                     device, Bstr("").raw(),
     251                                                     fForceUnmount));
    246252                }
    247253            }
     
    286292
    287293            /* attach a empty floppy/dvd drive after removing previous attachment */
    288             machine->DetachDevice(Bstr(pszCtl), port, device);
    289             CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, deviceType, NULL));
     294            machine->DetachDevice(Bstr(pszCtl).raw(), port, device);
     295            CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl).raw(), port, device,
     296                                              deviceType, NULL));
    290297        }
    291298    }
     
    319326                 */
    320327                ComPtr<IMediumAttachment> mediumAttachement;
    321                 rc = machine->GetMediumAttachment(Bstr(pszCtl), port, device, mediumAttachement.asOutParam());
     328                rc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port,
     329                                                  device,
     330                                                  mediumAttachement.asOutParam());
    322331                if (SUCCEEDED(rc))
    323332                {
     
    328337                    {
    329338                        ComPtr<IMedium> dvdMedium;
    330                         rc = a->virtualBox->FindMedium(Bstr(pszMedium), DeviceType_DVD, dvdMedium.asOutParam());
     339                        rc = a->virtualBox->FindMedium(Bstr(pszMedium).raw(),
     340                                                       DeviceType_DVD,
     341                                                       dvdMedium.asOutParam());
    331342                        if (dvdMedium)
    332343                            /*
     
    339350                    {
    340351                        ComPtr<IMedium> hardDisk;
    341                         rc = a->virtualBox->FindMedium(Bstr(pszMedium), DeviceType_HardDisk, hardDisk.asOutParam());
     352                        rc = a->virtualBox->FindMedium(Bstr(pszMedium).raw(),
     353                                                       DeviceType_HardDisk,
     354                                                       hardDisk.asOutParam());
    342355                        if (hardDisk)
    343356                            /*
     
    402415
    403416                /* check if there is a dvd drive at the given location, if not attach one */
    404                 rc = machine->GetMediumAttachment(Bstr(pszCtl), port, device, mediumAttachement.asOutParam());
     417                rc = machine->GetMediumAttachment(Bstr(pszCtl).raw(), port,
     418                                                  device,
     419                                                  mediumAttachement.asOutParam());
    405420                if (SUCCEEDED(rc))
    406421                {
     
    410425                    if (deviceType != DeviceType_DVD)
    411426                    {
    412                         machine->DetachDevice(Bstr(pszCtl), port, device);
    413                         rc = machine->AttachDevice(Bstr(pszCtl), port, device, DeviceType_DVD, NULL);
     427                        machine->DetachDevice(Bstr(pszCtl).raw(), port, device);
     428                        rc = machine->AttachDevice(Bstr(pszCtl).raw(), port,
     429                                                   device, DeviceType_DVD, NULL);
    414430                    }
    415431                }
    416432                else
    417433                {
    418                     rc = machine->AttachDevice(Bstr(pszCtl), port, device, DeviceType_DVD, NULL);
     434                    rc = machine->AttachDevice(Bstr(pszCtl).raw(), port,
     435                                               device, DeviceType_DVD, NULL);
    419436                }
    420437            }
     
    428445                    ComPtr<IHost> host;
    429446                    CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam()));
    430                     rc = host->FindHostDVDDrive(Bstr(pszMedium + 5), dvdMedium.asOutParam());
     447                    rc = host->FindHostDVDDrive(Bstr(pszMedium + 5).raw(),
     448                                                dvdMedium.asOutParam());
    431449                    if (!dvdMedium)
    432450                    {
     
    439457                            break;
    440458                        }
    441                         rc = host->FindHostDVDDrive(Bstr(szPathReal), dvdMedium.asOutParam());
     459                        rc = host->FindHostDVDDrive(Bstr(szPathReal).raw(),
     460                                                    dvdMedium.asOutParam());
    442461                        if (!dvdMedium)
    443462                        {
     
    450469                else
    451470                {
    452                     rc = a->virtualBox->FindMedium(Bstr(pszMedium), DeviceType_DVD, dvdMedium.asOutParam());
     471                    rc = a->virtualBox->FindMedium(Bstr(pszMedium).raw(),
     472                                                   DeviceType_DVD,
     473                                                   dvdMedium.asOutParam());
    453474                    if (FAILED(rc) || !dvdMedium)
    454475                    {
     
    456477                        Bstr emptyUUID;
    457478                        CHECK_ERROR(a->virtualBox,
    458                                     OpenMedium(Bstr(pszMedium),
     479                                    OpenMedium(Bstr(pszMedium).raw(),
    459480                                               DeviceType_DVD,
    460481                                               AccessMode_ReadWrite,
     
    473494            {
    474495                dvdMedium->COMGETTER(Id)(uuid.asOutParam());
    475                 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, uuid, fForceUnmount));
     496                CHECK_ERROR(machine, MountMedium(Bstr(pszCtl).raw(), port,
     497                                                 device, uuid.raw(),
     498                                                 fForceUnmount));
    476499            }
    477500        }
     
    482505
    483506            /* if there is anything attached at the given location, remove it */
    484             machine->DetachDevice(Bstr(pszCtl), port, device);
     507            machine->DetachDevice(Bstr(pszCtl).raw(), port, device);
    485508
    486509            /* first guess is that it's a UUID */
    487510            ComPtr<IMedium> hardDisk;
    488             rc = a->virtualBox->FindMedium(Bstr(pszMedium), DeviceType_HardDisk, hardDisk.asOutParam());
     511            rc = a->virtualBox->FindMedium(Bstr(pszMedium).raw(),
     512                                           DeviceType_HardDisk,
     513                                           hardDisk.asOutParam());
    489514
    490515            /* not successful? Then it must be a filename */
     
    493518                /* open the new hard disk object */
    494519                CHECK_ERROR(a->virtualBox,
    495                             OpenMedium(Bstr(pszMedium),
     520                            OpenMedium(Bstr(pszMedium).raw(),
    496521                                       DeviceType_HardDisk,
    497522                                       AccessMode_ReadWrite,
     
    501526            if (hardDisk)
    502527            {
    503                 CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_HardDisk, hardDisk));
     528                CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl).raw(), port,
     529                                                  device, DeviceType_HardDisk,
     530                                                  hardDisk));
    504531            }
    505532            else
     
    514541            ComPtr<IMedium> floppyMedium;
    515542            ComPtr<IMediumAttachment> floppyAttachment;
    516             machine->GetMediumAttachment(Bstr(pszCtl), port, device, floppyAttachment.asOutParam());
     543            machine->GetMediumAttachment(Bstr(pszCtl).raw(), port, device,
     544                                         floppyAttachment.asOutParam());
    517545
    518546            if (   !fRunTime
    519547                && !floppyAttachment)
    520                 CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_Floppy, NULL));
     548                CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl).raw(), port,
     549                                                  device, DeviceType_Floppy,
     550                                                  NULL));
    521551
    522552            /* host drive? */
     
    526556
    527557                CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam()));
    528                 rc = host->FindHostFloppyDrive(Bstr(pszMedium + 5), floppyMedium.asOutParam());
     558                rc = host->FindHostFloppyDrive(Bstr(pszMedium + 5).raw(),
     559                                               floppyMedium.asOutParam());
    529560                if (!floppyMedium)
    530561                {
     
    536567            {
    537568                /* first assume it's a UUID */
    538                 rc = a->virtualBox->FindMedium(Bstr(pszMedium), DeviceType_Floppy, floppyMedium.asOutParam());
     569                rc = a->virtualBox->FindMedium(Bstr(pszMedium).raw(),
     570                                               DeviceType_Floppy,
     571                                               floppyMedium.asOutParam());
    539572                if (FAILED(rc) || !floppyMedium)
    540573                {
     
    542575                    Bstr emptyUUID;
    543576                    CHECK_ERROR(a->virtualBox,
    544                                  OpenMedium(Bstr(pszMedium),
     577                                 OpenMedium(Bstr(pszMedium).raw(),
    545578                                            DeviceType_Floppy,
    546579                                            AccessMode_ReadWrite,
     
    558591            {
    559592                floppyMedium->COMGETTER(Id)(uuid.asOutParam());
    560                 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, uuid, fForceUnmount));
     593                CHECK_ERROR(machine, MountMedium(Bstr(pszCtl).raw(), port,
     594                                                 device, uuid.raw(),
     595                                                 fForceUnmount));
    561596            }
    562597        }
     
    573608        ComPtr<IMediumAttachment> mattach;
    574609
    575         CHECK_ERROR(machine, GetMediumAttachment(Bstr(pszCtl), port, device, mattach.asOutParam()));
     610        CHECK_ERROR(machine, GetMediumAttachment(Bstr(pszCtl).raw(), port,
     611                                                 device, mattach.asOutParam()));
    576612
    577613        if (SUCCEEDED(rc))
     
    579615            if (!RTStrICmp(pszPassThrough, "on"))
    580616            {
    581                 CHECK_ERROR(machine, PassthroughDevice(Bstr(pszCtl), port, device, TRUE));
     617                CHECK_ERROR(machine, PassthroughDevice(Bstr(pszCtl).raw(),
     618                                                       port, device, TRUE));
    582619            }
    583620            else if (!RTStrICmp(pszPassThrough, "off"))
    584621            {
    585                 CHECK_ERROR(machine, PassthroughDevice(Bstr(pszCtl), port, device, FALSE));
     622                CHECK_ERROR(machine, PassthroughDevice(Bstr(pszCtl).raw(),
     623                                                       port, device, FALSE));
    586624            }
    587625            else
     
    716754    if (!Guid(machineuuid).isEmpty())
    717755    {
    718         CHECK_ERROR_RET(a->virtualBox, GetMachine (machineuuid, machine.asOutParam()), 1);
     756        CHECK_ERROR_RET(a->virtualBox, GetMachine(machineuuid.raw(),
     757                                                  machine.asOutParam()), 1);
    719758    }
    720759    else
    721760    {
    722         CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()), 1);
     761        CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
     762                                                   machine.asOutParam()), 1);
    723763        machine->COMGETTER(Id)(machineuuid.asOutParam());
    724764    }
     
    743783
    744784        CHECK_ERROR(machine,
    745                      GetMediumAttachmentsOfController(Bstr(pszCtl),
     785                     GetMediumAttachmentsOfController(Bstr(pszCtl).raw(),
    746786                                                      ComSafeArrayAsOutParam(mediumAttachments)));
    747787        for (size_t i = 0; i < mediumAttachments.size(); ++ i)
     
    753793            CHECK_ERROR(mediumAttach, COMGETTER(Port)(&port));
    754794            CHECK_ERROR(mediumAttach, COMGETTER(Device)(&device));
    755             CHECK_ERROR(machine, DetachDevice(Bstr(pszCtl), port, device));
     795            CHECK_ERROR(machine, DetachDevice(Bstr(pszCtl).raw(), port, device));
    756796        }
    757797
    758798        if (SUCCEEDED(rc))
    759             CHECK_ERROR(machine, RemoveStorageController(Bstr(pszCtl)));
     799            CHECK_ERROR(machine, RemoveStorageController(Bstr(pszCtl).raw()));
    760800        else
    761801            errorArgument("Can't detach the devices connected to '%s' Controller\n"
     
    770810            if (!RTStrICmp(pszBusType, "ide"))
    771811            {
    772                 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_IDE, ctl.asOutParam()));
     812                CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl).raw(),
     813                                                          StorageBus_IDE,
     814                                                          ctl.asOutParam()));
    773815            }
    774816            else if (!RTStrICmp(pszBusType, "sata"))
    775817            {
    776                 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_SATA, ctl.asOutParam()));
     818                CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl).raw(),
     819                                                          StorageBus_SATA,
     820                                                          ctl.asOutParam()));
    777821            }
    778822            else if (!RTStrICmp(pszBusType, "scsi"))
    779823            {
    780                 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_SCSI, ctl.asOutParam()));
     824                CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl).raw(),
     825                                                          StorageBus_SCSI,
     826                                                          ctl.asOutParam()));
    781827            }
    782828            else if (!RTStrICmp(pszBusType, "floppy"))
    783829            {
    784                 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_Floppy, ctl.asOutParam()));
     830                CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl).raw(),
     831                                                          StorageBus_Floppy,
     832                                                          ctl.asOutParam()));
    785833            }
    786834            else if (!RTStrICmp(pszBusType, "sas"))
    787835            {
    788                 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_SAS, ctl.asOutParam()));
     836                CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl).raw(),
     837                                                          StorageBus_SAS,
     838                                                          ctl.asOutParam()));
    789839            }
    790840            else
     
    800850            ComPtr<IStorageController> ctl;
    801851
    802             CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam()));
     852            CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl).raw(),
     853                                                            ctl.asOutParam()));
    803854
    804855            if (SUCCEEDED(rc))
     
    854905            ComPtr<IStorageController> ctl;
    855906
    856             CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam()));
     907            CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl).raw(),
     908                                                            ctl.asOutParam()));
    857909
    858910            if (SUCCEEDED(rc))
     
    873925            ComPtr<IStorageController> ctl;
    874926
    875             CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam()));
     927            CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl).raw(),
     928                                                            ctl.asOutParam()));
    876929
    877930            if (SUCCEEDED(rc))
     
    891944            ComPtr<IStorageController> ctl;
    892945
    893             CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam()));
     946            CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl).raw(),
     947                                                            ctl.asOutParam()));
    894948
    895949            if (SUCCEEDED(rc))
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageUSB.cpp

    r31070 r32718  
    55
    66/*
    7  * Copyright (C) 2006-2009 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    122122public:
    123123
    124     Nullable() : mIsNull (true) {}
    125     Nullable (const T &aValue, bool aIsNull = false)
    126         : mIsNull (aIsNull), mValue (aValue) {}
     124    Nullable() : mIsNull(true) {}
     125    Nullable(const T &aValue, bool aIsNull = false)
     126        : mIsNull(aIsNull), mValue(aValue) {}
    127127
    128128    bool isNull() const { return mIsNull; };
    129     void setNull (bool aIsNull = true) { mIsNull = aIsNull; }
     129    void setNull(bool aIsNull = true) { mIsNull = aIsNull; }
    130130
    131131    operator const T&() const { return mValue; }
     
    149149    struct USBFilter
    150150    {
    151         USBFilter ()
    152             : mAction (USBDeviceFilterAction_Null)
     151        USBFilter()
     152            : mAction(USBDeviceFilterAction_Null)
    153153            {}
    154154
     
    168168    enum Action { Invalid, Add, Modify, Remove };
    169169
    170     USBFilterCmd() : mAction (Invalid), mIndex (0), mGlobal (false) {}
     170    USBFilterCmd() : mAction(Invalid), mIndex(0), mGlobal(false) {}
    171171
    172172    Action mAction;
     
    179179};
    180180
    181 int handleUSBFilter (HandlerArg *a)
     181int handleUSBFilter(HandlerArg *a)
    182182{
    183183    HRESULT rc = S_OK;
     
    198198
    199199    /* which index? */
    200     if (VINF_SUCCESS !=  RTStrToUInt32Full (a->argv[1], 10, &cmd.mIndex))
     200    if (VINF_SUCCESS !=  RTStrToUInt32Full(a->argv[1], 10, &cmd.mIndex))
    201201        return errorSyntax(USAGE_USBFILTER, "Invalid index '%s'", a->argv[1]);
    202202
     
    234234                    {
    235235                        /* assume it's a UUID of a machine */
    236                         rc = a->virtualBox->GetMachine(Bstr(a->argv[i]), cmd.mMachine.asOutParam());
     236                        rc = a->virtualBox->GetMachine(Bstr(a->argv[i]).raw(),
     237                                                       cmd.mMachine.asOutParam());
    237238                        if (FAILED(rc) || !cmd.mMachine)
    238239                        {
    239240                            /* must be a name */
    240                             CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[i]), cmd.mMachine.asOutParam()), 1);
     241                            CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[i]).raw(),
     242                                                                       cmd.mMachine.asOutParam()), 1);
    241243                        }
    242244                    }
     
    360362                        && !cmd.mMachine)
    361363                    || (   cmd.mGlobal
    362                         && cmd.mFilter.mRemote)
     364                        && !cmd.mFilter.mRemote.isEmpty())
    363365                   )
    364366                {
     
    388390                    {
    389391                        /* assume it's a UUID of a machine */
    390                         rc = a->virtualBox->GetMachine(Bstr(a->argv[i]), cmd.mMachine.asOutParam());
     392                        rc = a->virtualBox->GetMachine(Bstr(a->argv[i]).raw(),
     393                                                       cmd.mMachine.asOutParam());
    391394                        if (FAILED(rc) || !cmd.mMachine)
    392395                        {
    393396                            /* must be a name */
    394                             CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[i]), cmd.mMachine.asOutParam()), 1);
     397                            CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[i]).raw(),
     398                                                                       cmd.mMachine.asOutParam()), 1);
    395399                        }
    396400                    }
     
    413417    ComPtr <IUSBController> ctl;
    414418    if (cmd.mGlobal)
    415         CHECK_ERROR_RET (a->virtualBox, COMGETTER(Host) (host.asOutParam()), 1);
     419        CHECK_ERROR_RET(a->virtualBox, COMGETTER(Host)(host.asOutParam()), 1);
    416420    else
    417421    {
     
    431435            {
    432436                ComPtr <IHostUSBDeviceFilter> flt;
    433                 CHECK_ERROR_BREAK (host, CreateUSBDeviceFilter (f.mName, flt.asOutParam()));
     437                CHECK_ERROR_BREAK(host, CreateUSBDeviceFilter(f.mName.raw(),
     438                                                              flt.asOutParam()));
    434439
    435440                if (!f.mActive.isNull())
    436                     CHECK_ERROR_BREAK (flt, COMSETTER(Active) (f.mActive));
     441                    CHECK_ERROR_BREAK(flt, COMSETTER(Active)(f.mActive));
    437442                if (!f.mVendorId.isEmpty())
    438                     CHECK_ERROR_BREAK (flt, COMSETTER(VendorId) (f.mVendorId));
     443                    CHECK_ERROR_BREAK(flt, COMSETTER(VendorId)(f.mVendorId.raw()));
    439444                if (!f.mProductId.isEmpty())
    440                     CHECK_ERROR_BREAK (flt, COMSETTER(ProductId) (f.mProductId));
     445                    CHECK_ERROR_BREAK(flt, COMSETTER(ProductId)(f.mProductId.raw()));
    441446                if (!f.mRevision.isEmpty())
    442                     CHECK_ERROR_BREAK (flt, COMSETTER(Revision) (f.mRevision));
     447                    CHECK_ERROR_BREAK(flt, COMSETTER(Revision)(f.mRevision.raw()));
    443448                if (!f.mManufacturer.isEmpty())
    444                     CHECK_ERROR_BREAK (flt, COMSETTER(Manufacturer) (f.mManufacturer));
     449                    CHECK_ERROR_BREAK(flt, COMSETTER(Manufacturer)(f.mManufacturer.raw()));
    445450                if (!f.mSerialNumber.isEmpty())
    446                     CHECK_ERROR_BREAK (flt, COMSETTER(SerialNumber) (f.mSerialNumber));
     451                    CHECK_ERROR_BREAK(flt, COMSETTER(SerialNumber)(f.mSerialNumber.raw()));
    447452                if (!f.mMaskedInterfaces.isNull())
    448                     CHECK_ERROR_BREAK (flt, COMSETTER(MaskedInterfaces) (f.mMaskedInterfaces));
     453                    CHECK_ERROR_BREAK(flt, COMSETTER(MaskedInterfaces)(f.mMaskedInterfaces));
    449454
    450455                if (f.mAction != USBDeviceFilterAction_Null)
    451                     CHECK_ERROR_BREAK (flt, COMSETTER(Action) (f.mAction));
    452 
    453                 CHECK_ERROR_BREAK (host, InsertUSBDeviceFilter (cmd.mIndex, flt));
     456                    CHECK_ERROR_BREAK(flt, COMSETTER(Action)(f.mAction));
     457
     458                CHECK_ERROR_BREAK(host, InsertUSBDeviceFilter(cmd.mIndex, flt));
    454459            }
    455460            else
    456461            {
    457462                ComPtr <IUSBDeviceFilter> flt;
    458                 CHECK_ERROR_BREAK (ctl, CreateDeviceFilter (f.mName, flt.asOutParam()));
     463                CHECK_ERROR_BREAK(ctl, CreateDeviceFilter(f.mName.raw(),
     464                                                          flt.asOutParam()));
    459465
    460466                if (!f.mActive.isNull())
    461                     CHECK_ERROR_BREAK (flt, COMSETTER(Active) (f.mActive));
     467                    CHECK_ERROR_BREAK(flt, COMSETTER(Active)(f.mActive));
    462468                if (!f.mVendorId.isEmpty())
    463                     CHECK_ERROR_BREAK (flt, COMSETTER(VendorId) (f.mVendorId));
     469                    CHECK_ERROR_BREAK(flt, COMSETTER(VendorId)(f.mVendorId.raw()));
    464470                if (!f.mProductId.isEmpty())
    465                     CHECK_ERROR_BREAK (flt, COMSETTER(ProductId) (f.mProductId));
     471                    CHECK_ERROR_BREAK(flt, COMSETTER(ProductId)(f.mProductId.raw()));
    466472                if (!f.mRevision.isEmpty())
    467                     CHECK_ERROR_BREAK (flt, COMSETTER(Revision) (f.mRevision));
     473                    CHECK_ERROR_BREAK(flt, COMSETTER(Revision)(f.mRevision.raw()));
    468474                if (!f.mManufacturer.isEmpty())
    469                     CHECK_ERROR_BREAK (flt, COMSETTER(Manufacturer) (f.mManufacturer));
     475                    CHECK_ERROR_BREAK(flt, COMSETTER(Manufacturer)(f.mManufacturer.raw()));
    470476                if (!f.mRemote.isEmpty())
    471                     CHECK_ERROR_BREAK (flt, COMSETTER(Remote) (f.mRemote));
     477                    CHECK_ERROR_BREAK(flt, COMSETTER(Remote)(f.mRemote.raw()));
    472478                if (!f.mSerialNumber.isEmpty())
    473                     CHECK_ERROR_BREAK (flt, COMSETTER(SerialNumber) (f.mSerialNumber));
     479                    CHECK_ERROR_BREAK(flt, COMSETTER(SerialNumber)(f.mSerialNumber.raw()));
    474480                if (!f.mMaskedInterfaces.isNull())
    475                     CHECK_ERROR_BREAK (flt, COMSETTER(MaskedInterfaces) (f.mMaskedInterfaces));
    476 
    477                 CHECK_ERROR_BREAK (ctl, InsertDeviceFilter (cmd.mIndex, flt));
     481                    CHECK_ERROR_BREAK(flt, COMSETTER(MaskedInterfaces)(f.mMaskedInterfaces));
     482
     483                CHECK_ERROR_BREAK(ctl, InsertDeviceFilter(cmd.mIndex, flt));
    478484            }
    479485            break;
     
    484490            {
    485491                SafeIfaceArray <IHostUSBDeviceFilter> coll;
    486                 CHECK_ERROR_BREAK (host, COMGETTER(USBDeviceFilters) (ComSafeArrayAsOutParam(coll)));
     492                CHECK_ERROR_BREAK(host, COMGETTER(USBDeviceFilters)(ComSafeArrayAsOutParam(coll)));
    487493
    488494                ComPtr <IHostUSBDeviceFilter> flt = coll[cmd.mIndex];
    489495
    490496                if (!f.mName.isEmpty())
    491                     CHECK_ERROR_BREAK (flt, COMSETTER(Name) (f.mName));
     497                    CHECK_ERROR_BREAK(flt, COMSETTER(Name)(f.mName.raw()));
    492498                if (!f.mActive.isNull())
    493                     CHECK_ERROR_BREAK (flt, COMSETTER(Active) (f.mActive));
     499                    CHECK_ERROR_BREAK(flt, COMSETTER(Active)(f.mActive));
    494500                if (!f.mVendorId.isEmpty())
    495                     CHECK_ERROR_BREAK (flt, COMSETTER(VendorId) (f.mVendorId));
     501                    CHECK_ERROR_BREAK(flt, COMSETTER(VendorId)(f.mVendorId.raw()));
    496502                if (!f.mProductId.isEmpty())
    497                     CHECK_ERROR_BREAK (flt, COMSETTER(ProductId) (f.mProductId));
     503                    CHECK_ERROR_BREAK(flt, COMSETTER(ProductId)(f.mProductId.raw()));
    498504                if (!f.mRevision.isEmpty())
    499                     CHECK_ERROR_BREAK (flt, COMSETTER(Revision) (f.mRevision));
     505                    CHECK_ERROR_BREAK(flt, COMSETTER(Revision)(f.mRevision.raw()));
    500506                if (!f.mManufacturer.isEmpty())
    501                     CHECK_ERROR_BREAK (flt, COMSETTER(Manufacturer) (f.mManufacturer));
     507                    CHECK_ERROR_BREAK(flt, COMSETTER(Manufacturer)(f.mManufacturer.raw()));
    502508                if (!f.mSerialNumber.isEmpty())
    503                     CHECK_ERROR_BREAK (flt, COMSETTER(SerialNumber) (f.mSerialNumber));
     509                    CHECK_ERROR_BREAK(flt, COMSETTER(SerialNumber)(f.mSerialNumber.raw()));
    504510                if (!f.mMaskedInterfaces.isNull())
    505                     CHECK_ERROR_BREAK (flt, COMSETTER(MaskedInterfaces) (f.mMaskedInterfaces));
     511                    CHECK_ERROR_BREAK(flt, COMSETTER(MaskedInterfaces)(f.mMaskedInterfaces));
    506512
    507513                if (f.mAction != USBDeviceFilterAction_Null)
    508                     CHECK_ERROR_BREAK (flt, COMSETTER(Action) (f.mAction));
     514                    CHECK_ERROR_BREAK(flt, COMSETTER(Action)(f.mAction));
    509515            }
    510516            else
    511517            {
    512518                SafeIfaceArray <IUSBDeviceFilter> coll;
    513                 CHECK_ERROR_BREAK (ctl, COMGETTER(DeviceFilters) (ComSafeArrayAsOutParam(coll)));
     519                CHECK_ERROR_BREAK(ctl, COMGETTER(DeviceFilters)(ComSafeArrayAsOutParam(coll)));
    514520
    515521                ComPtr <IUSBDeviceFilter> flt = coll[cmd.mIndex];
    516522
    517523                if (!f.mName.isEmpty())
    518                     CHECK_ERROR_BREAK (flt, COMSETTER(Name) (f.mName));
     524                    CHECK_ERROR_BREAK(flt, COMSETTER(Name)(f.mName.raw()));
    519525                if (!f.mActive.isNull())
    520                     CHECK_ERROR_BREAK (flt, COMSETTER(Active) (f.mActive));
     526                    CHECK_ERROR_BREAK(flt, COMSETTER(Active)(f.mActive));
    521527                if (!f.mVendorId.isEmpty())
    522                     CHECK_ERROR_BREAK (flt, COMSETTER(VendorId) (f.mVendorId));
     528                    CHECK_ERROR_BREAK(flt, COMSETTER(VendorId)(f.mVendorId.raw()));
    523529                if (!f.mProductId.isEmpty())
    524                     CHECK_ERROR_BREAK (flt, COMSETTER(ProductId) (f.mProductId));
     530                    CHECK_ERROR_BREAK(flt, COMSETTER(ProductId)(f.mProductId.raw()));
    525531                if (!f.mRevision.isEmpty())
    526                     CHECK_ERROR_BREAK (flt, COMSETTER(Revision) (f.mRevision));
     532                    CHECK_ERROR_BREAK(flt, COMSETTER(Revision)(f.mRevision.raw()));
    527533                if (!f.mManufacturer.isEmpty())
    528                     CHECK_ERROR_BREAK (flt, COMSETTER(Manufacturer) (f.mManufacturer));
     534                    CHECK_ERROR_BREAK(flt, COMSETTER(Manufacturer)(f.mManufacturer.raw()));
    529535                if (!f.mRemote.isEmpty())
    530                     CHECK_ERROR_BREAK (flt, COMSETTER(Remote) (f.mRemote));
     536                    CHECK_ERROR_BREAK(flt, COMSETTER(Remote)(f.mRemote.raw()));
    531537                if (!f.mSerialNumber.isEmpty())
    532                     CHECK_ERROR_BREAK (flt, COMSETTER(SerialNumber) (f.mSerialNumber));
     538                    CHECK_ERROR_BREAK(flt, COMSETTER(SerialNumber)(f.mSerialNumber.raw()));
    533539                if (!f.mMaskedInterfaces.isNull())
    534                     CHECK_ERROR_BREAK (flt, COMSETTER(MaskedInterfaces) (f.mMaskedInterfaces));
     540                    CHECK_ERROR_BREAK(flt, COMSETTER(MaskedInterfaces)(f.mMaskedInterfaces));
    535541            }
    536542            break;
     
    541547            {
    542548                ComPtr <IHostUSBDeviceFilter> flt;
    543                 CHECK_ERROR_BREAK (host, RemoveUSBDeviceFilter (cmd.mIndex));
     549                CHECK_ERROR_BREAK(host, RemoveUSBDeviceFilter(cmd.mIndex));
    544550            }
    545551            else
    546552            {
    547553                ComPtr <IUSBDeviceFilter> flt;
    548                 CHECK_ERROR_BREAK (ctl, RemoveDeviceFilter (cmd.mIndex, flt.asOutParam()));
     554                CHECK_ERROR_BREAK(ctl, RemoveDeviceFilter(cmd.mIndex, flt.asOutParam()));
    549555            }
    550556            break;
     
    556562    if (cmd.mMachine)
    557563    {
    558         if (SUCCEEDED (rc))
     564        if (SUCCEEDED(rc))
    559565        {
    560566            /* commit the session */
     
    565571    }
    566572
    567     return SUCCEEDED (rc) ? 0 : 1;
     573    return SUCCEEDED(rc) ? 0 : 1;
    568574}
    569575/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracChangeset for help on using the changeset viewer.

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