VirtualBox

Changeset 92846 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Dec 9, 2021 12:33:57 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148774
Message:

Additions: Shared Clipboard: VBoxTray: unwrap CF_HTML content, bugref:10160.

This commit introduces unwrapping of CF_HTML payload when coping HTML data
from Windows guest.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp

    r92845 r92846  
    633633                            if (lp != NULL)
    634634                            {
    635                                 rc = VbglR3ClipboardWriteDataEx(&pEvent->cmdCtx, fFormat, lp, (uint32_t)GlobalSize(hClip));
     635                                /* Unwrap clipboard content from CF_HTML format if needed. */
     636                                if (SharedClipboardWinIsCFHTML((const char *)lp))
     637                                {
     638                                    char        *pszBuf = NULL;
     639                                    uint32_t    cbBuf   = 0;
     640
     641                                    rc = SharedClipboardWinConvertCFHTMLToMIME((const char *)lp, (uint32_t)GlobalSize(hClip), &pszBuf, &cbBuf);
     642                                    if (RT_SUCCESS(rc))
     643                                    {
     644                                        rc = VbglR3ClipboardWriteDataEx(&pEvent->cmdCtx, fFormat, pszBuf, cbBuf);
     645                                        RTMemFree(pszBuf);
     646                                    }
     647                                }
     648                                else
     649                                    rc = VbglR3ClipboardWriteDataEx(&pEvent->cmdCtx, fFormat, lp, (uint32_t)GlobalSize(hClip));
    636650
    637651                                GlobalUnlock(hClip);
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