VirtualBox

Changeset 50593 in vbox


Ignore:
Timestamp:
Feb 26, 2014 8:44:58 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92464
Message:

DnD: Bugfixes for Linux hosts.

Location:
trunk/src/VBox
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp

    r50562 r50593  
    947947    int rc;
    948948
    949     uint32_t cbMaxChunk = _64K; /* Transfer max. 64K chunks per message. */
     949    uint32_t cbMaxChunk = _64K; /** @todo Transfer max. 64K chunks per message. Configurable? */
    950950    uint32_t cbSent     = 0;
    951951
     
    968968        Assert(cbSent == cbData);
    969969
    970     LogFlowFunc(("Returning rc=%Rrc, cbData=%RU32, cbAddtionalData=%RU32\n",
    971                  rc, cbData, cbAdditionalData));
     970    LogFlowFunc(("Returning rc=%Rrc, cbData=%RU32, cbAddtionalData=%RU32, cbSent=%RU32\n",
     971                 rc, cbData, cbAdditionalData, cbSent));
    972972    return rc;
    973973}
     
    11441144    {
    11451145        int rc2 = VbglR3DnDGHSendError(u32ClientId, rc);
    1146         if (RT_SUCCESS(rc2))
    1147             rc2 = rc;
     1146        AssertRC(rc2);
    11481147    }
    11491148
  • trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp

    r50561 r50593  
    10341034}
    10351035
    1036 
    10371036#ifdef VBOX_WITH_DRAG_AND_DROP_GH
    1038 /*
    1039  * Guest -> Host
    1040  */
    1041 
    10421037int DragInstance::ghIsDnDPending(void)
    10431038{
     
    10841079                else
    10851080                {
    1086                     xrc = XGetWindowProperty(m_pDisplay, wndOwner, xAtom(XA_XdndTypeList), 0, VBOX_MAX_XPROPERTIES, False, XA_ATOM, &type, &f, &n, &a, &ret);
     1081                    xrc = XGetWindowProperty(m_pDisplay, wndOwner,
     1082                                             xAtom(XA_XdndTypeList),
     1083                                             0, VBOX_MAX_XPROPERTIES,
     1084                                             False, XA_ATOM, &type, &f, &n, &a, &ret);
    10871085                    if (   xrc == Success
    10881086                        && n > 0
     
    10981096                    }
    10991097                }
     1098
    11001099                /* Fetch the possible list of actions, if this property is set. */
    1101                 xrc = XGetWindowProperty(m_pDisplay, wndOwner, xAtom(XA_XdndActionList), 0, VBOX_MAX_XPROPERTIES, False, XA_ATOM, &type, &f, &n, &a, &ret);
     1100                xrc = XGetWindowProperty(m_pDisplay, wndOwner,
     1101                                         xAtom(XA_XdndActionList),
     1102                                         0, VBOX_MAX_XPROPERTIES,
     1103                                         False, XA_ATOM, &type, &f, &n, &a, &ret);
    11021104                if (   xrc == Success
    11031105                    && n > 0
     
    11101112                        m_actions.append(data[i]);
    11111113                    }
     1114
    11121115                    XFree(ret);
    11131116                }
     
    11151118                m_state = Dragging;
    11161119                m_mode  = GH;
     1120
    11171121                /* Acknowledge the event by sending a Status msg back to the
    11181122                 * window. */
     
    11521156            }
    11531157        }
     1158
    11541159        hideProxyWin();
    11551160
    1156         rc = VbglR3DnDGHAcknowledgePending(DND_COPY_ACTION, toHGCMActions(m_actions),
     1161        rc = VbglR3DnDGHAcknowledgePending(m_uClientID, DND_COPY_ACTION, toHGCMActions(m_actions),
    11571162                                           gX11->xAtomListToString(m_formats).c_str());
    11581163    }
     
    11621167}
    11631168
    1164 int DragInstance::ghDropped(const RTCString &strFormat, uint32_t action)
    1165 {
    1166     LogFlowThisFunc(("format='%s' action=%d\n", strFormat.c_str(), action));
     1169int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
     1170{
     1171    LogFlowThisFunc(("strFormat=%s, uAction=%RU32\n",
     1172                     strFormat.c_str(), uAction));
     1173
    11671174    int rc = VINF_SUCCESS;
    11681175
     
    11711178    showProxyWin(rx, ry);
    11721179    XFlush(m_pDisplay);
     1180
    11731181    /* We send a fake release event to the current window, cause
    11741182     * this should have the grab. */
    11751183    sendButtonEvent(m_wndCur, rx, ry, 1, false);
     1184
    11761185    /* The fake button release event, should lead to an XdndDrop event from the
    11771186     * source. Because of the showing of the proxy window, sometimes other Xdnd
     
    11811190    XClientMessageEvent *clme = 0;
    11821191    RT_ZERO(e);
    1183     int tries = 3;
    1184     do
     1192
     1193    int cRetries = 3;
     1194    for (int i = 0; i < cRetries; i++)
    11851195    {
    11861196        if (m_pParent->waitForXMsg(e, ClientMessage))
     
    11921202            }
    11931203        }
    1194     } while (tries--);
     1204    }
     1205
    11951206    if (clme)
    11961207    {
     
    12021213            Window srcWin = m_wndCur;//clme->data.l[0];
    12031214            Atom aFormat  = gX11->stringToxAtom(strFormat.c_str());
    1204             XConvertSelection(m_pDisplay, xAtom(XA_XdndSelection), aFormat, xAtom(XA_XdndSelection), m_wndProxy, clme->data.l[2]);
     1215
     1216            XConvertSelection(m_pDisplay, xAtom(XA_XdndSelection),
     1217                              aFormat, xAtom(XA_XdndSelection),
     1218                              m_wndProxy, clme->data.l[2]);
     1219
    12051220            /* Wait for the selection notify event. */
    12061221            RT_ZERO(e);
     
    12151230                {
    12161231                    LogFlowThisFunc(("Selection notfiy (from: %x)\n", m_wndCur));
     1232
    12171233                    Atom type;
    12181234                    int format;
     
    12421258                                memcpy(ucData1, ucData, cbData);
    12431259                                ucData1[cbData++] = '\0';
     1260
    12441261                                /* Got the data and its fully transfered. */
    1245                                 rc = VbglR3DnDGHSendData(ucData1, cbData);
     1262                                rc = VbglR3DnDGHSendData(m_uClientID, strFormat.c_str(),
     1263                                                         ucData1, cbData);
    12461264                                RTMemFree(ucData1);
    12471265                            }
     
    12501268                        }
    12511269                        else
     1270                        {
    12521271                            /* Just send the data to the host. */
    1253                             rc = VbglR3DnDGHSendData(ucData, cbData);
     1272                            rc = VbglR3DnDGHSendData(m_uClientID, strFormat.c_str(),
     1273                                                     ucData, cbData);
     1274                        }
    12541275
    12551276                        LogFlowThisFunc(("send responce\n"));
     
    12641285                        m.data.l[0]    = m_wndProxy;
    12651286                        m.data.l[1]    = RT_SUCCESS(rc) ?                   1 : 0;    /* Confirm or deny success */
    1266                         m.data.l[2]    = RT_SUCCESS(rc) ? toX11Action(action) : None; /* Action used on success */
     1287                        m.data.l[2]    = RT_SUCCESS(rc) ? toX11Action(uAction) : None; /* Action used on success */
    12671288
    12681289                        int xrc = XSendEvent(m_pDisplay, srcWin, True, NoEventMask, reinterpret_cast<XEvent*>(&m));
     
    12741295                        if (type == xAtom(XA_INCR))
    12751296                        {
    1276                             /* Todo: */
     1297                            /** @todo Support incremental transfers. */
    12771298                            AssertMsgFailed(("Incrementally transfers are not supported, yet\n"));
    12781299                            rc = VERR_NOT_IMPLEMENTED;
     
    12831304                            rc = VERR_INVALID_PARAMETER;
    12841305                        }
     1306
    12851307                        /* Cancel this. */
    12861308                        XClientMessageEvent m;
     
    12941316                        m.data.l[1]    = 0;
    12951317                        m.data.l[2]    = None;
     1318
    12961319                        int xrc = XSendEvent(m_pDisplay, srcWin, False, NoEventMask, reinterpret_cast<XEvent*>(&m));
    12971320                        if (RT_UNLIKELY(xrc == 0))
     
    12991322                        m_wndCur = 0;
    13001323                    }
     1324
    13011325                    /* Cleanup */
    13021326                    if (ucData)
     
    13151339        rc = VERR_TIMEOUT;
    13161340
    1317     /* Inform the host on error */
     1341    /* Inform the host on error. */
    13181342    if (RT_FAILURE(rc))
    1319         VbglR3DnDGHSendError(rc);
     1343        VbglR3DnDGHSendError(m_uClientID, rc);
    13201344
    13211345    /* At this point, we have either successfully transfered any data or not.
     
    13261350    return rc;
    13271351}
    1328 
    13291352#endif /* VBOX_WITH_DRAG_AND_DROP_GH */
    13301353
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDrag.cpp

    r50561 r50593  
    5656#endif
    5757{
    58     LogFlowFunc(("m_defAction=0x%x, m_actions=0x%x\n", m_defAction, m_actions));
     58    LogFlowFunc(("m_defAction=0x%x\n", m_defAction));
    5959    LogFlowFunc(("Number of formats: %d\n", m_lstFormats.size()));
    6060#ifdef DEBUG
     
    6969
    7070    int rc = VINF_SUCCESS;
    71     try
     71#ifdef RT_OS_WINDOWS
     72    UIDnDDropSource *pDropSource = new UIDnDDropSource(this /* pParent */);
     73    UIDnDDataObject *pDataObject = new UIDnDDataObject(m_lstFormats, this /* pParent */);
     74
     75    DWORD dwOKEffects = DROPEFFECT_NONE;
     76    if (m_actions)
    7277    {
    73 #ifdef RT_OS_WINDOWS
    74         UIDnDDropSource *pDropSource = new UIDnDDropSource(this /* pParent */);
    75         UIDnDDataObject *pDataObject = new UIDnDDataObject(m_lstFormats, this /* pParent */);
     78        if (m_actions & Qt::CopyAction)
     79            dwOKEffects |= DROPEFFECT_COPY;
     80        if (m_actions & Qt::MoveAction)
     81            dwOKEffects |= DROPEFFECT_MOVE;
     82        if (m_actions & Qt::LinkAction)
     83            dwOKEffects |= DROPEFFECT_LINK;
     84    }
    7685
    77         DWORD dwOKEffects = DROPEFFECT_NONE;
    78         if (m_actions)
    79         {
    80             if (m_actions & Qt::CopyAction)
    81                 dwOKEffects |= DROPEFFECT_COPY;
    82             if (m_actions & Qt::MoveAction)
    83                 dwOKEffects |= DROPEFFECT_MOVE;
    84             if (m_actions & Qt::LinkAction)
    85                 dwOKEffects |= DROPEFFECT_LINK;
    86         }
     86    DWORD dwEffect;
     87    HRESULT hr = ::DoDragDrop(pDataObject, pDropSource,
     88                              dwOKEffects, &dwEffect);
     89    LogFlowThisFunc(("DoDragDrop ended with hr=%Rhrc, dwEffect=%RI32\n",
     90                     hr, dwEffect));
    8791
    88         DWORD dwEffect;
    89         HRESULT hr = ::DoDragDrop(pDataObject, pDropSource,
    90                                   dwOKEffects, &dwEffect);
    91         LogFlowThisFunc(("DoDragDrop ended with hr=%Rhrc, dwEffect=%RI32\n",
    92                          hr, dwEffect));
     92    if (pDropSource)
     93        pDropSource->Release();
     94    if (pDataObject)
     95        pDataObject->Release();
     96#else
     97    QDrag *pDrag = new QDrag(m_pParent);
    9398
    94         if (pDropSource)
    95             pDropSource->Release();
    96         if (pDataObject)
    97             pDataObject->Release();
    98 #else
    99         QDrag *pDrag = new QDrag(m_pParent);
     99    /* pMData is transfered to the QDrag object, so no need for deletion. */
     100    pMData = new UIDnDMimeData(m_session, m_lstFormats,
     101                               m_defAction, m_actions, m_pParent);
    100102
    101         /* pMData is transfered to the QDrag object, so no need for deletion. */
    102         pMData = new UIDnDMimeData(m_session, m_lstFormats,
    103                                    m_defAction, m_actions, m_pParent);
     103    /* Inform the MIME data object of any changes in the current action. */
     104    connect(pDrag, SIGNAL(actionChanged(Qt::DropAction)),
     105            pMData, SLOT(sltDropActionChanged(Qt::DropAction)));
    104106
    105         /* Inform this object that MIME data from the guest is available so that
    106          * it can update the MIME data object accordingly. */
    107         connect(pMData, SIGNAL(sigDataAvailable(QString)),
    108                 this, SLOT(sltDataAvailable(QString)), Qt::DirectConnection);
     107    /* Fire it up.
     108     *
     109     * On Windows this will start a modal operation using OLE's
     110     * DoDragDrop() method, so this call will block until the DnD operation
     111     * is finished. */
     112    pDrag->setMimeData(pMData);
     113    Qt::DropAction dropAction = pDrag->exec(m_actions, m_defAction);
     114    LogFlowFunc(("dropAction=%ld\n", UIDnDHandler::toVBoxDnDAction(dropAction)));
    109115
    110         /* Inform the MIME data object of any changes in the current action. */
    111         connect(pDrag, SIGNAL(actionChanged(Qt::DropAction)),
    112                 pMData, SLOT(sltDropActionChanged(Qt::DropAction)));
    113 
    114         /* Fire it up.
    115          *
    116          * On Windows this will start a modal operation using OLE's
    117          * DoDragDrop() method, so this call will block until the DnD operation
    118          * is finished. */
    119         pDrag->setMimeData(pMData);
    120         Qt::DropAction dropAction = pDrag->exec(m_actions, m_defAction);
    121         LogFlowFunc(("dropAction=%ld\n", UIDnDHandler::toVBoxDnDAction(dropAction)));
    122 
    123          /* Note: The UIDnDMimeData object will not be not accessible here anymore,
    124          *        since QDrag had its ownership and deleted it after the (blocking)
    125          *        QDrag::exec() call. */
     116     /* Note: The UIDnDMimeData object will not be not accessible here anymore,
     117     *        since QDrag had its ownership and deleted it after the (blocking)
     118     *        QDrag::exec() call. */
    126119#endif /* !RT_OS_WINDOWS */
    127     }
    128     catch (std::bad_alloc)
    129     {
    130         rc = VERR_NO_MEMORY;
    131     }
    132120
    133121    LogFlowFuncLeaveRC(rc);
     
    135123}
    136124
    137 int UIDnDDrag::RetrieveData(const QString &strMimeType,
    138                             QVariant::Type vaType, QVariant &vaData)
    139 {
    140     LogFlowFunc(("Retrieving data as type=%s (variant type=%ld)\n",
    141                  strMimeType.toAscii().constData(), vaType));
    142 
    143     int rc = VINF_SUCCESS;
    144     CGuest guest = m_session.GetConsole().GetGuest();
    145 
    146     /* Start getting the data from the guest. First inform the guest we
    147      * want the data in the specified MIME type. */
    148     CProgress progress = guest.DragGHDropped(strMimeType,
    149                                              UIDnDHandler::toVBoxDnDAction(m_defAction));
    150     if (guest.isOk())
    151     {
    152         msgCenter().showModalProgressDialog(progress,
    153                                             tr("Retrieving data ..."), ":/progress_dnd_gh_90px.png",
    154                                             m_pParent);
    155         if (!progress.GetCanceled())
    156         {
    157             rc =   (   progress.isOk()
    158                     && progress.GetResultCode() == 0)
    159                  ? VINF_SUCCESS : VERR_GENERAL_FAILURE; /** @todo Fudge; do a GetResultCode() to rc translation. */
    160 
    161             if (RT_SUCCESS(rc))
    162             {
    163                 /* After the data successfully arrived from the guest, we query it from Main. */
    164                 QVector<uint8_t> vecData = guest.DragGHGetData();
    165                 if (!vecData.isEmpty())
    166                 {
    167                     switch (vaType)
    168                     {
    169                         case QVariant::String:
    170                         {
    171                             vaData = QVariant(QString(reinterpret_cast<const char*>(vecData.constData())));
    172                             break;
    173                         }
    174 
    175                         case QVariant::ByteArray:
    176                         {
    177                             QByteArray ba(reinterpret_cast<const char*>(vecData.constData()), vecData.size());
    178                             vaData = QVariant(ba);
    179                             break;
    180                         }
    181 
    182                         case QVariant::StringList:
    183                         {
    184                             QString strData = QString(reinterpret_cast<const char*>(vecData.constData()));
    185                             QStringList lstString = strData.split("\r\n", QString::SkipEmptyParts);
    186 
    187                             vaData = QVariant(lstString);
    188                             break;
    189                         }
    190 
    191                         default:
    192                             rc = VERR_NOT_SUPPORTED;
    193                             break;
    194                     }
    195                 }
    196                 else
    197                     rc = VERR_NO_DATA;
    198             }
    199             else
    200                 msgCenter().cannotDropData(progress, m_pParent);
    201         }
    202         else
    203             rc = VERR_CANCELLED;
    204     }
    205     else
    206     {
    207         msgCenter().cannotDropData(guest, m_pParent);
    208         rc = VERR_GENERAL_FAILURE; /** @todo Fudge; do a GetResultCode() to rc translation. */
    209     }
    210 
    211     LogFlowFuncLeaveRC(rc);
    212     return rc;
    213 }
    214 
    215 #ifndef RT_OS_WINDOWS
    216 void UIDnDDrag::sltDataAvailable(const QString &mimeType)
    217 {
    218     LogFlowFunc(("pMData=0x%p, mimeType=%s\n",
    219                  pMData, mimeType.toAscii().constData()));
    220 
    221     if (pMData)
    222         pMData->setData(mimeType);
    223 }
    224 #endif
    225 
    226125#include "UIDnDDrag.moc"
    227126
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDrag.h

    r50460 r50593  
    5656                     QVariant::Type vaType, QVariant &vaData);
    5757
    58 public slots:
    59 
    60 #ifndef RT_OS_WINDOWS
    61     void sltDataAvailable(const QString &mimetype);
    62 #endif
    63 
    6458private:
    6559
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp

    r50460 r50593  
    234234    if (!lstFmtNative.isEmpty())
    235235    {
    236         try
    237         {
    238             UIDnDDrag *pDrag = new UIDnDDrag(session, lstFmtNative,
    239                                              toQtDnDAction(defaultAction),
    240                                              toQtDnDActions(vecActions), pParent);
    241             rc = pDrag->DoDragDrop();
    242 
    243             delete pDrag;
    244         }
    245         catch (std::bad_alloc)
    246         {
    247             rc = VERR_NO_MEMORY;
    248         }
     236        UIDnDDrag *pDrag = new UIDnDDrag(session, lstFmtNative,
     237                                         toQtDnDAction(defaultAction),
     238                                         toQtDnDActions(vecActions), pParent);
     239        rc = pDrag->DoDragDrop();
     240
     241        delete pDrag;
    249242    }
    250243    else
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.cpp

    r50460 r50593  
    4040UIDnDMimeData::UIDnDMimeData(CSession &session, QStringList formats,
    4141                             Qt::DropAction defAction, Qt::DropActions actions,
    42                              UIDnDDrag *pParent)
     42                             QWidget *pParent)
    4343    : m_pParent(pParent)
    4444    , m_session(session)
     
    164164    {
    165165        AssertPtr(m_pParent);
    166         rc = m_pParent->RetrieveData(strMIMEType, type, m_data);
     166        rc = retrieveDataInternal(strMIMEType, type, m_data);
    167167        if (RT_SUCCESS(rc))
    168168        {
     
    178178    LogFlowFunc(("Returning rc=%Rrc, m_enmState=%ld\n",
    179179                 rc, m_enmState));
    180     return QMimeData::retrieveData(strMIMEType, type);
     180    return m_data;
     181}
     182
     183int UIDnDMimeData::retrieveDataInternal(const QString &strMimeType,
     184                                        QVariant::Type vaType, QVariant &vaData) const
     185{
     186    LogFlowFunc(("Retrieving data as type=%s (variant type=%ld)\n",
     187                 strMimeType.toAscii().constData(), vaType));
     188
     189    int rc = VINF_SUCCESS;
     190    CGuest guest = m_session.GetConsole().GetGuest();
     191
     192    /* Start getting the data from the guest. First inform the guest we
     193     * want the data in the specified MIME type. */
     194    CProgress progress = guest.DragGHDropped(strMimeType,
     195                                             UIDnDHandler::toVBoxDnDAction(m_defAction));
     196    if (guest.isOk())
     197    {
     198        msgCenter().showModalProgressDialog(progress,
     199                                            tr("Retrieving data ..."), ":/progress_dnd_gh_90px.png",
     200                                            m_pParent);
     201        if (!progress.GetCanceled())
     202        {
     203            rc =   (   progress.isOk()
     204                    && progress.GetResultCode() == 0)
     205                 ? VINF_SUCCESS : VERR_GENERAL_FAILURE; /** @todo Fudge; do a GetResultCode() to rc translation. */
     206
     207            if (RT_SUCCESS(rc))
     208            {
     209                /* After the data successfully arrived from the guest, we query it from Main. */
     210                QVector<uint8_t> vecData = guest.DragGHGetData();
     211                if (!vecData.isEmpty())
     212                {
     213                    switch (vaType)
     214                    {
     215                        case QVariant::String:
     216                        {
     217                            vaData = QVariant(QString(reinterpret_cast<const char*>(vecData.constData())));
     218                            break;
     219                        }
     220
     221                        case QVariant::ByteArray:
     222                        {
     223                            QByteArray ba(reinterpret_cast<const char*>(vecData.constData()), vecData.size());
     224                            vaData = QVariant(ba);
     225                            break;
     226                        }
     227
     228                        case QVariant::StringList:
     229                        {
     230                            QString strData = QString(reinterpret_cast<const char*>(vecData.constData()));
     231                            QStringList lstString = strData.split("\r\n", QString::SkipEmptyParts);
     232
     233                            vaData = QVariant(lstString);
     234                            break;
     235                        }
     236
     237                        default:
     238                            rc = VERR_NOT_SUPPORTED;
     239                            break;
     240                    }
     241                }
     242                else
     243                    rc = VERR_NO_DATA;
     244            }
     245            else
     246                msgCenter().cannotDropData(progress, m_pParent);
     247        }
     248        else
     249            rc = VERR_CANCELLED;
     250    }
     251    else
     252    {
     253        msgCenter().cannotDropData(guest, m_pParent);
     254        rc = VERR_GENERAL_FAILURE; /** @todo Fudge; do a GetResultCode() to rc translation. */
     255    }
     256
     257    LogFlowFuncLeaveRC(rc);
     258    return rc;
    181259}
    182260
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.h

    r50460 r50593  
    5151         *  having retrieved the metadata from the guest yet. */
    5252        Dragging = 0,
    53         /** Guest sent over the (MIME) metadata so that the
    54          *  host knows which DnD targets can be used. */
    55         MetaDataRetrieved,
    5653        /** There has been a "dropped" action which indicates
    5754         *  that the guest can continue sending more data (if any)
     
    6663    UIDnDMimeData(CSession &session, QStringList formats,
    6764                  Qt::DropAction defAction,
    68                   Qt::DropActions actions, UIDnDDrag *pParent);
     65                  Qt::DropActions actions, QWidget *pParent);
    6966
    7067    int setData(const QString &mimeType);
     
    9895#endif
    9996
     97protected:
     98
     99    int retrieveDataInternal(const QString &strMimeType, QVariant::Type vaType, QVariant &vaData) const;
     100
    100101private:
    101102
    102     UIDnDDrag        *m_pParent;
     103    QWidget          *m_pParent;
    103104    CSession          m_session;
    104105    QStringList       m_lstFormats;
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp

    r50561 r50593  
    348348    AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
    349349
    350     char *pszPathURI = RTUriCreate("file" /* pszScheme */, "/" /* pszAuthority */,
    351                                    pszPath, NULL /* pszQuery */, NULL /* pszFragment */);
    352350    int rc;
    353     if (pszPathURI)
    354     {
    355         rc = AppendURIPath(pszPathURI, fFlags);
    356         RTStrFree(pszPathURI);
     351    char *pszPathNative = RTStrDup(pszPath);
     352    if (pszPathNative)
     353    {
     354        RTPathChangeToUnixSlashes(pszPathNative, true /* fForce */);
     355
     356        char *pszPathURI = RTUriCreate("file" /* pszScheme */, "/" /* pszAuthority */,
     357                                       pszPathNative, NULL /* pszQuery */, NULL /* pszFragment */);
     358        if (pszPathURI)
     359        {
     360            rc = AppendURIPath(pszPathURI, fFlags);
     361            RTStrFree(pszPathURI);
     362        }
     363        else
     364            rc = VERR_INVALID_PARAMETER;
     365
     366        RTStrFree(pszPathNative);
    357367    }
    358368    else
    359         rc = VERR_INVALID_PARAMETER;
     369        rc = VERR_NO_MEMORY;
    360370
    361371    return rc;
  • trunk/src/VBox/HostServices/DragAndDrop/service.cpp

    r50561 r50593  
    128128int DragAndDropService::clientConnect(uint32_t u32ClientID, void *pvClient)
    129129{
    130     LogFlowFunc(("New client (%ld) connected\n", u32ClientID));
     130    LogFlowFunc(("New client (%RU32) connected\n", u32ClientID));
    131131    if (m_cClients < UINT32_MAX)
    132132        m_cClients++;
  • trunk/src/VBox/Main/src-client/GuestDnDImpl.cpp

    r50561 r50593  
    372372                                  uint32_t uState, int rcOp /* = VINF_SUCCESS */)
    373373{
    374     LogFlowFunc(("uPercentage=%RU32, uState=%ld, rcOp=%Rrc\n",
     374    LogFlowFunc(("uPercentage=%RU32, uState=%RU32, rcOp=%Rrc\n",
    375375                 uPercentage, uState, rcOp));
    376376
     
    438438#else
    439439    AssertMsg(m_cbDataCurrent <= m_cbDataTotal,
    440               ("More data transferred (%RU32) than initially announced (%RU32)\n",
    441               m_cbDataCurrent, m_cbDataTotal));
     440              ("More data transferred (%zu) than initially announced (%zu), cbDataAdd=%zu\n",
     441              m_cbDataCurrent, m_cbDataTotal, cbDataAdd));
    442442#endif
    443443    int rc = setProgress(cPercentage, uStatus);
     
    449449        rc = setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED);
    450450
     451    LogFlowFuncLeaveRC(rc);
    451452    return rc;
    452453}
     
    10971098    AssertReturn(cbPath, VERR_INVALID_PARAMETER);
    10981099
    1099     LogFlowFunc(("strDir=%s, cbPath=%zu, fMode=0x%x\n",
     1100    LogFlowFunc(("pszPath=%s, cbPath=%zu, fMode=0x%x\n",
    11001101                 pszPath, cbPath, fMode));
    11011102
     
    11251126    AssertReturn(cbPath, VERR_INVALID_PARAMETER);
    11261127
    1127     LogFlowFunc(("strFile=%s, cbPath=%zu, fMode=0x%x\n",
     1128    LogFlowFunc(("pszPath=%s, cbPath=%zu, fMode=0x%x\n",
    11281129                 pszPath, cbPath, fMode));
    11291130
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette