VirtualBox

Ignore:
Timestamp:
Jan 28, 2009 8:41:30 PM (16 years ago)
Author:
vboxsync
Message:

SUPLib-darwin: io_connect_t isn't a pointer actually, but a natural, so use uintptr_t instead of void * in the struct.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r13865 r16335  
    195195#if   defined(RT_OS_DARWIN)
    196196    /** The connection to the VBoxSupDrv service. */
    197     void               *pvConnection;
     197    uintptr_t           uConnection;
    198198#elif defined(RT_OS_LINUX)
    199199    /** Indicates whether madvise(,,MADV_DONTFORK) works. */
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp

    r15653 r16335  
    177177    {
    178178        LogRel(("SUP: IOServiceOpen returned %d. Driver open failed.\n", kr));
    179         pThis->pvConnection = NULL;
     179        pThis->uConnection = 0;
    180180        return VERR_VM_DRIVER_OPEN_ERROR;
    181181    }
    182182
    183     AssertCompile(sizeof(void *) == sizeof(Connection));
    184     pThis->pvConnection = (void *)Connection;
     183    AssertCompile(sizeof(pThis->uConnection) >= sizeof(Connection));
     184    pThis->uConnection = Connection;
    185185    return VINF_SUCCESS;
    186186}
     
    205205        if (RT_FAILURE(rc))
    206206        {
    207             kern_return_t kr = IOServiceClose((io_connect_t)pThis->pvConnection);
     207            kern_return_t kr = IOServiceClose((io_connect_t)pThis->uConnection);
    208208            if (kr != kIOReturnSuccess)
    209209            {
    210                 LogRel(("Warning: IOServiceClose(%p) returned %d\n", pThis->pvConnection, kr));
     210                LogRel(("Warning: IOServiceClose(%RCv) returned %d\n", pThis->uConnection, kr));
    211211                AssertFailed();
    212212            }
    213             pThis->pvConnection = NULL;
     213            pThis->uConnection = 0;
    214214        }
    215215    }
     
    227227     * This will cause the SUPDRVSESSION to be closed (starting IOC 9.1).
    228228     */
    229     if (pThis->pvConnection)
    230     {
    231         kern_return_t kr = IOServiceClose((io_connect_t)pThis->pvConnection);
     229    if (pThis->uConnection)
     230    {
     231        kern_return_t kr = IOServiceClose((io_connect_t)pThis->uConnection);
    232232        if (kr != kIOReturnSuccess)
    233233        {
    234             LogRel(("Warning: IOServiceClose(%p) returned %d\n", pThis->pvConnection, kr));
     234            LogRel(("Warning: IOServiceClose(%RCv) returned %d\n", pThis->uConnection, kr));
    235235            AssertFailed();
    236236        }
    237         pThis->pvConnection = NULL;
     237        pThis->uConnection = 0;
    238238    }
    239239
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette