Ticket #1: supdrv.2.diff

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

VBox support driver

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

    diff -urN vbox-trunk-bk\src\VBox\HostDrivers/Support/Makefile.kmk vbox-trunk\src\VBox\HostDrivers/Support/Makefile.kmk
    old new  
    525525        SUPDrv.cpp \
    526526        SUPDrvGip.cpp \
    527527        SUPDrvSem.cpp \
    528         SUPLibAll.cpp
     528        SUPLibAll.cpp \
     529        SUPDrvTracerA.asm \
     530        SUPDrvTracer.cpp
    529531
    530532endif # os2
    531533
  • \src\VBox\HostDrivers/Support/os2/SUPDrv-os2.cpp

    diff -urN vbox-trunk-bk\src\VBox\HostDrivers/Support/os2/SUPDrv-os2.cpp vbox-trunk\src\VBox\HostDrivers/Support/os2/SUPDrv-os2.cpp
    old new  
    222222    /*
    223223     * Close the session.
    224224     */
    225     supdrvSessionRelease(pSession);
     225    if (pSession)
     226        supdrvSessionRelease(pSession);
     227
    226228    return 0;
    227229}
    228230
     
    245247               &&   (   pSession->sfn != sfn
    246248                     || pSession->Process != Process));
    247249
    248         if (RT_LIKELY(pSession))
    249             supdrvSessionRetain(pSession);
    250250    }
    251251    RTSpinlockRelease(g_Spinlock);
    252     if (RT_UNLIKELY(!pSession))
     252    if (!pSession)
    253253    {
    254254        OSDBGPRINT(("VBoxDrvIoctl: WHUT?!? pSession == NULL! This must be a mistake... pid=%d\n", (int)Process));
    255255        return VERR_INVALID_PARAMETER;
     
    259259     * Dispatch the fast IOCtl.
    260260     */
    261261    supdrvIOCtlFast(iFunction, 0, &g_DevExt, pSession);
    262     supdrvSessionRelease(pSession);
    263262    return 0;
    264263}
    265264
     
    272271    const RTPROCESS     Process = RTProcSelf();
    273272    const unsigned      iHash = SESSION_HASH(sfn);
    274273    PSUPDRVSESSION      pSession;
     274    int rc = 0;
    275275
    276276    RTSpinlockAcquire(g_Spinlock);
    277277    pSession = g_apSessionHashTab[iHash];
     
    281281        while (     pSession
    282282               &&   (   pSession->sfn != sfn
    283283                     || pSession->Process != Process));
    284 
    285         if (RT_LIKELY(pSession))
    286             supdrvSessionRetain(pSession);
    287284    }
    288285    RTSpinlockRelease(g_Spinlock);
    289286    if (!pSession)
     
    307304        PSUPREQHDR pHdr = (PSUPREQHDR)pvParm;
    308305        AssertReturn(*pcbParm == sizeof(*pHdr), VERR_INVALID_PARAMETER);
    309306        KernVMLock_t Lock;
    310         int rc = KernVMLock(VMDHL_WRITE, pHdr, *pcbParm, &Lock, (KernPageList_t *)-1, NULL);
     307        rc = KernVMLock(VMDHL_WRITE, pHdr, *pcbParm, &Lock, (KernPageList_t *)-1, NULL);
    311308        AssertMsgReturn(!rc, ("KernVMLock(VMDHL_WRITE, %p, %#x, &p, NULL, NULL) -> %d\n", pHdr, *pcbParm, &Lock, rc), VERR_LOCK_FAILED);
    312309
    313310        /*
     
    353350         * Unlock and return.
    354351         */
    355352        int rc2 = KernVMUnlock(&Lock);
    356         AssertMsg(!rc2, ("rc2=%d\n", rc2)); NOREF(rc2);s
     353        AssertMsg(!rc2, ("rc2=%d\n", rc2)); NOREF(rc2);
    357354    }
    358355    else
    359356        rc = VERR_NOT_SUPPORTED;
    360357
    361     supdrvSessionRelease(pSession);
    362358    Log2(("VBoxDrvIOCtl: returns %d\n", rc));
    363359    return rc;
    364360}
     
    415411
    416412bool VBOXCALL  supdrvOSAreTscDeltasInSync(void)
    417413{
    418     NOREF(pDevExt);
     414    // NOREF(pDevExt);
    419415    return false;
    420416}
    421417
  • \src\VBox\HostDrivers/Support/os2/SUPLib-os2.cpp

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

    diff -urN vbox-trunk-bk\src\VBox\HostDrivers/Support/SUPDrv.cpp vbox-trunk\src\VBox\HostDrivers/Support/SUPDrv.cpp
    old new  
    601601                        g_aFunctions[2].pfn = (void *)(uintptr_t)ASMGetSS();    /* SUPR0Abs64bitKernelSS */
    602602                        g_aFunctions[3].pfn = (void *)(uintptr_t)ASMGetDS();    /* SUPR0Abs64bitKernelDS */
    603603# else
    604                         g_aFunctions[0].pfn = g_aFunctions[1].pfn = g_aFunctions[2].pfn = g_aFunctions[4].pfn = (void *)0;
     604                        g_aFunctions[0].pfn = g_aFunctions[1].pfn = g_aFunctions[2].pfn = g_aFunctions[3].pfn = (void *)0;
    605605# endif
    606606                        g_aFunctions[4].pfn = (void *)(uintptr_t)ASMGetCS();    /* SUPR0AbsKernelCS */
    607607                        g_aFunctions[5].pfn = (void *)(uintptr_t)ASMGetSS();    /* SUPR0AbsKernelSS */
  • \src\VBox\HostDrivers/Support/SUPR3HardenedVerify.cpp

    diff -urN vbox-trunk-bk\src\VBox\HostDrivers/Support/SUPR3HardenedVerify.cpp vbox-trunk\src\VBox\HostDrivers/Support/SUPR3HardenedVerify.cpp
    old new  
    130130    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxVMM" SUPLIB_DLL_SUFF },
    131131    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxREM" SUPLIB_DLL_SUFF },
    132132#if HC_ARCH_BITS == 32
     133#ifndef RT_OS_OS2
    133134    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxREM32" SUPLIB_DLL_SUFF },
    134135    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxREM64" SUPLIB_DLL_SUFF },
     136#else
     137    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxRM32" SUPLIB_DLL_SUFF },
     138    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxRM64" SUPLIB_DLL_SUFF },
     139#endif
    135140#endif
    136141    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxDD" SUPLIB_DLL_SUFF },
    137142    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxDD2" SUPLIB_DLL_SUFF },
     
    152157    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxDragAndDropSvc" SUPLIB_DLL_SUFF },
    153158//#endif
    154159//#ifdef VBOX_WITH_GUEST_PROPS
     160#ifndef RT_OS_OS2
    155161    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxGuestPropSvc" SUPLIB_DLL_SUFF },
     162#else
     163    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxSIS" SUPLIB_DLL_SUFF },
     164#endif
    156165//#endif
    157166//#ifdef VBOX_WITH_GUEST_CONTROL
    158167    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxGuestControlSvc" SUPLIB_DLL_SUFF },
    159168//#endif
     169#ifndef RT_OS_OS2
    160170    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxHostChannel" SUPLIB_DLL_SUFF },
     171#else
     172    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxHC" SUPLIB_DLL_SUFF },
     173#endif
    161174    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxSharedCrOpenGL" SUPLIB_DLL_SUFF },
    162175    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxOGLhostcrutil" SUPLIB_DLL_SUFF },
    163176    {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VBoxOGLhosterrorspu" SUPLIB_DLL_SUFF },