- 時間撮記:
- 2014-4-17 上午09:29:40 (11 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Main/src-client/VMMDevInterface.cpp
r51092 r51096 74 74 } DRVMAINVMMDEV, *PDRVMAINVMMDEV; 75 75 76 /** Converts PDMIVMMDEVCONNECTOR pointer to a DRVMAINVMMDEV pointer. */77 #define PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface) ( (PDRVMAINVMMDEV) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINVMMDEV, Connector)) )78 79 #ifdef VBOX_WITH_HGCM80 /** Converts PDMIHGCMCONNECTOR pointer to a DRVMAINVMMDEV pointer. */81 #define PDMIHGCMCONNECTOR_2_MAINVMMDEV(pInterface) ( (PDRVMAINVMMDEV) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINVMMDEV, HGCMConnector)) )82 #endif83 84 76 // 85 77 // constructor / destructor … … 164 156 uint32_t fFlags, PCRTTIMESPEC pTimeSpecTS) 165 157 { 166 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);158 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 167 159 Console *pConsole = pDrv->pVMMDev->getParent(); 168 160 169 161 /* Store that information in IGuest */ 170 162 Guest* guest = pConsole->getGuest(); 171 Assert(guest); 172 if (!guest) 173 return; 163 AssertPtrReturnVoid(guest); 174 164 175 165 guest->setAdditionsStatus((VBoxGuestFacilityType)uFacility, (VBoxGuestFacilityStatus)uStatus, fFlags, pTimeSpecTS); … … 186 176 const uint8_t *puDetails, uint32_t cbDetails) 187 177 { 188 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);178 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 189 179 AssertPtr(pDrv); 190 180 Console *pConsole = pDrv->pVMMDev->getParent(); … … 193 183 /* Store that information in IGuest. */ 194 184 Guest* pGuest = pConsole->getGuest(); 195 AssertPtr(pGuest); 196 if (!pGuest) 197 return; 185 AssertPtrReturnVoid(pGuest); 198 186 199 187 pGuest->onUserStateChange(Bstr(pszUser), Bstr(pszDomain), (VBoxGuestUserState)uState, … … 214 202 DECLCALLBACK(void) vmmdevUpdateGuestInfo(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestInfo *guestInfo) 215 203 { 216 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 217 218 Assert(guestInfo); 219 if (!guestInfo) 220 return; 221 204 AssertPtrReturnVoid(guestInfo); 205 206 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 222 207 Console *pConsole = pDrv->pVMMDev->getParent(); 223 208 224 209 /* Store that information in IGuest */ 225 210 Guest* guest = pConsole->getGuest(); 226 Assert(guest); 227 if (!guest) 228 return; 211 AssertPtrReturnVoid(guest); 229 212 230 213 if (guestInfo->interfaceVersion != 0) … … 266 249 const char *pszName, uint32_t uRevision, uint32_t fFeatures) 267 250 { 268 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);251 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 269 252 AssertPtr(pszName); 270 253 Assert(uFullVersion); … … 272 255 /* Store that information in IGuest. */ 273 256 Guest *pGuest = pDrv->pVMMDev->getParent()->getGuest(); 274 Assert(pGuest); 275 if (!pGuest) 276 return; 257 AssertPtrReturnVoid(pGuest); 277 258 278 259 /* Just pass it on... */ … … 297 278 DECLCALLBACK(void) vmmdevUpdateGuestCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities) 298 279 { 299 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);280 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 300 281 AssertPtr(pDrv); 301 282 Console *pConsole = pDrv->pVMMDev->getParent(); … … 303 284 /* store that information in IGuest */ 304 285 Guest* pGuest = pConsole->getGuest(); 305 AssertPtr(pGuest); 306 if (!pGuest) 307 return; 286 AssertPtrReturnVoid(pGuest); 308 287 309 288 /* … … 330 309 DECLCALLBACK(void) vmmdevUpdateMouseCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t fNewCaps) 331 310 { 332 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);311 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 333 312 Console *pConsole = pDrv->pVMMDev->getParent(); 334 313 … … 363 342 void *pShape) 364 343 { 365 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);344 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 366 345 Console *pConsole = pDrv->pVMMDev->getParent(); 367 346 … … 382 361 DECLCALLBACK(int) iface_VideoAccelEnable(PPDMIVMMDEVCONNECTOR pInterface, bool fEnable, VBVAMEMORY *pVbvaMemory) 383 362 { 384 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);363 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 385 364 Console *pConsole = pDrv->pVMMDev->getParent(); 386 365 … … 397 376 DECLCALLBACK(void) iface_VideoAccelFlush(PPDMIVMMDEVCONNECTOR pInterface) 398 377 { 399 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);378 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 400 379 Console *pConsole = pDrv->pVMMDev->getParent(); 401 380 … … 412 391 uint32_t bpp, bool *fSupported) 413 392 { 414 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);393 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 415 394 Console *pConsole = pDrv->pVMMDev->getParent(); 416 395 … … 441 420 DECLCALLBACK(int) vmmdevGetHeightReduction(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *heightReduction) 442 421 { 443 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);422 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 444 423 Console *pConsole = pDrv->pVMMDev->getParent(); 445 424 … … 456 435 DECLCALLBACK(int) vmmdevSetCredentialsJudgementResult(PPDMIVMMDEVCONNECTOR pInterface, uint32_t u32Flags) 457 436 { 458 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);437 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 459 438 460 439 if (pDrv->pVMMDev) … … 466 445 DECLCALLBACK(int) vmmdevSetVisibleRegion(PPDMIVMMDEVCONNECTOR pInterface, uint32_t cRect, PRTRECT pRect) 467 446 { 468 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);447 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 469 448 Console *pConsole = pDrv->pVMMDev->getParent(); 470 449 … … 477 456 DECLCALLBACK(int) vmmdevQueryVisibleRegion(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcRect, PRTRECT pRect) 478 457 { 479 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);458 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 480 459 Console *pConsole = pDrv->pVMMDev->getParent(); 481 460 … … 496 475 DECLCALLBACK(int) vmmdevQueryStatisticsInterval(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pulInterval) 497 476 { 498 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);477 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 499 478 Console *pConsole = pDrv->pVMMDev->getParent(); 500 479 ULONG val = 0; … … 505 484 /* store that information in IGuest */ 506 485 Guest* guest = pConsole->getGuest(); 507 Assert(guest); 508 if (!guest) 509 return VERR_GENERAL_FAILURE; 486 AssertPtrReturn(guest, VERR_GENERAL_FAILURE); 510 487 511 488 guest->COMGETTER(StatisticsUpdateInterval)(&val); … … 524 501 DECLCALLBACK(int) vmmdevQueryBalloonSize(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcbBalloon) 525 502 { 526 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);503 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 527 504 Console *pConsole = pDrv->pVMMDev->getParent(); 528 505 ULONG val = 0; … … 533 510 /* store that information in IGuest */ 534 511 Guest* guest = pConsole->getGuest(); 535 Assert(guest); 536 if (!guest) 537 return VERR_GENERAL_FAILURE; 512 AssertPtrReturn(guest, VERR_GENERAL_FAILURE); 538 513 539 514 guest->COMGETTER(MemoryBalloonSize)(&val); … … 552 527 DECLCALLBACK(int) vmmdevIsPageFusionEnabled(PPDMIVMMDEVCONNECTOR pInterface, bool *pfPageFusionEnabled) 553 528 { 554 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);529 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 555 530 Console *pConsole = pDrv->pVMMDev->getParent(); 556 531 BOOL val = 0; … … 561 536 /* store that information in IGuest */ 562 537 Guest* guest = pConsole->getGuest(); 563 Assert(guest); 564 if (!guest) 565 return VERR_GENERAL_FAILURE; 538 AssertPtrReturn(guest, VERR_GENERAL_FAILURE); 566 539 567 540 *pfPageFusionEnabled = !!guest->isPageFusionEnabled(); … … 579 552 DECLCALLBACK(int) vmmdevReportStatistics(PPDMIVMMDEVCONNECTOR pInterface, VBoxGuestStatistics *pGuestStats) 580 553 { 581 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 582 Console *pConsole = pDrv->pVMMDev->getParent(); 583 584 Assert(pGuestStats); 585 if (!pGuestStats) 586 return VERR_INVALID_POINTER; 554 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 555 Console *pConsole = pDrv->pVMMDev->getParent(); 556 557 AssertPtrReturn(pGuestStats, VERR_INVALID_POINTER); 587 558 588 559 /* store that information in IGuest */ 589 560 Guest* guest = pConsole->getGuest(); 590 Assert(guest); 591 if (!guest) 592 return VERR_GENERAL_FAILURE; 561 AssertPtrReturn(guest, VERR_GENERAL_FAILURE); 593 562 594 563 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_IDLE) … … 633 602 LogSunlover(("Enter\n")); 634 603 635 PDRVMAINVMMDEV pDrv = PDMIHGCMCONNECTOR_2_MAINVMMDEV(pInterface);604 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, HGCMConnector); 636 605 637 606 if ( !pServiceLocation … … 652 621 LogSunlover(("Enter\n")); 653 622 654 PDRVMAINVMMDEV pDrv = PDMIHGCMCONNECTOR_2_MAINVMMDEV(pInterface);623 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, HGCMConnector); 655 624 656 625 if (!pDrv->pVMMDev || !pDrv->pVMMDev->hgcmIsActive()) … … 665 634 LogSunlover(("Enter\n")); 666 635 667 PDRVMAINVMMDEV pDrv = PDMIHGCMCONNECTOR_2_MAINVMMDEV(pInterface);636 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, HGCMConnector); 668 637 669 638 if (!pDrv->pVMMDev || !pDrv->pVMMDev->hgcmIsActive())
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器