VirtualBox

Ignore:
Timestamp:
Nov 29, 2018 10:12:53 PM (6 years ago)
Author:
vboxsync
Message:

VBoxGuestControl: Optimizing message handling - part 4. bugref:9313

File:
1 edited

Legend:

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

    r75807 r75824  
    427427 * @return  IPRT status code.
    428428 * @param   idClient        The client ID returned by VbglR3GuestCtrlConnect().
    429  */
    430 VBGLR3DECL(int) VbglR3GuestCtrlMsgSkip(uint32_t idClient)
     429 * @param   rcSkip          The status code to pass back to Main when skipping.
     430 * @param   idMsg           The message ID to skip, pass UINT32_MAX to pass any.
     431 */
     432VBGLR3DECL(int) VbglR3GuestCtrlMsgSkip(uint32_t idClient, int rcSkip, uint32_t idMsg)
    431433{
    432434    if (vbglR3GuestCtrlSupportsPeekGetCancel(idClient))
    433435    {
    434         VBGLIOCHGCMCALL Hdr;
    435         VBGL_HGCM_HDR_INIT(&Hdr, idClient, GUEST_MSG_SKIP, 0);
    436         return VbglR3HGCMCall(&Hdr, sizeof(Hdr));
     436        struct
     437        {
     438            VBGLIOCHGCMCALL         Hdr;
     439            HGCMFunctionParameter   rcSkip;
     440            HGCMFunctionParameter   idMsg;
     441        } Msg;
     442        VBGL_HGCM_HDR_INIT(&Msg.Hdr, idClient, GUEST_MSG_SKIP, 2);
     443        VbglHGCMParmUInt32Set(&Msg.rcSkip, (uint32_t)rcSkip);
     444        VbglHGCMParmUInt32Set(&Msg.idMsg, idMsg);
     445        return VbglR3HGCMCall(&Msg.Hdr, sizeof(Msg));
    437446    }
    438447
     
    624633                *pidSession = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(pCtx->uContextID);
    625634        }
    626         /* Try get the context ID so we can inform the host about this message retrival failure. */
    627         else if (Msg.context.u.value32 != HOST_SESSION_CREATE)
    628             Msg.context.GetUInt32(&pCtx->uContextID);
    629635
    630636    } while (rc == VERR_INTERRUPTED && g_fVbglR3GuestCtrlHavePeekGetCancel);
     
    666672
    667673/**
    668  * Retrieves a HOST_SESSION_CLOSE message.
     674 * Retrieves a HOST_PATH_RENAME message.
    669675 */
    670676VBGLR3DECL(int) VbglR3GuestCtrlPathGetRename(PVBGLR3GUESTCTRLCMDCTX     pCtx,
     
    698704            Msg.flags.GetUInt32(pfFlags);
    699705        }
     706
    700707    } while (rc == VERR_INTERRUPTED && g_fVbglR3GuestCtrlHavePeekGetCancel);
    701708    return rc;
     
    913920        }
    914921    } while (rc == VERR_INTERRUPTED && g_fVbglR3GuestCtrlHavePeekGetCancel);
    915     return rc;
     922
     923    if (   rc != VERR_TOO_MUCH_DATA
     924        || g_fVbglR3GuestCtrlHavePeekGetCancel)
     925        return rc;
     926    return VERR_BUFFER_OVERFLOW;
    916927}
    917928
     
    11291140        }
    11301141    } while (rc == VERR_INTERRUPTED && g_fVbglR3GuestCtrlHavePeekGetCancel);
    1131     return rc;
     1142
     1143    if (   rc != VERR_TOO_MUCH_DATA
     1144        || g_fVbglR3GuestCtrlHavePeekGetCancel)
     1145        return rc;
     1146    return VERR_BUFFER_OVERFLOW;
    11321147}
    11331148
     
    11671182        }
    11681183    } while (rc == VERR_INTERRUPTED && g_fVbglR3GuestCtrlHavePeekGetCancel);
    1169     return rc;
     1184
     1185    if (   rc != VERR_TOO_MUCH_DATA
     1186        || g_fVbglR3GuestCtrlHavePeekGetCancel)
     1187        return rc;
     1188    return VERR_BUFFER_OVERFLOW;
    11701189}
    11711190
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