Changeset 51096 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Apr 17, 2014 9:29:40 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93373
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r51092 r51096 9999 9999 DECLCALLBACK(void) Console::drvStatus_UnitChanged(PPDMILEDCONNECTORS pInterface, unsigned iLUN) 10000 10000 { 10001 PDRVMAINSTATUS pThis = (PDRVMAINSTATUS)((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINSTATUS, ILedConnectors));10001 PDRVMAINSTATUS pThis = RT_FROM_MEMBER(pInterface, DRVMAINSTATUS, ILedConnectors); 10002 10002 if (iLUN >= pThis->iFirstLUN && iLUN <= pThis->iLastLUN) 10003 10003 { … … 10021 10021 DECLCALLBACK(int) Console::drvStatus_MediumEjected(PPDMIMEDIANOTIFY pInterface, unsigned uLUN) 10022 10022 { 10023 PDRVMAINSTATUS pThis = (PDRVMAINSTATUS)((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINSTATUS, IMediaNotify));10023 PDRVMAINSTATUS pThis = RT_FROM_MEMBER(pInterface, DRVMAINSTATUS, IMediaNotify); 10024 10024 PPDMDRVINS pDrvIns = pThis->pDrvIns; 10025 10025 LogFunc(("uLUN=%d\n", uLUN)); -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r51092 r51096 284 284 typedef VRDEVoiceOut * PVRDEVoiceOut; 285 285 286 /** Makes a PDRVBLOCK out of a PPDMIBLOCK. */287 #define PDMIHOSTAUDIO_2_DRVAUDIOVRDE(pInterface) ( (PDRVAUDIOVRDE)((uintptr_t)pInterface - RT_OFFSETOF(DRVAUDIOVRDE, IHostAudioR3)) )288 289 286 AudioVRDE::AudioVRDE(Console *console) 290 287 : mpDrv(NULL), … … 684 681 static DECLCALLBACK(int) drvAudioVRDEInitOut(PPDMIHOSTAUDIO pInterface, PPDMHOSTVOICEOUT pHostVoiceOut, audsettings_t *as) 685 682 { 686 PDRVAUDIOVRDE pDrv = PDMIHOSTAUDIO_2_DRVAUDIOVRDE(pInterface); 683 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 684 687 685 PVRDEVoiceOut pVRDEVoiceOut = (PVRDEVoiceOut)pHostVoiceOut; 688 686 LogFlow(("DrvAudioVRDEInitOut: audio input begin cShift=%d\n", pHostVoiceOut->Props.cShift)); … … 696 694 { 697 695 LogFlow(("DrvAudioVRDE: drvAudioVRDEInitIn \n")); 698 PDRVAUDIOVRDE pDrv = PDMIHOSTAUDIO_2_DRVAUDIOVRDE(pInterface);696 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 699 697 PVRDEVoice pVRDEVoice = (PVRDEVoice)pHostVoiceIn; 700 698 pHostVoiceIn->cSamples = 6174; … … 781 779 static DECLCALLBACK(int) drvAudioVRDEPlayOut(PPDMIHOSTAUDIO pInterface, PPDMHOSTVOICEOUT pHostVoiceOut) 782 780 { 783 PDRVAUDIOVRDE pDrv = PDMIHOSTAUDIO_2_DRVAUDIOVRDE(pInterface);781 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 784 782 PVRDEVoiceOut pVRDEVoiceOut = (PVRDEVoiceOut)pHostVoiceOut; 785 783 int live; … … 834 832 static DECLCALLBACK(void) drvAudioVRDEFiniIn(PPDMIHOSTAUDIO pInterface, PPDMHOSTVOICEIN hw) 835 833 { 836 PDRVAUDIOVRDE pDrv = PDMIHOSTAUDIO_2_DRVAUDIOVRDE(pInterface);834 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 837 835 LogFlow(("DrvAudioVRDE: drvAudioVRDEFiniIn \n")); 838 836 pDrv->pConsoleVRDPServer->SendAudioInputEnd(NULL); … … 841 839 static DECLCALLBACK(void) drvAudioVRDEFiniOut(PPDMIHOSTAUDIO pInterface, PPDMHOSTVOICEOUT pHostVoiceOut) 842 840 { 843 PDRVAUDIOVRDE pDrv = PDMIHOSTAUDIO_2_DRVAUDIOVRDE(pInterface);841 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 844 842 LogFlow(("DrvAudioVRDE: audio input end\n")); 845 843 } … … 853 851 static DECLCALLBACK(int) drvAudioVRDEDisableEnableIn(PPDMIHOSTAUDIO pInterface, PPDMHOSTVOICEIN pHostVoiceIn, int cmd) 854 852 { 855 PDRVAUDIOVRDE pDrv = PDMIHOSTAUDIO_2_DRVAUDIOVRDE(pInterface);853 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 856 854 857 855 /* Initialize VRDEVoice and return to VRDP server which returns this struct back to us -
trunk/src/VBox/Main/src-client/KeyboardImpl.cpp
r50962 r51096 61 61 } DRVMAINKEYBOARD, *PDRVMAINKEYBOARD; 62 62 63 /** Converts PDMIVMMDEVCONNECTOR pointer to a DRVMAINVMMDEV pointer. */64 #define PPDMIKEYBOARDCONNECTOR_2_MAINKEYBOARD(pInterface) ( (PDRVMAINKEYBOARD) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINKEYBOARD, IConnector)) )65 66 63 67 64 // constructor / destructor … … 287 284 DECLCALLBACK(void) Keyboard::keyboardLedStatusChange(PPDMIKEYBOARDCONNECTOR pInterface, PDMKEYBLEDS enmLeds) 288 285 { 289 PDRVMAINKEYBOARD pDrv = PPDMIKEYBOARDCONNECTOR_2_MAINKEYBOARD(pInterface);286 PDRVMAINKEYBOARD pDrv = RT_FROM_MEMBER(pInterface, DRVMAINKEYBOARD, IConnector); 290 287 pDrv->pKeyboard->getParent()->onKeyboardLedsChange(RT_BOOL(enmLeds & PDMKEYBLEDS_NUMLOCK), 291 288 RT_BOOL(enmLeds & PDMKEYBLEDS_CAPSLOCK), … … 298 295 DECLCALLBACK(void) Keyboard::keyboardSetActive(PPDMIKEYBOARDCONNECTOR pInterface, bool fActive) 299 296 { 300 PDRVMAINKEYBOARD pDrv = PPDMIKEYBOARDCONNECTOR_2_MAINKEYBOARD(pInterface);297 PDRVMAINKEYBOARD pDrv = RT_FROM_MEMBER(pInterface, DRVMAINKEYBOARD, IConnector); 301 298 if (fActive) 302 299 pDrv->u32DevCaps |= KEYBOARD_DEVCAP_ENABLED; -
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())
Note:
See TracChangeset
for help on using the changeset viewer.