Changeset 85554 in vbox for trunk/src/VBox
- Timestamp:
- Jul 30, 2020 1:07:17 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139622
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestDnDPrivate.h
r85553 r85554 674 674 * @param cbBuf Size (in bytes) of data to use. 675 675 */ 676 int setNextPointer(void *pvBuf, uint32_t cbBuf)676 int appendPointer(void *pvBuf, uint32_t cbBuf) 677 677 { 678 678 PVBOXHGCMSVCPARM pParm = getNextParam(); … … 699 699 * @param pszString Pointer to string data to use. 700 700 */ 701 int setNextString(const char *pszString)701 int appendString(const char *pszString) 702 702 { 703 703 PVBOXHGCMSVCPARM pParm = getNextParam(); … … 719 719 * @param u32Val uint32_t value to use. 720 720 */ 721 int setNextUInt32(uint32_t u32Val)721 int appendUInt32(uint32_t u32Val) 722 722 { 723 723 PVBOXHGCMSVCPARM pParm = getNextParam(); … … 735 735 * @param u64Val uint64_t value to use. 736 736 */ 737 int setNextUInt64(uint64_t u64Val)737 int appendUInt64(uint64_t u64Val) 738 738 { 739 739 PVBOXHGCMSVCPARM pParm = getNextParam(); -
trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp
r85553 r85554 1365 1365 Msg.setType(HOST_DND_CANCEL); 1366 1366 if (m_DataBase.uProtocolVersion >= 3) 1367 Msg. setNextUInt32(0); /** @todo ContextID not used yet. */1367 Msg.appendUInt32(0); /** @todo ContextID not used yet. */ 1368 1368 1369 1369 LogRel2(("DnD: Cancelling operation on guest ...\n")); -
trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
r85537 r85554 277 277 Msg.setType(HOST_DND_GH_REQ_PENDING); 278 278 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); 281 281 282 282 int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); … … 1105 1105 Msg.setType(HOST_DND_GH_EVT_DROPPED); 1106 1106 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); 1111 1111 1112 1112 /* Make the initial call to the guest by telling that we initiated the "dropped" event on … … 1225 1225 Msg.setType(HOST_DND_GH_EVT_DROPPED); 1226 1226 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); 1231 1231 1232 1232 /* 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 317 317 Msg.setType(HOST_DND_HG_EVT_ENTER); 318 318 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); 327 327 328 328 rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); … … 395 395 Msg.setType(HOST_DND_HG_EVT_MOVE); 396 396 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); 405 405 406 406 rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); … … 442 442 Msg.setType(HOST_DND_HG_EVT_LEAVE); 443 443 if (m_DataBase.uProtocolVersion >= 3) 444 Msg. setNextUInt32(0); /** @todo ContextID not used yet. */444 Msg.appendUInt32(0); /** @todo ContextID not used yet. */ 445 445 446 446 int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); … … 518 518 Msg.setType(HOST_DND_HG_EVT_DROPPED); 519 519 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); 528 528 529 529 int vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); … … 838 838 if (m_DataBase.uProtocolVersion < 3) 839 839 { 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 */ 844 844 /* Fill in the current data block size to send. 845 845 * Note: Only supports uint32_t. */ 846 Msg. setNextUInt32((uint32_t)cbChunk); /* cbData */846 Msg.appendUInt32((uint32_t)cbChunk); /* cbData */ 847 847 } 848 848 else 849 849 { 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. */ 855 855 } 856 856 … … 893 893 pCtx->getTotalAnnounced(), pCtx->Meta.cbData, pCtx->Transfer.cObjToProcess)); 894 894 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. */ 907 907 908 908 int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); … … 926 926 pMsg->setType(HOST_DND_HG_SND_DIR); 927 927 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 */ 932 932 933 933 return VINF_SUCCESS; … … 986 986 */ 987 987 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 */ 994 994 995 995 LogRel2(("DnD: Transferring host file '%s' to guest (as '%s', %zu bytes, mode %#x)\n", … … 1050 1050 const size_t cchDstPath = RTStrNLen(pcszDstPath, RTPATH_MAX); 1051 1051 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 */ 1054 1054 } 1055 1055 else if (m_DataBase.uProtocolVersion >= 2) 1056 1056 { 1057 pMsg-> setNextUInt32(0); /** @todo ContextID not used yet. */1057 pMsg->appendUInt32(0); /** @todo ContextID not used yet. */ 1058 1058 } 1059 1059 … … 1072 1072 if (m_DataBase.uProtocolVersion <= 1) 1073 1073 { 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 */ 1077 1077 } 1078 1078 else /* Protocol v2 and up. */ 1079 1079 { 1080 pMsg-> setNextPointer(pvBuf, cbRead); /* pvData */1081 pMsg-> setNextUInt32(cbRead); /* cbData */1080 pMsg->appendPointer(pvBuf, cbRead); /* pvData */ 1081 pMsg->appendUInt32(cbRead); /* cbData */ 1082 1082 1083 1083 if (m_DataBase.uProtocolVersion >= 3) 1084 1084 { 1085 1085 /** @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 */ 1088 1088 } 1089 1089 }
Note:
See TracChangeset
for help on using the changeset viewer.