Changeset 85306 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Jul 13, 2020 12:10:02 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139284
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r85304 r85306 4698 4698 // i_onExtraDataCanChange() only briefly requests the VirtualBox 4699 4699 // lock to copy the list of callbacks to invoke 4700 Bstr error; 4701 Bstr bstrValue(aValue); 4702 4703 if (!mParent->i_onExtraDataCanChange(mData->mUuid, Bstr(aKey).raw(), bstrValue.raw(), error)) 4704 { 4705 const char *sep = error.isEmpty() ? "" : ": "; 4706 Log1WarningFunc(("Someone vetoed! Change refused%s%ls\n", sep, error.raw())); 4700 Bstr bstrError; 4701 if (!mParent->i_onExtraDataCanChange(mData->mUuid, aKey, aValue, bstrError)) 4702 { 4703 const char *sep = bstrError.isEmpty() ? "" : ": "; 4704 Log1WarningFunc(("Someone vetoed! Change refused%s%ls\n", sep, bstrError.raw())); 4707 4705 return setError(E_ACCESSDENIED, 4708 4706 tr("Could not set extra data because someone refused the requested change of '%s' to '%s'%s%ls"), … … 4710 4708 aValue.c_str(), 4711 4709 sep, 4712 error.raw());4710 bstrError.raw()); 4713 4711 } 4714 4712 … … 4739 4737 // fire notification outside the lock 4740 4738 if (fChanged) 4741 mParent->i_onExtraDataChanged(mData->mUuid, Bstr(aKey).raw(), Bstr(aValue).raw());4739 mParent->i_onExtraDataChanged(mData->mUuid, aKey, aValue); 4742 4740 4743 4741 return S_OK; … … 5523 5521 alock.release(); 5524 5522 5525 mParent->i_onGuestPropertyChanged(mData->mUuid, Bstr(aName).raw(), Bstr(aValue).raw(), Bstr(aFlags).raw());5523 mParent->i_onGuestPropertyChanged(mData->mUuid, aName, aValue, aFlags); 5526 5524 } 5527 5525 } … … 13536 13534 alock.release(); 13537 13535 13538 mParent->i_onGuestPropertyChanged(mData->mUuid, Bstr(aName).raw(), Bstr(aValue).raw(), Bstr(aFlags).raw());13536 mParent->i_onGuestPropertyChanged(mData->mUuid, aName, aValue, aFlags); 13539 13537 } 13540 13538 catch (...) -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r85304 r85306 3246 3246 ComPtr<IEvent> ptrEvent; 3247 3247 HRESULT hrc = ::CreateMediumRegisteredEvent(ptrEvent.asOutParam(), m->pEventSource, 3248 aMediumId.to Utf16().raw(), aDevType, aRegistered);3248 aMediumId.toString(), aDevType, aRegistered); 3249 3249 AssertComRCReturnVoid(hrc); 3250 3250 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3274 3274 ComPtr<IEvent> ptrEvent; 3275 3275 HRESULT hrc = ::CreateStorageControllerChangedEvent(ptrEvent.asOutParam(), m->pEventSource, 3276 aMachineId.to Utf16().raw(), Bstr(aControllerName).raw());3276 aMachineId.toString(), aControllerName); 3277 3277 AssertComRCReturnVoid(hrc); 3278 3278 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3293 3293 { 3294 3294 ComPtr<IEvent> ptrEvent; 3295 HRESULT hrc = ::CreateMachineStateChangedEvent(ptrEvent.asOutParam(), m->pEventSource, aId.to Utf16().raw(), aState);3295 HRESULT hrc = ::CreateMachineStateChangedEvent(ptrEvent.asOutParam(), m->pEventSource, aId.toString(), aState); 3296 3296 AssertComRCReturnVoid(hrc); 3297 3297 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3304 3304 { 3305 3305 ComPtr<IEvent> ptrEvent; 3306 HRESULT hrc = ::CreateMachineDataChangedEvent(ptrEvent.asOutParam(), m->pEventSource, aId.to Utf16().raw(), aTemporary);3306 HRESULT hrc = ::CreateMachineDataChangedEvent(ptrEvent.asOutParam(), m->pEventSource, aId.toString(), aTemporary); 3307 3307 AssertComRCReturnVoid(hrc); 3308 3308 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3312 3312 * @note Locks this object for reading. 3313 3313 */ 3314 BOOL VirtualBox::i_onExtraDataCanChange(const Guid &aId, IN_BSTR aKey, IN_BSTR aValue, 3315 Bstr &aError) 3316 { 3317 LogFlowThisFunc(("machine={%RTuuid} aKey={%ls} aValue={%ls}\n", aId.raw(), aKey, aValue)); 3314 BOOL VirtualBox::i_onExtraDataCanChange(const Guid &aId, const Utf8Str &aKey, const Utf8Str &aValue, Bstr &aError) 3315 { 3316 LogFlowThisFunc(("machine={%RTuuid} aKey={%s} aValue={%s}\n", aId.raw(), aKey.c_str(), aValue.c_str())); 3318 3317 3319 3318 AutoCaller autoCaller(this); … … 3321 3320 3322 3321 ComPtr<IEvent> ptrEvent; 3323 HRESULT hrc = ::CreateExtraDataCanChangeEvent(ptrEvent.asOutParam(), m->pEventSource, aId.to Utf16().raw(), aKey, aValue);3322 HRESULT hrc = ::CreateExtraDataCanChangeEvent(ptrEvent.asOutParam(), m->pEventSource, aId.toString(), aKey, aValue); 3324 3323 AssertComRCReturn(hrc, TRUE); 3325 3324 … … 3353 3352 * @note Doesn't lock any object. 3354 3353 */ 3355 void VirtualBox::i_onExtraDataChanged(const Guid &aId, IN_BSTR aKey, IN_BSTRaValue)3354 void VirtualBox::i_onExtraDataChanged(const Guid &aId, const Utf8Str &aKey, const Utf8Str &aValue) 3356 3355 { 3357 3356 ComPtr<IEvent> ptrEvent; 3358 HRESULT hrc = ::CreateExtraDataChangedEvent(ptrEvent.asOutParam(), m->pEventSource, aId.to Utf16().raw(), aKey, aValue);3357 HRESULT hrc = ::CreateExtraDataChangedEvent(ptrEvent.asOutParam(), m->pEventSource, aId.toString(), aKey, aValue); 3359 3358 AssertComRCReturnVoid(hrc); 3360 3359 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3367 3366 { 3368 3367 ComPtr<IEvent> ptrEvent; 3369 HRESULT hrc = ::CreateMachineRegisteredEvent(ptrEvent.asOutParam(), m->pEventSource, aId.to Utf16().raw(), aRegistered);3368 HRESULT hrc = ::CreateMachineRegisteredEvent(ptrEvent.asOutParam(), m->pEventSource, aId.toString(), aRegistered); 3370 3369 AssertComRCReturnVoid(hrc); 3371 3370 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3378 3377 { 3379 3378 ComPtr<IEvent> ptrEvent; 3380 HRESULT hrc = ::CreateSessionStateChangedEvent(ptrEvent.asOutParam(), m->pEventSource, aId.to Utf16().raw(), aState);3379 HRESULT hrc = ::CreateSessionStateChangedEvent(ptrEvent.asOutParam(), m->pEventSource, aId.toString(), aState); 3381 3380 AssertComRCReturnVoid(hrc); 3382 3381 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3390 3389 ComPtr<IEvent> ptrEvent; 3391 3390 HRESULT hrc = ::CreateSnapshotTakenEvent(ptrEvent.asOutParam(), m->pEventSource, 3392 aMachineId.to Utf16().raw(), aSnapshotId.toUtf16().raw());3391 aMachineId.toString(), aSnapshotId.toString()); 3393 3392 AssertComRCReturnVoid(hrc); 3394 3393 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3402 3401 ComPtr<IEvent> ptrEvent; 3403 3402 HRESULT hrc = ::CreateSnapshotDeletedEvent(ptrEvent.asOutParam(), m->pEventSource, 3404 aMachineId.to Utf16().raw(), aSnapshotId.toUtf16().raw());3403 aMachineId.toString(), aSnapshotId.toString()); 3405 3404 AssertComRCReturnVoid(hrc); 3406 3405 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3414 3413 ComPtr<IEvent> ptrEvent; 3415 3414 HRESULT hrc = ::CreateSnapshotRestoredEvent(ptrEvent.asOutParam(), m->pEventSource, 3416 aMachineId.to Utf16().raw(), aSnapshotId.toUtf16().raw());3415 aMachineId.toString(), aSnapshotId.toString()); 3417 3416 AssertComRCReturnVoid(hrc); 3418 3417 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3426 3425 ComPtr<IEvent> ptrEvent; 3427 3426 HRESULT hrc = ::CreateSnapshotChangedEvent(ptrEvent.asOutParam(), m->pEventSource, 3428 aMachineId.to Utf16().raw(), aSnapshotId.toUtf16().raw());3427 aMachineId.toString(), aSnapshotId.toString()); 3429 3428 AssertComRCReturnVoid(hrc); 3430 3429 i_postEvent(new AsyncEvent(this, ptrEvent)); … … 3711 3710 * @note Doesn't lock any object. 3712 3711 */ 3713 void VirtualBox::i_onGuestPropertyChanged(const Guid &aMachineId, IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags) 3712 void VirtualBox::i_onGuestPropertyChanged(const Guid &aMachineId, const Utf8Str &aName, const Utf8Str &aValue, 3713 const Utf8Str &aFlags) 3714 3714 { 3715 3715 ComPtr<IEvent> ptrEvent; 3716 3716 HRESULT hrc = ::CreateGuestPropertyChangedEvent(ptrEvent.asOutParam(), m->pEventSource, 3717 aMachineId.to Utf16().raw(), aName, aValue, aFlags);3717 aMachineId.toString(), aName, aValue, aFlags); 3718 3718 AssertComRCReturnVoid(hrc); 3719 3719 i_postEvent(new AsyncEvent(this, ptrEvent));
Note:
See TracChangeset
for help on using the changeset viewer.