Changeset 85021 in vbox
- Timestamp:
- Jul 1, 2020 11:42:30 AM (4 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
r84998 r85021 1048 1048 if (RT_FAILURE(rc)) 1049 1049 return rc; 1050 1051 /* Set the default protocol version to use. */ 1050 Assert(pCtx->uClientID); 1051 1052 /* Set the default protocol version we would like to use. */ 1052 1053 pCtx->uProtocol = 3; 1053 Assert(pCtx->uClientID);1054 1054 1055 1055 /* … … 1062 1062 1063 1063 /* 1064 * Check if the host is >= VBox 5.0 which in case supports GUEST_DND_CONNECT. 1064 * Try sending the connect message to tell the protocol version to use. 1065 * Note: This might fail when the Guest Additions run on an older VBox host (< VBox 5.0) which 1066 * does not implement this command. 1065 1067 */ 1066 bool fSupportsConnectReq = false; 1068 HGCMMsgConnect Msg; 1069 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_DND_CONNECT, 2); 1070 /** @todo Context ID not used yet. */ 1071 Msg.u.v3.uContext.SetUInt32(0); 1072 Msg.u.v3.uProtocol.SetUInt32(pCtx->uProtocol); 1073 Msg.u.v3.uFlags.SetUInt32(0); /* Unused at the moment. */ 1074 1075 rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); 1067 1076 if (RT_SUCCESS(rc)) 1068 1077 { 1069 /* The guest property service might not be available. Not fatal. */ 1070 uint32_t uGuestPropSvcClientID; 1071 rc2 = VbglR3GuestPropConnect(&uGuestPropSvcClientID); 1072 if (RT_SUCCESS(rc2)) 1073 { 1074 char *pszHostVersion; 1075 rc2 = VbglR3GuestPropReadValueAlloc(uGuestPropSvcClientID, "/VirtualBox/HostInfo/VBoxVer", &pszHostVersion); 1076 if (RT_SUCCESS(rc2)) 1077 { 1078 fSupportsConnectReq = RTStrVersionCompare(pszHostVersion, "5.0") >= 0; 1079 LogFlowFunc(("pszHostVersion=%s, fSupportsConnectReq=%RTbool\n", pszHostVersion, fSupportsConnectReq)); 1080 VbglR3GuestPropReadValueFree(pszHostVersion); 1081 } 1082 1083 VbglR3GuestPropDisconnect(uGuestPropSvcClientID); 1084 } 1085 1086 if (RT_FAILURE(rc2)) 1087 LogFlowFunc(("Retrieving host version failed with rc=%Rrc\n", rc2)); 1088 } 1089 1090 if (fSupportsConnectReq) 1091 { 1092 /* 1093 * Try sending the connect message to tell the protocol version to use. 1094 * Note: This might fail when the Guest Additions run on an older VBox host (< VBox 5.0) which 1095 * does not implement this command. 1096 */ 1097 HGCMMsgConnect Msg; 1098 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_DND_CONNECT, 3); 1099 /** @todo Context ID not used yet. */ 1100 Msg.u.v3.uContext.SetUInt32(0); 1101 Msg.u.v3.uProtocol.SetUInt32(pCtx->uProtocol); 1102 Msg.u.v3.uFlags.SetUInt32(0); /* Unused at the moment. */ 1103 1104 rc2 = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); 1105 if (RT_FAILURE(rc2)) 1106 fSupportsConnectReq = false; 1107 1108 LogFlowFunc(("Connection request ended with rc=%Rrc\n", rc2)); 1109 } 1110 1111 if (fSupportsConnectReq) 1112 { 1078 /* Set the protocol version we're going to use as told by the host. */ 1079 rc = Msg.u.v3.uProtocol.GetUInt32(&pCtx->uProtocol); AssertRC(rc); 1080 1113 1081 pCtx->cbMaxChunkSize = _64K; /** @todo Use a scratch buffer on the heap? */ 1114 1082 } 1115 else /* GUEST_DND_CONNECT not supported; the user needs to upgrade the host. */ 1116 rc = VERR_NOT_SUPPORTED; 1083 else 1084 pCtx->uProtocol = 0; /* We're using protocol v0 (initial draft) as a fallback. */ 1085 1086 /** @todo Implement protocol feature flags. */ 1117 1087 1118 1088 LogFlowFunc(("uClient=%RU32, uProtocol=%RU32, rc=%Rrc\n", pCtx->uClientID, pCtx->uProtocol, rc)); -
trunk/src/VBox/HostServices/DragAndDrop/VBoxDragAndDropSvc.cpp
r82968 r85021 489 489 rc = HGCMSvcGetU32(&paParms[idxProto + 1], &data.uFlags); 490 490 if (RT_SUCCESS(rc)) 491 { 492 unsigned uProtocolVer = 3; /* The protocol version we're going to use. */ 493 494 /* Make sure we're only setting a protocl version we're supporting on the host. */ 495 if (data.uProtocol > uProtocolVer) 496 data.uProtocol = uProtocolVer; 497 491 498 pClient->SetProtocolVer(data.uProtocol); 492 if (RT_SUCCESS(rc)) 493 { 499 500 /* Return the highest protocol version we're supporting. */ 501 paParms[idxProto].u.uint32 = data.uProtocol; 502 494 503 LogFlowFunc(("Client %RU32 is now using protocol v%RU32\n", pClient->GetClientID(), pClient->GetProtocolVer())); 495 504 DO_HOST_CALLBACK();
Note:
See TracChangeset
for help on using the changeset viewer.