Changeset 15841 in vbox
- Timestamp:
- Jan 7, 2009 4:40:02 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/err.h
r14645 r15841 495 495 /** A page count is ouf of range. */ 496 496 #define VERR_PAGE_COUNT_OUT_OF_RANGE (-84) 497 /** Generic object destroyed status. */ 498 #define VERR_OBJECT_DESTROYED (-85) 499 /** Generic object was destroyed by the call status. */ 500 #define VINF_OBJECT_DESTROYED 85 501 /** Generic dangling objects status. */ 502 #define VERR_DANGLING_OBJECTS (-86) 503 /** Generic dangling objects status. */ 504 #define VWRN_DANGLING_OBJECTS 86 497 505 /** @} */ 498 506 -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r15838 r15841 1822 1822 AssertReturn(SUP_IS_SESSION_VALID(pSession), VERR_INVALID_PARAMETER); 1823 1823 AssertPtrReturn(pObj, VERR_INVALID_POINTER); 1824 AssertMsgReturn(pObj->u32Magic == SUPDRVOBJ_MAGIC || pObj->u32Magic == SUPDRVOBJ_MAGIC + 1,1825 ("Invalid pvObj=%p magic=%#x (expected %#x or %#x)\n", pvObj, pObj->u32Magic, SUPDRVOBJ_MAGIC, SUPDRVOBJ_MAGIC + 1),1824 AssertMsgReturn(pObj->u32Magic == SUPDRVOBJ_MAGIC || pObj->u32Magic == SUPDRVOBJ_MAGIC_DEAD, 1825 ("Invalid pvObj=%p magic=%#x (expected %#x or %#x)\n", pvObj, pObj->u32Magic, SUPDRVOBJ_MAGIC, SUPDRVOBJ_MAGIC_DEAD), 1826 1826 VERR_INVALID_PARAMETER); 1827 1827 … … 1913 1913 * 1914 1914 * @returns IPRT status code. 1915 * @retval VINF_SUCCESS if not destroyed. 1916 * @retval VINF_OBJECT_DESTROYED if it's destroyed by this release call. 1917 * @retval VERR_INVALID_PARAMETER if the object isn't valid. Will assert in 1918 * string builds. 1919 * 1915 1920 * @param pvObj The identifier returned by SUPR0ObjRegister(). 1916 1921 * @param pSession The session which is referencing the object. … … 1921 1926 PSUPDRVDEVEXT pDevExt = pSession->pDevExt; 1922 1927 PSUPDRVOBJ pObj = (PSUPDRVOBJ)pvObj; 1923 bool fDestroy = false;1928 int rc = VERR_INVALID_PARAMETER; 1924 1929 PSUPDRVUSAGE pUsage; 1925 1930 PSUPDRVUSAGE pUsagePrev; … … 1945 1950 if (pUsage->pObj == pObj) 1946 1951 { 1952 rc = VINF_SUCCESS; 1947 1953 AssertMsg(pUsage->cUsage >= 1 && pObj->cUsage >= pUsage->cUsage, ("glob %d; sess %d\n", pObj->cUsage, pUsage->cUsage)); 1948 1954 if (pUsage->cUsage > 1) … … 1971 1977 * Object is to be destroyed, unlink it. 1972 1978 */ 1973 pObj->u32Magic = SUPDRVOBJ_MAGIC + 1;1974 fDestroy = true;1979 pObj->u32Magic = SUPDRVOBJ_MAGIC_DEAD; 1980 rc = VINF_OBJECT_DESTROYED; 1975 1981 if (pDevExt->pObjs == pObj) 1976 1982 pDevExt->pObjs = pObj->pNext; … … 1997 2003 * Call the destructor and free the object if required. 1998 2004 */ 1999 if ( fDestroy)2005 if (rc == VINF_OBJECT_DESTROYED) 2000 2006 { 2001 2007 Log(("SUPR0ObjRelease: destroying %p/%d (%p/%p) cpid=%RTproc pid=%RTproc dtor=%p\n", … … 2011 2017 2012 2018 AssertMsg(pUsage, ("pvObj=%p\n", pvObj)); 2013 return pUsage ? VINF_SUCCESS : VERR_INVALID_PARAMETER;2019 return rc; 2014 2020 } 2015 2021 … … 3573 3579 if (RT_UNLIKELY((uintptr_t)pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImage)) 3574 3580 { 3575 rc = VERR_ SHARING_VIOLATION; /** @todo VERR_DANGLING_OBJECTS */3581 rc = VERR_DANGLING_OBJECTS; 3576 3582 break; 3577 3583 } … … 3583 3589 if (RT_UNLIKELY((uintptr_t)pGenUsage->pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImage)) 3584 3590 { 3585 rc = VERR_ SHARING_VIOLATION; /** @todo VERR_DANGLING_OBJECTS */3591 rc = VERR_DANGLING_OBJECTS; 3586 3592 break; 3587 3593 } … … 3610 3616 } 3611 3617 else 3618 { 3612 3619 Log(("supdrvIOCtl_LdrFree: Dangling objects in %p/%s!\n", pImage->pvImage, pImage->szName)); 3620 rc = VINF_SUCCESS; /** @todo BRANCH-2.1: remove this after branching. */ 3621 } 3613 3622 } 3614 3623 else … … 3622 3631 3623 3632 RTSemFastMutexRelease(pDevExt->mtxLdr); 3624 return VINF_SUCCESS;3633 return rc; 3625 3634 } 3626 3635 -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r14901 r15841 448 448 /** Magic number for SUPDRVOBJ::u32Magic. (Dame Agatha Mary Clarissa Christie). */ 449 449 #define SUPDRVOBJ_MAGIC 0x18900915 450 /** Dead number magic for SUPDRVOBJ::u32Magic. */ 451 #define SUPDRVOBJ_MAGIC_DEAD 0x19760112 450 452 451 453 /** -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r15505 r15841 261 261 CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION; 262 262 const uint32_t MinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x000a0000 263 ? 0x000a000 8263 ? 0x000a0009 264 264 : SUPDRV_IOC_VERSION & 0xffff0000; 265 265 CookieReq.u.In.u32MinVersion = MinVersion;
Note:
See TracChangeset
for help on using the changeset viewer.