VirtualBox

Ignore:
Timestamp:
Apr 16, 2010 10:13:22 AM (15 years ago)
Author:
vboxsync
Message:

Guest Control: Update (guest shutdown handling, timed peeks).

File:
1 edited

Legend:

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

    r28286 r28402  
    107107 *                          in a second call to the host.
    108108 */
    109 VBGLR3DECL(int) VbglR3GuestCtrlGetHostMsg(uint32_t u32ClientId, uint32_t *puMsg, uint32_t *puNumParms)
     109VBGLR3DECL(int) VbglR3GuestCtrlGetHostMsg(uint32_t u32ClientId, uint32_t *puMsg, uint32_t *puNumParms, uint32_t u32Timeout)
    110110{
    111111    AssertPtr(puMsg);
     
    114114    VBoxGuestCtrlHGCMMsgType Msg;
    115115
    116     Msg.hdr.result = VERR_WRONG_ORDER;
    117     Msg.hdr.u32ClientID = u32ClientId;
    118     Msg.hdr.u32Function = GUEST_GET_HOST_MSG; /* Tell the host we want our next command. */
    119     Msg.hdr.cParms = 2;                       /* Just peek for the next message! */
     116    Msg.hdr.u32Timeout = u32Timeout;
     117    Msg.hdr.fInterruptible = true;
     118
     119    Msg.hdr.info.result = VERR_WRONG_ORDER;
     120    Msg.hdr.info.u32ClientID = u32ClientId;
     121    Msg.hdr.info.u32Function = GUEST_GET_HOST_MSG; /* Tell the host we want our next command. */
     122    Msg.hdr.info.cParms = 2;                       /* Just peek for the next message! */
    120123
    121124    VbglHGCMParmUInt32Set(&Msg.msg, 0);
    122125    VbglHGCMParmUInt32Set(&Msg.num_parms, 0);
    123126
    124     int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg));
     127    int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL_TIMED(sizeof(Msg)), &Msg, sizeof(Msg));
    125128    if (RT_SUCCESS(rc))
    126129    {
     
    129132            rc = VbglHGCMParmUInt32Get(&Msg.num_parms, puNumParms);
    130133            if (RT_SUCCESS(rc))
    131                 rc = Msg.hdr.result;
     134                rc = Msg.hdr.info.result;
    132135                /* Ok, so now we know what message type and how much parameters there are. */
    133136    }
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