VirtualBox

Changeset 20912 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Jun 24, 2009 11:51:48 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
49073
Message:

semeventmulti-r0drv-nt.cpp,semevent-r0drv-nt.cpp: Seems it's ok to allocate the timerout value on the stack, at least according to the vista driver verifier. Just use the specified interruptibility as a UserMode/KernelMode indicator.

Location:
trunk/src/VBox/Runtime/r0drv/nt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp

    r20883 r20912  
    136136    }
    137137
     138#if 1
     139    /*
     140     * Wait for it.
     141     * We're assuming interruptible waits should happen at UserMode level.
     142     */
     143    NTSTATUS        rcNt;
     144    KPROCESSOR_MODE WaitMode   = fInterruptible ? UserMode : KernelMode;
     145    KWAIT_REASON    WaitReason = Executive; /*fInterruptible ? Executive : UserRequest; ?*/
     146    if (cMillies == RT_INDEFINITE_WAIT)
     147        rcNt = KeWaitForSingleObject(&pEventInt->Event, WaitReason, WaitMode, fInterruptible, NULL);
     148    else
     149    {
     150        LARGE_INTEGER Timeout;
     151        Timeout.QuadPart = -(int64_t)cMillies * 10000;
     152        rcNt = KeWaitForSingleObject(&pEventInt->Event, WaitReason, WaitMode, fInterruptible, &Timeout);
     153    }
     154#else
    138155    /*
    139156     * Wait for it.
    140157     *
    141      * We default to UserMode here as the waits might be aborted due to process termination. 
     158     * We default to UserMode here as the waits might be aborted due to process termination.
    142159     * @todo As far as I can tell this is currently safe as all calls are made on behalf of user threads.
    143160     */
     
    156173        RTMemFree(pTimeout);
    157174    }
     175#endif
    158176    switch (rcNt)
    159177    {
  • trunk/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp

    r20884 r20912  
    143143    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER);
    144144
     145#if 1
     146    /*
     147     * Wait for it.
     148     * We're assuming interruptible waits should happen at UserMode level.
     149     */
     150    NTSTATUS        rcNt;
     151    KPROCESSOR_MODE WaitMode   = fInterruptible ? UserMode : KernelMode;
     152    KWAIT_REASON    WaitReason = Executive; /*fInterruptible ? Executive : UserRequest; ?*/
     153    if (cMillies == RT_INDEFINITE_WAIT)
     154        rcNt = KeWaitForSingleObject(&pThis->Event, WaitReason, WaitMode, fInterruptible, NULL);
     155    else
     156    {
     157        LARGE_INTEGER Timeout;
     158        Timeout.QuadPart = -(int64_t)cMillies * 10000;
     159        rcNt = KeWaitForSingleObject(&pThis->Event, WaitReason, WaitMode, fInterruptible, &Timeout);
     160    }
     161#else
    145162    /*
    146163     * Wait for it.
    147164     *
    148      * We default to UserMode here as the waits might be aborted due to process termination. 
     165     * We default to UserMode here as the waits might be aborted due to process termination.
    149166     * @todo As far as I can tell this is currently safe as all calls are made on behalf of user threads.
    150167     */
     
    163180        RTMemFree(pTimeout);
    164181    }
     182#endif
    165183    switch (rcNt)
    166184    {
Note: See TracChangeset for help on using the changeset viewer.

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