Changeset 58257 in vbox for trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
- Timestamp:
- Oct 15, 2015 8:31:46 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r58231 r58257 303 303 GuestDnDMsg Msg; 304 304 Msg.setType(HOST_DND_HG_EVT_ENTER); 305 if (mDataBase.m_uProtocolVersion >= 3) 306 Msg.setNextUInt32(0); /** @todo ContextID not used yet. */ 305 307 Msg.setNextUInt32(aScreenId); 306 308 Msg.setNextUInt32(aX); … … 377 379 GuestDnDMsg Msg; 378 380 Msg.setType(HOST_DND_HG_EVT_MOVE); 381 if (mDataBase.m_uProtocolVersion >= 3) 382 Msg.setNextUInt32(0); /** @todo ContextID not used yet. */ 379 383 Msg.setNextUInt32(aScreenId); 380 384 Msg.setNextUInt32(aX); … … 489 493 GuestDnDMsg Msg; 490 494 Msg.setType(HOST_DND_HG_EVT_DROPPED); 495 if (mDataBase.m_uProtocolVersion >= 3) 496 Msg.setNextUInt32(0); /** @todo ContextID not used yet. */ 491 497 Msg.setNextUInt32(aScreenId); 492 498 Msg.setNextUInt32(aX); … … 810 816 else 811 817 { 812 Msg.setNextUInt32(0); /** @todo uContext;not used yet. */818 Msg.setNextUInt32(0); /** @todo ContextID not used yet. */ 813 819 Msg.setNextPointer(pData->getMeta().getDataMutable(), pData->getMeta().getSize()); /* pvData */ 814 820 Msg.setNextUInt32(pData->getMeta().getSize()); /* cbData */ … … 872 878 873 879 pMsg->setType(HOST_DND_HG_SND_DIR); 880 if (mDataBase.m_uProtocolVersion >= 3) 881 pMsg->setNextUInt32(0); /** @todo ContextID not used yet. */ 874 882 pMsg->setNextString(strPath.c_str()); /* path */ 875 883 pMsg->setNextUInt32((uint32_t)(strPath.length() + 1)); /* path length (maximum is RTPATH_MAX on guest side). */ … … 920 928 */ 921 929 pMsg->setType(HOST_DND_HG_SND_FILE_HDR); 922 pMsg->setNextUInt32(0); /* uContextID */ 923 rc = pMsg->setNextString(pObj->GetDestPath().c_str()); /* pvName */ 924 AssertRC(rc); 930 pMsg->setNextUInt32(0); /** @todo ContextID not used yet. */ 931 pMsg->setNextString(pObj->GetDestPath().c_str()); /* pvName */ 925 932 pMsg->setNextUInt32((uint32_t)(pObj->GetDestPath().length() + 1)); /* cbName */ 926 933 pMsg->setNextUInt32(0); /* uFlags */ … … 989 996 else if (mDataBase.m_uProtocolVersion >= 2) 990 997 { 991 /* Since protocol v2 we also send the context ID. Currently unused. */ 992 pMsg->setNextUInt32(0); /* uContext */ 998 pMsg->setNextUInt32(0); /** @todo ContextID not used yet. */ 993 999 } 994 1000 … … 1057 1063 AssertPtr(pCBData); 1058 1064 AssertReturn(sizeof(VBOXDNDCBHGGETNEXTHOSTMSG) == cbParms, VERR_INVALID_PARAMETER); 1059 AssertReturn(CB_MAGIC_DND_HG_GET_NEXT_HOST_MSG == pCBData->hdr.u 32Magic, VERR_INVALID_PARAMETER);1065 AssertReturn(CB_MAGIC_DND_HG_GET_NEXT_HOST_MSG == pCBData->hdr.uMagic, VERR_INVALID_PARAMETER); 1060 1066 1061 1067 try … … 1097 1103 AssertPtr(pCBData); 1098 1104 AssertReturn(sizeof(VBOXDNDCBEVTERRORDATA) == cbParms, VERR_INVALID_PARAMETER); 1099 AssertReturn(CB_MAGIC_DND_GH_EVT_ERROR == pCBData->hdr.u 32Magic, VERR_INVALID_PARAMETER);1105 AssertReturn(CB_MAGIC_DND_GH_EVT_ERROR == pCBData->hdr.uMagic, VERR_INVALID_PARAMETER); 1100 1106 1101 1107 pCtx->mpResp->reset(); … … 1243 1249 AssertPtr(pCtx->mpResp); 1244 1250 1245 #define URI_DATA_IS_VALID_BREAK(x) \1246 if (!x) \1247 { \1248 LogFlowFunc(("Invalid URI data value for \"" #x "\"\n")); \1249 rc = VERR_INVALID_PARAMETER; \1250 break; \1251 }1252 1253 1251 #define REGISTER_CALLBACK(x) \ 1254 1252 rc = pCtx->mpResp->setCallback(x, i_sendURIDataCallback, pCtx); \ 1255 1253 if (RT_FAILURE(rc)) \ 1256 return rc;1254 break; 1257 1255 1258 1256 #define UNREGISTER_CALLBACK(x) \ … … 1269 1267 if (RT_FAILURE(rc)) 1270 1268 return rc; 1271 1272 /*1273 * Register callbacks.1274 */1275 /* Guest callbacks. */1276 REGISTER_CALLBACK(GUEST_DND_GET_NEXT_HOST_MSG);1277 REGISTER_CALLBACK(GUEST_DND_GH_EVT_ERROR);1278 /* Host callbacks. */1279 REGISTER_CALLBACK(HOST_DND_HG_SND_DIR);1280 if (mDataBase.m_uProtocolVersion >= 2)1281 REGISTER_CALLBACK(HOST_DND_HG_SND_FILE_HDR);1282 REGISTER_CALLBACK(HOST_DND_HG_SND_FILE_DATA);1283 1269 1284 1270 do … … 1340 1326 if (RT_SUCCESS(rc)) 1341 1327 { 1328 /* 1329 * Register callbacks. 1330 */ 1331 /* Guest callbacks. */ 1332 REGISTER_CALLBACK(GUEST_DND_GET_NEXT_HOST_MSG); 1333 REGISTER_CALLBACK(GUEST_DND_GH_EVT_ERROR); 1334 /* Host callbacks. */ 1335 REGISTER_CALLBACK(HOST_DND_HG_SND_DIR); 1336 if (mDataBase.m_uProtocolVersion >= 2) 1337 REGISTER_CALLBACK(HOST_DND_HG_SND_FILE_HDR); 1338 REGISTER_CALLBACK(HOST_DND_HG_SND_FILE_DATA); 1339 1342 1340 rc = waitForEvent(&pCtx->mCBEvent, pCtx->mpResp, msTimeout); 1343 1341 if (RT_FAILURE(rc)) … … 1351 1349 else 1352 1350 rc = pCtx->mpResp->setProgress(100, DND_PROGRESS_COMPLETE, VINF_SUCCESS); 1351 1352 /* 1353 * Unregister callbacks. 1354 */ 1355 /* Guest callbacks. */ 1356 UNREGISTER_CALLBACK(GUEST_DND_GET_NEXT_HOST_MSG); 1357 UNREGISTER_CALLBACK(GUEST_DND_GH_EVT_ERROR); 1358 /* Host callbacks. */ 1359 UNREGISTER_CALLBACK(HOST_DND_HG_SND_DIR); 1360 if (mDataBase.m_uProtocolVersion >= 2) 1361 UNREGISTER_CALLBACK(HOST_DND_HG_SND_FILE_HDR); 1362 UNREGISTER_CALLBACK(HOST_DND_HG_SND_FILE_DATA); 1353 1363 } 1354 1364 1355 1365 } while (0); 1356 1357 /*1358 * Unregister callbacks.1359 */1360 /* Guest callbacks. */1361 UNREGISTER_CALLBACK(GUEST_DND_GET_NEXT_HOST_MSG);1362 UNREGISTER_CALLBACK(GUEST_DND_GH_EVT_ERROR);1363 /* Host callbacks. */1364 UNREGISTER_CALLBACK(HOST_DND_HG_SND_DIR);1365 if (mDataBase.m_uProtocolVersion >= 2)1366 UNREGISTER_CALLBACK(HOST_DND_HG_SND_FILE_HDR);1367 UNREGISTER_CALLBACK(HOST_DND_HG_SND_FILE_DATA);1368 1366 1369 1367 #undef REGISTER_CALLBACK … … 1380 1378 AssertRC(rc2); 1381 1379 } 1382 1383 #undef URI_DATA_IS_VALID_BREAK1384 1380 1385 1381 LogFlowFuncLeaveRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.