Changeset 90804 in vbox
- Timestamp:
- Aug 23, 2021 7:08:53 PM (3 years ago)
- Location:
- trunk/src/VBox/HostDrivers
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r87235 r90804 99 99 { 100 100 PVM pVM = CreateVMReq.pVMR3; 101 AssertRelease( VALID_PTR(pVM));101 AssertRelease(RT_VALID_PTR(pVM)); 102 102 AssertRelease(pVM->pVMR0ForCall == CreateVMReq.pVMR0); 103 103 AssertRelease(pVM->pSession == pSession); -
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r85344 r90804 752 752 uint64_t NanoTS = RTTimeSystemNanoTS(); 753 753 LogFlow(("vboxNetFltDarwinIffDetached: pThis=%p NanoTS=%RU64 (%d)\n", 754 pThis, NanoTS, VALID_PTR(pIfNet) ? VBOX_GET_PCOUNT(pIfNet) : -1));754 pThis, NanoTS, RT_VALID_PTR(pIfNet) ? VBOX_GET_PCOUNT(pIfNet) : -1)); 755 755 756 756 Assert(!pThis->fDisconnectedFromHost); … … 771 771 772 772 pIfNet = ASMAtomicUoReadPtrT(&pThis->u.s.pIfNet, ifnet_t); 773 int cPromisc = VALID_PTR(pIfNet) ? VBOX_GET_PCOUNT(pIfNet) : - 1;773 int cPromisc = RT_VALID_PTR(pIfNet) ? VBOX_GET_PCOUNT(pIfNet) : - 1; 774 774 775 775 ASMAtomicUoWriteNullPtr(&pThis->u.s.pIfNet); … … 836 836 * Watch out for the interface going online / offline. 837 837 */ 838 if ( 839 && 840 && 841 && 842 && 838 if ( RT_VALID_PTR(pThis) 839 && RT_VALID_PTR(pEvMsg) 840 && pEvMsg->vendor_code == KEV_VENDOR_APPLE 841 && pEvMsg->kev_class == KEV_NETWORK_CLASS 842 && pEvMsg->kev_subclass == KEV_DL_SUBCLASS) 843 843 { 844 844 if (pThis->u.s.pIfNet == pIfNet) … … 881 881 } 882 882 else 883 Log(("vboxNetFltDarwinIffEvent: pThis->u.s.pIfNet=%p pIfNet=%p (%d)\n", pThis->u.s.pIfNet, pIfNet, VALID_PTR(pIfNet) ? VBOX_GET_PCOUNT(pIfNet) : -1));884 } 885 else if ( VALID_PTR(pEvMsg))883 Log(("vboxNetFltDarwinIffEvent: pThis->u.s.pIfNet=%p pIfNet=%p (%d)\n", pThis->u.s.pIfNet, pIfNet, RT_VALID_PTR(pIfNet) ? VBOX_GET_PCOUNT(pIfNet) : -1)); 884 } 885 else if (RT_VALID_PTR(pEvMsg)) 886 886 Log(("vboxNetFltDarwinIffEvent: vendor_code=%#x kev_class=%#x kev_subclass=%#x event_code=%#x\n", 887 887 pEvMsg->vendor_code, pEvMsg->kev_class, pEvMsg->kev_subclass, pEvMsg->event_code)); -
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r90249 r90804 403 403 * careful here and avoid the race. 404 404 */ 405 if ( ! VALID_PTR(pOverride)405 if ( !RT_VALID_PTR(pOverride) 406 406 || pOverride->u32Magic != VBOXNETDEVICEOPSOVERRIDE_MAGIC 407 407 # if RTLNX_VER_MIN(2,6,29) 408 || ! VALID_PTR(pOverride->pOrgOps)409 # endif /* RTLNX_VER_MIN(2,6,29) */408 || !RT_VALID_PTR(pOverride->pOrgOps) 409 # endif 410 410 ) 411 411 { … … 427 427 pEtherHdr = (PCRTNETETHERHDR)skb_header_pointer(pSkb, 0, cbHdrs, &abHdrBuf[0]); 428 428 if ( pEtherHdr 429 && VALID_PTR(pOverride->pVBoxNetFlt)429 && RT_VALID_PTR(pOverride->pVBoxNetFlt) 430 430 && (pSwitchPort = pOverride->pVBoxNetFlt->pSwitchPort) != NULL 431 && VALID_PTR(pSwitchPort)431 && RT_VALID_PTR(pSwitchPort) 432 432 && cbHdrs >= 6) 433 433 { … … 458 458 459 459 /* Cancel override if ethtool_ops is missing (host-only case, @bugref{5712}) */ 460 if (! VALID_PTR(pDev->OVR_OPS))460 if (!RT_VALID_PTR(pDev->OVR_OPS)) 461 461 return; 462 462 pOverride = RTMemAlloc(sizeof(*pOverride)); … … 497 497 if (!pDev) 498 498 pDev = ASMAtomicUoReadPtrT(&pThis->u.s.pDev, struct net_device *); 499 if ( VALID_PTR(pDev))499 if (RT_VALID_PTR(pDev)) 500 500 { 501 501 pOverride = (PVBOXNETDEVICEOPSOVERRIDE)pDev->OVR_OPS; 502 if ( 503 && 504 && 502 if ( RT_VALID_PTR(pOverride) 503 && pOverride->u32Magic == VBOXNETDEVICEOPSOVERRIDE_MAGIC 504 && RT_VALID_PTR(pOverride->pOrgOps) 505 505 ) 506 506 { -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFltBow-solaris.c
r90785 r90804 722 722 723 723 PVBOXNETFLTINS pThis = pvArg; 724 Assert ReturnVoid(VALID_PTR(pThis));725 Assert ReturnVoid(pThis->u.s.hInterface);724 AssertPtrReturnVoid(pThis); 725 AssertPtrReturnVoid(pThis->u.s.hInterface); 726 726 727 727 switch (Type) … … 1475 1475 */ 1476 1476 PVBOXNETFLTVNIC pVNIC = pvIfData; 1477 Assert MsgReturnVoid(VALID_PTR(pVNIC) && pVNIC->u32Magic == VBOXNETFLTVNIC_MAGIC,1478 ("Invalid pVNIC=%p magic=%#x (expected %#x)\n", pvIfData,1479 VALID_PTR(pVNIC) ? pVNIC->u32Magic : 0, VBOXNETFLTVNIC_MAGIC));1477 AssertPtrReturnVoid(pVNIC); 1478 AssertMsgReturnVoid(pVNIC->u32Magic == VBOXNETFLTVNIC_MAGIC, 1479 ("Invalid pVNIC=%p magic=%#x (expected %#x)\n", pvIfData, pVNIC->u32Magic, VBOXNETFLTVNIC_MAGIC)); 1480 1480 AssertMsgReturnVoid(pVNIC->hLinkId != DATALINK_INVALID_LINKID, 1481 ("Invalid hLinkId pVNIC=%p magic=%#x\n", pVNIC, pVNIC->u32Magic));1481 ("Invalid hLinkId pVNIC=%p magic=%#x\n", pVNIC, pVNIC->u32Magic)); 1482 1482 1483 1483 /* -
trunk/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp
r82968 r90804 308 308 USBLIB_DECL(int) USBFilterValidate(PCUSBFILTER pFilter) 309 309 { 310 if (! VALID_PTR(pFilter))310 if (!RT_VALID_PTR(pFilter)) 311 311 return VERR_INVALID_POINTER; 312 312 -
trunk/src/VBox/HostDrivers/VBoxUSB/VBoxUSBFilterMgr.cpp
r82968 r90804 236 236 if (!Owner || Owner == VBOXUSBFILTER_CONTEXT_NIL) 237 237 return VERR_INVALID_PARAMETER; 238 if (! VALID_PTR(puId))238 if (!RT_VALID_PTR(puId)) 239 239 return VERR_INVALID_POINTER; 240 240 -
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
r88264 r90804 1358 1358 #define CHECKRET_MIN_SIZE(mnemonic, cbMin) \ 1359 1359 do { \ 1360 if ( cbData < (cbMin)) \1360 if (RT_UNLIKELY(cbData < (cbMin))) \ 1361 1361 { \ 1362 1362 LogRel((DEVICE_NAME ": vboxUsbSolarisProcessIOCtl: " mnemonic ": cbData=%#zx (%zu) min is %#zx (%zu)\n", \ … … 1364 1364 return VERR_BUFFER_OVERFLOW; \ 1365 1365 } \ 1366 if ( (cbMin) != 0 && !VALID_PTR(pvBuf)) \1366 if (RT_UNLIKELY((cbMin) != 0 && !RT_VALID_PTR(pvBuf))) \ 1367 1367 { \ 1368 1368 LogRel((DEVICE_NAME ": vboxUsbSolarisProcessIOCtl: " mnemonic ": Invalid pointer %p\n", pvBuf)); \ -
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBMon-solaris.c
r82968 r90804 578 578 } 579 579 if (RT_UNLIKELY( ReqWrap.cbData != 0 580 && ! VALID_PTR(pvBuf)))580 && !RT_VALID_PTR(pvBuf))) 581 581 { 582 582 RTMemTmpFree(pvBuf); … … 658 658 #define CHECKRET_MIN_SIZE(mnemonic, cbMin) \ 659 659 do { \ 660 if ( cbData < (cbMin)) \660 if (RT_UNLIKELY(cbData < (cbMin))) \ 661 661 { \ 662 662 LogRel(("vboxUSBSolarisProcessIOCtl: " mnemonic ": cbData=%#zx (%zu) min is %#zx (%zu)\n", \ … … 664 664 return VERR_BUFFER_OVERFLOW; \ 665 665 } \ 666 if ( (cbMin) != 0 && !VALID_PTR(pvData)) \666 if (RT_UNLIKELY((cbMin) != 0 && !RT_VALID_PTR(pvData))) \ 667 667 { \ 668 668 LogRel(("vboxUSBSolarisProcessIOCtl: " mnemonic ": Invalid pointer %p\n", pvData)); \ -
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp
r88531 r90804 296 296 PDEVICE_RELATIONS pRel = (PDEVICE_RELATIONS)IoStatus.Information; 297 297 LOG(("pRel = %p", pRel)); 298 if (VALID_PTR(pRel)) 299 { 298 if (RT_VALID_PTR(pRel)) 300 299 *pDevRelations = pRel; 301 }302 300 else 303 301 { … … 370 368 { 371 369 WCHAR *pId = (WCHAR *)pIoStatus->Information; 372 if ( VALID_PTR(pId))370 if (RT_VALID_PTR(pId)) 373 371 { 374 372 KIRQL Iqrl = KeGetCurrentIrql(); … … 421 419 WCHAR *pTmp; 422 420 #endif 423 if ( VALID_PTR(pId))421 if (RT_VALID_PTR(pId)) 424 422 { 425 423 KIRQL Iqrl = KeGetCurrentIrql(); … … 582 580 PDEVICE_RELATIONS pRel = (PDEVICE_RELATIONS)pIoStatus->Information; 583 581 LOG(("pRel = %p", pRel)); 584 if ( VALID_PTR(pRel))582 if (RT_VALID_PTR(pRel)) 585 583 { 586 584 for (unsigned i=0;i<pRel->Count;i++) … … 615 613 { 616 614 PDEVICE_CAPABILITIES pCaps = pSl->Parameters.DeviceCapabilities.Capabilities; 617 if ( VALID_PTR(pCaps))615 if (RT_VALID_PTR(pCaps)) 618 616 { 619 617 LOG(("Caps.SilentInstall = %d", pCaps->SilentInstall));
Note:
See TracChangeset
for help on using the changeset viewer.