Ticket #1: supdrv.diff

File supdrv.diff, 7.2 KB (added by Valery V. Sedletski, 9 years ago)

Support driver

  • \src\VBox\HostDrivers/Support/Makefile.kmk

    diff -urN vbox-clean-bk\src\VBox\HostDrivers/Support/Makefile.kmk vbox-clean\src\VBox\HostDrivers/Support/Makefile.kmk
    old new  
    519519        SUPDrv.cpp \
    520520        SUPDrvGip.cpp \
    521521        SUPDrvSem.cpp \
    522         SUPLibAll.cpp
     522        SUPLibAll.cpp \
     523        SUPDrvTracerA.asm \
     524        SUPDrvTracer.cpp
    523525
    524526endif # os2
    525527
  • \src\VBox\HostDrivers/Support/os2/SUPDrv-os2.cpp

    diff -urN vbox-clean-bk\src\VBox\HostDrivers/Support/os2/SUPDrv-os2.cpp vbox-clean\src\VBox\HostDrivers/Support/os2/SUPDrv-os2.cpp
    old new  
    221221    /*
    222222     * Close the session.
    223223     */
    224     supdrvSessionRelease(pSession);
     224    if (pSession)
     225        supdrvSessionRelease(pSession);
     226
    225227    return 0;
    226228}
    227229
     
    244246               &&   (   pSession->sfn != sfn
    245247                     || pSession->Process != Process));
    246248
    247         if (RT_LIKELY(pSession))
    248             supdrvSessionRetain(pSession);
    249249    }
    250250    RTSpinlockRelease(g_Spinlock);
    251     if (RT_UNLIKELY(!pSession))
     251    if (!pSession)
    252252    {
    253253        OSDBGPRINT(("VBoxDrvIoctl: WHUT?!? pSession == NULL! This must be a mistake... pid=%d\n", (int)Process));
    254254        return VERR_INVALID_PARAMETER;
     
    258258     * Dispatch the fast IOCtl.
    259259     */
    260260    supdrvIOCtlFast(iFunction, 0, &g_DevExt, pSession);
    261     supdrvSessionRelease(pSession);
    262261    return 0;
    263262}
    264263
     
    271270    const RTPROCESS     Process = RTProcSelf();
    272271    const unsigned      iHash = SESSION_HASH(sfn);
    273272    PSUPDRVSESSION      pSession;
     273    int rc = 0;
    274274
    275275    RTSpinlockAcquire(g_Spinlock);
    276276    pSession = g_apSessionHashTab[iHash];
     
    280280        while (     pSession
    281281               &&   (   pSession->sfn != sfn
    282282                     || pSession->Process != Process));
    283 
    284         if (RT_LIKELY(pSession))
    285             supdrvSessionRetain(pSession);
    286283    }
    287284    RTSpinlockRelease(g_Spinlock);
    288285    if (!pSession)
     
    306303        PSUPREQHDR pHdr = (PSUPREQHDR)pvParm;
    307304        AssertReturn(*pcbParm == sizeof(*pHdr), VERR_INVALID_PARAMETER);
    308305        KernVMLock_t Lock;
    309         int rc = KernVMLock(VMDHL_WRITE, pHdr, *pcbParm, &Lock, (KernPageList_t *)-1, NULL);
     306        rc = KernVMLock(VMDHL_WRITE, pHdr, *pcbParm, &Lock, (KernPageList_t *)-1, NULL);
    310307        AssertMsgReturn(!rc, ("KernVMLock(VMDHL_WRITE, %p, %#x, &p, NULL, NULL) -> %d\n", pHdr, *pcbParm, &Lock, rc), VERR_LOCK_FAILED);
    311308
    312309        /*
     
    352349         * Unlock and return.
    353350         */
    354351        int rc2 = KernVMUnlock(&Lock);
    355         AssertMsg(!rc2, ("rc2=%d\n", rc2)); NOREF(rc2);s
     352        AssertMsg(!rc2, ("rc2=%d\n", rc2)); NOREF(rc2);
    356353    }
    357354    else
    358355        rc = VERR_NOT_SUPPORTED;
    359356
    360     supdrvSessionRelease(pSession);
    361357    Log2(("VBoxDrvIOCtl: returns %d\n", rc));
    362358    return rc;
    363359}
     
    414410
    415411bool VBOXCALL  supdrvOSAreTscDeltasInSync(void)
    416412{
    417     NOREF(pDevExt);
     413    // NOREF(pDevExt);
    418414    return false;
    419415}
    420416
  • \src\VBox\HostDrivers/Support/os2/SUPLib-os2.cpp

    diff -urN vbox-clean-bk\src\VBox\HostDrivers/Support/os2/SUPLib-os2.cpp vbox-clean\src\VBox\HostDrivers/Support/os2/SUPLib-os2.cpp
    old new  
    150150int suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
    151151{
    152152    NOREF(idCpu);
    153     int32_t rcRet = VERR_INTERNAL_ERROR;
    154153    int rc = DosDevIOCtl((HFILE)pThis->hDevice, SUP_CTL_CATEGORY_FAST, uFunction,
    155154                         NULL, 0, NULL,
    156155                         NULL, 0, NULL);
    157     if (RT_LIKELY(rc == NO_ERROR))
    158         rc = rcRet;
    159     else
    160         rc = RTErrConvertFromOS2(rc);
    161     return rc;
     156
     157    return rc = RTErrConvertFromOS2(rc);
    162158}
    163159
    164160
  • \src\VBox\HostDrivers/Support/SUPDrv.cpp

    diff -urN vbox-clean-bk\src\VBox\HostDrivers/Support/SUPDrv.cpp vbox-clean\src\VBox\HostDrivers/Support/SUPDrv.cpp
    old new  
    571571                        g_aFunctions[2].pfn = (void *)(uintptr_t)ASMGetSS();    /* SUPR0Abs64bitKernelSS */
    572572                        g_aFunctions[3].pfn = (void *)(uintptr_t)ASMGetDS();    /* SUPR0Abs64bitKernelDS */
    573573# else
    574                         g_aFunctions[0].pfn = g_aFunctions[1].pfn = g_aFunctions[2].pfn = g_aFunctions[4].pfn = (void *)0;
     574                        g_aFunctions[0].pfn = g_aFunctions[1].pfn = g_aFunctions[2].pfn = g_aFunctions[3].pfn = (void *)0;
    575575# endif
    576576                        g_aFunctions[4].pfn = (void *)(uintptr_t)ASMGetCS();    /* SUPR0AbsKernelCS */
    577577                        g_aFunctions[5].pfn = (void *)(uintptr_t)ASMGetSS();    /* SUPR0AbsKernelSS */
  • \src\VBox\HostDrivers/Support/SUPR3HardenedVerify.cpp

    diff -urN vbox-clean-bk\src\VBox\HostDrivers/Support/SUPR3HardenedVerify.cpp vbox-clean\src\VBox\HostDrivers/Support/SUPR3HardenedVerify.cpp
    old new  
    126126    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxVMM" SUPLIB_DLL_SUFF },
    127127    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxREM" SUPLIB_DLL_SUFF },
    128128#if HC_ARCH_BITS == 32
     129#ifndef RT_OS_OS2
    129130    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxREM32" SUPLIB_DLL_SUFF },
    130131    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxREM64" SUPLIB_DLL_SUFF },
     132#else
     133    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxRM32" SUPLIB_DLL_SUFF },
     134    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxRM64" SUPLIB_DLL_SUFF },
     135#endif
    131136#endif
    132137    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxDD" SUPLIB_DLL_SUFF },
    133138    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxDD2" SUPLIB_DLL_SUFF },
     
    148153    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxDragAndDropSvc" SUPLIB_DLL_SUFF },
    149154//#endif
    150155//#ifdef VBOX_WITH_GUEST_PROPS
     156#ifndef RT_OS_OS2
    151157    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxGuestPropSvc" SUPLIB_DLL_SUFF },
     158#else
     159    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxSIS" SUPLIB_DLL_SUFF },
     160#endif
    152161//#endif
    153162//#ifdef VBOX_WITH_GUEST_CONTROL
    154163    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxGuestControlSvc" SUPLIB_DLL_SUFF },
    155164//#endif
     165#ifndef RT_OS_OS2
    156166    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxHostChannel" SUPLIB_DLL_SUFF },
     167#else
     168    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxHC" SUPLIB_DLL_SUFF },
     169#endif
    157170    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxSharedCrOpenGL" SUPLIB_DLL_SUFF },
    158171    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxOGLhostcrutil" SUPLIB_DLL_SUFF },
    159172    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxOGLhosterrorspu" SUPLIB_DLL_SUFF },