Changeset 90789 in vbox
- Timestamp:
- Aug 23, 2021 10:27:29 AM (3 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldr.cpp
r82968 r90789 50 50 AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), VERR_INVALID_HANDLE); 51 51 AssertMsgReturn(pszSymbol, ("pszSymbol=%p\n", pszSymbol), VERR_INVALID_PARAMETER); 52 Assert MsgReturn(VALID_PTR(ppvValue), ("ppvValue=%p\n", ppvValue), VERR_INVALID_PARAMETER);52 AssertPtrReturn(ppvValue, VERR_INVALID_POINTER); 53 53 PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod; 54 54 //AssertMsgReturn(pMod->eState == LDR_STATE_OPENED, ("eState=%d\n", pMod->eState), VERR_WRONG_ORDER); -
trunk/src/VBox/Runtime/common/ldr/ldrEx.cpp
r89969 r90789 279 279 */ 280 280 AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), VERR_INVALID_HANDLE); 281 Assert MsgReturn(VALID_PTR(pvBits), ("pvBits=%p\n", pvBits), VERR_INVALID_PARAMETER);282 Assert MsgReturn(VALID_PTR(pfnGetImport), ("pfnGetImport=%p\n", pfnGetImport), VERR_INVALID_PARAMETER);281 AssertPtrReturn(pvBits, VERR_INVALID_POINTER); 282 AssertPtrReturn(pfnGetImport, VERR_INVALID_POINTER); 283 283 PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod; 284 284 AssertMsgReturn(pMod->eState == LDR_STATE_OPENED, ("eState=%d\n", pMod->eState), VERR_WRONG_ORDER); … … 395 395 AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), VERR_INVALID_HANDLE); 396 396 AssertMsgReturn(!pvBits || VALID_PTR(pvBits), ("pvBits=%p\n", pvBits), VERR_INVALID_PARAMETER); 397 Assert MsgReturn(VALID_PTR(pfnCallback), ("pfnCallback=%p\n", pfnCallback), VERR_INVALID_PARAMETER);397 AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER); 398 398 PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod; 399 399 //AssertMsgReturn(pMod->eState == LDR_STATE_OPENED, ("eState=%d\n", pMod->eState), VERR_WRONG_ORDER); … … 419 419 AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), VERR_INVALID_HANDLE); 420 420 AssertMsgReturn(!pvBits || RT_VALID_PTR(pvBits), ("pvBits=%p\n", pvBits), VERR_INVALID_PARAMETER); 421 Assert MsgReturn(RT_VALID_PTR(pfnCallback), ("pfnCallback=%p\n", pfnCallback), VERR_INVALID_PARAMETER);421 AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER); 422 422 PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod; 423 423 //AssertMsgReturn(pMod->eState == LDR_STATE_OPENED, ("eState=%d\n", pMod->eState), VERR_WRONG_ORDER); … … 447 447 */ 448 448 AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), VERR_INVALID_HANDLE); 449 Assert MsgReturn(RT_VALID_PTR(pfnCallback), ("pfnCallback=%p\n", pfnCallback), VERR_INVALID_PARAMETER);449 AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER); 450 450 PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod; 451 451 //AssertMsgReturn(pMod->eState == LDR_STATE_OPENED, ("eState=%d\n", pMod->eState), VERR_WRONG_ORDER); -
trunk/src/VBox/Runtime/generic/RTFileCopyByHandlesEx-generic.cpp
r82968 r90789 45 45 AssertMsgReturn(RTFileIsValid(hFileSrc), ("hFileSrc=%RTfile\n", hFileSrc), VERR_INVALID_PARAMETER); 46 46 AssertMsgReturn(RTFileIsValid(hFileDst), ("hFileDst=%RTfile\n", hFileDst), VERR_INVALID_PARAMETER); 47 Assert MsgReturn(!pfnProgress || VALID_PTR(pfnProgress), ("pfnProgress=%p\n", pfnProgress), VERR_INVALID_PARAMETER);47 AssertPtrNullReturn(pfnProgress, VERR_INVALID_POINTER); 48 48 49 49 /* -
trunk/src/VBox/Runtime/generic/RTFileCopyEx-generic.cpp
r82968 r90789 41 41 * Validate input. 42 42 */ 43 Assert MsgReturn(VALID_PTR(pszSrc), ("pszSrc=%p\n", pszSrc), VERR_INVALID_PARAMETER);43 AssertPtrReturn(pszSrc, VERR_INVALID_POINTER); 44 44 AssertMsgReturn(*pszSrc, ("pszSrc=%p\n", pszSrc), VERR_INVALID_PARAMETER); 45 Assert MsgReturn(VALID_PTR(pszDst), ("pszDst=%p\n", pszDst), VERR_INVALID_PARAMETER);45 AssertPtrReturn(pszDst, VERR_INVALID_POINTER); 46 46 AssertMsgReturn(*pszDst, ("pszDst=%p\n", pszDst), VERR_INVALID_PARAMETER); 47 Assert MsgReturn(!pfnProgress || VALID_PTR(pfnProgress), ("pfnProgress=%p\n", pfnProgress), VERR_INVALID_PARAMETER);47 AssertPtrReturn(pfnProgress, VERR_INVALID_POINTER); 48 48 AssertMsgReturn(!(fFlags & ~RTFILECOPY_FLAGS_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER); 49 49 -
trunk/src/VBox/Runtime/include/internal/dir.h
r85121 r90789 162 162 DECLINLINE(bool) rtDirValidHandle(PRTDIRINTERNAL pDir) 163 163 { 164 Assert MsgReturn(VALID_PTR(pDir), ("%p\n", pDir), false);164 AssertPtrReturn(pDir, false); 165 165 AssertMsgReturn(pDir->u32Magic == RTDIR_MAGIC, ("%#RX32\n", pDir->u32Magic), false); 166 166 return true; -
trunk/src/VBox/Runtime/include/internal/ldr.h
r86524 r90789 576 576 DECLINLINE(bool) rtldrIsValid(RTLDRMOD hLdrMod) 577 577 { 578 return VALID_PTR(hLdrMod)578 return RT_VALID_PTR(hLdrMod) 579 579 && ((PRTLDRMODINTERNAL)hLdrMod)->u32Magic == RTLDRMOD_MAGIC; 580 580 } -
trunk/src/VBox/Runtime/r0drv/solaris/semeventwait-r0drv-solaris.h
r82968 r90789 201 201 kthread_t *pThread = pWait->pThread; 202 202 kmutex_t *pMtx = (kmutex_t *)ASMAtomicReadPtr(&pWait->pvMtx); 203 if ( VALID_PTR(pMtx))203 if (RT_VALID_PTR(pMtx)) 204 204 { 205 205 /* Enter the mutex here to make sure the thread has gone to sleep … … 234 234 kthread_t *pThread = pWait->pThread; 235 235 kmutex_t *pMtx = (kmutex_t *)ASMAtomicReadPtr((void * volatile *)&pWait->pvMtx); 236 if ( VALID_PTR(pMtx))236 if (RT_VALID_PTR(pMtx)) 237 237 { 238 238 /* Enter the mutex here to make sure the thread has gone to sleep -
trunk/src/VBox/Runtime/r3/darwin/krnlmod-darwin.cpp
r86300 r90789 229 229 uint32_t *pcEntries) 230 230 { 231 AssertReturn(VALID_PTR(pahKrnlModInfo) || cEntriesMax == 0, VERR_INVALID_PARAMETER); 231 AssertPtrReturn(pahKrnlModInfo, VERR_INVALID_POINTER); 232 AssertReturn(cEntriesMax == 0, VERR_INVALID_PARAMETER); 232 233 233 234 int rc = VINF_SUCCESS; -
trunk/src/VBox/Runtime/r3/linux/RTFileSetAllocationSize-linux.cpp
r82968 r90789 56 56 VERR_NOT_SUPPORTED); 57 57 58 int rc = VINF_SUCCESS;58 int rc; 59 59 PFNLNXFALLOCATE pfnLnxFAllocate = (PFNLNXFALLOCATE)(uintptr_t)dlsym(RTLD_DEFAULT, "fallocate64"); 60 if ( VALID_PTR(pfnLnxFAllocate))60 if (RT_VALID_PTR(pfnLnxFAllocate)) 61 61 { 62 62 int fLnxFlags = (fFlags & RTFILE_ALLOC_SIZE_F_KEEP_SIZE) ? LNX_FALLOC_FL_KEEP_SIZE : 0; 63 63 int rcLnx = pfnLnxFAllocate(RTFileToNative(hFile), fLnxFlags, 0, cbSize); 64 if (rcLnx != 0) 65 { 66 if (errno == EOPNOTSUPP) 67 rc = VERR_NOT_SUPPORTED; 68 else 69 rc = RTErrConvertFromErrno(errno); 70 } 64 if (rcLnx == 0) 65 rc = VINF_SUCCESS; 66 else if (errno == EOPNOTSUPP) 67 rc = VERR_NOT_SUPPORTED; 68 else 69 rc = RTErrConvertFromErrno(errno); 71 70 } 72 71 else -
trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp
r82968 r90789 451 451 * completion port. 452 452 */ 453 AssertMsg(VALID_PTR(pReqInt->pCtxInt), 454 ("Invalid state. Request was canceled but wasn't submitted\n")); 453 AssertMsg(RT_VALID_PTR(pReqInt->pCtxInt), ("Invalid state. Request was canceled but wasn't submitted\n")); 455 454 456 455 ASMAtomicDecS32(&pReqInt->pCtxInt->cRequests); -
trunk/src/VBox/Runtime/r3/linux/krnlmod-linux.cpp
r86301 r90789 196 196 uint32_t *pcEntries) 197 197 { 198 AssertReturn(VALID_PTR(pahKrnlModInfo) || cEntriesMax == 0, VERR_INVALID_PARAMETER); 198 AssertPtrReturn(pahKrnlModInfo, VERR_INVALID_POINTER); 199 AssertReturn(cEntriesMax == 0, VERR_INVALID_PARAMETER); 199 200 200 201 uint32_t cKmodsLoaded = RTKrnlModLoadedGetCount(); -
trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp
r82968 r90789 202 202 */ 203 203 struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem; 204 Assert Return(VALID_PTR(pThis) && pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,205 204 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 205 AssertReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, VERR_INVALID_HANDLE); 206 206 207 207 #ifdef RTSEMEVENTMULTI_STRICT … … 236 236 */ 237 237 struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem; 238 Assert Return(VALID_PTR(pThis) && pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,239 238 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 239 AssertReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, VERR_INVALID_HANDLE); 240 240 #ifdef RT_STRICT 241 241 int32_t i = pThis->iState; -
trunk/src/VBox/Runtime/r3/posix/fs-posix.cpp
r82968 r90789 58 58 * Validate input. 59 59 */ 60 AssertMsgReturn(VALID_PTR(pszFsPath) && *pszFsPath, ("%p", pszFsPath), VERR_INVALID_PARAMETER); 60 AssertPtrReturn(pszFsPath, VERR_INVALID_POINTER); 61 AssertReturn(*pszFsPath != '\0', VERR_INVALID_PARAMETER); 61 62 62 63 /* … … 103 104 * Validate input. 104 105 */ 105 AssertMsgReturn(VALID_PTR(pszFsPath) && *pszFsPath, ("%p", pszFsPath), VERR_INVALID_PARAMETER); 106 AssertMsgReturn(VALID_PTR(pu32Serial), ("%p", pu32Serial), VERR_INVALID_PARAMETER); 106 AssertPtrReturn(pszFsPath, VERR_INVALID_POINTER); 107 AssertReturn(*pszFsPath != '\0', VERR_INVALID_PARAMETER); 108 AssertPtrReturn(pu32Serial, VERR_INVALID_POINTER); 107 109 108 110 /* … … 135 137 * Validate. 136 138 */ 137 AssertMsgReturn(VALID_PTR(pszFsPath) && *pszFsPath, ("%p", pszFsPath), VERR_INVALID_PARAMETER); 138 AssertMsgReturn(VALID_PTR(pProperties), ("%p", pProperties), VERR_INVALID_PARAMETER); 139 AssertPtrReturn(pszFsPath, VERR_INVALID_POINTER); 140 AssertReturn(*pszFsPath != '\0', VERR_INVALID_PARAMETER); 141 AssertPtrReturn(pProperties, VERR_INVALID_POINTER); 139 142 140 143 /* -
trunk/src/VBox/Runtime/r3/solaris/fileaio-solaris.cpp
r82968 r90789 237 237 * completion port. 238 238 */ 239 AssertMsg(VALID_PTR(pReqInt->pCtxInt), 240 ("Invalid state. Request was canceled but wasn't submitted\n")); 239 AssertMsg(RT_VALID_PTR(pReqInt->pCtxInt), ("Invalid state. Request was canceled but wasn't submitted\n")); 241 240 242 241 ASMAtomicDecS32(&pReqInt->pCtxInt->cRequests); -
trunk/src/VBox/Runtime/r3/solaris/krnlmod-solaris.cpp
r86301 r90789 196 196 uint32_t *pcEntries) 197 197 { 198 AssertReturn(VALID_PTR(pahKrnlModInfo) || cEntriesMax == 0, VERR_INVALID_PARAMETER); 198 AssertPtrReturn(pahKrnlModInfo, VERR_INVALID_POINTER); 199 AssertReturn(cEntriesMax == 0, VERR_INVALID_PARAMETER); 199 200 200 201 uint32_t cKmodsLoaded = RTKrnlModLoadedGetCount(); -
trunk/src/VBox/Runtime/r3/win/fs-win.cpp
r82968 r90789 187 187 * Validate & get valid root path. 188 188 */ 189 AssertMsgReturn(VALID_PTR(pszFsPath) && *pszFsPath, ("%p", pszFsPath), VERR_INVALID_PARAMETER); 189 AssertPtrReturn(pszFsPath, VERR_INVALID_POINTER); 190 AssertReturn(*pszFsPath != '\0', VERR_INVALID_PARAMETER); 190 191 PRTUTF16 pwszFsRoot; 191 192 int rc = rtFsGetRoot(pszFsPath, &pwszFsRoot); … … 258 259 * Validate & get valid root path. 259 260 */ 260 AssertMsgReturn(VALID_PTR(pszFsPath) && *pszFsPath, ("%p", pszFsPath), VERR_INVALID_PARAMETER); 261 AssertMsgReturn(VALID_PTR(pu32Serial), ("%p", pu32Serial), VERR_INVALID_PARAMETER); 261 AssertPtrReturn(pszFsPath, VERR_INVALID_POINTER); 262 AssertReturn(*pszFsPath != '\0', VERR_INVALID_PARAMETER); 263 AssertPtrReturn(pu32Serial, VERR_INVALID_POINTER); 262 264 PRTUTF16 pwszFsRoot; 263 265 int rc = rtFsGetRoot(pszFsPath, &pwszFsRoot); … … 298 300 * Validate & get valid root path. 299 301 */ 300 AssertMsgReturn(VALID_PTR(pszFsPath) && *pszFsPath, ("%p", pszFsPath), VERR_INVALID_PARAMETER); 301 AssertMsgReturn(VALID_PTR(pProperties), ("%p", pProperties), VERR_INVALID_PARAMETER); 302 AssertPtrReturn(pszFsPath, VERR_INVALID_POINTER); 303 AssertReturn(*pszFsPath != '\0', VERR_INVALID_PARAMETER); 304 AssertPtrReturn(pProperties, VERR_INVALID_POINTER); 302 305 PRTUTF16 pwszFsRoot; 303 306 int rc = rtFsGetRoot(pszFsPath, &pwszFsRoot); -
trunk/src/VBox/Runtime/r3/win/krnlmod-win.cpp
r86301 r90789 186 186 uint32_t *pcEntries) 187 187 { 188 AssertReturn(VALID_PTR(pahKrnlModInfo) || cEntriesMax == 0, VERR_INVALID_PARAMETER); 188 AssertPtrReturn(pahKrnlModInfo, VERR_INVALID_POINTER); 189 AssertReturn(cEntriesMax == 0, VERR_INVALID_PARAMETER); 189 190 190 191 PRTL_PROCESS_MODULES pKrnlMods = NULL; -
trunk/src/VBox/Runtime/r3/win/serialport-win.cpp
r86017 r90789 334 334 { 335 335 AssertPtrReturn(phSerialPort, VERR_INVALID_POINTER); 336 AssertReturn( VALID_PTR(pszPortAddress) && *pszPortAddress != '\0', VERR_INVALID_PARAMETER);336 AssertReturn(RT_VALID_PTR(pszPortAddress) && *pszPortAddress != '\0', VERR_INVALID_PARAMETER); 337 337 AssertReturn(!(fFlags & ~RTSERIALPORT_OPEN_F_VALID_MASK), VERR_INVALID_PARAMETER); 338 338 AssertReturn((fFlags & RTSERIALPORT_OPEN_F_READ) || (fFlags & RTSERIALPORT_OPEN_F_WRITE),
Note:
See TracChangeset
for help on using the changeset viewer.