Changeset 70058 in vbox for trunk/src/VBox/Main
- Timestamp:
- Dec 11, 2017 3:02:07 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119600
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r70036 r70058 1766 1766 * changes to the object state. 1767 1767 */ 1768 P HOSTCALLBACKDATA pCBData = reinterpret_cast<PHOSTCALLBACKDATA>(pvParms);1769 AssertReturn(sizeof( HOSTCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER);1770 AssertReturn( HOSTCALLBACKMAGIC == pCBData->u32Magic, VERR_INVALID_PARAMETER);1768 PGUESTPROPHOSTCALLBACKDATA pCBData = reinterpret_cast<PGUESTPROPHOSTCALLBACKDATA>(pvParms); 1769 AssertReturn(sizeof(GUESTPROPHOSTCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER); 1770 AssertReturn(pCBData->u32Magic == GUESTPROPHOSTCALLBACKDATA_MAGIC, VERR_INVALID_PARAMETER); 1771 1771 LogFlow(("Console::doGuestPropNotification: pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n", 1772 1772 pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); … … 1839 1839 parm[2].u.uint32 = 0; 1840 1840 1841 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", ENUM_PROPS_HOST, 3, 1842 &parm[0]); 1841 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ENUM_PROPS_HOST, 3, &parm[0]); 1843 1842 Utf8Buf.jolt(); 1844 1843 if (parm[2].type != VBOX_HGCM_SVC_PARM_32BIT) … … 5941 5940 { 5942 5941 VBOXHGCMSVCPARM parm[4]; 5943 char szBuffer[ MAX_VALUE_LEN +MAX_FLAGS_LEN];5942 char szBuffer[GUEST_PROP_MAX_VALUE_LEN + GUEST_PROP_MAX_FLAGS_LEN]; 5944 5943 5945 5944 parm[0].type = VBOX_HGCM_SVC_PARM_PTR; … … 5957 5956 parm[3].u.uint32 = 0; 5958 5957 5959 int vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", G ET_PROP_HOST,5958 int vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_GET_PROP_HOST, 5960 5959 4, &parm[0]); 5961 5960 /* The returned string should never be able to be greater than our buffer */ … … 6028 6027 if (aFlags.isEmpty()) 6029 6028 { 6030 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", SET_PROP_VALUE_HOST, 6031 2, &parm[0]); 6029 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_SET_PROP_VALUE_HOST, 2, &parm[0]); 6032 6030 } 6033 6031 else … … 6037 6035 parm[2].u.pointer.size = (uint32_t)aFlags.length() + 1; /* The + 1 is the null terminator */ 6038 6036 6039 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", SET_PROP_HOST, 6040 3, &parm[0]); 6037 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_SET_PROP_HOST, 3, &parm[0]); 6041 6038 } 6042 6039 … … 6073 6070 parm[0].u.pointer.size = (uint32_t)aName.length() + 1; /* The + 1 is the null terminator */ 6074 6071 6075 int vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", DEL_PROP_HOST, 6076 1, &parm[0]); 6072 int vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_DEL_PROP_HOST, 1, &parm[0]); 6077 6073 6078 6074 HRESULT hrc = S_OK; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r70035 r70058 5906 5906 5907 5907 #ifdef VBOX_WITH_GUEST_PROPS 5908 5908 5909 /** 5909 5910 * Set an array of guest properties … … 5930 5931 parms[3].u.pointer.size = 0; /* We don't actually care. */ 5931 5932 5932 pVMMDev->hgcmHostCall("VBoxGuestPropSvc", 5933 guestProp::SET_PROPS_HOST, 5934 4, 5935 &parms[0]); 5933 pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_SET_PROPS_HOST, 4, &parms[0]); 5936 5934 } 5937 5935 … … 5958 5956 parms[2].u.pointer.addr = (void *)pszFlags; 5959 5957 parms[2].u.pointer.size = (uint32_t)strlen(pszFlags) + 1; 5960 pVMMDev->hgcmHostCall("VBoxGuestPropSvc", guestProp::SET_PROP_HOST, 3, 5961 &parms[0]); 5958 pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_SET_PROP_HOST, 3, &parms[0]); 5962 5959 } 5963 5960 … … 5969 5966 * @param eFlags the flags to set 5970 5967 */ 5971 int configSetGlobalPropertyFlags(VMMDev * const pVMMDev, 5972 guestProp::ePropFlags eFlags) 5968 int configSetGlobalPropertyFlags(VMMDev * const pVMMDev, uint32_t fFlags) 5973 5969 { 5974 5970 VBOXHGCMSVCPARM paParm; 5975 paParm.setUInt32(eFlags); 5976 int rc = pVMMDev->hgcmHostCall("VBoxGuestPropSvc", 5977 guestProp::SET_GLOBAL_FLAGS_HOST, 1, 5978 &paParm); 5971 paParm.setUInt32(fFlags); 5972 int rc = pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_SET_GLOBAL_FLAGS_HOST, 1, &paParm); 5979 5973 if (RT_FAILURE(rc)) 5980 5974 { 5981 char szFlags[ guestProp::MAX_FLAGS_LEN];5982 if (RT_FAILURE( writeFlags(eFlags, szFlags)))5975 char szFlags[GUEST_PROP_MAX_FLAGS_LEN]; 5976 if (RT_FAILURE(GuestPropWriteFlags(fFlags, szFlags))) 5983 5977 Log(("Failed to set the global flags.\n")); 5984 5978 else … … 5987 5981 return rc; 5988 5982 } 5983 5989 5984 #endif /* VBOX_WITH_GUEST_PROPS */ 5990 5985 … … 6020 6015 { 6021 6016 VBOXHGCMSVCPARM Params[2]; 6022 int rc2 = pConsole->m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", guestProp::GET_DBGF_INFO_FN, 2, &Params[0]);6017 int rc2 = pConsole->m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_GET_DBGF_INFO_FN, 2, &Params[0]); 6023 6018 if (RT_SUCCESS(rc2)) 6024 6019 { … … 6134 6129 6135 6130 #ifdef VBOX_WITH_GUEST_PROPS_RDONLY_GUEST 6136 rc = configSetGlobalPropertyFlags(pConsole->m_pVMMDev, 6137 guestProp::RDONLYGUEST); 6131 rc = configSetGlobalPropertyFlags(pConsole->m_pVMMDev, guestProp::RDONLYGUEST); 6138 6132 AssertRCReturn(rc, rc); 6139 6133 #endif -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r68986 r70058 5654 5654 if (it != mHWData->mGuestProperties.end()) 5655 5655 { 5656 char szFlags[ MAX_FLAGS_LEN + 1];5656 char szFlags[GUEST_PROP_MAX_FLAGS_LEN + 1]; 5657 5657 aValue = it->second.strValue; 5658 5658 *aTimestamp = it->second.mTimestamp; 5659 writeFlags(it->second.mFlags, szFlags);5659 GuestPropWriteFlags(it->second.mFlags, szFlags); 5660 5660 aFlags = Utf8Str(szFlags); 5661 5661 } … … 5752 5752 try 5753 5753 { 5754 uint32_t fFlags = NILFLAG;5755 if (aFlags.length() && RT_FAILURE( validateFlags(aFlags.c_str(), &fFlags)))5754 uint32_t fFlags = GUEST_PROP_F_NILFLAG; 5755 if (aFlags.length() && RT_FAILURE(GuestPropValidateFlags(aFlags.c_str(), &fFlags))) 5756 5756 return setError(E_INVALIDARG, tr("Invalid guest property flag values: '%s'"), aFlags.c_str()); 5757 5757 … … 5774 5774 else 5775 5775 { 5776 if (it->second.mFlags & ( RDONLYHOST))5776 if (it->second.mFlags & (GUEST_PROP_F_RDONLYHOST)) 5777 5777 { 5778 5778 rc = setError(E_ACCESSDENIED, tr("The property '%s' cannot be changed by the host"), aName.c_str()); … … 5936 5936 aFlags.resize(cEntries); 5937 5937 5938 char szFlags[ MAX_FLAGS_LEN + 1];5938 char szFlags[GUEST_PROP_MAX_FLAGS_LEN + 1]; 5939 5939 size_t i = 0; 5940 5940 for (HWData::GuestPropertyMap::const_iterator … … 5946 5946 aValues[i] = it->second.strValue; 5947 5947 aTimestamps[i] = it->second.mTimestamp; 5948 writeFlags(it->second.mFlags, szFlags);5948 GuestPropWriteFlags(it->second.mFlags, szFlags); 5949 5949 aFlags[i] = Utf8Str(szFlags); 5950 5950 } … … 9158 9158 { 9159 9159 const settings::GuestProperty &prop = *it; 9160 uint32_t fFlags = guestProp::NILFLAG;9161 guestProp::validateFlags(prop.strFlags.c_str(), &fFlags);9160 uint32_t fFlags = GUEST_PROP_F_NILFLAG; 9161 GuestPropValidateFlags(prop.strFlags.c_str(), &fFlags); 9162 9162 if ( fSkipTransientGuestProperties 9163 && ( fFlags & guestProp::TRANSIENT9164 || fFlags & guestProp::TRANSRESET))9163 && ( fFlags & GUEST_PROP_F_TRANSIENT 9164 || fFlags & GUEST_PROP_F_TRANSRESET)) 9165 9165 { 9166 9166 it = llGuestProperties.erase(it); … … 10454 10454 || mData->mMachineState == MachineState_Aborted 10455 10455 || mData->mMachineState == MachineState_Teleported) 10456 && ( property.mFlags & guestProp::TRANSIENT 10457 || property.mFlags & guestProp::TRANSRESET)) 10456 && (property.mFlags & (GUEST_PROP_F_TRANSIENT | GUEST_PROP_F_TRANSRESET))) 10458 10457 continue; 10459 settings::GuestProperty prop; 10458 settings::GuestProperty prop; /// @todo r=bird: some excellent variable name choices here: 'prop' and 'property'; No 'const' clue either. 10460 10459 prop.strName = it->first; 10461 10460 prop.strValue = property.strValue; 10462 10461 prop.timestamp = property.mTimestamp; 10463 char szFlags[ guestProp::MAX_FLAGS_LEN + 1];10464 guestProp::writeFlags(property.mFlags, szFlags);10462 char szFlags[GUEST_PROP_MAX_FLAGS_LEN + 1]; 10463 GuestPropWriteFlags(property.mFlags, szFlags); 10465 10464 prop.strFlags = szFlags; 10466 10465 … … 13541 13540 ++it, ++i) 13542 13541 { 13543 char szFlags[ MAX_FLAGS_LEN + 1];13542 char szFlags[GUEST_PROP_MAX_FLAGS_LEN + 1]; 13544 13543 aNames[i] = it->first; 13545 13544 aValues[i] = it->second.strValue; … … 13549 13548 if (it->second.mFlags) 13550 13549 { 13551 writeFlags(it->second.mFlags, szFlags);13550 GuestPropWriteFlags(it->second.mFlags, szFlags); 13552 13551 aFlags[i] = szFlags; 13553 13552 } … … 13576 13575 * Convert input up front. 13577 13576 */ 13578 uint32_t fFlags = NILFLAG;13577 uint32_t fFlags = GUEST_PROP_F_NILFLAG; 13579 13578 if (aFlags.length()) 13580 13579 { 13581 int vrc = validateFlags(aFlags.c_str(), &fFlags);13580 int vrc = GuestPropValidateFlags(aFlags.c_str(), &fFlags); 13582 13581 AssertRCReturn(vrc, E_INVALIDARG); 13583 13582 } … … 14803 14802 { 14804 14803 uint32_t fFlags = it->second.mFlags; 14805 if ( fFlags & guestProp::TRANSIENT 14806 || fFlags & guestProp::TRANSRESET) 14804 if (fFlags & (GUEST_PROP_F_TRANSIENT | GUEST_PROP_F_TRANSRESET)) 14807 14805 { 14808 14806 /* iterator where we need to continue after the erase call
Note:
See TracChangeset
for help on using the changeset viewer.