Changeset 45686 in vbox for trunk/src/VBox
- Timestamp:
- Apr 23, 2013 6:15:40 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85223
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r45679 r45686 5499 5499 ReturnComNotImplemented(); 5500 5500 #else /* VBOX_WITH_GUEST_PROPS */ 5501 if (! VALID_PTR(aName))5501 if (!RT_VALID_PTR(aName)) 5502 5502 return setError(E_INVALIDARG, tr("Name cannot be NULL or an invalid pointer")); 5503 if ( (aValue != NULL) && !VALID_PTR(aValue))5503 if (aValue != NULL && !RT_VALID_PTR(aValue)) 5504 5504 return setError(E_INVALIDARG, tr("Invalid value pointer")); 5505 if ( (aFlags != NULL) && !VALID_PTR(aFlags))5505 if (aFlags != NULL && !RT_VALID_PTR(aFlags)) 5506 5506 return setError(E_INVALIDARG, tr("Invalid flags pointer")); 5507 5507 … … 5517 5517 * ptrVM, so there is no need to hold a lock of this */ 5518 5518 5519 HRESULT rc = E_UNEXPECTED;5520 5519 using namespace guestProp; 5521 5520 5522 5521 VBOXHGCMSVCPARM parm[3]; 5522 5523 5523 Utf8Str Utf8Name = aName; 5524 int vrc = VINF_SUCCESS;5525 5526 5524 parm[0].type = VBOX_HGCM_SVC_PARM_PTR; 5527 5525 parm[0].u.pointer.addr = (void*)Utf8Name.c_str(); 5528 5526 /* The + 1 is the null terminator */ 5529 5527 parm[0].u.pointer.size = (uint32_t)Utf8Name.length() + 1; 5530 Utf8Str Utf8Value = aValue; 5528 5531 5529 if (aValue != NULL) 5532 5530 { 5531 Utf8Str Utf8Value = aValue; 5533 5532 parm[1].type = VBOX_HGCM_SVC_PARM_PTR; 5534 parm[1].u.pointer.addr = (void *)Utf8Value.c_str();5533 parm[1].u.pointer.addr = (void *)Utf8Value.c_str(); 5535 5534 /* The + 1 is the null terminator */ 5536 5535 parm[1].u.pointer.size = (uint32_t)Utf8Value.length() + 1; 5537 5536 } 5538 Utf8Str Utf8Flags = aFlags; 5537 5539 5538 if (aFlags != NULL) 5540 5539 { 5540 Utf8Str Utf8Flags = aFlags; 5541 5541 parm[2].type = VBOX_HGCM_SVC_PARM_PTR; 5542 5542 parm[2].u.pointer.addr = (void*)Utf8Flags.c_str(); … … 5544 5544 parm[2].u.pointer.size = (uint32_t)Utf8Flags.length() + 1; 5545 5545 } 5546 if ((aValue != NULL) && (aFlags != NULL)) 5546 5547 int vrc; 5548 if (aValue != NULL && aFlags != NULL) 5547 5549 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", SET_PROP_HOST, 5548 5550 3, &parm[0]); … … 5553 5555 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", DEL_PROP_HOST, 5554 5556 1, &parm[0]); 5557 HRESULT hrc; 5555 5558 if (RT_SUCCESS(vrc)) 5556 rc = S_OK;5559 hrc = S_OK; 5557 5560 else 5558 rc = setError(E_UNEXPECTED, 5559 tr("The service call failed with the error %Rrc"), 5560 vrc); 5561 return rc; 5561 hrc = setError(E_UNEXPECTED, tr("The service call failed with the error %Rrc"), vrc); 5562 return hrc; 5562 5563 #endif /* VBOX_WITH_GUEST_PROPS */ 5563 5564 }
Note:
See TracChangeset
for help on using the changeset viewer.