VirtualBox

Changeset 197 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Jan 20, 2007 1:22:45 AM (18 years ago)
Author:
vboxsync
Message:

A stab at generic timers (untested).

Location:
trunk/src/VBox/Runtime/r3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/timer-posix.cpp

    r1 r197  
    319319    LogFlow(("RTTimerDestroy: pTimer=%p\n", pTimer));
    320320
     321    /* NULL is ok. */
     322    if (!pTimer)
     323        return VINF_SUCCESS;
     324
    321325    /*
    322326     * Validate input.
    323327     */
    324328    int rc = VINF_SUCCESS;
    325     if (pTimer)
     329    if (VALID_PTR(pTimer))
    326330    {
    327331        /*
     
    354358    else
    355359    {
    356         AssertMsgFailed(("An attempt was made to destroy a NULL timer!\n"));
    357         rc = VERR_INVALID_POINTER;
     360        AssertMsgFailed(("Bad pTimer pointer %p!\n", pTimer));
     361        rc = VERR_INVALID_HANDLE;
    358362    }
    359363    return rc;
  • trunk/src/VBox/Runtime/r3/win32/timer-win32.cpp

    r1 r197  
    412412RTR3DECL(int)     RTTimerDestroy(PRTTIMER pTimer)
    413413{
     414    /* NULL is ok. */
     415    if (!pTimer)
     416        return VINF_SUCCESS;
     417
    414418    /*
    415419     * Validate handle first.
    416420     */
    417421    int rc;
    418     if (pTimer && pTimer->u32Magic == RTTIMER_MAGIC)
     422    if (    VALID_PTR(pTimer)
     423        &&  pTimer->u32Magic == RTTIMER_MAGIC)
    419424    {
    420425#ifdef USE_WINMM
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