Changeset 40767 in vbox
- Timestamp:
- Apr 5, 2012 9:47:33 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
include/VBox/HostServices/GuestPropertySvc.h (modified) (1 diff)
-
src/VBox/HostServices/GuestProperties/service.cpp (modified) (5 diffs)
-
src/VBox/Main/include/ConsoleImpl.h (modified) (1 diff)
-
src/VBox/Main/src-client/ConsoleImpl2.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/GuestPropertySvc.h
r37980 r40767 260 260 * Takes one 32-bit unsigned integer parameter for the flags. 261 261 */ 262 SET_GLOBAL_FLAGS_HOST = 7 262 SET_GLOBAL_FLAGS_HOST = 7, 263 264 /** 265 * Return the pointer to a debug info function enumerating all guest properties. 266 */ 267 GET_DBGF_INFO_FN = 8 263 268 }; 264 269 -
trunk/src/VBox/HostServices/GuestProperties/service.cpp
r40633 r40767 52 52 #include <iprt/thread.h> 53 53 #include <iprt/time.h> 54 #include <VBox/vmm/dbgf.h> 54 55 55 56 #include <memory> /* for auto_ptr */ … … 359 360 return VINF_SUCCESS; 360 361 } 362 361 363 private: 362 364 static DECLCALLBACK(int) reqThreadFn(RTTHREAD ThreadSelf, void *pvUser); … … 383 385 int hostCall(uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 384 386 int uninit(); 387 void dbgInfoShow(PCDBGFINFOHLP pHlp); 388 static DECLCALLBACK(void) dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs); 385 389 }; 386 390 … … 1252 1256 } 1253 1257 1258 /** 1259 * Enumeration data shared between dbgInfoCallback and Service::dbgInfoShow. 1260 */ 1261 typedef struct ENUMDBGINFO 1262 { 1263 PCDBGFINFOHLP pHlp; 1264 } ENUMDBGINFO; 1265 1266 static DECLCALLBACK(int) dbgInfoCallback(PRTSTRSPACECORE pStr, void *pvUser) 1267 { 1268 Property *pProp = (Property *)pStr; 1269 PCDBGFINFOHLP pHlp = ((ENUMDBGINFO*)pvUser)->pHlp; 1270 1271 char szFlags[MAX_FLAGS_LEN]; 1272 int rc = writeFlags(pProp->mFlags, szFlags); 1273 if (RT_FAILURE(rc)) 1274 RTStrPrintf(szFlags, sizeof(szFlags), "???"); 1275 1276 pHlp->pfnPrintf(pHlp, "%s: '%s', %RU64", 1277 pProp->mName.c_str(), pProp->mValue.c_str(), pProp->mTimestamp); 1278 if (strlen(szFlags)) 1279 pHlp->pfnPrintf(pHlp, " (%s)", szFlags); 1280 pHlp->pfnPrintf(pHlp, "\n"); 1281 return 0; 1282 } 1283 1284 void Service::dbgInfoShow(PCDBGFINFOHLP pHlp) 1285 { 1286 ENUMDBGINFO EnumData = { pHlp }; 1287 RTStrSpaceEnumerate(&mhProperties, dbgInfoCallback, &EnumData); 1288 } 1289 1290 /** 1291 * Handler for debug info. 1292 * 1293 * @param pvUser user pointer. 1294 * @param pHlp The info helper functions. 1295 * @param pszArgs Arguments, ignored. 1296 */ 1297 void Service::dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs) 1298 { 1299 SELF *pSelf = reinterpret_cast<SELF *>(pvUser); 1300 pSelf->dbgInfoShow(pHlp); 1301 } 1302 1254 1303 1255 1304 /** … … 1317 1366 else 1318 1367 rc = VERR_INVALID_PARAMETER; 1368 break; 1369 1370 case GET_DBGF_INFO_FN: 1371 if (cParms != 2) 1372 return VERR_INVALID_PARAMETER; 1373 paParms[0].u.pointer.addr = (void*)(uintptr_t)dbgInfo; 1374 paParms[1].u.pointer.addr = (void*)this; 1319 1375 break; 1320 1376 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r40499 r40767 580 580 bool fAttachDetach, bool fIgnoreConnectFailure); 581 581 582 static DECLCALLBACK(int) configGuestProperties(void *pvConsole );582 static DECLCALLBACK(int) configGuestProperties(void *pvConsole, PVM pVM); 583 583 static DECLCALLBACK(int) configGuestControl(void *pvConsole); 584 584 static DECLCALLBACK(void) vmstateChangeCallback(PVM aVM, VMSTATE aState, -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r40706 r40767 2571 2571 */ 2572 2572 2573 rc = configGuestProperties(this );2573 rc = configGuestProperties(this, pVM); 2574 2574 #endif /* VBOX_WITH_GUEST_PROPS defined */ 2575 2575 … … 4736 4736 * the machine XML and set a couple of initial properties. 4737 4737 */ 4738 /* static */ int Console::configGuestProperties(void *pvConsole )4738 /* static */ int Console::configGuestProperties(void *pvConsole, PVM pVM) 4739 4739 { 4740 4740 #ifdef VBOX_WITH_GUEST_PROPS … … 4760 4760 * change. 4761 4761 */ 4762 4763 { 4764 VBOXHGCMSVCPARM Params[2]; 4765 pConsole->m_pVMMDev->hgcmHostCall("VBoxGuestPropSvc", guestProp::GET_DBGF_INFO_FN, 2, &Params[0]); 4766 PFNDBGFHANDLEREXT pfnHandler = (PFNDBGFHANDLEREXT)(uintptr_t)Params[0].u.pointer.addr; 4767 void *pService = (void*)Params[1].u.pointer.addr; 4768 DBGFR3InfoRegisterExternal(pVM, "guestprops", "Display the guest properties", pfnHandler, pService); 4769 } 4762 4770 4763 4771 /* Sysprep execution by VBoxService. */
Note:
See TracChangeset
for help on using the changeset viewer.

