VirtualBox

儲存庫 vbox 的更動 56661


忽略:
時間撮記:
2015-6-26 下午02:46:12 (10 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
101302
訊息:

DnD/VBoxTray: Also support retrieving plain text, added better (release) diagnostics, some renaming.

位置:
trunk/src/VBox/Additions/WINNT/VBoxTray
檔案:
修改 4 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp

    r55571 r56661  
    8282    {
    8383        LogFlowFunc(("\t%s\n", arrEntries[i].c_str()));
    84         this->lstAllowedFormats.append(arrEntries[i]);
     84        this->lstFmtSup.append(arrEntries[i]);
    8585    }
    8686}
     
    749749    setMode(HG);
    750750
    751     /* Save all allowed actions. */
    752     this->uAllActions = uAllActions;
    753 
    754     /*
    755      * Check if requested formats are compatible with this client.
    756      */
    757     LogFlowThisFunc(("Supported formats:\n"));
    758     for (size_t i = 0; i < lstFormats.size(); i++)
    759     {
    760         bool fSupported = false;
    761         for (size_t a = 0; a < this->lstAllowedFormats.size(); a++)
    762         {
    763             LogFlowThisFunc(("\t\"%s\" <=> \"%s\"\n", this->lstAllowedFormats.at(a).c_str(), lstFormats.at(i).c_str()));
    764             fSupported = RTStrICmp(this->lstAllowedFormats.at(a).c_str(), lstFormats.at(i).c_str()) == 0;
    765             if (fSupported)
     751    int rc = VINF_SUCCESS;
     752
     753    try
     754    {
     755        /* Save all allowed actions. */
     756        this->uAllActions = uAllActions;
     757
     758        /*
     759         * Check if reported formats from host are compatible with this client.
     760         */
     761        size_t cFormatsSup    = this->lstFmtSup.size();
     762        size_t cFormatsActive = 0;
     763
     764        LPFORMATETC pFormatEtc = new FORMATETC[cFormatsSup];
     765        RT_BZERO(pFormatEtc, sizeof(FORMATETC) * cFormatsSup);
     766
     767        LPSTGMEDIUM pStgMeds   = new STGMEDIUM[cFormatsSup];
     768        RT_BZERO(pStgMeds, sizeof(STGMEDIUM) * cFormatsSup);
     769
     770        LogRel2(("DnD: Reported formats:\n"));
     771        for (size_t i = 0; i < lstFormats.size(); i++)
     772        {
     773            bool fSupported = false;
     774            for (size_t a = 0; a < this->lstFmtSup.size(); a++)
    766775            {
    767                 this->lstFormats.append(lstFormats.at(i));
    768                 break;
     776                const char *pszFormat = lstFormats.at(i).c_str();
     777                LogFlowThisFunc(("\t\"%s\" <=> \"%s\"\n", this->lstFmtSup.at(a).c_str(), pszFormat));
     778
     779                fSupported = RTStrICmp(this->lstFmtSup.at(a).c_str(), pszFormat) == 0;
     780                if (fSupported)
     781                {
     782                    this->lstFmtActive.append(lstFormats.at(i));
     783
     784                    /** @todo Put this into a #define / struct. */
     785                    if (!RTStrICmp(pszFormat, "text/uri-list"))
     786                    {
     787                        pFormatEtc[cFormatsActive].cfFormat = CF_HDROP;
     788                        pFormatEtc[cFormatsActive].dwAspect = DVASPECT_CONTENT;
     789                        pFormatEtc[cFormatsActive].lindex   = -1;
     790                        pFormatEtc[cFormatsActive].tymed    = TYMED_HGLOBAL;
     791
     792                        pStgMeds  [cFormatsActive].tymed    = TYMED_HGLOBAL;
     793                        cFormatsActive++;
     794                    }
     795                    else if (   !RTStrICmp(pszFormat, "text/plain")
     796                             || !RTStrICmp(pszFormat, "text/html")
     797                             || !RTStrICmp(pszFormat, "text/plain;charset=utf-8")
     798                             || !RTStrICmp(pszFormat, "text/plain;charset=utf-16")
     799                             || !RTStrICmp(pszFormat, "text/plain")
     800                             || !RTStrICmp(pszFormat, "text/richtext")
     801                             || !RTStrICmp(pszFormat, "UTF8_STRING")
     802                             || !RTStrICmp(pszFormat, "TEXT")
     803                             || !RTStrICmp(pszFormat, "STRING"))
     804                    {
     805                        pFormatEtc[cFormatsActive].cfFormat = CF_TEXT;
     806                        pFormatEtc[cFormatsActive].dwAspect = DVASPECT_CONTENT;
     807                        pFormatEtc[cFormatsActive].lindex   = -1;
     808                        pFormatEtc[cFormatsActive].tymed    = TYMED_HGLOBAL;
     809
     810                        pStgMeds  [cFormatsActive].tymed    = TYMED_HGLOBAL;
     811                        cFormatsActive++;
     812                    }
     813                    else /* Should never happen. */
     814                        AssertReleaseFailedBreak(("Format specification for '%s' not implemented\n", pszFormat));
     815                    break;
     816                }
    769817            }
    770         }
    771 
    772         LogFlowThisFunc(("\t%s: %RTbool\n", lstFormats.at(i).c_str(), fSupported));
    773     }
    774 
    775     /*
    776      * Warn in the log if this guest does not accept anything.
    777      */
    778     if (!this->lstFormats.size())
    779         LogRel(("DnD: Warning: No supported drag and drop formats on the guest found!\n"));
    780 
    781     /*
    782      * Prepare the startup info for DoDragDrop().
    783      */
    784     int rc = VINF_SUCCESS;
    785     try
    786     {
     818
     819            LogRel2(("DnD: \t%s: %RTbool\n", lstFormats.at(i).c_str(), fSupported));
     820        }
     821
     822        /*
     823         * Warn in the log if this guest does not accept anything.
     824         */
     825        Assert(cFormatsActive <= cFormatsSup);
     826        if (cFormatsActive)
     827        {
     828            LogRel2(("DnD: %RU32 supported formats found:\n", cFormatsActive));
     829            for (size_t i = 0; i < cFormatsActive; i++)
     830                LogRel2(("DnD: \t%s\n", this->lstFmtActive.at(i).c_str()));
     831        }
     832        else
     833            LogRel(("DnD: Warning: No supported drag and drop formats on the guest found!\n"));
     834
     835        /*
     836         * Prepare the startup info for DoDragDrop().
     837         */
     838
    787839        /* Translate our drop actions into allowed Windows drop effects. */
    788840        startupInfo.dwOKEffects = DROPEFFECT_NONE;
     
    797849        }
    798850
     851        LogRel2(("DnD: Supported drop actions: 0x%x\n", startupInfo.dwOKEffects));
     852
    799853        startupInfo.pDropSource = new VBoxDnDDropSource(this);
    800         startupInfo.pDataObject = new VBoxDnDDataObject();
     854        startupInfo.pDataObject = new VBoxDnDDataObject(pFormatEtc, pStgMeds, cFormatsActive);
     855
     856        if (pFormatEtc)
     857            delete pFormatEtc;
     858        if (pStgMeds)
     859            delete pStgMeds;
    801860    }
    802861    catch (std::bad_alloc)
     
    903962    if (mState == Dragging)
    904963    {
    905         if (lstFormats.size() >= 1)
     964        if (lstFmtActive.size() >= 1)
    906965        {
    907966            /** @todo What to do when multiple formats are available? */
    908             mFormatRequested = lstFormats.at(0);
     967            mFormatRequested = lstFmtActive.at(0);
    909968
    910969            rc = RTCritSectEnter(&mCritSect);
     
    14281487     */
    14291488
    1430     this->lstFormats.clear();
     1489    this->lstFmtActive.clear();
    14311490    this->uAllActions = DND_IGNORE_ACTION;
    14321491
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.h

    r55422 r56661  
    4646public:
    4747
    48     VBoxDnDDataObject(FORMATETC *pFormatEtc = NULL, STGMEDIUM *pStgMed = NULL, ULONG cFormats = 0);
     48    VBoxDnDDataObject(LPFORMATETC pFormatEtc = NULL, LPSTGMEDIUM pStgMed = NULL, ULONG cFormats = 0);
    4949    virtual ~VBoxDnDDataObject(void);
    5050
    51 public:
    52 
    53     static int CreateDataObject(FORMATETC *pFormatEtc, STGMEDIUM *pStgMeds,
    54                                 ULONG cFormats, IDataObject **ppDataObject);
    5551public: /* IUnknown methods. */
    5652
     
    6157public: /* IDataObject methods. */
    6258
    63     STDMETHOD(GetData)(FORMATETC *pFormatEtc, STGMEDIUM *pMedium);
    64     STDMETHOD(GetDataHere)(FORMATETC *pFormatEtc, STGMEDIUM *pMedium);
    65     STDMETHOD(QueryGetData)(FORMATETC *pFormatEtc);
    66     STDMETHOD(GetCanonicalFormatEtc)(FORMATETC *pFormatEct,  FORMATETC *pFormatEtcOut);
    67     STDMETHOD(SetData)(FORMATETC *pFormatEtc, STGMEDIUM *pMedium, BOOL fRelease);
     59    STDMETHOD(GetData)(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium);
     60    STDMETHOD(GetDataHere)(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium);
     61    STDMETHOD(QueryGetData)(LPFORMATETC pFormatEtc);
     62    STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC pFormatEct,  LPFORMATETC pFormatEtcOut);
     63    STDMETHOD(SetData)(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease);
    6864    STDMETHOD(EnumFormatEtc)(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc);
    69     STDMETHOD(DAdvise)(FORMATETC *pFormatEtc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
     65    STDMETHOD(DAdvise)(LPFORMATETC pFormatEtc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
    7066    STDMETHOD(DUnadvise)(DWORD dwConnection);
    7167    STDMETHOD(EnumDAdvise)(IEnumSTATDATA **ppEnumAdvise);
     
    8177protected:
    8278
    83     bool LookupFormatEtc(FORMATETC *pFormatEtc, ULONG *puIndex);
     79    bool LookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex);
    8480    static HGLOBAL MemDup(HGLOBAL hMemSource);
    85     void RegisterFormat(FORMATETC *pFormatEtc, CLIPFORMAT clipFormat, TYMED tyMed = TYMED_HGLOBAL,
     81    void RegisterFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat, TYMED tyMed = TYMED_HGLOBAL,
    8682                        LONG lindex = -1, DWORD dwAspect = DVASPECT_CONTENT, DVTARGETDEVICE *pTargetDevice = NULL);
    8783
    88     Status     mStatus;
    89     LONG       mRefCount;
    90     ULONG      mcFormats;
    91     FORMATETC *mpFormatEtc;
    92     STGMEDIUM *mpStgMedium;
    93     RTSEMEVENT mSemEvent;
    94     RTCString  mstrFormat;
    95     void      *mpvData;
    96     uint32_t   mcbData;
     84    Status      mStatus;
     85    LONG        mRefCount;
     86    ULONG       mcFormats;
     87    LPFORMATETC mpFormatEtc;
     88    LPSTGMEDIUM mpStgMedium;
     89    RTSEMEVENT  mSemEvent;
     90    RTCString   mstrFormat;
     91    void       *mpvData;
     92    uint32_t    mcbData;
    9793};
    9894
     
    180176public:
    181177
    182     VBoxDnDEnumFormatEtc(FORMATETC *pFormatEtc, ULONG cFormats);
     178    VBoxDnDEnumFormatEtc(LPFORMATETC pFormatEtc, ULONG cFormats);
    183179    virtual ~VBoxDnDEnumFormatEtc(void);
    184180
     
    189185    STDMETHOD_(ULONG, Release)(void);
    190186
    191     STDMETHOD(Next)(ULONG cFormats, FORMATETC *pFormatEtc, ULONG *pcFetched);
     187    STDMETHOD(Next)(ULONG cFormats, LPFORMATETC pFormatEtc, ULONG *pcFetched);
    192188    STDMETHOD(Skip)(ULONG cFormats);
    193189    STDMETHOD(Reset)(void);
    194     STDMETHOD(Clone)(IEnumFORMATETC ** ppEnumFormatEtc);
    195 
    196 public:
    197 
    198     static void CopyFormat(FORMATETC *pFormatDest, FORMATETC *pFormatSource);
    199     static HRESULT CreateEnumFormatEtc(UINT cFormats, FORMATETC *pFormatEtc, IEnumFORMATETC **ppEnumFormatEtc);
     190    STDMETHOD(Clone)(IEnumFORMATETC **ppEnumFormatEtc);
     191
     192public:
     193
     194    static void CopyFormat(LPFORMATETC pFormatDest, LPFORMATETC pFormatSource);
     195    static HRESULT CreateEnumFormatEtc(UINT cFormats, LPFORMATETC pFormatEtc, IEnumFORMATETC **ppEnumFormatEtc);
    200196
    201197private:
     
    204200    ULONG       m_nIndex;
    205201    ULONG       m_nNumFormats;
    206     FORMATETC * m_pFormatEtc;
     202    LPFORMATETC m_pFormatEtc;
    207203};
    208204
     
    369365     *  property so that we can selectively allow/forbid
    370366     *  certain types later on runtime. */
    371     RTCList<RTCString>         lstAllowedFormats;
     367    RTCList<RTCString>         lstFmtSup;
    372368    /** List of formats for the current
    373369     *  drag'n drop operation. */
    374     RTCList<RTCString>         lstFormats;
     370    RTCList<RTCString>         lstFmtActive;
    375371    /** Flags of all current drag'n drop
    376372     *  actions allowed. */
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDataObject.cpp

    r51476 r56661  
    55
    66/*
    7  * Copyright (C) 2013-2014 Oracle Corporation
     7 * Copyright (C) 2013-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4141/** @todo Implement IDataObjectAsyncCapability interface? */
    4242
    43 VBoxDnDDataObject::VBoxDnDDataObject(FORMATETC *pFormatEtc,
    44                                      STGMEDIUM *pStgMed, ULONG cFormats)
     43VBoxDnDDataObject::VBoxDnDDataObject(LPFORMATETC pFormatEtc, LPSTGMEDIUM pStgMed, ULONG cFormats)
    4544    : mStatus(Uninitialized),
    4645      mRefCount(1),
     
    5150    HRESULT hr;
    5251
    53     /* Make sure that there's enough room for our fixed formats. */
    54     ULONG cAllFormats = cFormats + 1;
     52    ULONG cFixedFormats = 1;
     53    ULONG cAllFormats   = cFormats + cFixedFormats;
    5554
    5655    try
     
    6160        RT_BZERO(mpStgMedium, sizeof(STGMEDIUM) * cAllFormats);
    6261
    63         if (   pFormatEtc
    64             && pStgMed)
     62        /*
     63         * Registration of dynamic formats needed?
     64         */
     65        LogFlowFunc(("%RU32 dynamic formats\n", cFormats));
     66        if (cFormats)
    6567        {
     68            AssertPtr(pFormatEtc);
     69            AssertPtr(pStgMed);
     70
    6671            for (ULONG i = 0; i < cFormats; i++)
    6772            {
     
    8590        AssertRC(rc2);
    8691
    87         /* Most commonly used format. */
     92        /*
     93         * Register fixed formats.
     94         */
     95#if 0
     96        /* CF_HDROP. */
    8897        RegisterFormat(&mpFormatEtc[cFormats], CF_HDROP);
    8998        mpStgMedium[cFormats++].tymed = TYMED_HGLOBAL;
    90 #if 0
     99
    91100        /* IStream. */
    92101        RegisterFormat(&mpFormatEtc[cFormats++],
     
    107116#endif
    108117        mcFormats = cFormats;
    109         mStatus = Initialized;
     118        mStatus   = Initialized;
    110119    }
    111120
     
    125134
    126135    LogFlowFunc(("mRefCount=%RI32\n", mRefCount));
    127 }
    128 
    129 /* static */
    130 int VBoxDnDDataObject::CreateDataObject(FORMATETC *pFormatEtc, STGMEDIUM *pStgMeds,
    131                                         ULONG cFormats, IDataObject **ppDataObject)
    132 {
    133     AssertPtrReturn(pFormatEtc, VERR_INVALID_POINTER);
    134     AssertPtrReturn(pStgMeds, VERR_INVALID_POINTER);
    135     AssertPtrReturn(ppDataObject, VERR_INVALID_POINTER);
    136 
    137     int rc;
    138     try
    139     {
    140         *ppDataObject = new VBoxDnDDataObject(pFormatEtc, pStgMeds, cFormats);
    141         rc = VINF_SUCCESS;
    142     }
    143     catch(std::bad_alloc &)
    144     {
    145         rc = VERR_NO_MEMORY;
    146     }
    147 
    148     return rc;
    149136}
    150137
     
    195182 * @param   pMedium
    196183 */
    197 STDMETHODIMP VBoxDnDDataObject::GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium)
     184STDMETHODIMP VBoxDnDDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
    198185{
    199186    AssertPtrReturn(pFormatEtc, DV_E_FORMATETC);
     
    206193        return DV_E_FORMATETC;
    207194
    208     FORMATETC *pThisFormat = &mpFormatEtc[lIndex];
     195    LPFORMATETC pThisFormat = &mpFormatEtc[lIndex];
    209196    AssertPtr(pThisFormat);
    210197
    211     STGMEDIUM *pThisMedium = &mpStgMedium[lIndex];
     198    LPSTGMEDIUM pThisMedium = &mpStgMedium[lIndex];
    212199    AssertPtr(pThisMedium);
    213200
    214201    LogFlowFunc(("Using pThisFormat=%p, pThisMedium=%p\n", pThisFormat, pThisMedium));
    215202
    216     HRESULT hr = DV_E_FORMATETC;
     203    HRESULT hr = DV_E_FORMATETC; /* Play safe. */
    217204
    218205    LogFlowFunc(("mStatus=%ld\n", mStatus));
     
    226213    if (mStatus == Dropped)
    227214    {
    228         LogFlowFunc(("cfFormat=%RI16, sFormat=%s, tyMed=%RU32, dwAspect=%RU32\n",
    229                      pThisFormat->cfFormat, VBoxDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
    230                      pThisFormat->tymed, pThisFormat->dwAspect));
    231         LogFlowFunc(("Got strFormat=%s, pvData=%p, cbData=%RU32\n",
    232                      mstrFormat.c_str(), mpvData, mcbData));
    233 
     215        LogRel3(("DnD: cfFormat=%RI16, sFormat=%s, tyMed=%RU32, dwAspect=%RU32\n",
     216                 pThisFormat->cfFormat, VBoxDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
     217                 pThisFormat->tymed, pThisFormat->dwAspect));
     218        LogRel3(("DnD: Got strFormat=%s, pvData=%p, cbData=%RU32\n",
     219                  mstrFormat.c_str(), mpvData, mcbData));
     220
     221        /*
     222         * Initialize default values.
     223         */
     224        pMedium->tymed          = pThisFormat->tymed;
     225        pMedium->pUnkForRelease = NULL;
     226
     227        /*
     228         * URI list handling.
     229         */
    234230        if (mstrFormat.equalsIgnoreCase("text/uri-list"))
    235231        {
     
    372368            }
    373369        }
    374     }
    375 
     370        /*
     371         * Plain text handling.
     372         */
     373        else if (   mstrFormat.equalsIgnoreCase("text/plain")
     374                 || mstrFormat.equalsIgnoreCase("text/html")
     375                 || mstrFormat.equalsIgnoreCase("text/plain;charset=utf-8")
     376                 || mstrFormat.equalsIgnoreCase("text/plain;charset=utf-16")
     377                 || mstrFormat.equalsIgnoreCase("text/plain")
     378                 || mstrFormat.equalsIgnoreCase("text/richtext")
     379                 || mstrFormat.equalsIgnoreCase("UTF8_STRING")
     380                 || mstrFormat.equalsIgnoreCase("TEXT")
     381                 || mstrFormat.equalsIgnoreCase("STRING"))
     382        {
     383            pMedium->hGlobal = GlobalAlloc(GHND, mcbData + 1);
     384            if (pMedium->hGlobal)
     385            {
     386                char *pcDst  = (char *)GlobalLock(pMedium->hGlobal);
     387                memcpy(pcDst, mpvData, mcbData);
     388                pcDst[mcbData] = '\0';
     389                GlobalUnlock(pMedium->hGlobal);
     390
     391                hr = S_OK;
     392            }
     393        }
     394        else
     395            LogRel(("DnD: Error: Format '%s' not implemented\n", mstrFormat.c_str()));
     396    }
     397
     398    /* Error handling; at least return some basic data. */
    376399    if (FAILED(hr))
    377400    {
     
    392415        pMedium->pUnkForRelease = NULL;
    393416    }
     417
     418    if (hr == DV_E_FORMATETC)
     419        LogRel(("DnD: Error handling format '%s' (%RU32 bytes)\n", mstrFormat.c_str(), mcbData));
    394420
    395421    LogFlowFunc(("hr=%Rhrc\n", hr));
     
    405431 * @param   pMedium
    406432 */
    407 STDMETHODIMP VBoxDnDDataObject::GetDataHere(FORMATETC *pFormatEtc, STGMEDIUM *pMedium)
     433STDMETHODIMP VBoxDnDDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
    408434{
    409435    LogFlowFunc(("\n"));
     
    418444 * @param   pFormatEtc
    419445 */
    420 STDMETHODIMP VBoxDnDDataObject::QueryGetData(FORMATETC *pFormatEtc)
     446STDMETHODIMP VBoxDnDDataObject::QueryGetData(LPFORMATETC pFormatEtc)
    421447{
    422448    LogFlowFunc(("\n"));
     
    424450}
    425451
    426 STDMETHODIMP VBoxDnDDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatEct, FORMATETC *pFormatEtcOut)
     452STDMETHODIMP VBoxDnDDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatEct, LPFORMATETC pFormatEtcOut)
    427453{
    428454    LogFlowFunc(("\n"));
     
    433459}
    434460
    435 STDMETHODIMP VBoxDnDDataObject::SetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium,  BOOL fRelease)
     461STDMETHODIMP VBoxDnDDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium,  BOOL fRelease)
    436462{
    437463    return E_NOTIMPL;
     
    455481}
    456482
    457 STDMETHODIMP VBoxDnDDataObject::DAdvise(FORMATETC *pFormatEtc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
     483STDMETHODIMP VBoxDnDDataObject::DAdvise(LPFORMATETC pFormatEtc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
    458484{
    459485    return OLE_E_ADVISENOTSUPPORTED;
     
    564590}
    565591
    566 bool VBoxDnDDataObject::LookupFormatEtc(FORMATETC *pFormatEtc, ULONG *puIndex)
     592bool VBoxDnDDataObject::LookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex)
    567593{
    568594    AssertReturn(pFormatEtc, false);
     
    575601            && pFormatEtc->dwAspect == mpFormatEtc[i].dwAspect)
    576602        {
    577             LogFlowFunc(("Format found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32, ulIndex=%RU32\n",
    578                          pFormatEtc->tymed, pFormatEtc->cfFormat, VBoxDnDDataObject::ClipboardFormatToString(mpFormatEtc[i].cfFormat),
    579                          pFormatEtc->dwAspect, i));
     603            LogRel3(("DnD: Format found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32, ulIndex=%RU32\n",
     604                      pFormatEtc->tymed, pFormatEtc->cfFormat, VBoxDnDDataObject::ClipboardFormatToString(mpFormatEtc[i].cfFormat),
     605                      pFormatEtc->dwAspect, i));
    580606            if (puIndex)
    581607                *puIndex = i;
     
    584610    }
    585611
    586 #ifdef VBOX_DND_DEBUG_FORMATS
    587     LogFlowFunc(("Format NOT found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32\n",
    588                  pFormatEtc->tymed, pFormatEtc->cfFormat, VBoxDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
    589                  pFormatEtc->dwAspect));
    590 #endif
     612    LogRel3(("DnD: Format NOT found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32\n",
     613             pFormatEtc->tymed, pFormatEtc->cfFormat, VBoxDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
     614             pFormatEtc->dwAspect));
     615
    591616    return false;
    592617}
     
    611636}
    612637
    613 void VBoxDnDDataObject::RegisterFormat(FORMATETC *pFormatEtc, CLIPFORMAT clipFormat,
     638void VBoxDnDDataObject::RegisterFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat,
    614639                                       TYMED tyMed, LONG lIndex, DWORD dwAspect,
    615640                                       DVTARGETDEVICE *pTargetDevice)
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDEnumFormat.cpp

    r51469 r56661  
    55
    66/*
    7  * Copyright (C) 2013 Oracle Corporation
     7 * Copyright (C) 2013-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030
    3131
    32 VBoxDnDEnumFormatEtc::VBoxDnDEnumFormatEtc(FORMATETC *pFormatEtc, ULONG cFormats)
     32VBoxDnDEnumFormatEtc::VBoxDnDEnumFormatEtc(LPFORMATETC pFormatEtc, ULONG cFormats)
    3333    : m_lRefCount(1),
    3434      m_nIndex(0)
     
    112112}
    113113
    114 STDMETHODIMP VBoxDnDEnumFormatEtc::Next(ULONG cFormats, FORMATETC *pFormatEtc, ULONG *pcFetched)
     114STDMETHODIMP VBoxDnDEnumFormatEtc::Next(ULONG cFormats, LPFORMATETC pFormatEtc, ULONG *pcFetched)
    115115{
    116116    ULONG ulCopied  = 0;
     
    158158
    159159/* static */
    160 void VBoxDnDEnumFormatEtc::CopyFormat(FORMATETC *pDest, FORMATETC *pSource)
     160void VBoxDnDEnumFormatEtc::CopyFormat(LPFORMATETC pDest, LPFORMATETC pSource)
    161161{
    162162    AssertPtrReturnVoid(pDest);
     
    173173
    174174/* static */
    175 HRESULT VBoxDnDEnumFormatEtc::CreateEnumFormatEtc(UINT nNumFormats, FORMATETC *pFormatEtc, IEnumFORMATETC **ppEnumFormatEtc)
     175HRESULT VBoxDnDEnumFormatEtc::CreateEnumFormatEtc(UINT nNumFormats, LPFORMATETC pFormatEtc, IEnumFORMATETC **ppEnumFormatEtc)
    176176{
    177177    AssertReturn(nNumFormats, E_INVALIDARG);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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