Changeset 26753 in vbox for trunk/src/VBox/Main
- Timestamp:
- Feb 24, 2010 4:24:33 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58004
- Location:
- trunk/src/VBox/Main
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r26603 r26753 1569 1569 mhda.lDevice, 1570 1570 DeviceType_Floppy, 1571 Bstr(""));1571 NULL); 1572 1572 if (FAILED(rc)) throw rc; 1573 1573 … … 1618 1618 mhda.lDevice, 1619 1619 DeviceType_DVD, 1620 Bstr(""));1620 NULL); 1621 1621 if (FAILED(rc)) throw rc; 1622 1622 … … 1744 1744 rc = mVirtualBox->OpenHardDisk(Bstr(strSrcFilePath), 1745 1745 AccessMode_ReadOnly, 1746 false, Bstr(""), false, Bstr(""), 1746 false, 1747 NULL, 1748 false, 1749 NULL, 1747 1750 srcHdVBox.asOutParam()); 1748 1751 if (FAILED(rc)) throw rc; … … 4281 4284 IN_BSTR aExtraConfigValue) 4282 4285 { 4283 CheckComArgNotNull(aVboxValue);4284 CheckComArgNotNull(aExtraConfigValue);4285 4286 4286 AutoCaller autoCaller(this); 4287 4287 if (FAILED(autoCaller.rc())) return autoCaller.rc(); -
trunk/src/VBox/Main/ConsoleImpl.cpp
r26615 r26753 574 574 { 575 575 if (!enabledGuestPropertiesVRDP()) 576 {577 576 return; 578 } 577 578 Bstr bstrReadOnlyGuest(L"RDONLYGUEST"); 579 579 580 580 int rc; … … 584 584 if (RT_SUCCESS(rc)) 585 585 { 586 mMachine->SetGuestProperty(Bstr(pszPropertyName), Bstr(""), Bstr("RDONLYGUEST"));586 mMachine->SetGuestProperty(Bstr(pszPropertyName), NULL, bstrReadOnlyGuest); 587 587 RTStrFree(pszPropertyName); 588 588 } … … 591 591 if (RT_SUCCESS(rc)) 592 592 { 593 mMachine->SetGuestProperty(Bstr(pszPropertyName), Bstr(""), Bstr("RDONLYGUEST"));593 mMachine->SetGuestProperty(Bstr(pszPropertyName), NULL, bstrReadOnlyGuest); 594 594 RTStrFree(pszPropertyName); 595 595 } … … 598 598 if (RT_SUCCESS(rc)) 599 599 { 600 mMachine->SetGuestProperty(Bstr(pszPropertyName), Bstr(""), Bstr("RDONLYGUEST"));600 mMachine->SetGuestProperty(Bstr(pszPropertyName), NULL, bstrReadOnlyGuest); 601 601 RTStrFree(pszPropertyName); 602 602 } … … 606 606 if (RT_SUCCESS(rc)) 607 607 { 608 mMachine->SetGuestProperty(Bstr("/VirtualBox/HostInfo/VRDP/LastDisconnectedClient"), Bstr(pszClientId), Bstr("RDONLYGUEST"));608 mMachine->SetGuestProperty(Bstr("/VirtualBox/HostInfo/VRDP/LastDisconnectedClient"), Bstr(pszClientId), bstrReadOnlyGuest); 609 609 RTStrFree(pszClientId); 610 610 } … … 1190 1190 1191 1191 // static 1192 DECLCALLBACK(int) 1193 Console::doGuestPropNotification(void *pvExtension, uint32_t u32Function, 1194 void *pvParms, uint32_t cbParms) 1192 DECLCALLBACK(int) Console::doGuestPropNotification(void *pvExtension, 1193 uint32_t u32Function, 1194 void *pvParms, 1195 uint32_t cbParms) 1195 1196 { 1196 1197 using namespace guestProp; … … 1212 1213 Bstr value(pCBData->pcszValue); 1213 1214 Bstr flags(pCBData->pcszFlags); 1214 if ( !name.isNull() 1215 && (!value.isNull() || pCBData->pcszValue == NULL) 1216 && (!flags.isNull() || pCBData->pcszFlags == NULL) 1217 ) 1218 { 1219 ComObjPtr<Console> ptrConsole = reinterpret_cast<Console *>(pvExtension); 1220 HRESULT hrc = ptrConsole->mControl->PushGuestProperty(name, 1221 value, 1222 pCBData->u64Timestamp, 1223 flags); 1224 if (SUCCEEDED(hrc)) 1225 rc = VINF_SUCCESS; 1226 else 1227 { 1228 LogFunc(("Console::doGuestPropNotification: hrc=%Rhrc pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n", 1229 pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1230 rc = Global::vboxStatusCodeFromCOM(hrc); 1231 } 1232 } 1215 ComObjPtr<Console> ptrConsole = reinterpret_cast<Console *>(pvExtension); 1216 HRESULT hrc = ptrConsole->mControl->PushGuestProperty(name, 1217 value, 1218 pCBData->u64Timestamp, 1219 flags); 1220 if (SUCCEEDED(hrc)) 1221 rc = VINF_SUCCESS; 1233 1222 else 1234 rc = VERR_NO_MEMORY; 1223 { 1224 LogFunc(("Console::doGuestPropNotification: hrc=%Rhrc pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n", 1225 pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1226 rc = Global::vboxStatusCodeFromCOM(hrc); 1227 } 1235 1228 return rc; 1236 1229 } … … 1248 1241 Utf8Str utf8Patterns(aPatterns); 1249 1242 parm[0].type = VBOX_HGCM_SVC_PARM_PTR; 1243 // mutableRaw() returns NULL for an empty string 1244 // if ((parm[0].u.pointer.addr = utf8Patterns.mutableRaw())) 1245 // parm[0].u.pointer.size = (uint32_t)utf8Patterns.length() + 1; 1246 // else 1247 // { 1248 // parm[0].u.pointer.addr = (void*)""; 1249 // parm[0].u.pointer.size = 1; 1250 // } 1250 1251 parm[0].u.pointer.addr = utf8Patterns.mutableRaw(); 1251 1252 parm[0].u.pointer.size = (uint32_t)utf8Patterns.length() + 1; … … 1364 1365 try 1365 1366 { 1366 Bstr pattern(""); 1367 hrc = doEnumerateGuestProperties(pattern, ComSafeArrayAsOutParam(namesOut), 1367 Bstr pattern; 1368 hrc = doEnumerateGuestProperties(pattern, 1369 ComSafeArrayAsOutParam(namesOut), 1368 1370 ComSafeArrayAsOutParam(valuesOut), 1369 1371 ComSafeArrayAsOutParam(timestampsOut), … … 1371 1373 if (SUCCEEDED(hrc)) 1372 1374 { 1373 std::vector 1374 std::vector 1375 std::vector 1376 std::vector 1375 std::vector<BSTR> names; 1376 std::vector<BSTR> values; 1377 std::vector<ULONG64> timestamps; 1378 std::vector<BSTR> flags; 1377 1379 for (size_t i = 0; i < namesOut.size(); ++i) 1378 1380 { … … 1392 1394 com::SafeArray<ULONG64> timestampsIn(timestamps); 1393 1395 com::SafeArray<BSTR> flagsIn(flags); 1394 if ( namesIn.isNull()1395 || valuesIn.isNull()1396 || timestampsIn.isNull()1397 || flagsIn.isNull()1398 )1399 throw std::bad_alloc();1400 1396 /* PushGuestProperties() calls DiscardSettings(), which calls us back */ 1401 1397 mControl->PushGuestProperties(ComSafeArrayAsInParam(namesIn), … … 2594 2590 { 2595 2591 #ifdef VBOX_WITH_USB 2596 CheckComArg NotNull(aAddress);2592 CheckComArgStrNotEmptyOrNull(aAddress); 2597 2593 CheckComArgOutPointerValid(aDevice); 2598 2594 … … 2664 2660 Console::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable) 2665 2661 { 2666 CheckComArg NotNull(aName);2667 CheckComArg NotNull(aHostPath);2662 CheckComArgStrNotEmptyOrNull(aName); 2663 CheckComArgStrNotEmptyOrNull(aHostPath); 2668 2664 2669 2665 AutoCaller autoCaller(this); … … 2732 2728 STDMETHODIMP Console::RemoveSharedFolder(IN_BSTR aName) 2733 2729 { 2734 CheckComArg NotNull(aName);2730 CheckComArgStrNotEmptyOrNull(aName); 2735 2731 2736 2732 AutoCaller autoCaller(this); … … 2798 2794 LogFlowThisFunc(("aName='%ls' mMachineState=%08X\n", aName, mMachineState)); 2799 2795 2800 CheckComArg NotNull(aName);2796 CheckComArgStrNotEmptyOrNull(aName); 2801 2797 CheckComArgOutPointerValid(aProgress); 2802 2798 … … 7725 7721 * (i.e. creating a snapshot online) 7726 7722 */ 7727 ComAssertThrow( (!pTask->bstrSavedStateFile.is Null() &&pTask->fTakingSnapshotOnline)7728 || ( pTask->bstrSavedStateFile.isNull() && !pTask->fTakingSnapshotOnline),7723 ComAssertThrow( (!pTask->bstrSavedStateFile.isEmpty() && pTask->fTakingSnapshotOnline) 7724 || ( pTask->bstrSavedStateFile.isEmpty() && !pTask->fTakingSnapshotOnline), 7729 7725 rc = E_FAIL); 7730 7726 … … 8040 8036 task->mProgress->notifyComplete(rc, 8041 8037 COM_IIDOF(IConsole), 8042 Console::getComponentName(),8038 (CBSTR)Console::getComponentName(), 8043 8039 errMsg.c_str()); 8044 8040 else -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r26681 r26753 3180 3180 } 3181 3181 3182 if (!networkName.is Null())3182 if (!networkName.isEmpty()) 3183 3183 { 3184 3184 /* … … 3187 3187 */ 3188 3188 ComPtr<IDHCPServer> dhcpServer; 3189 hrc = virtualBox->FindDHCPServerByNetworkName(networkName .mutableRaw(), dhcpServer.asOutParam());3189 hrc = virtualBox->FindDHCPServerByNetworkName(networkName, dhcpServer.asOutParam()); 3190 3190 if (SUCCEEDED(hrc)) 3191 3191 { -
trunk/src/VBox/Main/ConsoleImplTeleporter.cpp
r26603 r26753 903 903 CheckComArgOutPointerValid(aProgress); 904 904 CheckComArgStrNotEmptyOrNull(aHostname); 905 CheckComArg NotNull(aHostname);905 CheckComArgStrNotEmptyOrNull(aHostname); 906 906 CheckComArgExprMsg(aPort, aPort > 0 && aPort <= 65535, ("is %u", aPort)); 907 907 CheckComArgExprMsg(aMaxDowntime, aMaxDowntime > 0, ("is %u", aMaxDowntime)); -
trunk/src/VBox/Main/GuestImpl.cpp
r26603 r26753 127 127 128 128 // redirect the call to IMachine if no additions are installed 129 if (mData.mAdditionsVersion.is Null())130 return mParent->machine()->COMGETTER(OSTypeId) 129 if (mData.mAdditionsVersion.isEmpty()) 130 return mParent->machine()->COMGETTER(OSTypeId)(aOSTypeId); 131 131 132 132 mData.mOSTypeId.cloneTo(aOSTypeId); … … 262 262 IN_BSTR aDomain, BOOL aAllowInteractiveLogon) 263 263 { 264 CheckComArgNotNull(aUserName);265 CheckComArgNotNull(aPassword);266 CheckComArgNotNull(aDomain);267 268 264 AutoCaller autoCaller(this); 269 265 if (FAILED(autoCaller.rc())) return autoCaller.rc(); … … 315 311 ///////////////////////////////////////////////////////////////////////////// 316 312 317 void Guest::setAdditionsVersion (Bstr aVersion, VBOXOSTYPE aOsType) 318 { 319 Assert(aVersion.isNull() || !aVersion.isEmpty()); 320 313 void Guest::setAdditionsVersion(Bstr aVersion, VBOXOSTYPE aOsType) 314 { 321 315 AutoCaller autoCaller(this); 322 316 AssertComRCReturnVoid (autoCaller.rc()); … … 325 319 326 320 mData.mAdditionsVersion = aVersion; 327 mData.mAdditionsActive = !aVersion.is Null();321 mData.mAdditionsActive = !aVersion.isEmpty(); 328 322 329 323 mData.mOSTypeId = Global::OSTypeId (aOsType); -
trunk/src/VBox/Main/HostImpl.cpp
r26603 r26753 451 451 if(hr == S_OK) 452 452 { 453 size_t cUnicodeName = wcslen(lpszName) + 1; 454 size_t uniLen = (cUnicodeName * 2 + sizeof (OLECHAR) - 1) / sizeof (OLECHAR); 455 Bstr name (uniLen + 1 /* extra zero */); 456 wcscpy((wchar_t *) name.mutableRaw(), lpszName); 453 Bstr name((CBSTR)lpszName); 457 454 458 455 hr = pncc->GetInstanceGuid(&IfGuid); … … 1290 1287 STDMETHODIMP Host::FindHostDVDDrive(IN_BSTR aName, IMedium **aDrive) 1291 1288 { 1292 CheckComArg NotNull(aName);1289 CheckComArgStrNotEmptyOrNull(aName); 1293 1290 CheckComArgOutPointerValid(aDrive); 1294 1291 … … 1317 1314 STDMETHODIMP Host::FindHostFloppyDrive(IN_BSTR aName, IMedium **aDrive) 1318 1315 { 1319 CheckComArg NotNull(aName);1316 CheckComArgStrNotEmptyOrNull(aName); 1320 1317 CheckComArgOutPointerValid(aDrive); 1321 1318 … … 1451 1448 { 1452 1449 #ifdef VBOX_WITH_USB 1453 CheckComArg NotNull(aAddress);1450 CheckComArgStrNotEmptyOrNull(aAddress); 1454 1451 CheckComArgOutPointerValid(aDevice); 1455 1452 -
trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
r26603 r26753 423 423 { 424 424 m.realIPAddress = 0; 425 if (FAILED(mVBox->SetExtraData(Bstr (Utf8StrFmt("HostOnly/%ls/IPAddress", mInterfaceName.raw())), Bstr(""))))425 if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPAddress", mInterfaceName.raw()), NULL))) 426 426 return E_FAIL; 427 if (FAILED(mVBox->SetExtraData(Bstr (Utf8StrFmt("HostOnly/%ls/IPNetMask", mInterfaceName.raw())), Bstr(""))))427 if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPNetMask", mInterfaceName.raw()), NULL))) 428 428 return E_FAIL; 429 429 return S_OK; -
trunk/src/VBox/Main/MachineImpl.cpp
r26738 r26753 697 697 STDMETHODIMP Machine::COMSETTER(Name)(IN_BSTR aName) 698 698 { 699 CheckComArgNotNull(aName); 700 701 if (!*aName) 702 return setError(E_INVALIDARG, 703 tr("Machine name cannot be empty")); 699 CheckComArgStrNotEmptyOrNull(aName); 704 700 705 701 AutoCaller autoCaller(this); … … 779 775 STDMETHODIMP Machine::COMSETTER(OSTypeId)(IN_BSTR aOSTypeId) 780 776 { 781 CheckComArg NotNull(aOSTypeId);777 CheckComArgStrNotEmptyOrNull(aOSTypeId); 782 778 783 779 AutoCaller autoCaller(this); … … 1930 1926 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1931 1927 1932 if (mData->mSession.mType.isNull()) 1933 Bstr("").cloneTo(aSessionType); 1934 else 1935 mData->mSession.mType.cloneTo(aSessionType); 1928 mData->mSession.mType.cloneTo(aSessionType); 1936 1929 1937 1930 return S_OK; … … 1990 1983 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1991 1984 1992 if (mSSData->mStateFilePath.isEmpty()) 1993 Bstr("").cloneTo(aStateFilePath); 1994 else 1995 mSSData->mStateFilePath.cloneTo(aStateFilePath); 1985 mSSData->mStateFilePath.cloneTo(aStateFilePath); 1996 1986 1997 1987 return S_OK; … … 2137 2127 Machine::COMSETTER(GuestPropertyNotificationPatterns)(IN_BSTR aPatterns) 2138 2128 { 2139 CheckComArgNotNull(aPatterns);2140 2129 AutoCaller autoCaller(this); 2141 2130 if (FAILED(autoCaller.rc())) return autoCaller.rc(); … … 2403 2392 aControllerName, aControllerPort, aDevice, aType, aId)); 2404 2393 2405 CheckComArgNotNull(aControllerName); 2406 CheckComArgNotNull(aId); 2394 CheckComArgStrNotEmptyOrNull(aControllerName); 2407 2395 2408 2396 AutoCaller autoCaller(this); … … 2829 2817 LONG aDevice) 2830 2818 { 2831 CheckComArg NotNull(aControllerName);2819 CheckComArgStrNotEmptyOrNull(aControllerName); 2832 2820 2833 2821 LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%ld aDevice=%ld\n", … … 2914 2902 LONG aDevice, BOOL aPassthrough) 2915 2903 { 2916 CheckComArg NotNull(aControllerName);2904 CheckComArgStrNotEmptyOrNull(aControllerName); 2917 2905 2918 2906 LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%ld aDevice=%ld aPassthrough=%d\n", … … 2968 2956 aControllerName, aControllerPort, aDevice, aForce)); 2969 2957 2970 CheckComArg NotNull(aControllerName);2971 CheckComArg NotNull(aId);2958 CheckComArgStrNotEmptyOrNull(aControllerName); 2959 CheckComArgStrNotEmptyOrNull(aId); 2972 2960 2973 2961 AutoCaller autoCaller(this); … … 3109 3097 aControllerName, aControllerPort, aDevice)); 3110 3098 3111 CheckComArg NotNull(aControllerName);3099 CheckComArgStrNotEmptyOrNull(aControllerName); 3112 3100 CheckComArgOutPointerValid(aMedium); 3113 3101 … … 3208 3196 BSTR *aValue) 3209 3197 { 3210 CheckComArg NotNull(aKey);3198 CheckComArgStrNotEmptyOrNull(aKey); 3211 3199 CheckComArgOutPointerValid(aValue); 3212 3200 … … 3235 3223 STDMETHODIMP Machine::SetExtraData(IN_BSTR aKey, IN_BSTR aValue) 3236 3224 { 3237 CheckComArg NotNull(aKey);3225 CheckComArgStrNotEmptyOrNull(aKey); 3238 3226 3239 3227 AutoCaller autoCaller(this); … … 3266 3254 // lock to copy the list of callbacks to invoke 3267 3255 Bstr error; 3268 Bstr bstrValue; 3269 if (aValue) 3270 bstrValue = aValue; 3271 else 3272 bstrValue = (const char *)""; 3256 Bstr bstrValue(aValue); 3273 3257 3274 3258 if (!mParent->onExtraDataCanChange(mData->mUuid, aKey, bstrValue, error)) 3275 3259 { 3276 3260 const char *sep = error.isEmpty() ? "" : ": "; 3277 CBSTR err = error. isNull() ? (CBSTR) L"" : error.raw();3261 CBSTR err = error.raw(); 3278 3262 LogWarningFunc(("Someone vetoed! Change refused%s%ls\n", 3279 3263 sep, err)); … … 3459 3443 STDMETHODIMP Machine::FindSnapshot(IN_BSTR aName, ISnapshot **aSnapshot) 3460 3444 { 3461 CheckComArg NotNull(aName);3445 CheckComArgStrNotEmptyOrNull(aName); 3462 3446 CheckComArgOutPointerValid(aSnapshot); 3463 3447 … … 3485 3469 STDMETHODIMP Machine::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable) 3486 3470 { 3487 CheckComArg NotNull(aName);3488 CheckComArg NotNull(aHostPath);3471 CheckComArgStrNotEmptyOrNull(aName); 3472 CheckComArgStrNotEmptyOrNull(aHostPath); 3489 3473 3490 3474 AutoCaller autoCaller(this); … … 3520 3504 STDMETHODIMP Machine::RemoveSharedFolder(IN_BSTR aName) 3521 3505 { 3522 CheckComArg NotNull(aName);3506 CheckComArgStrNotEmptyOrNull(aName); 3523 3507 3524 3508 AutoCaller autoCaller(this); … … 3610 3594 ReturnComNotImplemented(); 3611 3595 #else // VBOX_WITH_GUEST_PROPS 3612 CheckComArg NotNull(aName);3596 CheckComArgStrNotEmptyOrNull(aName); 3613 3597 CheckComArgOutPointerValid(aValue); 3614 3598 CheckComArgOutPointerValid(aTimestamp); … … 3689 3673 using namespace guestProp; 3690 3674 3691 CheckComArgNotNull(aName); 3692 CheckComArgNotNull(aValue); 3675 CheckComArgStrNotEmptyOrNull(aName); 3693 3676 if ((aFlags != NULL) && !VALID_PTR(aFlags)) 3694 3677 return E_INVALIDARG; … … 3934 3917 aControllerName, aControllerPort, aDevice)); 3935 3918 3936 CheckComArg NotNull(aControllerName);3919 CheckComArgStrNotEmptyOrNull(aControllerName); 3937 3920 CheckComArgOutPointerValid(aAttachment); 3938 3921 … … 8950 8933 #endif /* VBOX_WITH_USB */ 8951 8934 8952 if (!mData->mSession.mType.is Null())8935 if (!mData->mSession.mType.isEmpty()) 8953 8936 { 8954 8937 /* mType is not null when this machine's process has been started by … … 9658 9641 using namespace guestProp; 9659 9642 9660 CheckComArg NotNull(aName);9643 CheckComArgStrNotEmptyOrNull(aName); 9661 9644 if (aValue != NULL && (!VALID_PTR(aValue) || !VALID_PTR(aFlags))) 9662 9645 return E_POINTER; /* aValue can be NULL to indicate deletion */ -
trunk/src/VBox/Main/Matching.cpp
r26603 r26753 196 196 197 197 // empty or null mSimple matches any match 198 return 199 mSimple.isEmpty() || 200 (mIgnoreCase && mSimple.compareIgnoreCase (aValue) == 0) || 201 (!mIgnoreCase && mSimple.compare (aValue) == 0); 198 return mSimple.isEmpty() 199 || (mIgnoreCase && mSimple.compare(aValue, Bstr::CaseInsensitive) == 0) 200 || (!mIgnoreCase && mSimple.compare(aValue) == 0); 202 201 } 203 202 -
trunk/src/VBox/Main/MediumImpl.cpp
r26603 r26753 1361 1361 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1362 1362 1363 if (m->strDescription.isEmpty()) 1364 Bstr("").cloneTo(aDescription); 1365 else 1366 m->strDescription.cloneTo(aDescription); 1363 m->strDescription.cloneTo(aDescription); 1367 1364 1368 1365 return S_OK; … … 1371 1368 STDMETHODIMP Medium::COMSETTER(Description)(IN_BSTR aDescription) 1372 1369 { 1373 CheckComArgNotNull(aDescription);1374 1375 1370 AutoCaller autoCaller(this); 1376 1371 if (FAILED(autoCaller.rc())) return autoCaller.rc(); … … 1415 1410 STDMETHODIMP Medium::COMSETTER(Location)(IN_BSTR aLocation) 1416 1411 { 1417 CheckComArg NotNull(aLocation);1412 CheckComArgStrNotEmptyOrNull(aLocation); 1418 1413 1419 1414 AutoCaller autoCaller(this); … … 1725 1720 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1726 1721 1727 if (m->strLastAccessError.isEmpty()) 1728 Bstr("").cloneTo(aLastAccessError); 1729 else 1730 m->strLastAccessError.cloneTo(aLastAccessError); 1722 m->strLastAccessError.cloneTo(aLastAccessError); 1731 1723 1732 1724 return S_OK; … … 2102 2094 tr("Property '%ls' does not exist"), aName); 2103 2095 2104 if (it->second.isEmpty()) 2105 Bstr("").cloneTo(aValue); 2106 else 2107 it->second.cloneTo(aValue); 2096 it->second.cloneTo(aValue); 2108 2097 2109 2098 return S_OK; … … 2169 2158 { 2170 2159 it->first.cloneTo(&names[i]); 2171 if (it->second.isEmpty()) 2172 Bstr("").cloneTo(&values[i]); 2173 else 2174 it->second.cloneTo(&values[i]); 2175 ++ i; 2160 it->second.cloneTo(&values[i]); 2161 ++i; 2176 2162 } 2177 2163 … … 2362 2348 2363 2349 STDMETHODIMP Medium::CloneTo(IMedium *aTarget, 2364 2365 2366 2350 MediumVariant_T aVariant, 2351 IMedium *aParent, 2352 IProgress **aProgress) 2367 2353 { 2368 2354 CheckComArgNotNull(aTarget); … … 3090 3076 { 3091 3077 /* only save properties that have non-default values */ 3092 if (!it->second.is Null())3078 if (!it->second.isEmpty()) 3093 3079 { 3094 3080 Utf8Str name = it->first; … … 4858 4844 4859 4845 /* we interpret null values as "no value" in Medium */ 4860 if (it->second.is Null())4846 if (it->second.isEmpty()) 4861 4847 return VERR_CFGM_VALUE_NOT_FOUND; 4862 4848 … … 4885 4871 4886 4872 /* we interpret null values as "no value" in Medium */ 4887 if (it->second.is Null())4873 if (it->second.isEmpty()) 4888 4874 return VERR_CFGM_VALUE_NOT_FOUND; 4889 4875 -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r26603 r26753 1026 1026 case NetworkAttachmentType_NAT: 1027 1027 mData->mNATNetwork = data.strName; 1028 if (mData->mNATNetwork.isNull())1029 mData->mNATNetwork = "";1030 1028 rc = AttachToNAT(); 1031 1029 if (FAILED(rc)) return rc; … … 1041 1039 case NetworkAttachmentType_Internal: 1042 1040 mData->mInternalNetwork = data.strName; 1043 Assert(!mData->mInternalNetwork.is Null());1041 Assert(!mData->mInternalNetwork.isEmpty()); 1044 1042 1045 1043 rc = AttachToInternalNetwork(); -
trunk/src/VBox/Main/RemoteUSBDeviceImpl.cpp
r26603 r26753 142 142 143 143 /* this is const, no need to lock */ 144 Bstr(mData.id).cloneTo(aId);144 mData.id.toUtf16().detachTo(aId); 145 145 146 146 return S_OK; -
trunk/src/VBox/Main/SessionImpl.cpp
r26603 r26753 694 694 Global::stringifySessionState(mState)); 695 695 AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 696 CheckComArg NotNull(aName);696 CheckComArgStrNotEmptyOrNull(aName); 697 697 if (!aIsSetter && !VALID_PTR(aRetValue)) 698 698 return E_POINTER; -
trunk/src/VBox/Main/SharedFolderImpl.cpp
r26603 r26753 333 333 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 334 334 335 if (m.lastAccessError.isEmpty()) 336 Bstr("").cloneTo(aLastAccessError); 337 else 338 m.lastAccessError.cloneTo(aLastAccessError); 335 m.lastAccessError.cloneTo(aLastAccessError); 339 336 340 337 return S_OK; -
trunk/src/VBox/Main/SnapshotImpl.cpp
r26603 r26753 342 342 STDMETHODIMP Snapshot::COMSETTER(Name)(IN_BSTR aName) 343 343 { 344 CheckComArg NotNull(aName);344 CheckComArgStrNotEmptyOrNull(aName); 345 345 346 346 AutoCaller autoCaller(this); … … 378 378 STDMETHODIMP Snapshot::COMSETTER(Description)(IN_BSTR aDescription) 379 379 { 380 CheckComArgNotNull(aDescription);381 382 380 AutoCaller autoCaller(this); 383 381 if (FAILED(autoCaller.rc())) return autoCaller.rc(); -
trunk/src/VBox/Main/SystemPropertiesImpl.cpp
r26603 r26753 828 828 /* MediumFormat is all const, no need to lock */ 829 829 830 if ((*it)->id().compare IgnoreCase (aFormat) == 0)830 if ((*it)->id().compare(aFormat, Bstr::CaseInsensitive) == 0) 831 831 { 832 832 format = *it; -
trunk/src/VBox/Main/USBControllerImpl.cpp
r26603 r26753 1110 1110 rc = aUSBDevice->COMGETTER(Manufacturer) (manufacturer.asOutParam()); 1111 1111 ComAssertComRCRet(rc, false); 1112 if (!manufacturer.is Null())1112 if (!manufacturer.isEmpty()) 1113 1113 USBFilterSetStringExact (&dev, USBFILTERIDX_MANUFACTURER_STR, Utf8Str(manufacturer).c_str(), true); 1114 1114 … … 1116 1116 rc = aUSBDevice->COMGETTER(Product) (product.asOutParam()); 1117 1117 ComAssertComRCRet(rc, false); 1118 if (!product.is Null())1118 if (!product.isEmpty()) 1119 1119 USBFilterSetStringExact (&dev, USBFILTERIDX_PRODUCT_STR, Utf8Str(product).c_str(), true); 1120 1120 … … 1122 1122 rc = aUSBDevice->COMGETTER(SerialNumber) (serialNumber.asOutParam()); 1123 1123 ComAssertComRCRet(rc, false); 1124 if (!serialNumber.is Null())1124 if (!serialNumber.isEmpty()) 1125 1125 USBFilterSetStringExact (&dev, USBFILTERIDX_SERIAL_NUMBER_STR, Utf8Str(serialNumber).c_str(), true); 1126 1126 -
trunk/src/VBox/Main/USBDeviceImpl.cpp
r26603 r26753 155 155 156 156 /* this is const, no need to lock */ 157 Guid(mData.id).to String().cloneTo(aId);157 Guid(mData.id).toUtf16().detachTo(aId); 158 158 159 159 return S_OK; -
trunk/src/VBox/Main/VFSExplorerImpl.cpp
r25860 r26753 561 561 STDMETHODIMP VFSExplorer::Cd(IN_BSTR aDir, IProgress **aProgress) 562 562 { 563 CheckComArg NotNull(aDir);563 CheckComArgStrNotEmptyOrNull(aDir); 564 564 CheckComArgOutPointerValid(aProgress); 565 565 -
trunk/src/VBox/Main/VirtualBoxBase.cpp
r26603 r26753 810 810 */ 811 811 /* static */ 812 HRESULT VirtualBoxSupportErrorInfoImplBase::setErrorInternal ( 813 HRESULT aResultCode, const GUID &aIID, 814 const Bstr &aComponent, const Bstr &aText, 815 bool aWarning, bool aLogIt) 812 HRESULT VirtualBoxSupportErrorInfoImplBase::setErrorInternal(HRESULT aResultCode, 813 const GUID &aIID, 814 const wchar_t *aComponent, 815 const Bstr &aText, 816 bool aWarning, 817 bool aLogIt) 816 818 { 817 819 /* whether multi-error mode is turned on */ 818 bool preserve = ((uintptr_t) RTTlsGet (MultiResult::sCounter)) > 0; 820 bool preserve = ((uintptr_t)RTTlsGet(MultiResult::sCounter)) > 0; 821 822 Bstr bstrComponent((CBSTR)aComponent); 819 823 820 824 if (aLogIt) 821 LogRel 822 823 aResultCode, aResultCode, &aIID, aComponent.raw(), aText.raw(), aWarning,824 825 LogRel(("ERROR [COM]: aRC=%Rhrc (%#08x) aIID={%RTuuid} aComponent={%ls} aText={%ls} " 826 "aWarning=%RTbool, preserve=%RTbool\n", 827 aResultCode, aResultCode, &aIID, bstrComponent.raw(), aText.raw(), aWarning, 828 preserve)); 825 829 826 830 /* these are mandatory, others -- not */ … … 870 874 871 875 /* set the current error info and preserve the previous one if any */ 872 rc = info->init (aResultCode, aIID, aComponent, aText, curInfo);876 rc = info->init(aResultCode, aIID, bstrComponent, aText, curInfo); 873 877 if (FAILED(rc)) break; 874 878 … … 914 918 915 919 /* set the current error info and preserve the previous one if any */ 916 rc = info->init (aResultCode, aIID, aComponent, aText, curInfo);920 rc = info->init(aResultCode, aIID, bstrComponent, aText, curInfo); 917 921 if (FAILED(rc)) break; 918 922 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r26603 r26753 302 302 LogFlowThisFuncEnter(); 303 303 304 if (sVersion.is Null())304 if (sVersion.isEmpty()) 305 305 sVersion = VBOX_VERSION_STRING; 306 306 sRevision = RTBldCfgRevision(); 307 if (sPackageType.is Null())307 if (sPackageType.isEmpty()) 308 308 sPackageType = VBOX_PACKAGE_STRING; 309 309 LogFlowThisFunc(("Version: %ls, Package: %ls\n", sVersion.raw(), sPackageType.raw())); … … 1225 1225 LogFlowThisFunc(("aName=\"%ls\", aMachine={%p}\n", aName, aMachine)); 1226 1226 1227 CheckComArg NotNull(aName);1227 CheckComArgStrNotEmptyOrNull(aName); 1228 1228 CheckComArgOutSafeArrayPointerValid(aMachine); 1229 1229 … … 1342 1342 STDMETHODIMP VirtualBox::OpenHardDisk(IN_BSTR aLocation, 1343 1343 AccessMode_T accessMode, 1344 BOOL aSetImageId, IN_BSTR aImageId, 1345 BOOL aSetParentId, IN_BSTR aParentId, 1344 BOOL aSetImageId, 1345 IN_BSTR aImageId, 1346 BOOL aSetParentId, 1347 IN_BSTR aParentId, 1346 1348 IMedium **aHardDisk) 1347 1349 { 1348 CheckComArgNotNull(aLocation); 1349 CheckComArgNotNull(aImageId); 1350 CheckComArgNotNull(aParentId); 1350 CheckComArgStrNotEmptyOrNull(aLocation); 1351 1351 CheckComArgOutSafeArrayPointerValid(aHardDisk); 1352 1352 … … 1423 1423 IMedium **aHardDisk) 1424 1424 { 1425 CheckComArg NotNull(aLocation);1425 CheckComArgStrNotEmptyOrNull(aLocation); 1426 1426 CheckComArgOutSafeArrayPointerValid(aHardDisk); 1427 1427 … … 1499 1499 STDMETHODIMP VirtualBox::FindDVDImage (IN_BSTR aLocation, IMedium **aDVDImage) 1500 1500 { 1501 CheckComArg NotNull(aLocation);1501 CheckComArgStrNotEmptyOrNull(aLocation); 1502 1502 CheckComArgOutSafeArrayPointerValid(aDVDImage); 1503 1503 … … 1578 1578 IMedium **aFloppyImage) 1579 1579 { 1580 CheckComArg NotNull(aLocation);1580 CheckComArgStrNotEmptyOrNull(aLocation); 1581 1581 CheckComArgOutSafeArrayPointerValid(aFloppyImage); 1582 1582 … … 1615 1615 }; 1616 1616 1617 CheckComArgNotNull 1617 CheckComArgNotNull(aType); 1618 1618 1619 1619 AutoCaller autoCaller(this); … … 1639 1639 { 1640 1640 const Bstr &typeId = (*it)->id(); 1641 AssertMsg (!!typeId, ("ID must not be NULL"));1642 if (typeId.compare IgnoreCase (id) == 0)1641 AssertMsg(!typeId.isEmpty(), ("ID must not be NULL")); 1642 if (typeId.compare(id, Bstr::CaseInsensitive) == 0) 1643 1643 { 1644 1644 (*it).queryInterfaceTo(aType); … … 1655 1655 STDMETHODIMP VirtualBox::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL /* aWritable */) 1656 1656 { 1657 CheckComArg NotNull(aName);1658 CheckComArg NotNull(aHostPath);1657 CheckComArgStrNotEmptyOrNull(aName); 1658 CheckComArgStrNotEmptyOrNull(aHostPath); 1659 1659 1660 1660 AutoCaller autoCaller(this); … … 1666 1666 STDMETHODIMP VirtualBox::RemoveSharedFolder(IN_BSTR aName) 1667 1667 { 1668 CheckComArg NotNull(aName);1668 CheckComArgStrNotEmptyOrNull(aName); 1669 1669 1670 1670 AutoCaller autoCaller(this); … … 1709 1709 BSTR *aValue) 1710 1710 { 1711 CheckComArg NotNull(aKey);1711 CheckComArgStrNotEmptyOrNull(aKey); 1712 1712 CheckComArgNotNull(aValue); 1713 1713 … … 1716 1716 1717 1717 /* start with nothing found */ 1718 Bstr bstrResult(""); 1719 1720 settings::ExtraDataItemsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.find(Utf8Str(aKey)); 1718 Utf8Str strKey(aKey); 1719 Bstr bstrResult; 1720 1721 settings::ExtraDataItemsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.find(strKey); 1721 1722 if (it != m->pMainConfigFile->mapExtraDataItems.end()) 1722 1723 // found: … … 1735 1736 IN_BSTR aValue) 1736 1737 { 1737 CheckComArg NotNull(aKey);1738 CheckComArgStrNotEmptyOrNull(aKey); 1738 1739 1739 1740 AutoCaller autoCaller(this); … … 1766 1767 // lock to copy the list of callbacks to invoke 1767 1768 Bstr error; 1768 Bstr bstrValue; 1769 if (aValue) 1770 bstrValue = aValue; 1771 else 1772 bstrValue = (const char *)""; 1769 Bstr bstrValue(aValue); 1773 1770 1774 1771 if (!onExtraDataCanChange(Guid::Empty, aKey, bstrValue, error)) 1775 1772 { 1776 1773 const char *sep = error.isEmpty() ? "" : ": "; 1777 CBSTR err = error. isNull() ? (CBSTR) L"" : error.raw();1774 CBSTR err = error.raw(); 1778 1775 LogWarningFunc(("Someone vetoed! Change refused%s%ls\n", 1779 1776 sep, err)); … … 1866 1863 LogRel(("remotesession=%s\n", Utf8Str(aMachineId).c_str())); 1867 1864 1868 CheckComArg NotNull(aMachineId);1865 CheckComArgStrNotEmptyOrNull(aMachineId); 1869 1866 CheckComArgNotNull(aSession); 1870 CheckComArg NotNull(aType);1867 CheckComArgStrNotEmptyOrNull(aType); 1871 1868 CheckComArgOutSafeArrayPointerValid(aProgress); 1872 1869 … … 4359 4356 STDMETHODIMP VirtualBox::CreateDHCPServer (IN_BSTR aName, IDHCPServer ** aServer) 4360 4357 { 4361 CheckComArg NotNull(aName);4358 CheckComArgStrNotEmptyOrNull(aName); 4362 4359 CheckComArgNotNull(aServer); 4363 4360 … … 4380 4377 STDMETHODIMP VirtualBox::FindDHCPServerByNetworkName(IN_BSTR aName, IDHCPServer ** aServer) 4381 4378 { 4382 CheckComArg NotNull(aName);4379 CheckComArgStrNotEmptyOrNull(aName); 4383 4380 CheckComArgNotNull(aServer); 4384 4381 … … 4456 4453 4457 4454 ComPtr<IDHCPServer> existing; 4458 rc = FindDHCPServerByNetworkName(name .mutableRaw(), existing.asOutParam());4455 rc = FindDHCPServerByNetworkName(name, existing.asOutParam()); 4459 4456 if (SUCCEEDED(rc)) 4460 4457 { -
trunk/src/VBox/Main/generic/NetIf-generic.cpp
r26603 r26753 234 234 return VERR_INVALID_PARAMETER; 235 235 iface->COMGETTER(Name) (ifname.asOutParam()); 236 if (ifname.is Null())236 if (ifname.isEmpty()) 237 237 return VERR_INTERNAL_ERROR; 238 238 -
trunk/src/VBox/Main/glue/VirtualBoxErrorInfo.cpp
r25149 r26753 202 202 return NS_ERROR_INVALID_POINTER; 203 203 204 Utf8Str 204 Utf8Str(mText).cloneTo(aMessage); 205 205 return S_OK; 206 206 } -
trunk/src/VBox/Main/glue/string.cpp
r26186 r26753 4 4 * 5 5 * MS COM / XPCOM Abstraction Layer: 6 * Smart string classes definition6 * UTF-8 and UTF-16 string classes 7 7 */ 8 8 … … 31 31 { 32 32 33 // BSTR representing a null wide char with 32 bits of length prefix (0); 34 // this will work on Windows as well as other platforms where BSTR does 35 // not use length prefixes 36 const OLECHAR g_achEmptyBstr[3] = { 0, 0, 0 }; 37 const BSTR g_bstrEmpty = (BSTR)(&g_achEmptyBstr[2]); 38 33 39 /* static */ 34 40 const Bstr Bstr::Null; /* default ctor is OK */ … … 36 42 /* static */ 37 43 const Utf8Str Utf8Str::Null; /* default ctor is OK */ 44 45 #if defined (VBOX_WITH_XPCOM) 46 void Utf8Str::cloneTo(char **pstr) const 47 { 48 size_t cb = length() + 1; 49 *pstr = (char*)nsMemory::Alloc(cb); 50 if (!*pstr) 51 throw std::bad_alloc(); 52 memcpy(*pstr, c_str(), cb); 53 } 54 #endif 38 55 39 56 Utf8Str& Utf8Str::toLower() -
trunk/src/VBox/Main/include/VirtualBoxBase.h
r26238 r26753 781 781 class VirtualBoxSupportErrorInfoImplBase 782 782 { 783 static HRESULT setErrorInternal(HRESULT aResultCode, const GUID &aIID, 784 const Bstr &aComponent, const Bstr &aText, 785 bool aWarning, bool aLogIt); 783 static HRESULT setErrorInternal(HRESULT aResultCode, 784 const GUID &aIID, 785 const wchar_t *aComponent, 786 const Bstr &aText, 787 bool aWarning, 788 bool aLogIt); 786 789 787 790 protected: … … 910 913 }; 911 914 912 static HRESULT setError(HRESULT aResultCode, const GUID &aIID, 913 const Bstr &aComponent, 915 static HRESULT setError(HRESULT aResultCode, 916 const GUID &aIID, 917 const wchar_t *aComponent, 914 918 const Bstr &aText, 915 919 bool aLogIt = true) … … 919 923 } 920 924 921 static HRESULT setWarning(HRESULT aResultCode, const GUID &aIID, 922 const Bstr &aComponent, 925 static HRESULT setWarning(HRESULT aResultCode, 926 const GUID &aIID, 927 const wchar_t *aComponent, 923 928 const Bstr &aText) 924 929 { … … 927 932 } 928 933 929 static HRESULT setError(HRESULT aResultCode, const GUID &aIID, 930 const Bstr &aComponent, 934 static HRESULT setError(HRESULT aResultCode, 935 const GUID &aIID, 936 const wchar_t *aComponent, 931 937 const char *aText, va_list aArgs, bool aLogIt = true) 932 938 { … … 936 942 } 937 943 938 static HRESULT setWarning(HRESULT aResultCode, const GUID &aIID, 939 const Bstr &aComponent, 944 static HRESULT setWarning(HRESULT aResultCode, 945 const GUID &aIID, 946 const wchar_t *aComponent, 940 947 const char *aText, va_list aArgs) 941 948 { … … 1061 1068 va_list args; 1062 1069 va_start(args, aText); 1063 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError( 1064 aResultCode, aIID, aComponent, aText, args, true /* aLogIt */); 1070 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(aResultCode, 1071 aIID, 1072 aComponent, 1073 aText, 1074 args, 1075 true /* aLogIt */); 1065 1076 va_end(args); 1066 1077 return rc; … … 1115 1126 va_list args; 1116 1127 va_start(args, aText); 1117 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError( 1118 aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args, true /* aLogIt */); 1128 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(aResultCode, 1129 COM_IIDOF(I), 1130 C::getComponentName(), 1131 aText, 1132 args, 1133 true /* aLogIt */); 1119 1134 va_end(args); 1120 1135 return rc; … … 1134 1149 va_list args; 1135 1150 va_start(args, aText); 1136 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning( 1137 aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args); 1151 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning(aResultCode, 1152 COM_IIDOF(I), 1153 C::getComponentName(), 1154 aText, 1155 args); 1138 1156 va_end(args); 1139 1157 return rc; … … 1152 1170 va_list aArgs) 1153 1171 { 1154 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError( 1155 aResultCode, COM_IIDOF(I), C::getComponentName(), aText, aArgs, true /* aLogIt */); 1172 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(aResultCode, 1173 COM_IIDOF(I), 1174 C::getComponentName(), 1175 aText, 1176 aArgs, 1177 true /* aLogIt */); 1156 1178 return rc; 1157 1179 } … … 1169 1191 va_list aArgs) 1170 1192 { 1171 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning( 1172 aResultCode, COM_IIDOF(I), C::getComponentName(), aText, aArgs); 1193 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning(aResultCode, 1194 COM_IIDOF(I), 1195 C::getComponentName(), 1196 aText, 1197 aArgs); 1173 1198 return rc; 1174 1199 } … … 1188 1213 va_list args; 1189 1214 va_start(args, aText); 1190 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError( 1191 aResultCode, aIID, C::getComponentName(), aText, args, true /* aLogIt */); 1215 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(aResultCode, 1216 aIID, 1217 C::getComponentName(), 1218 aText, 1219 args, 1220 true /* aLogIt */); 1192 1221 va_end(args); 1193 1222 return rc; … … 1208 1237 va_list args; 1209 1238 va_start(args, aText); 1210 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning( 1211 aResultCode, aIID, C::getComponentName(), aText, args); 1239 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning(aResultCode, 1240 aIID, 1241 C::getComponentName(), 1242 aText, 1243 args); 1212 1244 va_end(args); 1213 1245 return rc; … … 1225 1257 va_list args; 1226 1258 va_start(args, aText); 1227 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError( 1228 aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args, false /* aLogIt */); 1259 HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(aResultCode, 1260 COM_IIDOF(I), 1261 C::getComponentName(), 1262 aText, 1263 args, 1264 false /* aLogIt */); 1229 1265 va_end(args); 1230 1266 return rc; -
trunk/src/VBox/Main/win/NetIf-win.cpp
r26603 r26753 908 908 if(hr == S_OK) 909 909 { 910 size_t cUnicodeName = wcslen(lpszName) + 1; 911 size_t uniLen = (cUnicodeName * 2 + sizeof (OLECHAR) - 1) / sizeof (OLECHAR); 912 Bstr name (uniLen + 1 /* extra zero */); 913 wcscpy((wchar_t *) name.mutableRaw(), lpszName); 910 Bstr name(lpszName); 914 911 915 912 hr = pncc->GetInstanceGuid(&IfGuid); -
trunk/src/VBox/Main/win/svcmain.cpp
r26603 r26753 231 231 232 232 if (*lpszToken != NULL) 233 {234 Bstr str (lpszToken);235 LPCTSTR lpszToken2 = FindOneOf(lpszToken, szTokens);236 if (lpszToken2)237 str.mutableRaw()[lpszToken2 - lpszToken] = '\0';238 233 pipeName = Utf8Str(lpszToken); 239 }240 234 } 241 235
Note:
See TracChangeset
for help on using the changeset viewer.