Changeset 26603 in vbox for trunk/src/VBox/Main/ConsoleImpl.cpp
- Timestamp:
- Feb 17, 2010 12:24:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r26587 r26603 584 584 if (RT_SUCCESS(rc)) 585 585 { 586 mMachine->SetGuestProperty(Bstr(pszPropertyName), NULL, Bstr("RDONLYGUEST"));586 mMachine->SetGuestProperty(Bstr(pszPropertyName), Bstr(""), Bstr("RDONLYGUEST")); 587 587 RTStrFree(pszPropertyName); 588 588 } … … 591 591 if (RT_SUCCESS(rc)) 592 592 { 593 mMachine->SetGuestProperty(Bstr(pszPropertyName), NULL, Bstr("RDONLYGUEST"));593 mMachine->SetGuestProperty(Bstr(pszPropertyName), Bstr(""), Bstr("RDONLYGUEST")); 594 594 RTStrFree(pszPropertyName); 595 595 } … … 598 598 if (RT_SUCCESS(rc)) 599 599 { 600 mMachine->SetGuestProperty(Bstr(pszPropertyName), NULL, Bstr("RDONLYGUEST"));600 mMachine->SetGuestProperty(Bstr(pszPropertyName), Bstr(""), Bstr("RDONLYGUEST")); 601 601 RTStrFree(pszPropertyName); 602 602 } … … 1190 1190 1191 1191 // static 1192 DECLCALLBACK(int) Console::doGuestPropNotification(void *pvExtension,1193 1194 1192 DECLCALLBACK(int) 1193 Console::doGuestPropNotification(void *pvExtension, uint32_t u32Function, 1194 void *pvParms, uint32_t cbParms) 1195 1195 { 1196 1196 using namespace guestProp; … … 1212 1212 Bstr value(pCBData->pcszValue); 1213 1213 Bstr flags(pCBData->pcszFlags); 1214 ComObjPtr<Console> ptrConsole = reinterpret_cast<Console *>(pvExtension); 1215 HRESULT hrc = ptrConsole->mControl->PushGuestProperty(name, 1216 value, 1217 pCBData->u64Timestamp, 1218 flags); 1219 if (SUCCEEDED(hrc)) 1220 rc = VINF_SUCCESS; 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 } 1221 1233 else 1222 { 1223 LogFunc(("Console::doGuestPropNotification: hrc=%Rhrc pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n", 1224 pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1225 rc = Global::vboxStatusCodeFromCOM(hrc); 1226 } 1234 rc = VERR_NO_MEMORY; 1227 1235 return rc; 1228 1236 } … … 2586 2594 { 2587 2595 #ifdef VBOX_WITH_USB 2588 CheckComArg StrNotEmptyOrNull(aAddress);2596 CheckComArgNotNull(aAddress); 2589 2597 CheckComArgOutPointerValid(aDevice); 2590 2598 … … 2653 2661 } 2654 2662 2655 STDMETHODIMP Console::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable) 2656 { 2657 CheckComArgStrNotEmptyOrNull(aName); 2658 CheckComArgStrNotEmptyOrNull(aHostPath); 2663 STDMETHODIMP 2664 Console::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable) 2665 { 2666 CheckComArgNotNull(aName); 2667 CheckComArgNotNull(aHostPath); 2659 2668 2660 2669 AutoCaller autoCaller(this); … … 2723 2732 STDMETHODIMP Console::RemoveSharedFolder(IN_BSTR aName) 2724 2733 { 2725 CheckComArg StrNotEmptyOrNull(aName);2734 CheckComArgNotNull(aName); 2726 2735 2727 2736 AutoCaller autoCaller(this); … … 2789 2798 LogFlowThisFunc(("aName='%ls' mMachineState=%08X\n", aName, mMachineState)); 2790 2799 2791 CheckComArg StrNotEmptyOrNull(aName);2800 CheckComArgNotNull(aName); 2792 2801 CheckComArgOutPointerValid(aProgress); 2793 2802 … … 5025 5034 Bstr hostif; 5026 5035 adapter->COMGETTER(HostInterface)(hostif.asOutParam()); 5027 if ( hostif.isEmpty())5036 if (!hostif) 5028 5037 { 5029 5038 return setError(VBOX_E_HOST_ERROR, … … 5081 5090 rc = mMachine->COMGETTER(StateFilePath)(savedStateFile.asOutParam()); 5082 5091 if (FAILED(rc)) return rc; 5083 ComAssertRet(! savedStateFile.isEmpty(), E_FAIL);5092 ComAssertRet(!!savedStateFile, E_FAIL); 5084 5093 int vrc = SSMR3ValidateFile(Utf8Str(savedStateFile).c_str(), false /* fChecksumIt */); 5085 5094 if (RT_FAILURE(vrc)) … … 5809 5818 { 5810 5819 ComAssertRet(aName && *aName, E_FAIL); 5811 ComAssertRet( !aData.mHostPath.isEmpty(), E_FAIL);5820 ComAssertRet(aData.mHostPath, E_FAIL); 5812 5821 5813 5822 /* sanity checks */ … … 7716 7725 * (i.e. creating a snapshot online) 7717 7726 */ 7718 ComAssertThrow( (!pTask->bstrSavedStateFile.is Empty() && pTask->fTakingSnapshotOnline)7719 || (pTask->bstrSavedStateFile.is Empty() && !pTask->fTakingSnapshotOnline),7727 ComAssertThrow( (!pTask->bstrSavedStateFile.isNull() && pTask->fTakingSnapshotOnline) 7728 || (pTask->bstrSavedStateFile.isNull() && !pTask->fTakingSnapshotOnline), 7720 7729 rc = E_FAIL); 7721 7730
Note:
See TracChangeset
for help on using the changeset viewer.