Changeset 21978 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Aug 5, 2009 11:07:39 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuestLib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp
r21211 r21978 811 811 * @param u64Timestamp The timestamp of the last event seen. Pass zero 812 812 * to wait for the next event. 813 * @param u32TimeoutTimeout in milliseconds. Use RT_INDEFINITE_WAIT813 * @param cMillies Timeout in milliseconds. Use RT_INDEFINITE_WAIT 814 814 * to wait indefinitely. 815 815 * @param ppszName Where to store the pointer to the name retrieved. … … 825 825 const char *pszPatterns, 826 826 void *pvBuf, uint32_t cbBuf, 827 uint64_t u64Timestamp, uint32_t u32Timeout,827 uint64_t u64Timestamp, uint32_t cMillies, 828 828 char ** ppszName, char **ppszValue, 829 829 uint64_t *pu64Timestamp, char **ppszFlags, … … 835 835 GetNotification Msg; 836 836 837 Msg.hdr.u32Timeout = u32Timeout;837 Msg.hdr.u32Timeout = cMillies; 838 838 Msg.hdr.fInterruptible = true; 839 839 Msg.hdr.info.result = VERR_WRONG_ORDER; -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r21912 r21978 31 31 32 32 /** 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. 38 34 * 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. 45 47 */ 46 VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t u32Timeout, 47 uint32_t *pfEvents) 48 VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t cMillies, uint32_t *pfEvents) 48 49 { 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); 56 54 57 55 VBoxGuestWaitEventInfo waitEvent; 58 int rc; 59 60 waitEvent.u32TimeoutIn = u32Timeout; 56 waitEvent.u32TimeoutIn = cMillies; 61 57 waitEvent.u32EventMaskIn = fMask; 62 58 waitEvent.u32Result = VBOXGUEST_WAITEVENT_ERROR; 63 59 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)); 69 70 return rc; 70 71 }
Note:
See TracChangeset
for help on using the changeset viewer.