Changeset 75498 in vbox for trunk/src/VBox/HostServices/GuestProperties
- Timestamp:
- Nov 16, 2018 12:03:41 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 126655
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestProperties/service.cpp
r73511 r75498 394 394 } 395 395 396 #ifdef ASYNC_HOST_NOTIFY397 396 int initialize(); 398 #endif399 397 400 398 private: … … 422 420 int hostCall(uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 423 421 int uninit(); 424 void dbgInfoShow(PCDBGFINFOHLP pHlp);425 422 static DECLCALLBACK(void) dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs); 426 423 … … 1439 1436 static DECLCALLBACK(int) dbgInfoCallback(PRTSTRSPACECORE pStr, void *pvUser) 1440 1437 { 1441 Property *pProp = (Property *)pStr;1442 PCDBGFINFOHLP pHlp = ((ENUMDBGINFO*)pvUser)->pHlp;1438 Property *pProp = (Property *)pStr; 1439 PCDBGFINFOHLP pHlp = ((ENUMDBGINFO *)pvUser)->pHlp; 1443 1440 1444 1441 char szFlags[GUEST_PROP_MAX_FLAGS_LEN]; … … 1447 1444 RTStrPrintf(szFlags, sizeof(szFlags), "???"); 1448 1445 1449 pHlp->pfnPrintf(pHlp, "%s: '%s', %RU64", 1450 pProp->mName.c_str(), pProp->mValue.c_str(), pProp->mTimestamp); 1446 pHlp->pfnPrintf(pHlp, "%s: '%s', %RU64", pProp->mName.c_str(), pProp->mValue.c_str(), pProp->mTimestamp); 1451 1447 if (strlen(szFlags)) 1452 1448 pHlp->pfnPrintf(pHlp, " (%s)", szFlags); … … 1455 1451 } 1456 1452 1457 void Service::dbgInfoShow(PCDBGFINFOHLP pHlp)1458 {1459 ENUMDBGINFO EnumData = { pHlp };1460 RTStrSpaceEnumerate(&mhProperties, dbgInfoCallback, &EnumData);1461 }1462 1453 1463 1454 /** … … 1468 1459 * @param pszArgs Arguments, ignored. 1469 1460 */ 1470 voidService::dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs)1461 DECLCALLBACK(void) Service::dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs) 1471 1462 { 1472 1463 RT_NOREF1(pszArgs); 1473 1464 SELF *pSelf = reinterpret_cast<SELF *>(pvUser); 1474 pSelf->dbgInfoShow(pHlp); 1465 1466 ENUMDBGINFO EnumData = { pHlp }; 1467 RTStrSpaceEnumerate(&pSelf->mhProperties, dbgInfoCallback, &EnumData); 1475 1468 } 1476 1469 … … 1542 1535 break; 1543 1536 1544 case GUEST_PROP_FN_HOST_GET_DBGF_INFO:1545 if (cParms != 2)1546 return VERR_INVALID_PARAMETER;1547 paParms[0].u.pointer.addr = (void*)(uintptr_t)dbgInfo;1548 paParms[1].u.pointer.addr = (void*)this;1549 break;1550 1551 1537 default: 1552 1538 rc = VERR_NOT_SUPPORTED; … … 1564 1550 1565 1551 #ifdef ASYNC_HOST_NOTIFY 1552 1566 1553 /* static */ 1567 1554 DECLCALLBACK(int) Service::threadNotifyHost(RTTHREAD hThreadSelf, void *pvUser) … … 1596 1583 } 1597 1584 1585 #endif /* ASYNC_HOST_NOTIFY */ 1586 1598 1587 int Service::initialize() 1599 1588 { 1589 #ifdef ASYNC_HOST_NOTIFY 1600 1590 /* The host notification thread and queue. */ 1601 1591 int rc = RTReqQueueCreate(&mhReqQNotifyHost); … … 1619 1609 } 1620 1610 } 1611 #else /* !ASYNC_HOST_NOTIFY */ 1612 int rc = VINF_SUCCESS; 1613 #endif /* !ASYNC_HOST_NOTIFY */ 1614 1615 /* Finally debug stuff (ignore failures): */ 1616 if (RT_SUCCESS(rc)) 1617 HGCMSvcHlpInfoRegister(mpHelpers, "guestprops", "Display the guest properties", Service::dbgInfo, this); 1621 1618 1622 1619 return rc; 1623 1620 } 1624 1621 1622 #ifdef ASYNC_HOST_NOTIFY 1625 1623 /** 1626 1624 * @callback_method_impl{FNRTSTRSPACECALLBACK, Destroys Property.} … … 1638 1636 int Service::uninit() 1639 1637 { 1638 if (mpHelpers) 1639 HGCMSvcHlpInfoDeregister(mpHelpers, "guestprops"); 1640 1640 1641 #ifdef ASYNC_HOST_NOTIFY 1641 1642 if (mhReqQNotifyHost != NIL_RTREQQUEUE) … … 1656 1657 } 1657 1658 #endif 1658 1659 1659 return VINF_SUCCESS; 1660 1660 } … … 1667 1667 * @copydoc VBOXHGCMSVCLOAD 1668 1668 */ 1669 extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad 1669 extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad(VBOXHGCMSVCFNTABLE *ptable) 1670 1670 { 1671 1671 int rc = VERR_IPE_UNINITIALIZED_STATUS; … … 1713 1713 ptable->pfnLoadState = NULL; /* construction done before restoring suffices */ 1714 1714 ptable->pfnRegisterExtension = Service::svcRegisterExtension; 1715 ptable->pvService = pService; 1715 1716 1716 1717 /* Service specific initialization. */ 1717 ptable->pvService = pService;1718 1719 #ifdef ASYNC_HOST_NOTIFY1720 1718 rc = pService->initialize(); 1721 1719 if (RT_FAILURE(rc)) … … 1724 1722 pService = NULL; 1725 1723 } 1726 #endif1727 1724 } 1728 1725 else
Note:
See TracChangeset
for help on using the changeset viewer.