VirtualBox

忽略:
時間撮記:
2015-10-22 上午10:34:26 (9 年 以前)
作者:
vboxsync
訊息:

DnD: Warnings.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp

    r58329 r58370  
    243243                              DnDAction_T                      aDefaultAction,
    244244                              const std::vector<DnDAction_T>  &aAllowedActions,
    245                               const GuestDnDMIMEList           &aFormats,
     245                              const GuestDnDMIMEList          &aFormats,
    246246                              DnDAction_T                     *aResultAction)
    247247{
     
    281281     * as GuestDnDTarget acts as a source for the guest.
    282282     */
    283     Utf8Str strFormats = GuestDnD::toFormatString(GuestDnD::toFilteredFormatList(m_lstFmtSupported, aFormats));
     283    Utf8Str strFormats       = GuestDnD::toFormatString(GuestDnD::toFilteredFormatList(m_lstFmtSupported, aFormats));
    284284    if (strFormats.isEmpty())
    285285        return setError(E_INVALIDARG, tr("No or not supported format(s) specified"));
     286    const uint32_t cbFormats = (uint32_t)strFormats.length() + 1; /* Include terminating zero. */
    286287
    287288    LogRel2(("DnD: Offered formats to guest:\n"));
     
    310311        Msg.setNextUInt32(uDefAction);
    311312        Msg.setNextUInt32(uAllowedActions);
    312         Msg.setNextPointer((void*)strFormats.c_str(), strFormats.length() + 1);
    313         Msg.setNextUInt32(strFormats.length() + 1);
     313        Msg.setNextPointer((void *)strFormats.c_str(), cbFormats);
     314        Msg.setNextUInt32(cbFormats);
    314315
    315316        rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    368369     * as GuestDnDTarget acts as a source for the guest.
    369370     */
    370     Utf8Str strFormats = GuestDnD::toFormatString(GuestDnD::toFilteredFormatList(m_lstFmtSupported, aFormats));
     371    Utf8Str strFormats       = GuestDnD::toFormatString(GuestDnD::toFilteredFormatList(m_lstFmtSupported, aFormats));
    371372    if (strFormats.isEmpty())
    372373        return setError(E_INVALIDARG, tr("No or not supported format(s) specified"));
     374    const uint32_t cbFormats = (uint32_t)strFormats.length() + 1; /* Include terminating zero. */
    373375
    374376    HRESULT hr = S_OK;
     
    386388        Msg.setNextUInt32(uDefAction);
    387389        Msg.setNextUInt32(uAllowedActions);
    388         Msg.setNextPointer((void*)strFormats.c_str(), strFormats.length() + 1);
    389         Msg.setNextUInt32(strFormats.length() + 1);
     390        Msg.setNextPointer((void *)strFormats.c_str(), cbFormats);
     391        Msg.setNextUInt32(cbFormats);
    390392
    391393        rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    483485     * as GuestDnDTarget acts as a source for the guest.
    484486     */
    485     Utf8Str strFormats = GuestDnD::toFormatString(GuestDnD::toFilteredFormatList(m_lstFmtSupported, aFormats));
     487    Utf8Str strFormats       = GuestDnD::toFormatString(GuestDnD::toFilteredFormatList(m_lstFmtSupported, aFormats));
    486488    if (strFormats.isEmpty())
    487489        return setError(E_INVALIDARG, tr("No or not supported format(s) specified"));
     490    const uint32_t cbFormats = (uint32_t)strFormats.length() + 1; /* Include terminating zero. */
    488491
    489492    /* Adjust the coordinates in a multi-monitor setup. */
     
    500503        Msg.setNextUInt32(uDefAction);
    501504        Msg.setNextUInt32(uAllowedActions);
    502         Msg.setNextPointer((void*)strFormats.c_str(), strFormats.length() + 1);
    503         Msg.setNextUInt32(strFormats.length() + 1);
     505        Msg.setNextPointer((void*)strFormats.c_str(), cbFormats);
     506        Msg.setNextUInt32(cbFormats);
    504507
    505508        int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     
    13251328         */
    13261329        void    *pvFmt = (void *)pCtx->mFmtReq.c_str();
    1327         uint32_t cbFmt = pCtx->mFmtReq.length() + 1;        /* Include terminating zero. */
     1330        uint32_t cbFmt = (uint32_t)pCtx->mFmtReq.length() + 1;           /* Include terminating zero. */
    13281331
    13291332        pData->setFmt(pvFmt, cbFmt);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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