VirtualBox

Changeset 21978 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Aug 5, 2009 11:07:39 AM (15 years ago)
Author:
vboxsync
Message:

VbglR3: u32Timeout -> cMillies and other nitpicking.

Location:
trunk/src/VBox/Additions/common/VBoxGuestLib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp

    r21211 r21978  
    811811 * @param   u64Timestamp    The timestamp of the last event seen.  Pass zero
    812812 *                          to wait for the next event.
    813  * @param   u32Timeout      Timeout in milliseconds.  Use RT_INDEFINITE_WAIT
     813 * @param   cMillies        Timeout in milliseconds.  Use RT_INDEFINITE_WAIT
    814814 *                          to wait indefinitely.
    815815 * @param   ppszName        Where to store the pointer to the name retrieved.
     
    825825                                    const char *pszPatterns,
    826826                                    void *pvBuf, uint32_t cbBuf,
    827                                     uint64_t u64Timestamp, uint32_t u32Timeout,
     827                                    uint64_t u64Timestamp, uint32_t cMillies,
    828828                                    char ** ppszName, char **ppszValue,
    829829                                    uint64_t *pu64Timestamp, char **ppszFlags,
     
    835835    GetNotification Msg;
    836836
    837     Msg.hdr.u32Timeout = u32Timeout;
     837    Msg.hdr.u32Timeout = cMillies;
    838838    Msg.hdr.fInterruptible = true;
    839839    Msg.hdr.info.result = VERR_WRONG_ORDER;
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp

    r21912 r21978  
    3131
    3232/**
    33  * Wait for the host to signal one or several of a set of events and return the
    34  * events signalled.  The events will only be delivered by the host if they
    35  * have been enabled previously using @a VbglR3CtlFilterMask.  If one or
    36  * several of the events have already been signalled but not yet waited for,
    37  * this function will return immediately and return those events.
     33 * Wait for the host to signal one or more events and return which.
    3834 *
    39  * @returns iprt status code
    40  * @param   fMask       the events we want to wait for, or-ed together
    41  * @param   u32Timeout  how long to wait before giving up and returning.  Use
    42  *                      RT_INDEFINITE_WAIT to wait until we are interrupted or
    43  *                      one of the events is signalled.
    44  * @param   pfEvents    where to store the events signalled
     35 * The events will only be delivered by the host if they have been enabled
     36 * previously using @a VbglR3CtlFilterMask.  If one or several of the events
     37 * have already been signalled but not yet waited for, this function will return
     38 * immediately and return those events.
     39 *
     40 * @returns IPRT status code
     41 *
     42 * @param   fMask       The events we want to wait for, or-ed together.
     43 * @param   cMillies    How long to wait before giving up and returning
     44 *                      (VERR_TIMEOUT). Use RT_INDEFINITE_WAIT to wait until we
     45 *                      are interrupted or one of the events is signalled.
     46 * @param   pfEvents    Where to store the events signalled. Optional.
    4547 */
    46 VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t u32Timeout,
    47                                 uint32_t *pfEvents)
     48VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t cMillies, uint32_t *pfEvents)
    4849{
    49     LogFlowFunc(("fMask=0x%x, u32Timeout=%u, pfEvents=%p\n", fMask, u32Timeout,
    50                  pfEvents));
    51     AssertReturn((fMask & ~VMMDEV_EVENT_VALID_EVENT_MASK) == 0,
    52                  VERR_INVALID_PARAMETER);
    53     /* Does pfEvents == NULL make sense? */
    54     AssertReturn(VALID_PTR(pfEvents) || pfEvents == NULL,
    55                  VERR_INVALID_POINTER);
     50    LogFlow(("VbglR3WaitEvent: fMask=0x%x, cMillies=%u, pfEvents=%p\n",
     51             fMask, cMillies, pfEvents));
     52    AssertReturn((fMask & ~VMMDEV_EVENT_VALID_EVENT_MASK) == 0, VERR_INVALID_PARAMETER);
     53    AssertPtrNullReturn(pfEvents, VERR_INVALID_POINTER);
    5654
    5755    VBoxGuestWaitEventInfo waitEvent;
    58     int rc;
    59 
    60     waitEvent.u32TimeoutIn = u32Timeout;
     56    waitEvent.u32TimeoutIn = cMillies;
    6157    waitEvent.u32EventMaskIn = fMask;
    6258    waitEvent.u32Result = VBOXGUEST_WAITEVENT_ERROR;
    6359    waitEvent.u32EventFlagsOut = 0;
    64     rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent));
    65     if (RT_SUCCESS(rc) && (pfEvents) != NULL)
    66         *pfEvents = waitEvent.u32EventFlagsOut;
    67     LogFlowFunc(("rc=%Rrc, waitEvent.u32EventFlagsOut=0x%x\n", rc,
    68                  waitEvent.u32EventFlagsOut));
     60    int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent));
     61    if (RT_SUCCESS(rc))
     62    {
     63        AssertMsg(waitEvent.u32Result == VBOXGUEST_WAITEVENT_OK, ("%d\n", waitEvent.u32Result));
     64        if (pfEvents)
     65            *pfEvents = waitEvent.u32EventFlagsOut;
     66    }
     67
     68    LogFlow(("VbglR3WaitEvent: rc=%Rrc, u32EventFlagsOut=0x%x. u32Result=%d\n",
     69             rc, waitEvent.u32EventFlagsOut, waitEvent.u32Result));
    6970    return rc;
    7071}
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