VirtualBox

Changeset 10720 in vbox for trunk


Ignore:
Timestamp:
Jul 17, 2008 12:06:56 PM (16 years ago)
Author:
vboxsync
Message:

Fixed issue in fast (METHOD_NEITHER) ioctls.
Write the last error to pVM->vmm.s.iLastGCRc instead of writing it to a user buffer.

Location:
trunk/src/VBox
Files:
5 edited

Legend:

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

    r10680 r10720  
    524524SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr)
    525525{
    526 #if 0 /* temp hack. */
    527526    /*
    528527     * The following operations don't belong here.
     
    533532                    ("%#x\n", uOperation),
    534533                    VERR_INTERNAL_ERROR);
    535 #else
    536     if (    (    uOperation == SUP_VMMR0_DO_RAW_RUN
    537              ||  uOperation == SUP_VMMR0_DO_HWACC_RUN
    538              ||  uOperation == SUP_VMMR0_DO_NOP)
    539         &&  !pReqHdr
    540         &&  !u64Arg)
    541         return (int) SUPCallVMMR0Fast(pVMR0, uOperation);
    542 #endif
    543534
    544535    /* fake */
     
    598589
    599590#else
    600     if (RT_LIKELY(uOperation == SUP_VMMR0_DO_RAW_RUN))
    601     {
    602         Assert(!pvArg);
    603         return suplibOsIOCtlFast(SUP_IOCTL_FAST_DO_RAW_RUN);
    604     }
    605     if (RT_LIKELY(uOperation == SUP_VMMR0_DO_HWACC_RUN))
    606     {
    607         Assert(!pvArg);
    608         return suplibOsIOCtlFast(SUP_IOCTL_FAST_DO_HWACC_RUN);
    609     }
    610     if (RT_LIKELY(uOperation == SUP_VMMR0_DO_NOP))
    611     {
    612         Assert(!pvArg);
    613         return suplibOsIOCtlFast(SUP_IOCTL_FAST_DO_NOP);
    614     }
     591    /*
     592     * The following operations don't belong here.
     593     */
     594    AssertMsgReturn(    uOperation != SUP_VMMR0_DO_RAW_RUN
     595                    &&  uOperation != SUP_VMMR0_DO_HWACC_RUN
     596                    &&  uOperation != SUP_VMMR0_DO_NOP,
     597                    ("%#x\n", uOperation),
     598                    VERR_INTERNAL_ERROR);
    615599    return SUPCallVMMR0Ex(pVMR0, uOperation, (uintptr_t)pvArg, NULL);
    616600#endif
  • trunk/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp

    r10256 r10720  
    171171{
    172172    int32_t rcRet = VERR_INTERNAL_ERROR;
    173     ULONG cbRet = sizeof(rcRet);
    174173    int rc = DosDevIOCtl(g_hDevice, SUP_CTL_CATEGORY_FAST, uFunction,
    175174                         NULL, 0, NULL,
    176                          &rcRet, sizeof(rcRet), &cbRet);
     175                         NULL, 0, NULL);
    177176    if (RT_LIKELY(rc == NO_ERROR))
    178177        rc = rcRet;
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r10662 r10720  
    296296        int   rc;
    297297
     298        /* We're here with METHOD_NEITHER, which means no parameter validation has been performed. Do not use input
     299         * or write to output parameters!
     300         */
     301
    298302        /* Raise the IRQL to DISPATCH_LEVEl to prevent Windows from rescheduling us to another CPU/core. */
    299303        Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL);
     
    304308        /* Complete the I/O request. */
    305309        NTSTATUS rcNt = pIrp->IoStatus.Status = STATUS_SUCCESS;
    306         pIrp->IoStatus.Information = sizeof(rc);
    307         __try
    308         {
    309             *(int *)pIrp->UserBuffer = rc;
    310         }
    311         __except(EXCEPTION_EXECUTE_HANDLER)
    312         {
    313             rcNt = pIrp->IoStatus.Status = GetExceptionCode();
    314             dprintf(("VBoxSupDrvDeviceContorl: Exception Code %#x\n", rcNt));
    315         }
    316310        IoCompleteRequest(pIrp, IO_NO_INCREMENT);
    317311        return rcNt;
  • trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp

    r10256 r10720  
    645645     */
    646646    int rc = VERR_INTERNAL_ERROR;
    647     DWORD cbReturned = (ULONG)sizeof(rc);
    648     if (DeviceIoControl(g_hDevice, uFunction, NULL, 0, &rc, (DWORD)sizeof(rc), &cbReturned, NULL))
     647    if (DeviceIoControl(g_hDevice, uFunction, NULL, 0, NULL, 0, NULL, NULL))
    649648        return rc;
    650649    return suplibConvertWin32Err(GetLastError());
  • trunk/src/VBox/VMM/VMM.cpp

    r10450 r10720  
    19491949            rc = VERR_GENERAL_FAILURE;
    19501950#else
    1951             rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
     1951            rc = SUPCallVMMR0Fast(pVM->pVMR0, VMMR0_DO_RAW_RUN);
     1952            if (RT_LIKELY(rc == VINF_SUCCESS))
     1953                rc = pVM->vmm.s.iLastGCRc;
    19521954#endif
    19531955        } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
     
    19982000#else
    19992001            rc = SUPCallVMMR0Fast(pVM->pVMR0, VMMR0_DO_HWACC_RUN);
     2002            if (RT_LIKELY(rc == VINF_SUCCESS))
     2003                rc = pVM->vmm.s.iLastGCRc;
    20002004#endif
    20012005        } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
     
    20782082            rc = VERR_GENERAL_FAILURE;
    20792083#else
    2080             rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
     2084            rc = SUPCallVMMR0Fast(pVM->pVMR0, VMMR0_DO_RAW_RUN);
     2085            if (RT_LIKELY(rc == VINF_SUCCESS))
     2086                rc = pVM->vmm.s.iLastGCRc;
    20812087#endif
    20822088        } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
     
    21322138            rc = VERR_GENERAL_FAILURE;
    21332139#else
    2134             rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
     2140            rc = SUPCallVMMR0Fast(pVM->pVMR0, VMMR0_DO_RAW_RUN);
     2141            if (RT_LIKELY(rc == VINF_SUCCESS))
     2142                rc = pVM->vmm.s.iLastGCRc;
    21352143#endif
    21362144        } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
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