Changeset 80664 in vbox for trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp
- Timestamp:
- Sep 9, 2019 10:00:04 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp
r80662 r80664 41 41 //#define VBOX_CLIPBOARD_WITH_UNICODE_SUPPORT 0 42 42 43 VBoxClipboardWinDataObject::VBoxClipboardWinDataObject(PSHCLURITRANSFER pTransfer,44 LPFORMATETC pFormatEtc, LPSTGMEDIUM pStgMed, ULONG cFormats)43 SharedClipboardWinDataObject::SharedClipboardWinDataObject(PSHCLURITRANSFER pTransfer, 44 LPFORMATETC pFormatEtc, LPSTGMEDIUM pStgMed, ULONG cFormats) 45 45 : m_enmStatus(Uninitialized) 46 46 , m_lRefCount(0) … … 129 129 } 130 130 131 VBoxClipboardWinDataObject::~VBoxClipboardWinDataObject(void)131 SharedClipboardWinDataObject::~SharedClipboardWinDataObject(void) 132 132 { 133 133 RTSemEventDestroy(m_EventListComplete); … … 153 153 */ 154 154 155 STDMETHODIMP_(ULONG) VBoxClipboardWinDataObject::AddRef(void)155 STDMETHODIMP_(ULONG) SharedClipboardWinDataObject::AddRef(void) 156 156 { 157 157 LONG lCount = InterlockedIncrement(&m_lRefCount); … … 160 160 } 161 161 162 STDMETHODIMP_(ULONG) VBoxClipboardWinDataObject::Release(void)162 STDMETHODIMP_(ULONG) SharedClipboardWinDataObject::Release(void) 163 163 { 164 164 LONG lCount = InterlockedDecrement(&m_lRefCount); … … 173 173 } 174 174 175 STDMETHODIMP VBoxClipboardWinDataObject::QueryInterface(REFIID iid, void **ppvObject)175 STDMETHODIMP SharedClipboardWinDataObject::QueryInterface(REFIID iid, void **ppvObject) 176 176 { 177 177 AssertPtrReturn(ppvObject, E_INVALIDARG); … … 198 198 * @param phGlobal Where to store the allocated HGLOBAL object. 199 199 */ 200 int VBoxClipboardWinDataObject::copyToHGlobal(const void *pvData, size_t cbData, UINT fFlags, HGLOBAL *phGlobal)200 int SharedClipboardWinDataObject::copyToHGlobal(const void *pvData, size_t cbData, UINT fFlags, HGLOBAL *phGlobal) 201 201 { 202 202 AssertPtrReturn(phGlobal, VERR_INVALID_POINTER); … … 229 229 * @param strDir Directory path to handle. 230 230 */ 231 int VBoxClipboardWinDataObject::readDir(PSHCLURITRANSFER pTransfer, const Utf8Str &strDir)231 int SharedClipboardWinDataObject::readDir(PSHCLURITRANSFER pTransfer, const Utf8Str &strDir) 232 232 { 233 233 LogFlowFunc(("strDir=%s\n", strDir.c_str())); … … 309 309 * @returns VBox status code. 310 310 * @param ThreadSelf Thread handle. Unused at the moment. 311 * @param pvUser Pointer to user-provided data. Of type VBoxClipboardWinDataObject.311 * @param pvUser Pointer to user-provided data. Of type SharedClipboardWinDataObject. 312 312 */ 313 313 /* static */ 314 DECLCALLBACK(int) VBoxClipboardWinDataObject::readThread(RTTHREAD ThreadSelf, void *pvUser)314 DECLCALLBACK(int) SharedClipboardWinDataObject::readThread(RTTHREAD ThreadSelf, void *pvUser) 315 315 { 316 316 RT_NOREF(ThreadSelf); … … 318 318 LogFlowFuncEnter(); 319 319 320 VBoxClipboardWinDataObject *pThis = (VBoxClipboardWinDataObject *)pvUser;320 SharedClipboardWinDataObject *pThis = (SharedClipboardWinDataObject *)pvUser; 321 321 322 322 PSHCLURITRANSFER pTransfer = pThis->m_pTransfer; … … 405 405 * @param phGlobal Where to store the allocated HGLOBAL object on success. 406 406 */ 407 int VBoxClipboardWinDataObject::createFileGroupDescriptorFromTransfer(PSHCLURITRANSFER pTransfer,407 int SharedClipboardWinDataObject::createFileGroupDescriptorFromTransfer(PSHCLURITRANSFER pTransfer, 408 408 bool fUnicode, HGLOBAL *phGlobal) 409 409 { … … 529 529 * @param pMedium 530 530 */ 531 STDMETHODIMP VBoxClipboardWinDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)531 STDMETHODIMP SharedClipboardWinDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium) 532 532 { 533 533 AssertPtrReturn(pFormatEtc, DV_E_FORMATETC); … … 564 564 { 565 565 /* Start the transfer asynchronously in a separate thread. */ 566 rc = SharedClipboardURITransferRun(m_pTransfer, & VBoxClipboardWinDataObject::readThread, this);566 rc = SharedClipboardURITransferRun(m_pTransfer, &SharedClipboardWinDataObject::readThread, this); 567 567 if (RT_SUCCESS(rc)) 568 568 { … … 614 614 615 615 /* Hand-in the provider so that our IStream implementation can continue working with it. */ 616 hr = VBoxClipboardWinStreamImpl::Create(this /* pParent */, m_pTransfer,617 fsObjEntry.strPath.c_str()/* File name */, &fsObjEntry.objInfo /* PSHCLFSOBJINFO */,618 &m_pStream);616 hr = SharedClipboardWinStreamImpl::Create(this /* pParent */, m_pTransfer, 617 fsObjEntry.strPath.c_str()/* File name */, &fsObjEntry.objInfo /* PSHCLFSOBJINFO */, 618 &m_pStream); 619 619 if (SUCCEEDED(hr)) 620 620 { … … 650 650 * @param pMedium 651 651 */ 652 STDMETHODIMP VBoxClipboardWinDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)652 STDMETHODIMP SharedClipboardWinDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium) 653 653 { 654 654 RT_NOREF(pFormatEtc, pMedium); … … 664 664 * @param pFormatEtc 665 665 */ 666 STDMETHODIMP VBoxClipboardWinDataObject::QueryGetData(LPFORMATETC pFormatEtc)666 STDMETHODIMP SharedClipboardWinDataObject::QueryGetData(LPFORMATETC pFormatEtc) 667 667 { 668 668 LogFlowFunc(("\n")); … … 670 670 } 671 671 672 STDMETHODIMP VBoxClipboardWinDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatEtc, LPFORMATETC pFormatEtcOut)672 STDMETHODIMP SharedClipboardWinDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatEtc, LPFORMATETC pFormatEtcOut) 673 673 { 674 674 RT_NOREF(pFormatEtc); … … 680 680 } 681 681 682 STDMETHODIMP VBoxClipboardWinDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease)682 STDMETHODIMP SharedClipboardWinDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease) 683 683 { 684 684 RT_NOREF(pFormatEtc, pMedium, fRelease); … … 688 688 } 689 689 690 STDMETHODIMP VBoxClipboardWinDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc)690 STDMETHODIMP SharedClipboardWinDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc) 691 691 { 692 692 LogFlowFunc(("dwDirection=%RI32, mcFormats=%RI32, mpFormatEtc=%p\n", dwDirection, m_cFormats, m_pFormatEtc)); … … 694 694 HRESULT hr; 695 695 if (dwDirection == DATADIR_GET) 696 hr = VBoxClipboardWinEnumFormatEtc::CreateEnumFormatEtc(m_cFormats, m_pFormatEtc, ppEnumFormatEtc);696 hr = SharedClipboardWinEnumFormatEtc::CreateEnumFormatEtc(m_cFormats, m_pFormatEtc, ppEnumFormatEtc); 697 697 else 698 698 hr = E_NOTIMPL; … … 702 702 } 703 703 704 STDMETHODIMP VBoxClipboardWinDataObject::DAdvise(LPFORMATETC pFormatEtc, DWORD fAdvise, IAdviseSink *pAdvSink, DWORD *pdwConnection)704 STDMETHODIMP SharedClipboardWinDataObject::DAdvise(LPFORMATETC pFormatEtc, DWORD fAdvise, IAdviseSink *pAdvSink, DWORD *pdwConnection) 705 705 { 706 706 RT_NOREF(pFormatEtc, fAdvise, pAdvSink, pdwConnection); … … 708 708 } 709 709 710 STDMETHODIMP VBoxClipboardWinDataObject::DUnadvise(DWORD dwConnection)710 STDMETHODIMP SharedClipboardWinDataObject::DUnadvise(DWORD dwConnection) 711 711 { 712 712 RT_NOREF(dwConnection); … … 714 714 } 715 715 716 STDMETHODIMP VBoxClipboardWinDataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise)716 STDMETHODIMP SharedClipboardWinDataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise) 717 717 { 718 718 RT_NOREF(ppEnumAdvise); … … 725 725 */ 726 726 727 STDMETHODIMP VBoxClipboardWinDataObject::EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects)727 STDMETHODIMP SharedClipboardWinDataObject::EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects) 728 728 { 729 729 RT_NOREF(hResult, pbcReserved, dwEffects); … … 731 731 } 732 732 733 STDMETHODIMP VBoxClipboardWinDataObject::GetAsyncMode(BOOL *pfIsOpAsync)733 STDMETHODIMP SharedClipboardWinDataObject::GetAsyncMode(BOOL *pfIsOpAsync) 734 734 { 735 735 RT_NOREF(pfIsOpAsync); … … 737 737 } 738 738 739 STDMETHODIMP VBoxClipboardWinDataObject::InOperation(BOOL *pfInAsyncOp)739 STDMETHODIMP SharedClipboardWinDataObject::InOperation(BOOL *pfInAsyncOp) 740 740 { 741 741 RT_NOREF(pfInAsyncOp); … … 743 743 } 744 744 745 STDMETHODIMP VBoxClipboardWinDataObject::SetAsyncMode(BOOL fDoOpAsync)745 STDMETHODIMP SharedClipboardWinDataObject::SetAsyncMode(BOOL fDoOpAsync) 746 746 { 747 747 RT_NOREF(fDoOpAsync); … … 749 749 } 750 750 751 STDMETHODIMP VBoxClipboardWinDataObject::StartOperation(IBindCtx *pbcReserved)751 STDMETHODIMP SharedClipboardWinDataObject::StartOperation(IBindCtx *pbcReserved) 752 752 { 753 753 RT_NOREF(pbcReserved); … … 760 760 */ 761 761 762 int VBoxClipboardWinDataObject::Init(void)762 int SharedClipboardWinDataObject::Init(void) 763 763 { 764 764 LogFlowFuncLeaveRC(VINF_SUCCESS); … … 766 766 } 767 767 768 void VBoxClipboardWinDataObject::OnTransferComplete(int rc /* = VINF_SUCESS */)768 void SharedClipboardWinDataObject::OnTransferComplete(int rc /* = VINF_SUCESS */) 769 769 { 770 770 RT_NOREF(rc); … … 785 785 } 786 786 787 void VBoxClipboardWinDataObject::OnTransferCanceled(void)787 void SharedClipboardWinDataObject::OnTransferCanceled(void) 788 788 { 789 789 LogFlowFuncEnter(); … … 799 799 800 800 /* static */ 801 const char* VBoxClipboardWinDataObject::ClipboardFormatToString(CLIPFORMAT fmt)801 const char* SharedClipboardWinDataObject::ClipboardFormatToString(CLIPFORMAT fmt) 802 802 { 803 803 #if 0 … … 881 881 } 882 882 883 bool VBoxClipboardWinDataObject::lookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex)883 bool SharedClipboardWinDataObject::lookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex) 884 884 { 885 885 AssertReturn(pFormatEtc, false); … … 894 894 { 895 895 LogRel3(("Shared Clipboard: Format found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32, ulIndex=%RU32\n", 896 pFormatEtc->tymed, pFormatEtc->cfFormat, VBoxClipboardWinDataObject::ClipboardFormatToString(m_pFormatEtc[i].cfFormat),896 pFormatEtc->tymed, pFormatEtc->cfFormat, SharedClipboardWinDataObject::ClipboardFormatToString(m_pFormatEtc[i].cfFormat), 897 897 pFormatEtc->dwAspect, i)); 898 898 if (puIndex) … … 903 903 904 904 LogRel3(("Shared Clipboard: Format NOT found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32\n", 905 pFormatEtc->tymed, pFormatEtc->cfFormat, VBoxClipboardWinDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),905 pFormatEtc->tymed, pFormatEtc->cfFormat, SharedClipboardWinDataObject::ClipboardFormatToString(pFormatEtc->cfFormat), 906 906 pFormatEtc->dwAspect)); 907 907 … … 909 909 } 910 910 911 void VBoxClipboardWinDataObject::registerFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat,912 TYMED tyMed, LONG lIndex, DWORD dwAspect,913 DVTARGETDEVICE *pTargetDevice)911 void SharedClipboardWinDataObject::registerFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat, 912 TYMED tyMed, LONG lIndex, DWORD dwAspect, 913 DVTARGETDEVICE *pTargetDevice) 914 914 { 915 915 AssertPtr(pFormatEtc); … … 922 922 923 923 LogFlowFunc(("Registered format=%ld, sFormat=%s\n", 924 pFormatEtc->cfFormat, VBoxClipboardWinDataObject::ClipboardFormatToString(pFormatEtc->cfFormat)));925 } 926 924 pFormatEtc->cfFormat, SharedClipboardWinDataObject::ClipboardFormatToString(pFormatEtc->cfFormat))); 925 } 926
Note:
See TracChangeset
for help on using the changeset viewer.