Changeset 70063 in vbox
- Timestamp:
- Dec 11, 2017 3:32:07 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
include/VBox/HostServices/GuestPropertySvc.h (modified) (1 diff)
-
src/VBox/HostServices/GuestProperties/service.cpp (modified) (8 diffs)
-
src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp (modified) (10 diffs)
-
src/VBox/Main/src-client/ConsoleImpl.cpp (modified) (5 diffs)
-
src/VBox/Main/src-client/ConsoleImpl2.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/GuestPropertySvc.h
r70062 r70063 222 222 * parameters. These are, in order, name, value, timestamp, flags. Strings are 223 223 * stored as pointers to mutable utf8 data. All parameters must be supplied. */ 224 #define GUEST_PROP_FN_ SET_PROPS_HOST1224 #define GUEST_PROP_FN_HOST_SET_PROPS 1 225 225 /** Get the value attached to a guest property. 226 226 * The parameter format matches that of GET_PROP. */ 227 #define GUEST_PROP_FN_ GET_PROP_HOST2227 #define GUEST_PROP_FN_HOST_GET_PROP 2 228 228 /** Set the value attached to a guest property. 229 229 * The parameter format matches that of SET_PROP. */ 230 #define GUEST_PROP_FN_ SET_PROP_HOST3230 #define GUEST_PROP_FN_HOST_SET_PROP 3 231 231 /** Set the value attached to a guest property. 232 232 * The parameter format matches that of SET_PROP_VALUE. */ 233 #define GUEST_PROP_FN_ SET_PROP_VALUE_HOST4233 #define GUEST_PROP_FN_HOST_SET_PROP_VALUE 4 234 234 /** Remove a guest property. 235 235 * The parameter format matches that of DEL_PROP. */ 236 #define GUEST_PROP_FN_ DEL_PROP_HOST5236 #define GUEST_PROP_FN_HOST_DEL_PROP 5 237 237 /** Enumerate guest properties. 238 238 * The parameter format matches that of ENUM_PROPS. */ 239 #define GUEST_PROP_FN_ ENUM_PROPS_HOST6239 #define GUEST_PROP_FN_HOST_ENUM_PROPS 6 240 240 /** Set global flags for the service. 241 241 * Currently RDONLYGUEST is supported. Takes one 32-bit unsigned integer 242 242 * parameter for the flags. */ 243 #define GUEST_PROP_FN_ SET_GLOBAL_FLAGS_HOST7243 #define GUEST_PROP_FN_HOST_SET_GLOBAL_FLAGS 7 244 244 /** Return the pointer to a debug info function enumerating all guest 245 245 * properties. */ 246 #define GUEST_PROP_FN_ GET_DBGF_INFO_FN8246 #define GUEST_PROP_FN_HOST_GET_DBGF_INFO 8 247 247 /** @} */ 248 248 -
trunk/src/VBox/HostServices/GuestProperties/service.cpp
r70058 r70063 1456 1456 { 1457 1457 /* The host wishes to set a block of properties */ 1458 case GUEST_PROP_FN_ SET_PROPS_HOST:1458 case GUEST_PROP_FN_HOST_SET_PROPS: 1459 1459 LogFlowFunc(("SET_PROPS_HOST\n")); 1460 1460 rc = setPropertyBlock(cParms, paParms); … … 1462 1462 1463 1463 /* The host wishes to read a configuration value */ 1464 case GUEST_PROP_FN_ GET_PROP_HOST:1464 case GUEST_PROP_FN_HOST_GET_PROP: 1465 1465 LogFlowFunc(("GET_PROP_HOST\n")); 1466 1466 rc = getProperty(cParms, paParms); … … 1468 1468 1469 1469 /* The host wishes to set a configuration value */ 1470 case GUEST_PROP_FN_ SET_PROP_HOST:1470 case GUEST_PROP_FN_HOST_SET_PROP: 1471 1471 LogFlowFunc(("SET_PROP_HOST\n")); 1472 1472 rc = setProperty(cParms, paParms, false); … … 1474 1474 1475 1475 /* The host wishes to set a configuration value */ 1476 case GUEST_PROP_FN_ SET_PROP_VALUE_HOST:1476 case GUEST_PROP_FN_HOST_SET_PROP_VALUE: 1477 1477 LogFlowFunc(("SET_PROP_VALUE_HOST\n")); 1478 1478 rc = setProperty(cParms, paParms, false); … … 1480 1480 1481 1481 /* The host wishes to remove a configuration value */ 1482 case GUEST_PROP_FN_ DEL_PROP_HOST:1482 case GUEST_PROP_FN_HOST_DEL_PROP: 1483 1483 LogFlowFunc(("DEL_PROP_HOST\n")); 1484 1484 rc = delProperty(cParms, paParms, false); … … 1486 1486 1487 1487 /* The host wishes to enumerate all properties */ 1488 case GUEST_PROP_FN_ ENUM_PROPS_HOST:1488 case GUEST_PROP_FN_HOST_ENUM_PROPS: 1489 1489 LogFlowFunc(("ENUM_PROPS\n")); 1490 1490 rc = enumProps(cParms, paParms); … … 1492 1492 1493 1493 /* The host wishes to set global flags for the service */ 1494 case GUEST_PROP_FN_ SET_GLOBAL_FLAGS_HOST:1494 case GUEST_PROP_FN_HOST_SET_GLOBAL_FLAGS: 1495 1495 LogFlowFunc(("SET_GLOBAL_FLAGS_HOST\n")); 1496 1496 if (cParms == 1) … … 1505 1505 break; 1506 1506 1507 case GUEST_PROP_FN_ GET_DBGF_INFO_FN:1507 case GUEST_PROP_FN_HOST_GET_DBGF_INFO: 1508 1508 if (cParms != 2) 1509 1509 return VERR_INVALID_PARAMETER; -
trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
r70061 r70063 229 229 aParms[2].setPointer((void *)g_au64TimestampBlock, 0); 230 230 aParms[3].setPointer((void *)g_apcszFlagsBlock, 0); 231 RTTESTI_CHECK_RC(ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_ SET_PROPS_HOST, 4, &aParms[0]), VINF_SUCCESS);231 RTTESTI_CHECK_RC(ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_HOST_SET_PROPS, 4, &aParms[0]), VINF_SUCCESS); 232 232 } 233 233 … … 340 340 aParms[1].setPointer((void *)abBuffer, g_aEnumStrings[i].cbBuffer - 1); 341 341 memset(abBuffer, 0x55, sizeof(abBuffer)); 342 int rc2 = ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_ ENUM_PROPS_HOST, 3, aParms);342 int rc2 = ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_HOST_ENUM_PROPS, 3, aParms); 343 343 if (rc2 == VERR_BUFFER_OVERFLOW) 344 344 { … … 356 356 aParms[1].setPointer((void *)abBuffer, g_aEnumStrings[i].cbBuffer); 357 357 memset(abBuffer, 0x55, sizeof(abBuffer)); 358 rc2 = ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_ ENUM_PROPS_HOST, 3, aParms);358 rc2 = ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_HOST_ENUM_PROPS, 3, aParms); 359 359 if (rc2 == VINF_SUCCESS) 360 360 { … … 401 401 { 402 402 if (useSetProp) 403 command = GUEST_PROP_FN_ SET_PROP_HOST;403 command = GUEST_PROP_FN_HOST_SET_PROP; 404 404 else 405 command = GUEST_PROP_FN_ SET_PROP_VALUE_HOST;405 command = GUEST_PROP_FN_HOST_SET_PROP_VALUE; 406 406 } 407 407 else if (useSetProp) … … 498 498 int command = GUEST_PROP_FN_DEL_PROP; 499 499 if (isHost) 500 command = GUEST_PROP_FN_ DEL_PROP_HOST;500 command = GUEST_PROP_FN_HOST_DEL_PROP; 501 501 VBOXHGCMSVCPARM aParms[1]; 502 502 aParms[0].setString(pcszName); … … 604 604 memset(szBuffer, 0x55, sizeof(szBuffer)); 605 605 aParms[1].setPointer(szBuffer, sizeof(szBuffer)); 606 int rc2 = pTable->pfnHostCall(pTable->pvService, GUEST_PROP_FN_ GET_PROP_HOST, 4, aParms);606 int rc2 = pTable->pfnHostCall(pTable->pvService, GUEST_PROP_FN_HOST_GET_PROP, 4, aParms); 607 607 608 608 if (s_aGetProperties[i].exists && RT_FAILURE(rc2)) … … 824 824 VBOXHGCMSVCPARM paParm; 825 825 paParm.setUInt32(fFlags); 826 int rc = pTable->pfnHostCall(pTable->pvService, GUEST_PROP_FN_ SET_GLOBAL_FLAGS_HOST, 1, &paParm);826 int rc = pTable->pfnHostCall(pTable->pvService, GUEST_PROP_FN_HOST_SET_GLOBAL_FLAGS, 1, &paParm); 827 827 if (RT_FAILURE(rc)) 828 828 { … … 1009 1009 aParms[0].setString(s_szProp); 1010 1010 aParms[1].setPointer(pvBuf, cbBuf); 1011 svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_ GET_PROP_HOST, RT_ELEMENTS(aParms), aParms);1011 svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_HOST_GET_PROP, RT_ELEMENTS(aParms), aParms); 1012 1012 1013 1013 RTTestGuardedFree(g_hTest, pvBuf); … … 1045 1045 aParms[0].setString("*"); 1046 1046 aParms[1].setPointer(pvBuf, cbBuf); 1047 svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_ ENUM_PROPS_HOST, RT_ELEMENTS(aParms), aParms);1047 svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_HOST_ENUM_PROPS, RT_ELEMENTS(aParms), aParms); 1048 1048 1049 1049 RTTestGuardedFree(g_hTest, pvBuf); … … 1114 1114 aParms[0].setPointer(szProp, (uint32_t)cchProp + 1); 1115 1115 aParms[1].setPointer(szBuffer, sizeof(szBuffer)); 1116 RTTESTI_CHECK_RC_BREAK(svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_ GET_PROP_HOST, 4, aParms), VINF_SUCCESS);1116 RTTESTI_CHECK_RC_BREAK(svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_HOST_GET_PROP, 4, aParms), VINF_SUCCESS); 1117 1117 } 1118 1118 cNsElapsed = RTTimeNanoTS() - cNsElapsed; -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r70061 r70063 1834 1834 parm[2].u.uint32 = 0; 1835 1835 1836 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ ENUM_PROPS_HOST, 3, &parm[0]);1836 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_ENUM_PROPS, 3, &parm[0]); 1837 1837 Utf8Buf.jolt(); 1838 1838 if (parm[2].type != VBOX_HGCM_SVC_PARM_32BIT) … … 5949 5949 parm[3].u.uint32 = 0; 5950 5950 5951 int vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ GET_PROP_HOST,5951 int vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_GET_PROP, 5952 5952 4, &parm[0]); 5953 5953 /* The returned string should never be able to be greater than our buffer */ … … 6018 6018 if (aFlags.isEmpty()) 6019 6019 { 6020 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ SET_PROP_VALUE_HOST, 2, &parm[0]);6020 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_PROP_VALUE, 2, &parm[0]); 6021 6021 } 6022 6022 else … … 6026 6026 parm[2].u.pointer.size = (uint32_t)aFlags.length() + 1; /* The + 1 is the null terminator */ 6027 6027 6028 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ SET_PROP_HOST, 3, &parm[0]);6028 vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_PROP, 3, &parm[0]); 6029 6029 } 6030 6030 … … 6058 6058 parm[0].u.pointer.size = (uint32_t)aName.length() + 1; /* The + 1 is the null terminator */ 6059 6059 6060 int vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ DEL_PROP_HOST, 1, &parm[0]);6060 int vrc = m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_DEL_PROP, 1, &parm[0]); 6061 6061 6062 6062 HRESULT hrc = S_OK; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r70061 r70063 5931 5931 parms[3].u.pointer.size = 0; /* We don't actually care. */ 5932 5932 5933 pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ SET_PROPS_HOST, 4, &parms[0]);5933 pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_PROPS, 4, &parms[0]); 5934 5934 } 5935 5935 … … 5956 5956 parms[2].u.pointer.addr = (void *)pszFlags; 5957 5957 parms[2].u.pointer.size = (uint32_t)strlen(pszFlags) + 1; 5958 pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ SET_PROP_HOST, 3, &parms[0]);5958 pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_PROP, 3, &parms[0]); 5959 5959 } 5960 5960 … … 5970 5970 VBOXHGCMSVCPARM paParm; 5971 5971 paParm.setUInt32(fFlags); 5972 int rc = pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ SET_GLOBAL_FLAGS_HOST, 1, &paParm);5972 int rc = pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_GLOBAL_FLAGS, 1, &paParm); 5973 5973 if (RT_FAILURE(rc)) 5974 5974 { … … 6015 6015 { 6016 6016 VBOXHGCMSVCPARM Params[2]; 6017 int rc2 = pConsole->m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_ GET_DBGF_INFO_FN, 2, &Params[0]);6017 int rc2 = pConsole->m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_GET_DBGF_INFO, 2, &Params[0]); 6018 6018 if (RT_SUCCESS(rc2)) 6019 6019 { 6020 6020 PFNDBGFHANDLEREXT pfnHandler = (PFNDBGFHANDLEREXT)(uintptr_t)Params[0].u.pointer.addr; 6021 void *p Service = (void*)Params[1].u.pointer.addr;6022 DBGFR3InfoRegisterExternal(pUVM, "guestprops", "Display the guest properties", pfnHandler, p Service);6021 void *pvService = Params[1].u.pointer.addr; 6022 DBGFR3InfoRegisterExternal(pUVM, "guestprops", "Display the guest properties", pfnHandler, pvService); 6023 6023 } 6024 6024 }
Note:
See TracChangeset
for help on using the changeset viewer.

