GuestDnDTargetImpl.cpp revision c8e3a310b008bd03e42089b1e7e8adc16daaf077
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/* $Id$ */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/** @file
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * VBox Console COM Class implementation - Guest drag'n drop target.
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/*
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * Copyright (C) 2014 Oracle Corporation
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync *
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * available from http://www.virtualbox.org. This file is free software;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * you can redistribute it and/or modify it under the terms of the GNU
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * General Public License (GPL) as published by the Free Software
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/*******************************************************************************
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync* Header Files *
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync*******************************************************************************/
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#include "GuestImpl.h"
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#include "GuestDnDTargetImpl.h"
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#include "Global.h"
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#include "AutoCaller.h"
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#include <iprt/cpp/utils.h> /* For unconst(). */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#include <VBox/com/array.h>
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#include <VBox/HostServices/DragAndDropSvc.h>
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#ifdef LOG_GROUP
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync #undef LOG_GROUP
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#endif
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#define LOG_GROUP LOG_GROUP_GUEST_DND
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#include <VBox/log.h>
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync// constructor / destructor
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/////////////////////////////////////////////////////////////////////////////
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsyncDEFINE_EMPTY_CTOR_DTOR(GuestDnDTarget)
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsyncHRESULT GuestDnDTarget::FinalConstruct(void)
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync{
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync LogFlowThisFunc(("\n"));
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync return BaseFinalConstruct();
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync}
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsyncvoid GuestDnDTarget::FinalRelease(void)
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync{
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync LogFlowThisFuncEnter();
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync uninit();
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync BaseFinalRelease();
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync LogFlowThisFuncLeave();
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync}
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync// public initializer/uninitializer for internal purposes only
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/////////////////////////////////////////////////////////////////////////////
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsyncint GuestDnDTarget::init(const ComObjPtr<Guest>& pGuest)
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync{
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync LogFlowThisFuncEnter();
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* Enclose the state transition NotReady->InInit->Ready. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync AutoInitSpan autoInitSpan(this);
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync AssertReturn(autoInitSpan.isOk(), E_FAIL);
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync unconst(m_pGuest) = pGuest;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* Confirm a successful initialization when it's the case. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync autoInitSpan.setSucceeded();
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync return VINF_SUCCESS;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync}
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/**
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * Uninitializes the instance.
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * Called from FinalRelease().
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsyncvoid GuestDnDTarget::uninit(void)
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync{
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync LogFlowThisFunc(("\n"));
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* Enclose the state transition Ready->InUninit->NotReady. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync AutoUninitSpan autoUninitSpan(this);
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (autoUninitSpan.uninitDone())
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync return;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync}
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync// implementation of wrapped private getters/setters for attributes
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync/////////////////////////////////////////////////////////////////////////////
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsyncHRESULT GuestDnDTarget::enter(ULONG aScreenId, ULONG aX, ULONG aY,
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync DnDAction_T aDefaultAction,
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync const std::vector<DnDAction_T> &aAllowedActions,
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync const std::vector<com::Utf8Str> &aFormats,
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync DnDAction_T *aResultAction)
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync{
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#if !defined(VBOX_WITH_DRAG_AND_DROP) || !defined(VBOX_WITH_DRAG_AND_DROP_GH)
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync ReturnComNotImplemented();
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync#else /* VBOX_WITH_DRAG_AND_DROP */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* Input validation. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (aDefaultAction == DnDAction_Ignore)
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync return setError(E_INVALIDARG, tr("No default action specified"));
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (!aAllowedActions.size())
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync return setError(E_INVALIDARG, tr("Number of allowed actions is empty"));
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (!aFormats.size())
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync return setError(E_INVALIDARG, tr("Number of supported formats is empty"));
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync AutoCaller autoCaller(this);
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (FAILED(autoCaller.rc())) return autoCaller.rc();
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* Default action is ignoring. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync DnDAction_T resAction = DnDAction_Ignore;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* Check & convert the drag & drop actions */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync uint32_t uDefAction = 0;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync uint32_t uAllowedActions = 0;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync GuestDnD::toHGCMActions(aDefaultAction, &uDefAction,
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync aAllowedActions, &uAllowedActions);
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* If there is no usable action, ignore this request. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (isDnDIgnoreAction(uDefAction))
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync return S_OK;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* Make a flat data string out of the supported format list. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync Utf8Str strFormats = GuestDnD::toFormatString(GuestDnDInst()->supportedFormats(),
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync aFormats);
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /* If there is no valid supported format, ignore this request. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (strFormats.isEmpty())
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync return S_OK;
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync HRESULT hr = S_OK;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync /* Adjust the coordinates in a multi-monitor setup. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync int rc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY);
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (RT_SUCCESS(rc))
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync {
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync VBOXHGCMSVCPARM paParms[8];
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync int i = 0;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync paParms[i++].setUInt32(aScreenId);
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync paParms[i++].setUInt32(aX);
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync paParms[i++].setUInt32(aY);
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync paParms[i++].setUInt32(uDefAction);
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync paParms[i++].setUInt32(uAllowedActions);
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync paParms[i++].setPointer((void*)strFormats.c_str(), strFormats.length() + 1);
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync paParms[i++].setUInt32(strFormats.length() + 1);
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync rc = GuestDnDInst()->hostCall(DragAndDropSvc::HOST_DND_HG_EVT_ENTER,
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync i, paParms);
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync if (RT_SUCCESS(rc))
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync {
d23a94a28e59f64d02905f20bb8f3b23f1c9eb17vboxsync GuestDnDResponse *pResp = GuestDnDInst()->response();
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (pResp && RT_SUCCESS(pResp->waitForGuestResponse()))
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync resAction = GuestDnD::toMainAction(pResp->defAction());
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync }
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync }
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync if (aResultAction)
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync *aResultAction = resAction;
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync LogFlowFunc(("hr=%Rhrc, resAction=%ld\n", hr, resAction));
return hr;
#endif /* VBOX_WITH_DRAG_AND_DROP */
}
HRESULT GuestDnDTarget::move(ULONG aScreenId, ULONG aX, ULONG aY,
DnDAction_T aDefaultAction,
const std::vector<DnDAction_T> &aAllowedActions,
const std::vector<com::Utf8Str> &aFormats,
DnDAction_T *aResultAction)
{
#if !defined(VBOX_WITH_DRAG_AND_DROP) || !defined(VBOX_WITH_DRAG_AND_DROP_GH)
ReturnComNotImplemented();
#else /* VBOX_WITH_DRAG_AND_DROP */
/* Input validation. */
AutoCaller autoCaller(this);
if (FAILED(autoCaller.rc())) return autoCaller.rc();
/* Default action is ignoring. */
DnDAction_T resAction = DnDAction_Ignore;
/* Check & convert the drag & drop actions. */
uint32_t uDefAction = 0;
uint32_t uAllowedActions = 0;
GuestDnD::toHGCMActions(aDefaultAction, &uDefAction,
aAllowedActions, &uAllowedActions);
/* If there is no usable action, ignore this request. */
if (isDnDIgnoreAction(uDefAction))
return S_OK;
/* Make a flat data string out of the supported format list. */
RTCString strFormats = GuestDnD::toFormatString(GuestDnDInst()->supportedFormats(),
aFormats);
/* If there is no valid supported format, ignore this request. */
if (strFormats.isEmpty())
return S_OK;
HRESULT hr = S_OK;
int rc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY);
if (RT_SUCCESS(rc))
{
VBOXHGCMSVCPARM paParms[8];
int i = 0;
paParms[i++].setUInt32(aScreenId);
paParms[i++].setUInt32(aX);
paParms[i++].setUInt32(aY);
paParms[i++].setUInt32(uDefAction);
paParms[i++].setUInt32(uAllowedActions);
paParms[i++].setPointer((void*)strFormats.c_str(), strFormats.length() + 1);
paParms[i++].setUInt32(strFormats.length() + 1);
rc = GuestDnDInst()->hostCall(DragAndDropSvc::HOST_DND_HG_EVT_MOVE,
i, paParms);
if (RT_SUCCESS(rc))
{
GuestDnDResponse *pResp = GuestDnDInst()->response();
if (pResp && RT_SUCCESS(pResp->waitForGuestResponse()))
resAction = GuestDnD::toMainAction(pResp->defAction());
}
}
if (aResultAction)
*aResultAction = resAction;
LogFlowFunc(("hr=%Rhrc, *pResultAction=%ld\n", hr, resAction));
return hr;
#endif /* VBOX_WITH_DRAG_AND_DROP */
}
HRESULT GuestDnDTarget::leave(ULONG uScreenId)
{
#if !defined(VBOX_WITH_DRAG_AND_DROP) || !defined(VBOX_WITH_DRAG_AND_DROP_GH)
ReturnComNotImplemented();
#else /* VBOX_WITH_DRAG_AND_DROP */
AutoCaller autoCaller(this);
if (FAILED(autoCaller.rc())) return autoCaller.rc();
HRESULT hr = S_OK;
int rc = GuestDnDInst()->hostCall(DragAndDropSvc::HOST_DND_HG_EVT_LEAVE,
0 /* cParms */, NULL /* paParms */);
if (RT_SUCCESS(rc))
{
GuestDnDResponse *pResp = GuestDnDInst()->response();
if (pResp)
pResp->waitForGuestResponse();
}
LogFlowFunc(("hr=%Rhrc\n", hr));
return hr;
#endif /* VBOX_WITH_DRAG_AND_DROP */
}
HRESULT GuestDnDTarget::drop(ULONG aScreenId, ULONG aX, ULONG aY,
DnDAction_T aDefaultAction,
const std::vector<DnDAction_T> &aAllowedActions,
const std::vector<com::Utf8Str> &aFormats,
com::Utf8Str &aFormat, DnDAction_T *aResultAction)
{
#if !defined(VBOX_WITH_DRAG_AND_DROP) || !defined(VBOX_WITH_DRAG_AND_DROP_GH)
ReturnComNotImplemented();
#else /* VBOX_WITH_DRAG_AND_DROP */
/* Input validation. */
/* Everything else is optional. */
AutoCaller autoCaller(this);
if (FAILED(autoCaller.rc())) return autoCaller.rc();
/* Default action is ignoring. */
DnDAction_T resAction = DnDAction_Ignore;
/* Check & convert the drag & drop actions. */
uint32_t uDefAction = 0;
uint32_t uAllowedActions = 0;
GuestDnD::toHGCMActions(aDefaultAction, &uDefAction,
aAllowedActions, &uAllowedActions);
/* If there is no usable action, ignore this request. */
if (isDnDIgnoreAction(uDefAction))
return S_OK;
/* Make a flat data string out of the supported format list. */
Utf8Str strFormats = GuestDnD::toFormatString(GuestDnDInst()->supportedFormats(),
aFormats);
/* If there is no valid supported format, ignore this request. */
if (strFormats.isEmpty())
return S_OK;
HRESULT hr = S_OK;
/* Adjust the coordinates in a multi-monitor setup. */
int rc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY);
if (RT_SUCCESS(rc))
{
VBOXHGCMSVCPARM paParms[8];
int i = 0;
paParms[i++].setUInt32(aScreenId);
paParms[i++].setUInt32(aX);
paParms[i++].setUInt32(aY);
paParms[i++].setUInt32(uDefAction);
paParms[i++].setUInt32(uAllowedActions);
paParms[i++].setPointer((void*)strFormats.c_str(), strFormats.length() + 1);
paParms[i++].setUInt32(strFormats.length() + 1);
rc = GuestDnDInst()->hostCall(DragAndDropSvc::HOST_DND_HG_EVT_DROPPED,
i, paParms);
if (RT_SUCCESS(rc))
{
GuestDnDResponse *pResp = GuestDnDInst()->response();
if (pResp && RT_SUCCESS(pResp->waitForGuestResponse()))
{
resAction = GuestDnD::toMainAction(pResp->defAction());
aFormat = pResp->format();
LogFlowFunc(("resFormat=%s, resAction=%RU32\n",
pResp->format().c_str(), pResp->defAction()));
}
}
}
if (aResultAction)
*aResultAction = resAction;
return hr;
#endif /* VBOX_WITH_DRAG_AND_DROP */
}
HRESULT GuestDnDTarget::sendData(ULONG aScreenId,
const com::Utf8Str &aFormat,
const std::vector<BYTE> &aData,
ComPtr<IProgress> &aProgress)
{
#if !defined(VBOX_WITH_DRAG_AND_DROP) || !defined(VBOX_WITH_DRAG_AND_DROP_GH)
ReturnComNotImplemented();
#else /* VBOX_WITH_DRAG_AND_DROP */
/* Input validation */
AutoCaller autoCaller(this);
if (FAILED(autoCaller.rc())) return autoCaller.rc();
HRESULT hr = S_OK;
VBOXHGCMSVCPARM paParms[8];
int i = 0;
paParms[i++].setUInt32(aScreenId);
paParms[i++].setPointer((void *)aFormat.c_str(), (uint32_t)aFormat.length() + 1);
paParms[i++].setUInt32((uint32_t)aFormat.length() + 1);
paParms[i++].setPointer((void *)aData.front(), (uint32_t)aData.size());
paParms[i++].setUInt32((uint32_t)aData.size());
GuestDnDResponse *pResp = GuestDnDInst()->response();
if (pResp)
{
/* Reset any old progress status. */
pResp->resetProgress(m_pGuest);
/* Note: The actual data transfer of files/directoies is performed by the
* DnD host service. */
int rc = GuestDnDInst()->hostCall(DragAndDropSvc::HOST_DND_HG_SND_DATA,
i, paParms);
if (RT_SUCCESS(rc))
{
/* Query the progress object to the caller. */
if (aProgress)
pResp->queryProgressTo(aProgress.asOutParam());
}
}
return hr;
#endif /* VBOX_WITH_DRAG_AND_DROP */
}