VirtualBox

Changeset 85554 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 30, 2020 1:07:17 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139622
Message:

DnD/Main: Renamed GuestDnDMsg::setNextXXX() -> GuestDnDMsg::appendXXX().

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestDnDPrivate.h

    r85553 r85554  
    674674     * @param   cbBuf           Size (in bytes) of data to use.
    675675     */
    676     int setNextPointer(void *pvBuf, uint32_t cbBuf)
     676    int appendPointer(void *pvBuf, uint32_t cbBuf)
    677677    {
    678678        PVBOXHGCMSVCPARM pParm = getNextParam();
     
    699699     * @param   pszString       Pointer to string data to use.
    700700     */
    701     int setNextString(const char *pszString)
     701    int appendString(const char *pszString)
    702702    {
    703703        PVBOXHGCMSVCPARM pParm = getNextParam();
     
    719719     * @param   u32Val          uint32_t value to use.
    720720     */
    721     int setNextUInt32(uint32_t u32Val)
     721    int appendUInt32(uint32_t u32Val)
    722722    {
    723723        PVBOXHGCMSVCPARM pParm = getNextParam();
     
    735735     * @param   u64Val          uint64_t value to use.
    736736     */
    737     int setNextUInt64(uint64_t u64Val)
     737    int appendUInt64(uint64_t u64Val)
    738738    {
    739739        PVBOXHGCMSVCPARM pParm = getNextParam();
  • trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp

    r85553 r85554  
    13651365    Msg.setType(HOST_DND_CANCEL);
    13661366    if (m_DataBase.uProtocolVersion >= 3)
    1367         Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
     1367        Msg.appendUInt32(0); /** @todo ContextID not used yet. */
    13681368
    13691369    LogRel2(("DnD: Cancelling operation on guest ...\n"));
  • trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp

    r85537 r85554  
    277277    Msg.setType(HOST_DND_GH_REQ_PENDING);
    278278    if (m_DataBase.uProtocolVersion >= 3)
    279         Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
    280     Msg.setNextUInt32(uScreenId);
     279        Msg.appendUInt32(0); /** @todo ContextID not used yet. */
     280    Msg.appendUInt32(uScreenId);
    281281
    282282    int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    11051105        Msg.setType(HOST_DND_GH_EVT_DROPPED);
    11061106        if (m_DataBase.uProtocolVersion >= 3)
    1107             Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
    1108         Msg.setNextPointer((void*)pCtx->strFmtRecv.c_str(), (uint32_t)pCtx->strFmtRecv.length() + 1);
    1109         Msg.setNextUInt32((uint32_t)pCtx->strFmtRecv.length() + 1);
    1110         Msg.setNextUInt32(pCtx->enmAction);
     1107            Msg.appendUInt32(0); /** @todo ContextID not used yet. */
     1108        Msg.appendPointer((void*)pCtx->strFmtRecv.c_str(), (uint32_t)pCtx->strFmtRecv.length() + 1);
     1109        Msg.appendUInt32((uint32_t)pCtx->strFmtRecv.length() + 1);
     1110        Msg.appendUInt32(pCtx->enmAction);
    11111111
    11121112        /* Make the initial call to the guest by telling that we initiated the "dropped" event on
     
    12251225        Msg.setType(HOST_DND_GH_EVT_DROPPED);
    12261226        if (m_DataBase.uProtocolVersion >= 3)
    1227             Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
    1228         Msg.setNextPointer((void*)pCtx->strFmtRecv.c_str(), (uint32_t)pCtx->strFmtRecv.length() + 1);
    1229         Msg.setNextUInt32((uint32_t)pCtx->strFmtRecv.length() + 1);
    1230         Msg.setNextUInt32(pCtx->enmAction);
     1227            Msg.appendUInt32(0); /** @todo ContextID not used yet. */
     1228        Msg.appendPointer((void*)pCtx->strFmtRecv.c_str(), (uint32_t)pCtx->strFmtRecv.length() + 1);
     1229        Msg.appendUInt32((uint32_t)pCtx->strFmtRecv.length() + 1);
     1230        Msg.appendUInt32(pCtx->enmAction);
    12311231
    12321232        /* Make the initial call to the guest by telling that we initiated the "dropped" event on
  • trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp

    r85537 r85554  
    317317        Msg.setType(HOST_DND_HG_EVT_ENTER);
    318318        if (m_DataBase.uProtocolVersion >= 3)
    319             Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
    320         Msg.setNextUInt32(aScreenId);
    321         Msg.setNextUInt32(aX);
    322         Msg.setNextUInt32(aY);
    323         Msg.setNextUInt32(dndActionDefault);
    324         Msg.setNextUInt32(dndActionListAllowed);
    325         Msg.setNextPointer((void *)strFormats.c_str(), cbFormats);
    326         Msg.setNextUInt32(cbFormats);
     319            Msg.appendUInt32(0); /** @todo ContextID not used yet. */
     320        Msg.appendUInt32(aScreenId);
     321        Msg.appendUInt32(aX);
     322        Msg.appendUInt32(aY);
     323        Msg.appendUInt32(dndActionDefault);
     324        Msg.appendUInt32(dndActionListAllowed);
     325        Msg.appendPointer((void *)strFormats.c_str(), cbFormats);
     326        Msg.appendUInt32(cbFormats);
    327327
    328328        rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    395395        Msg.setType(HOST_DND_HG_EVT_MOVE);
    396396        if (m_DataBase.uProtocolVersion >= 3)
    397             Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
    398         Msg.setNextUInt32(aScreenId);
    399         Msg.setNextUInt32(aX);
    400         Msg.setNextUInt32(aY);
    401         Msg.setNextUInt32(dndActionDefault);
    402         Msg.setNextUInt32(dndActionListAllowed);
    403         Msg.setNextPointer((void *)strFormats.c_str(), cbFormats);
    404         Msg.setNextUInt32(cbFormats);
     397            Msg.appendUInt32(0); /** @todo ContextID not used yet. */
     398        Msg.appendUInt32(aScreenId);
     399        Msg.appendUInt32(aX);
     400        Msg.appendUInt32(aY);
     401        Msg.appendUInt32(dndActionDefault);
     402        Msg.appendUInt32(dndActionListAllowed);
     403        Msg.appendPointer((void *)strFormats.c_str(), cbFormats);
     404        Msg.appendUInt32(cbFormats);
    405405
    406406        rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    442442    Msg.setType(HOST_DND_HG_EVT_LEAVE);
    443443    if (m_DataBase.uProtocolVersion >= 3)
    444         Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
     444        Msg.appendUInt32(0); /** @todo ContextID not used yet. */
    445445
    446446    int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    518518        Msg.setType(HOST_DND_HG_EVT_DROPPED);
    519519        if (m_DataBase.uProtocolVersion >= 3)
    520             Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
    521         Msg.setNextUInt32(aScreenId);
    522         Msg.setNextUInt32(aX);
    523         Msg.setNextUInt32(aY);
    524         Msg.setNextUInt32(dndActionDefault);
    525         Msg.setNextUInt32(dndActionListAllowed);
    526         Msg.setNextPointer((void*)strFormats.c_str(), cbFormats);
    527         Msg.setNextUInt32(cbFormats);
     520            Msg.appendUInt32(0); /** @todo ContextID not used yet. */
     521        Msg.appendUInt32(aScreenId);
     522        Msg.appendUInt32(aX);
     523        Msg.appendUInt32(aY);
     524        Msg.appendUInt32(dndActionDefault);
     525        Msg.appendUInt32(dndActionListAllowed);
     526        Msg.appendPointer((void*)strFormats.c_str(), cbFormats);
     527        Msg.appendUInt32(cbFormats);
    528528
    529529        int vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    838838        if (m_DataBase.uProtocolVersion < 3)
    839839        {
    840             Msg.setNextUInt32(pCtx->uScreenID);                                 /* uScreenId */
    841             Msg.setNextPointer(unconst(pcszFmt), (uint32_t)cbFmt);              /* pvFormat */
    842             Msg.setNextUInt32((uint32_t)cbFmt);                                 /* cbFormat */
    843             Msg.setNextPointer(pvChunk, (uint32_t)cbChunk);                     /* pvData */
     840            Msg.appendUInt32(pCtx->uScreenID);                                 /* uScreenId */
     841            Msg.appendPointer(unconst(pcszFmt), (uint32_t)cbFmt);              /* pvFormat */
     842            Msg.appendUInt32((uint32_t)cbFmt);                                 /* cbFormat */
     843            Msg.appendPointer(pvChunk, (uint32_t)cbChunk);                     /* pvData */
    844844            /* Fill in the current data block size to send.
    845845             * Note: Only supports uint32_t. */
    846             Msg.setNextUInt32((uint32_t)cbChunk);                               /* cbData */
     846            Msg.appendUInt32((uint32_t)cbChunk);                               /* cbData */
    847847        }
    848848        else
    849849        {
    850             Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
    851             Msg.setNextPointer(pvChunk, (uint32_t)cbChunk);                     /* pvData */
    852             Msg.setNextUInt32((uint32_t)cbChunk);                               /* cbData */
    853             Msg.setNextPointer(NULL, 0);                                        /** @todo pvChecksum; not used yet. */
    854             Msg.setNextUInt32(0);                                               /** @todo cbChecksum; not used yet. */
     850            Msg.appendUInt32(0); /** @todo ContextID not used yet. */
     851            Msg.appendPointer(pvChunk, (uint32_t)cbChunk);                     /* pvData */
     852            Msg.appendUInt32((uint32_t)cbChunk);                               /* cbData */
     853            Msg.appendPointer(NULL, 0);                                        /** @todo pvChecksum; not used yet. */
     854            Msg.appendUInt32(0);                                               /** @todo cbChecksum; not used yet. */
    855855        }
    856856
     
    893893             pCtx->getTotalAnnounced(), pCtx->Meta.cbData, pCtx->Transfer.cObjToProcess));
    894894
    895     Msg.setNextUInt32(0);                                                /** @todo uContext; not used yet. */
    896     Msg.setNextUInt32(0);                                                /** @todo uFlags; not used yet. */
    897     Msg.setNextUInt32(pCtx->uScreenID);                                  /* uScreen */
    898     Msg.setNextUInt64(pCtx->getTotalAnnounced());                        /* cbTotal */
    899     Msg.setNextUInt32((uint32_t)pCtx->Meta.cbData);                      /* cbMeta*/
    900     Msg.setNextPointer(unconst(pCtx->Meta.strFmt.c_str()), (uint32_t)pCtx->Meta.strFmt.length() + 1); /* pvMetaFmt */
    901     Msg.setNextUInt32((uint32_t)pCtx->Meta.strFmt.length() + 1);                                      /* cbMetaFmt */
    902     Msg.setNextUInt64(pCtx->Transfer.cObjToProcess);                     /* cObjects */
    903     Msg.setNextUInt32(0);                                                /** @todo enmCompression; not used yet. */
    904     Msg.setNextUInt32(0);                                                /** @todo enmChecksumType; not used yet. */
    905     Msg.setNextPointer(NULL, 0);                                         /** @todo pvChecksum; not used yet. */
    906     Msg.setNextUInt32(0);                                                /** @todo cbChecksum; not used yet. */
     895    Msg.appendUInt32(0);                                                /** @todo uContext; not used yet. */
     896    Msg.appendUInt32(0);                                                /** @todo uFlags; not used yet. */
     897    Msg.appendUInt32(pCtx->uScreenID);                                  /* uScreen */
     898    Msg.appendUInt64(pCtx->getTotalAnnounced());                        /* cbTotal */
     899    Msg.appendUInt32((uint32_t)pCtx->Meta.cbData);                      /* cbMeta*/
     900    Msg.appendPointer(unconst(pCtx->Meta.strFmt.c_str()), (uint32_t)pCtx->Meta.strFmt.length() + 1); /* pvMetaFmt */
     901    Msg.appendUInt32((uint32_t)pCtx->Meta.strFmt.length() + 1);                                      /* cbMetaFmt */
     902    Msg.appendUInt64(pCtx->Transfer.cObjToProcess);                     /* cObjects */
     903    Msg.appendUInt32(0);                                                /** @todo enmCompression; not used yet. */
     904    Msg.appendUInt32(0);                                                /** @todo enmChecksumType; not used yet. */
     905    Msg.appendPointer(NULL, 0);                                         /** @todo pvChecksum; not used yet. */
     906    Msg.appendUInt32(0);                                                /** @todo cbChecksum; not used yet. */
    907907
    908908    int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    926926    pMsg->setType(HOST_DND_HG_SND_DIR);
    927927    if (m_DataBase.uProtocolVersion >= 3)
    928         pMsg->setNextUInt32(0); /** @todo ContextID not used yet. */
    929     pMsg->setNextString(pcszDstPath);                    /* path */
    930     pMsg->setNextUInt32((uint32_t)(cchPath + 1));        /* path length, including terminator. */
    931     pMsg->setNextUInt32(DnDTransferObjectGetMode(pObj)); /* mode */
     928        pMsg->appendUInt32(0); /** @todo ContextID not used yet. */
     929    pMsg->appendString(pcszDstPath);                    /* path */
     930    pMsg->appendUInt32((uint32_t)(cchPath + 1));        /* path length, including terminator. */
     931    pMsg->appendUInt32(DnDTransferObjectGetMode(pObj)); /* mode */
    932932
    933933    return VINF_SUCCESS;
     
    986986                 */
    987987                pMsg->setType(HOST_DND_HG_SND_FILE_HDR);
    988                 pMsg->setNextUInt32(0); /** @todo ContextID not used yet. */
    989                 pMsg->setNextString(pcszDstPath);                    /* pvName */
    990                 pMsg->setNextUInt32((uint32_t)(cchDstPath + 1));     /* cbName */
    991                 pMsg->setNextUInt32(0);                              /* uFlags */
    992                 pMsg->setNextUInt32(fMode);                          /* fMode */
    993                 pMsg->setNextUInt64(cbSize);                         /* uSize */
     988                pMsg->appendUInt32(0); /** @todo ContextID not used yet. */
     989                pMsg->appendString(pcszDstPath);                    /* pvName */
     990                pMsg->appendUInt32((uint32_t)(cchDstPath + 1));     /* cbName */
     991                pMsg->appendUInt32(0);                              /* uFlags */
     992                pMsg->appendUInt32(fMode);                          /* fMode */
     993                pMsg->appendUInt64(cbSize);                         /* uSize */
    994994
    995995                LogRel2(("DnD: Transferring host file '%s' to guest (as '%s', %zu bytes, mode %#x)\n",
     
    10501050        const size_t cchDstPath = RTStrNLen(pcszDstPath, RTPATH_MAX);
    10511051
    1052         pMsg->setNextString(pcszDstPath);              /* pvName */
    1053         pMsg->setNextUInt32((uint32_t)cchDstPath + 1); /* cbName */
     1052        pMsg->appendString(pcszDstPath);              /* pvName */
     1053        pMsg->appendUInt32((uint32_t)cchDstPath + 1); /* cbName */
    10541054    }
    10551055    else if (m_DataBase.uProtocolVersion >= 2)
    10561056    {
    1057         pMsg->setNextUInt32(0);                        /** @todo ContextID not used yet. */
     1057        pMsg->appendUInt32(0);                        /** @todo ContextID not used yet. */
    10581058    }
    10591059
     
    10721072        if (m_DataBase.uProtocolVersion <= 1)
    10731073        {
    1074             pMsg->setNextPointer(pvBuf, cbRead);                            /* pvData */
    1075             pMsg->setNextUInt32(cbRead);                                    /* cbData */
    1076             pMsg->setNextUInt32(DnDTransferObjectGetMode(pObj));            /* fMode */
     1074            pMsg->appendPointer(pvBuf, cbRead);                            /* pvData */
     1075            pMsg->appendUInt32(cbRead);                                    /* cbData */
     1076            pMsg->appendUInt32(DnDTransferObjectGetMode(pObj));            /* fMode */
    10771077        }
    10781078        else /* Protocol v2 and up. */
    10791079        {
    1080             pMsg->setNextPointer(pvBuf, cbRead);                            /* pvData */
    1081             pMsg->setNextUInt32(cbRead);                                    /* cbData */
     1080            pMsg->appendPointer(pvBuf, cbRead);                            /* pvData */
     1081            pMsg->appendUInt32(cbRead);                                    /* cbData */
    10821082
    10831083            if (m_DataBase.uProtocolVersion >= 3)
    10841084            {
    10851085                /** @todo Calculate checksum. */
    1086                 pMsg->setNextPointer(NULL, 0);                              /* pvChecksum */
    1087                 pMsg->setNextUInt32(0);                                     /* cbChecksum */
     1086                pMsg->appendPointer(NULL, 0);                              /* pvChecksum */
     1087                pMsg->appendUInt32(0);                                     /* cbChecksum */
    10881088            }
    10891089        }
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