Changeset 58230 in vbox for trunk/src/VBox
- Timestamp:
- Oct 14, 2015 11:31:33 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103394
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/DragAndDrop/service.cpp
r58212 r58230 382 382 if (cParms == 2) 383 383 { 384 uint32_t uProtocol; 385 rc = paParms[0].getUInt32(&uProtocol); /* Get protocol version. */ 386 if (RT_SUCCESS(rc)) 387 rc = pClient->setProtocol(uProtocol); 384 VBOXDNDCBCONNECTMSGDATA data; 385 data.hdr.u32Magic = CB_MAGIC_DND_CONNECT; 386 rc = paParms[0].getUInt32(&data.uProtocol); 387 if (RT_SUCCESS(rc)) 388 rc = paParms[1].getUInt32(&data.uFlags); 389 if (RT_SUCCESS(rc)) 390 rc = pClient->setProtocol(data.uProtocol); 388 391 if (RT_SUCCESS(rc)) 389 392 { 390 393 LogFlowFunc(("Client %RU32 is now using protocol v%RU32\n", pClient->clientId(), pClient->protocol())); 391 /** @todo Handle connection flags (paParms[1]). */394 DO_HOST_CALLBACK(); 392 395 } 393 394 /* Note: Does not reach the host; the client's protocol version395 * is only kept in this service. */396 396 } 397 397 break; -
trunk/src/VBox/Main/include/GuestDnDPrivate.h
r58225 r58230 151 151 if (strData.isNotEmpty()) 152 152 { 153 const size_t cb Data = strData.length() + 1; /* Include terminating zero. */154 rc = resize(cb Data);153 const size_t cbStrData = strData.length() + 1; /* Include terminating zero. */ 154 rc = resize(cbStrData); 155 155 if (RT_SUCCESS(rc)) 156 memcpy(pvData, strData.c_str(), cb Data);156 memcpy(pvData, strData.c_str(), cbStrData); 157 157 } 158 158 -
trunk/src/VBox/Main/include/GuestImpl.h
r57425 r58230 100 100 return setErrorInternal(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, false, true); 101 101 } 102 uint32_t i_getAdditionsRevision(void) { return mData.mAdditionsRevision; } 102 103 uint32_t i_getAdditionsVersion(void) { return mData.mAdditionsVersionFull; } 103 104 VBOXOSTYPE i_getGuestOSType(void) { return mData.mOSType; } -
trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp
r58212 r58230 362 362 switch (u32Function) 363 363 { 364 case DragAndDropSvc::GUEST_DND_CONNECT: 365 { 366 /* Not used in here (yet). */ 367 rc = VINF_SUCCESS; 368 break; 369 } 370 364 371 case DragAndDropSvc::GUEST_DND_HG_ACK_OP: 365 372 { … … 743 750 /* Initialzie private stuff. */ 744 751 mDataBase.m_cTransfersPending = 0; 752 mDataBase.m_uProtocolVersion = 0; 745 753 } 746 754 … … 795 803 } 796 804 805 /** 806 * Tries to guess the DnD protocol version to use on the guest, based on the 807 * installed Guest Additions version + revision. 808 * 809 * If unable to retrieve the protocol version, VERR_NOT_FOUND is returned along 810 * with protocol version 1. 811 * 812 * @return IPRT status code. 813 * @param puProto Where to store the protocol version. 814 */ 797 815 int GuestDnDBase::getProtocolVersion(uint32_t *puProto) 798 816 { … … 801 819 int rc; 802 820 803 uint32_t uProto = 1; /* Use protocol v1 as a fallback. */821 uint32_t uProto = 0; 804 822 uint32_t uVerAdditions = 0; 823 uint32_t uRevAdditions = 0; 805 824 if ( m_pGuest 806 && (uVerAdditions = m_pGuest->i_getAdditionsVersion()) > 0) 807 { 808 #if 1 825 && (uVerAdditions = m_pGuest->i_getAdditionsVersion()) > 0 826 && (uRevAdditions = m_pGuest->i_getAdditionsRevision()) > 0) 827 { 828 #ifdef _DEBUG 829 # if 0 809 830 /* Hardcode the to-used protocol version; nice for testing side effects. */ 810 831 uProto = 3; 811 #else 812 if (uVerAdditions >= VBOX_FULL_VERSION_MAKE(5, 0, 0)) 813 { 814 if (uVerAdditions >= VBOX_FULL_VERSION_MAKE(5, 0, 8)) 832 # endif 833 #endif 834 if (!uProto) /* Protocol not set yet? */ 835 { 836 if (uVerAdditions >= VBOX_FULL_VERSION_MAKE(5, 0, 0)) 815 837 { 816 uProto = 3; /* Since VBox 5.0.8: Protocol v3. */ 838 if (uRevAdditions >= 103344) /* Since r103344: Protocol v3. */ 839 { 840 uProto = 3; 841 } 842 else 843 uProto = 2; /* VBox 5.0.0 - 5.0.6: Protocol v2. */ 817 844 } 818 else 819 uProto = 2; /* VBox 5.0.0 - 5.0.6: Protocol v2. */ 820 } 821 #endif 822 LogRel3(("DnD: uVerAdditions=%RU32 (%RU32.%RU32.%RU32)\n", 823 uVerAdditions, VBOX_FULL_VERSION_GET_MAJOR(uVerAdditions), VBOX_FULL_VERSION_GET_MINOR(uVerAdditions), 824 VBOX_FULL_VERSION_GET_BUILD(uVerAdditions))); 825 rc = VINF_SUCCESS; 845 846 LogFlowFunc(("uVerAdditions=%RU32 (%RU32.%RU32.%RU32), r%RU32\n", 847 uVerAdditions, VBOX_FULL_VERSION_GET_MAJOR(uVerAdditions), VBOX_FULL_VERSION_GET_MINOR(uVerAdditions), 848 VBOX_FULL_VERSION_GET_BUILD(uVerAdditions), uRevAdditions)); 849 rc = VINF_SUCCESS; 850 } 826 851 } 827 852 else … … 831 856 } 832 857 833 LogRel 3(("DnD: uProto=%RU32, rc=%Rrc\n", uProto, rc));858 LogRel2(("DnD: Guest is using protocol v%RU32, rc=%Rrc\n", uProto, rc)); 834 859 835 860 *puProto = uProto; -
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r58212 r58230 804 804 Msg.setNextUInt32(pData->getFmtSize()); /* cbFormat */ 805 805 Msg.setNextPointer(pData->getMeta().getDataMutable(), pData->getMeta().getSize()); /* pvData */ 806 /* Note1: Fill in the total datato send.807 * Note 2: Only supports uint32_t. */808 Msg.setNextUInt32((uint32_t)pData->get Total());/* cbData */806 /* Fill in the current data block size to send. 807 * Note: Only supports uint32_t. */ 808 Msg.setNextUInt32((uint32_t)pData->getMeta().getSize()); /* cbData */ 809 809 } 810 810 else
Note:
See TracChangeset
for help on using the changeset viewer.