VirtualBox

Ignore:
Timestamp:
Nov 19, 2008 2:10:24 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39566
Message:

Additions/HGCM: merged code for HGCMCall and HGCMCallTimed, as per todo

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

Legend:

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

    r14207 r14352  
    187187}
    188188
    189 DECLVBGL(int) VbglHGCMCallTimeout (VBGLHGCMHANDLE handle,
    190                                    VBoxGuestHGCMCallInfoTimeout *pData, uint32_t cbData)
     189DECLVBGL(int) VbglHGCMCallTimed (VBGLHGCMHANDLE handle,
     190                                 VBoxGuestHGCMCallInfoTimed *pData, uint32_t cbData)
    191191{
    192192    int rc = VINF_SUCCESS;
    193193
    194     VBGL_HGCM_ASSERTMsg(cbData >= sizeof (VBoxGuestHGCMCallInfoTimeout) + pData->info.cParms * sizeof (HGCMFunctionParameter),
    195                         ("cbData = %d, cParms = %d (calculated size %d)\n", cbData, pData->info.cParms, sizeof (VBoxGuestHGCMCallInfoTimeout) + pData->info.cParms * sizeof (VBoxGuestHGCMCallInfo)));
    196 
    197     if (pData->u32Timeout == RT_INDEFINITE_WAIT)
    198     {
    199         uint32_t cbDataNew = cbData - RT_OFFSETOF(VBoxGuestHGCMCallInfoTimeout, info);
    200         rc = vbglDriverIOCtl (&handle->driver, VBOXGUEST_IOCTL_HGCM_CALL(cbDataNew), &pData->info,
    201                               cbDataNew);
    202     }
    203     else
    204         rc = vbglDriverIOCtl (&handle->driver, VBOXGUEST_IOCTL_HGCM_CALL_TIMEOUT(cbData), pData, cbData);
     194    uint32_t cbExpected =   sizeof (VBoxGuestHGCMCallInfoTimed)
     195                          + pData->info.cParms * sizeof (HGCMFunctionParameter);
     196    VBGL_HGCM_ASSERTMsg(cbData >= cbExpected,
     197                        ("cbData = %d, cParms = %d (calculated size %d)\n",
     198                        cbData, pData->info.cParms, cbExpected));
     199
     200    rc = vbglDriverIOCtl (&handle->driver, VBOXGUEST_IOCTL_HGCM_CALL_TIMED(cbData),
     201                          pData, cbData);
    205202
    206203    return rc;
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp

    r14214 r14352  
    846846    Msg.size.SetUInt32(0);
    847847
    848     int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL_TIMEOUT(sizeof(Msg)), &Msg, sizeof(Msg));
     848    int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL_TIMED(sizeof(Msg)), &Msg, sizeof(Msg));
    849849    if (RT_SUCCESS(rc))
    850850        rc = Msg.hdr.info.result;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette