VirtualBox

Ignore:
Timestamp:
Jun 22, 2011 7:30:06 PM (14 years ago)
Author:
vboxsync
Message:

*: RTFILE becomes a pointer, RTFileOpen++ expands it's flags paramter from uint32_t to uint64_t.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r37410 r37596  
    9797SUPLIBDATA                      g_supLibData =
    9898{
    99     NIL_RTFILE
     99    SUP_HDEVICE_NIL
    100100#if   defined(RT_OS_DARWIN)
    101101    , NULL
     
    185185        return VERR_INVALID_MAGIC;
    186186    if (    !(fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV)
    187         &&  pPreInitData->Data.hDevice == NIL_RTFILE)
     187        &&  pPreInitData->Data.hDevice == SUP_HDEVICE_NIL)
    188188        return VERR_INVALID_HANDLE;
    189189    if (    (fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV)
    190         &&  pPreInitData->Data.hDevice != NIL_RTFILE)
     190        &&  pPreInitData->Data.hDevice != SUP_HDEVICE_NIL)
    191191        return VERR_INVALID_PARAMETER;
    192192
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r35188 r37596  
    185185{
    186186    /** The device handle. */
    187     RTFILE              hDevice;
     187#if defined(RT_OS_WINDOWS)
     188    void               *hDevice;
     189#else
     190    int                 hDevice;
     191#endif
    188192#if   defined(RT_OS_DARWIN)
    189193    /** The connection to the VBoxSupDrv service. */
     
    203207/** Pointer to const pre-init data. */
    204208typedef SUPLIBDATA const *PCSUPLIBDATA;
     209
     210/** The NIL value of SUPLIBDATA::hDevice. */
     211#if defined(RT_OS_WINDOWS)
     212# define SUP_HDEVICE_NIL NULL
     213#else
     214# define SUP_HDEVICE_NIL (-1)
     215#endif
    205216
    206217
  • trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp

    r35311 r37596  
    10191019     */
    10201020    g_pszSupLibHardenedProgName = pszProgName;
    1021     g_SupPreInitData.u32Magic = SUPPREINITDATA_MAGIC;
    1022     g_SupPreInitData.Data.hDevice = NIL_RTFILE;
    1023     g_SupPreInitData.u32EndMagic = SUPPREINITDATA_MAGIC;
     1021    g_SupPreInitData.u32Magic     = SUPPREINITDATA_MAGIC;
     1022    g_SupPreInitData.Data.hDevice = SUP_HDEVICE_NIL;
     1023    g_SupPreInitData.u32EndMagic  = SUPPREINITDATA_MAGIC;
    10241024
    10251025#ifdef SUP_HARDENED_SUID
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp

    r33540 r37596  
    194194     * Do the job.
    195195     */
    196     Assert(pThis->hDevice == NIL_RTFILE);
     196    Assert(pThis->hDevice == (intptr_t)NIL_RTFILE);
    197197    int rc = suplibDarwinOpenService(pThis);
    198198    if (RT_SUCCESS(rc))
     
    237237     * Check if we're inited at all.
    238238     */
    239     if (pThis->hDevice != NIL_RTFILE)
     239    if (pThis->hDevice != (intptr_t)NIL_RTFILE)
    240240    {
    241241        if (close(pThis->hDevice))
    242242            AssertFailed();
    243         pThis->hDevice = NIL_RTFILE;
     243        pThis->hDevice = (intptr_t)NIL_RTFILE;
    244244    }
    245245
  • trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp

    r33540 r37596  
    133133     * Check if we're inited at all.
    134134     */
    135     if (pThis->hDevice != NIL_RTFILE)
     135    if (pThis->hDevice != (intptr_t)NIL_RTFILE)
    136136    {
    137137        if (close(pThis->hDevice))
    138138            AssertFailed();
    139         pThis->hDevice = NIL_RTFILE;
     139        pThis->hDevice = (intptr_t)NIL_RTFILE;
    140140    }
    141141    return VINF_SUCCESS;
  • trunk/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp

    r37556 r37596  
    7979    if (fPreInited)
    8080        return VINF_SUCCESS;
    81     Assert(pThis->hDevice == NIL_RTFILE);
     81    Assert(pThis->hDevice == (intptr_t)NIL_RTFILE);
    8282
    8383    /*
     
    145145     * Close the device if it's actually open.
    146146     */
    147     if (pThis->hDevice != NIL_RTFILE)
     147    if (pThis->hDevice != (intptr_t)NIL_RTFILE)
    148148    {
    149149        if (close(pThis->hDevice))
    150150            AssertFailed();
    151         pThis->hDevice = NIL_RTFILE;
     151        pThis->hDevice = (intptr_t)NIL_RTFILE;
    152152    }
    153153
     
    172172int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
    173173{
    174     AssertMsg(pThis->hDevice != NIL_RTFILE, ("SUPLIB not initiated successfully!\n"));
     174    AssertMsg(pThis->hDevice != (intptr_t)NIL_RTFILE, ("SUPLIB not initiated successfully!\n"));
    175175
    176176    /*
  • trunk/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp

    r33540 r37596  
    100100    }
    101101
    102     pThis->hDevice = (RTFILE)hDevice;
     102    pThis->hDevice = hDevice;
    103103    return VINF_SUCCESS;
    104104}
     
    112112     * Check if we're inited at all.
    113113     */
    114     if (pThis->hDevice != NIL_RTFILE)
     114    if (pThis->hDevice != (intptr_t)NIL_RTFILE)
    115115    {
    116116        APIRET rc = DosClose((HFILE)pThis->hDevice);
    117117        AssertMsg(rc == NO_ERROR, ("%d\n", rc)); NOREF(rc);
    118         pThis->hDevice = NIL_RTFILE;
     118        pThis->hDevice = (intptr_t)NIL_RTFILE;
    119119    }
    120120
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp

    r28800 r37596  
    162162        if (close(pThis->hDevice))
    163163            AssertFailed();
    164         pThis->hDevice = NIL_RTFILE;
     164        pThis->hDevice = (intptr_t)NIL_RTFILE;
    165165    }
    166166
  • trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp

    r33540 r37596  
    139139     * We're done.
    140140     */
    141     pThis->hDevice = (RTFILE)hDevice;
     141    pThis->hDevice = hDevice;
    142142    return VINF_SUCCESS;
    143143}
     
    475475     * Check if we're inited at all.
    476476     */
    477     if (pThis->hDevice != NIL_RTFILE)
     477    if (pThis->hDevice != NULL)
    478478    {
    479479        if (!CloseHandle((HANDLE)pThis->hDevice))
    480480            AssertFailed();
    481         pThis->hDevice = NIL_RTFILE;
     481        pThis->hDevice = NIL_RTFILE; /* yes, that's right */
    482482    }
    483483
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