VirtualBox

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


Ignore:
Timestamp:
Jun 25, 2009 11:21:35 AM (16 years ago)
Author:
vboxsync
Message:

semevent*-r0drv-nt.cpp: we've agreed that only the object is subject to the stack/swap warning when waiting in UserMode. The driver verifier concurs.

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

Legend:

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

    r20913 r20923  
    136136    }
    137137
    138 #if 1
    139138    /*
    140139     * Wait for it.
     
    151150        rcNt = KeWaitForSingleObject(&pEventInt->Event, Executive, WaitMode, fInterruptible, &Timeout);
    152151    }
    153 #else
    154     /*
    155      * Wait for it.
    156      *
    157      * We default to UserMode here as the waits might be aborted due to process termination.
    158      * @todo As far as I can tell this is currently safe as all calls are made on behalf of user threads.
    159      */
    160     NTSTATUS rcNt;
    161     if (cMillies == RT_INDEFINITE_WAIT)
    162         rcNt = KeWaitForSingleObject(&pEventInt->Event, Executive, UserMode, fInterruptible, NULL);
    163     else
    164     {
    165         /* Can't use the stack here as the wait is UserMode. */
    166         PLARGE_INTEGER pTimeout = (PLARGE_INTEGER)RTMemAlloc(sizeof(*pTimeout));
    167         if (!pTimeout)
    168             return VERR_NO_MEMORY;
    169 
    170         pTimeout->QuadPart = -(int64_t)cMillies * 10000;
    171         rcNt = KeWaitForSingleObject(&pEventInt->Event, Executive, UserMode, fInterruptible, pTimeout);
    172         RTMemFree(pTimeout);
    173     }
    174 #endif
    175152    switch (rcNt)
    176153    {
  • trunk/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp

    r20913 r20923  
    143143    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER);
    144144
    145 #if 1
    146145    /*
    147146     * Wait for it.
     
    158157        rcNt = KeWaitForSingleObject(&pThis->Event, Executive, WaitMode, fInterruptible, &Timeout);
    159158    }
    160 #else
    161     /*
    162      * Wait for it.
    163      *
    164      * We default to UserMode here as the waits might be aborted due to process termination.
    165      * @todo As far as I can tell this is currently safe as all calls are made on behalf of user threads.
    166      */
    167     NTSTATUS rcNt;
    168     if (cMillies == RT_INDEFINITE_WAIT)
    169         rcNt = KeWaitForSingleObject(&pThis->Event, Executive, UserMode, fInterruptible, NULL);
    170     else
    171     {
    172         /* Can't use the stack here as the wait is UserMode. */
    173         PLARGE_INTEGER pTimeout = (PLARGE_INTEGER)RTMemAlloc(sizeof(*pTimeout));
    174         if (!pTimeout)
    175             return VERR_NO_MEMORY;
    176 
    177         pTimeout->QuadPart = -(int64_t)cMillies * 10000;
    178         rcNt = KeWaitForSingleObject(&pThis->Event, Executive, UserMode, fInterruptible, pTimeout);
    179         RTMemFree(pTimeout);
    180     }
    181 #endif
    182159    switch (rcNt)
    183160    {
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