Changeset 13555 in vbox
- Timestamp:
- Oct 24, 2008 2:09:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r13551 r13555 5164 5164 5165 5165 Key guestPropertiesNode = aNode.findKey ("GuestProperties"); 5166 Bstr notificationPatterns (""); 5166 Bstr notificationPatterns (""); /* We catch allocation failure below. */ 5167 5167 if (!guestPropertiesNode.isNull()) 5168 5168 { … … 5181 5181 /* property flags (optional, defaults to empty) */ 5182 5182 Bstr flags = (*it).stringValue ("flags"); 5183 validateFlags (Utf8Str (flags).raw(), &fFlags); 5183 Utf8Str utf8Flags (flags); 5184 if (utf8Flags.isNull ()) 5185 return E_OUTOFMEMORY; 5186 validateFlags (utf8Flags.raw(), &fFlags); 5184 5187 HWData::GuestProperty property = { name, value, timestamp, fFlags }; 5185 5188 mHWData->mGuestProperties.push_back(property); 5189 /* This is just sanity, as the push_back() will probably have thrown 5190 * an exception if we are out of memory. Note that if we run out 5191 * allocating the Bstrs above, this will be caught here as well. */ 5192 if ( mHWData->mGuestProperties.back().mName.isNull () 5193 || mHWData->mGuestProperties.back().mValue.isNull () 5194 ) 5195 return E_OUTOFMEMORY; 5186 5196 } 5187 5197 notificationPatterns = guestPropertiesNode.stringValue ("notificationPatterns"); … … 5189 5199 mHWData->mPropertyServiceActive = false; 5190 5200 mHWData->mGuestPropertyNotificationPatterns = notificationPatterns; 5201 if (mHWData->mGuestPropertyNotificationPatterns.isNull ()) 5202 return E_OUTOFMEMORY; 5191 5203 } 5192 5204 #endif /* VBOX_WITH_GUEST_PROPS defined */ … … 6554 6566 #ifdef VBOX_WITH_GUEST_PROPS 6555 6567 /* Guest properties */ 6568 try 6556 6569 { 6557 6570 using namespace guestProp; … … 6560 6573 6561 6574 for (HWData::GuestPropertyList::const_iterator it = mHWData->mGuestProperties.begin(); 6562 it != mHWData->mGuestProperties.end(); 6563 ++ it) 6575 it != mHWData->mGuestProperties.end(); ++it) 6564 6576 { 6565 6577 HWData::GuestProperty property = *it; … … 6572 6584 propertyNode.setValue <ULONG64> ("timestamp", property.mTimestamp); 6573 6585 writeFlags(property.mFlags, szFlags); 6574 propertyNode.setValue <Bstr> ("flags", Bstr(szFlags)); 6575 } 6586 Bstr flags (szFlags); 6587 if (flags.isNull()) 6588 return E_OUTOFMEMORY; 6589 propertyNode.setValue <Bstr> ("flags", flags); 6590 } 6591 Bstr emptyStr (""); 6592 if (emptyStr.isNull()) 6593 return E_OUTOFMEMORY; 6576 6594 guestPropertiesNode.setValueOr <Bstr> ("notificationPatterns", 6577 6595 mHWData->mGuestPropertyNotificationPatterns, 6578 Bstr ("")); 6596 emptyStr); 6597 } 6598 catch (ENoMemory e) 6599 { 6600 return E_OUTOFMEMORY; 6579 6601 } 6580 6602 #endif /* VBOX_WITH_GUEST_PROPS defined */
Note:
See TracChangeset
for help on using the changeset viewer.