VirtualBox

Changeset 103631 in vbox


Ignore:
Timestamp:
Mar 1, 2024 11:00:38 AM (11 months ago)
Author:
vboxsync
Message:

Shared Clipboard: More cleanups (renaming Windows parts to match the other platforms). bugref:9437

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/SharedClipboard-win.h

    r103615 r103631  
    113113#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    114114/** Forward declaration for the Windows data object. */
    115 class SharedClipboardWinDataObject;
     115class ShClWinDataObject;
    116116#endif
    117117
     
    143143     *  hasn't been started yet.
    144144     *  Can be NULL if currently not being used / no current "in-flight" transfer present. */
    145     SharedClipboardWinDataObject
    146                       *pDataObjInFlight;
     145    ShClWinDataObject *pDataObjInFlight;
    147146#endif
    148147    /** Request queue.
     
    151150} SHCLWINCTX, *PSHCLWINCTX;
    152151
    153 int SharedClipboardWinOpen(HWND hWnd);
    154 int SharedClipboardWinClose(void);
    155 int SharedClipboardWinClear(void);
    156 
    157 int SharedClipboardWinCtxInit(PSHCLWINCTX pWinCtx);
    158 void SharedClipboardWinCtxDestroy(PSHCLWINCTX pWinCtx);
    159 
    160 int SharedClipboardWinCheckAndInitNewAPI(PSHCLWINAPINEW pAPI);
    161 bool SharedClipboardWinIsNewAPI(PSHCLWINAPINEW pAPI);
    162 
    163 int SharedClipboardWinDataWrite(UINT cfFormat, void *pvData, uint32_t cbData);
    164 
    165 int SharedClipboardWinChainAdd(PSHCLWINCTX pCtx);
    166 int SharedClipboardWinChainRemove(PSHCLWINCTX pCtx);
    167 VOID CALLBACK SharedClipboardWinChainPingProc(HWND hWnd, UINT uMsg, ULONG_PTR dwData, LRESULT lResult) RT_NOTHROW_DEF;
    168 LRESULT SharedClipboardWinChainPassToNext(PSHCLWINCTX pWinCtx, UINT msg, WPARAM wParam, LPARAM lParam);
    169 
    170 SHCLFORMAT SharedClipboardWinClipboardFormatToVBox(UINT uFormat);
    171 int SharedClipboardWinGetFormats(PSHCLWINCTX pCtx, PSHCLFORMATS pfFormats);
    172 
    173 int SharedClipboardWinGetCFHTMLHeaderValue(const char *pszSrc, const char *pszOption, uint32_t *puValue);
    174 bool SharedClipboardWinIsCFHTML(const char *pszSource);
    175 int SharedClipboardWinConvertCFHTMLToMIME(const char *pszSource, const uint32_t cch, char **ppszOutput, uint32_t *pcbOutput);
    176 int SharedClipboardWinConvertMIMEToCFHTML(const char *pszSource, size_t cb, char **ppszOutput, uint32_t *pcbOutput);
    177 
    178 LRESULT SharedClipboardWinHandleWMChangeCBChain(PSHCLWINCTX pWinCtx, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
    179 int SharedClipboardWinHandleWMDestroy(PSHCLWINCTX pWinCtx);
    180 int SharedClipboardWinHandleWMRenderAllFormats(PSHCLWINCTX pWinCtx, HWND hWnd);
    181 int SharedClipboardWinHandleWMTimer(PSHCLWINCTX pWinCtx);
    182 
    183 int SharedClipboardWinClearAndAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats, HWND hWnd);
     152int ShClWinOpen(HWND hWnd);
     153int ShClWinClose(void);
     154int ShClWinClear(void);
     155
     156int ShClWinCtxInit(PSHCLWINCTX pWinCtx);
     157void ShClWinCtxDestroy(PSHCLWINCTX pWinCtx);
     158
     159int ShClWinCheckAndInitNewAPI(PSHCLWINAPINEW pAPI);
     160bool ShClWinIsNewAPI(PSHCLWINAPINEW pAPI);
     161
     162int ShClWinDataWrite(UINT cfFormat, void *pvData, uint32_t cbData);
     163
     164int ShClWinChainAdd(PSHCLWINCTX pCtx);
     165int ShClWinChainRemove(PSHCLWINCTX pCtx);
     166VOID CALLBACK ShClWinChainPingProc(HWND hWnd, UINT uMsg, ULONG_PTR dwData, LRESULT lResult) RT_NOTHROW_DEF;
     167LRESULT ShClWinChainPassToNext(PSHCLWINCTX pWinCtx, UINT msg, WPARAM wParam, LPARAM lParam);
     168
     169SHCLFORMAT ShClWinClipboardFormatToVBox(UINT uFormat);
     170int ShClWinGetFormats(PSHCLWINCTX pCtx, PSHCLFORMATS pfFormats);
     171
     172int ShClWinGetCFHTMLHeaderValue(const char *pszSrc, const char *pszOption, uint32_t *puValue);
     173bool ShClWinIsCFHTML(const char *pszSource);
     174int ShClWinConvertCFHTMLToMIME(const char *pszSource, const uint32_t cch, char **ppszOutput, uint32_t *pcbOutput);
     175int ShClWinConvertMIMEToCFHTML(const char *pszSource, size_t cb, char **ppszOutput, uint32_t *pcbOutput);
     176
     177LRESULT ShClWinHandleWMChangeCBChain(PSHCLWINCTX pWinCtx, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
     178int ShClWinHandleWMDestroy(PSHCLWINCTX pWinCtx);
     179int ShClWinHandleWMRenderAllFormats(PSHCLWINCTX pWinCtx, HWND hWnd);
     180int ShClWinHandleWMTimer(PSHCLWINCTX pWinCtx);
     181
     182int ShClWinClearAndAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats, HWND hWnd);
    184183
    185184#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     
    190189
    191190/**
    192  * Generic Windows class implementing IDataObject for Shared Clipboard data transfers.
    193  */
    194 class SharedClipboardWinDataObject : public IDataObject //, public IDataObjectAsyncCapability
     191 * Shared CLipboard Windows class implementing IDataObject for Shared Clipboard data transfers.
     192 */
     193class ShClWinDataObject : public IDataObject //, public IDataObjectAsyncCapability
    195194{
    196195public:
     
    202201    {
    203202        /** Pointer to the data object of this callback. */
    204         SharedClipboardWinDataObject *pThis;
     203        ShClWinDataObject *pThis;
    205204        /** User-supplied pointer to more context data. */
    206205        void                         *pvUser;
     
    253252public:
    254253
    255     SharedClipboardWinDataObject(void);
    256     virtual ~SharedClipboardWinDataObject(void);
    257 
    258 public:
    259 
    260     int Init(PSHCLCONTEXT pCtx, SharedClipboardWinDataObject::PCALLBACKS pCallbacks, LPFORMATETC pFormatEtc = NULL, LPSTGMEDIUM pStgMed = NULL, ULONG cFormats = 0);
     254    ShClWinDataObject(void);
     255    virtual ~ShClWinDataObject(void);
     256
     257public:
     258
     259    int Init(PSHCLCONTEXT pCtx, ShClWinDataObject::PCALLBACKS pCallbacks, LPFORMATETC pFormatEtc = NULL, LPSTGMEDIUM pStgMed = NULL, ULONG cFormats = 0);
    261260    void Uninit(void);
    262261    void Destroy(void);
     
    382381 * Generic Windows class implementing IEnumFORMATETC for Shared Clipboard data transfers.
    383382 */
    384 class SharedClipboardWinEnumFormatEtc : public IEnumFORMATETC
    385 {
    386 public:
    387 
    388     SharedClipboardWinEnumFormatEtc(void);
    389     virtual ~SharedClipboardWinEnumFormatEtc(void);
     383class ShClWinEnumFormatEtc : public IEnumFORMATETC
     384{
     385public:
     386
     387    ShClWinEnumFormatEtc(void);
     388    virtual ~ShClWinEnumFormatEtc(void);
    390389
    391390public:
     
    423422 * Generic Windows class implementing IStream for Shared Clipboard data transfers.
    424423 */
    425 class SharedClipboardWinStreamImpl : public IStream
    426 {
    427 public:
    428 
    429     SharedClipboardWinStreamImpl(SharedClipboardWinDataObject *pParent, PSHCLTRANSFER pTransfer,
    430                                  const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo);
    431     virtual ~SharedClipboardWinStreamImpl(void);
     424class ShClWinStreamImpl : public IStream
     425{
     426public:
     427
     428    ShClWinStreamImpl(ShClWinDataObject *pParent, PSHCLTRANSFER pTransfer,
     429                      const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo);
     430    virtual ~ShClWinStreamImpl(void);
    432431
    433432public: /* IUnknown methods. */
     
    453452public: /* Own methods. */
    454453
    455     static HRESULT Create(SharedClipboardWinDataObject *pParent, PSHCLTRANSFER pTransfer, const Utf8Str &strPath,
     454    static HRESULT Create(ShClWinDataObject *pParent, PSHCLTRANSFER pTransfer, const Utf8Str &strPath,
    456455                          PSHCLFSOBJINFO pObjInfo, IStream **ppStream);
    457456private:
    458457
    459458    /** Pointer to the parent data object. */
    460     SharedClipboardWinDataObject  *m_pParent;
     459    ShClWinDataObject             *m_pParent;
    461460    /** The stream object's current reference count. */
    462461    LONG                           m_lRefCount;
     
    479478 * Set as pvUser / cbUser for SHCLTRANSFER on Windows hosts / guests.
    480479 */
    481 class SharedClipboardWinTransferCtx
    482 {
    483 public:
    484     SharedClipboardWinTransferCtx()
     480class ShClWinTransferCtx
     481{
     482public:
     483    ShClWinTransferCtx()
    485484        : pDataObj(NULL) { }
    486485
    487     virtual ~SharedClipboardWinTransferCtx() { }
     486    virtual ~ShClWinTransferCtx() { }
    488487
    489488    /** Pointer to data object to use for this transfer. Not owned.
    490489     *  Can be NULL if not being used. */
    491     SharedClipboardWinDataObject *pDataObj;
     490    ShClWinDataObject *pDataObj;
    492491};
    493492
    494 int SharedClipboardWinTransferGetRoots(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
    495 int SharedClipboardWinTransferDropFilesToStringList(DROPFILES *pDropFiles, char **papszList, uint32_t *pcbList);
    496 int SharedClipboardWinTransferGetRootsFromClipboard(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
    497 
    498 int SharedClipboardWinTransferCreate(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
    499 void SharedClipboardWinTransferDestroy(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
    500 
    501 int SharedClipboardWinTransferCreateAndSetDataObject(PSHCLWINCTX pWinCtx, PSHCLCONTEXT pCtx, SharedClipboardWinDataObject::PCALLBACKS pCallbacks);
    502 int SharedClipboardWinTransferInitialize(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
    503 int SharedClipboardWinTransferStart(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
     493int ShClWinTransferGetRoots(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
     494int ShClWinTransferDropFilesToStringList(DROPFILES *pDropFiles, char **papszList, uint32_t *pcbList);
     495int ShClWinTransferGetRootsFromClipboard(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
     496
     497int ShClWinTransferCreate(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
     498void ShClWinTransferDestroy(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
     499
     500int ShClWinTransferCreateAndSetDataObject(PSHCLWINCTX pWinCtx, PSHCLCONTEXT pCtx, ShClWinDataObject::PCALLBACKS pCallbacks);
     501int ShClWinTransferInitialize(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
     502int ShClWinTransferStart(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
    504503# endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
    505504#endif /* !VBOX_INCLUDED_GuestHost_SharedClipboard_win_h */
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp

    r103615 r103631  
    103103#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    104104/**
    105  * @copydoc SharedClipboardWinDataObject::CALLBACKS::pfnTransferBegin
    106  *
    107  * Called by SharedClipboardWinDataObject::GetData() when the user wants to paste data.
     105 * @copydoc ShClWinDataObject::CALLBACKS::pfnTransferBegin
     106 *
     107 * Called by ShClWinDataObject::GetData() when the user wants to paste data.
    108108 * This then requests a new transfer on the host.
    109109 *
    110110 * @thread  Clipboard main thread.
    111111 */
    112 static DECLCALLBACK(int) vbtrShClDataObjectTransferBeginCallback(SharedClipboardWinDataObject::PCALLBACKCTX pCbCtx)
     112static DECLCALLBACK(int) vbtrShClDataObjectTransferBeginCallback(ShClWinDataObject::PCALLBACKCTX pCbCtx)
    113113{
    114114    LogFlowFuncEnter();
     
    137137    AssertPtr(pCtx);
    138138
    139     int rc = SharedClipboardWinTransferCreate(&pCtx->Win, pCbCtx->pTransfer);
     139    int rc = ShClWinTransferCreate(&pCtx->Win, pCbCtx->pTransfer);
    140140
    141141    LogFlowFuncLeaveRC(rc);
     
    156156    AssertPtr(pCtx);
    157157
    158     SharedClipboardWinTransferDestroy(&pCtx->Win, pCbCtx->pTransfer);
     158    ShClWinTransferDestroy(&pCtx->Win, pCbCtx->pTransfer);
    159159
    160160    LogFlowFuncLeave();
     
    186186        case SHCLTRANSFERDIR_FROM_REMOTE: /* H->G */
    187187        {
    188             rc = SharedClipboardWinTransferInitialize(&pCtx->Win, pTransfer);
     188            rc = ShClWinTransferInitialize(&pCtx->Win, pTransfer);
    189189            break;
    190190        }
     
    192192        case SHCLTRANSFERDIR_TO_REMOTE: /* G->H */
    193193        {
    194             rc = SharedClipboardWinTransferGetRootsFromClipboard(&pCtx->Win, pTransfer);
     194            rc = ShClWinTransferGetRootsFromClipboard(&pCtx->Win, pTransfer);
    195195            break;
    196196        }
     
    229229        case SHCLTRANSFERDIR_FROM_REMOTE: /* H->G */
    230230        {
    231             rc = SharedClipboardWinTransferStart(&pCtx->Win, pTransfer);
     231            rc = ShClWinTransferStart(&pCtx->Win, pTransfer);
    232232            break;
    233233        }
     
    305305    if (enmDir == SHCLTRANSFERDIR_TO_REMOTE) /* G->H */
    306306    {
    307         rc = SharedClipboardWinTransferGetRootsFromClipboard(&pCtx->Win, pTransfer);
     307        rc = ShClWinTransferGetRootsFromClipboard(&pCtx->Win, pTransfer);
    308308    }
    309309    else if (enmDir == SHCLTRANSFERDIR_FROM_REMOTE) /* H->G */
     
    411411                     * Report available formats to the host. */
    412412                    SHCLFORMATS fFormats;
    413                     rc = SharedClipboardWinGetFormats(pWinCtx, &fFormats);
     413                    rc = ShClWinGetFormats(pWinCtx, &fFormats);
    414414                    if (RT_SUCCESS(rc))
    415415                    {
     
    434434        {
    435435            LogFunc(("WM_CHANGECBCHAIN\n"));
    436             lresultRc = SharedClipboardWinHandleWMChangeCBChain(pWinCtx, hwnd, msg, wParam, lParam);
     436            lresultRc = ShClWinHandleWMChangeCBChain(pWinCtx, hwnd, msg, wParam, lParam);
    437437            break;
    438438        }
     
    458458                    /* WM_DRAWCLIPBOARD always expects a return code of 0, so don't change "rc" here. */
    459459                    SHCLFORMATS fFormats;
    460                     rc = SharedClipboardWinGetFormats(pWinCtx, &fFormats);
     460                    rc = ShClWinGetFormats(pWinCtx, &fFormats);
    461461                    if (   RT_SUCCESS(rc)
    462462                        && fFormats != VBOX_SHCL_FMT_NONE)
     
    470470            }
    471471
    472             lresultRc = SharedClipboardWinChainPassToNext(pWinCtx, msg, wParam, lParam);
     472            lresultRc = ShClWinChainPassToNext(pWinCtx, msg, wParam, lParam);
    473473            break;
    474474        }
     
    476476        case WM_TIMER:
    477477        {
    478             int rc = SharedClipboardWinHandleWMTimer(pWinCtx);
     478            int rc = ShClWinHandleWMTimer(pWinCtx);
    479479            AssertRC(rc);
    480480
     
    492492            /* Insert the requested clipboard format data into the clipboard. */
    493493            const UINT       uFmtWin  = (UINT)wParam;
    494             const SHCLFORMAT uFmtVBox = SharedClipboardWinClipboardFormatToVBox(uFmtWin);
     494            const SHCLFORMAT uFmtVBox = ShClWinClipboardFormatToVBox(uFmtWin);
    495495
    496496            LogFunc(("WM_RENDERFORMAT: uFmtWin=%u -> uFmtVBox=0x%x\n", uFmtWin, uFmtVBox));
     
    504504            {
    505505                LogRel(("Shared Clipboard: Unsupported format (%#x) requested\n", uFmtWin));
    506                 SharedClipboardWinClear();
     506                ShClWinClear();
    507507            }
    508508            else
     
    529529                    {
    530530                        /* Wrap content into CF_HTML clipboard format if needed. */
    531                         if (!SharedClipboardWinIsCFHTML((const char *)pvData))
     531                        if (!ShClWinIsCFHTML((const char *)pvData))
    532532                        {
    533533                            char    *pszWrapped = NULL;
    534534                            uint32_t cbWrapped  = 0;
    535                             rc = SharedClipboardWinConvertMIMEToCFHTML((const char *)pvData, cbData, &pszWrapped, &cbWrapped);
     535                            rc = ShClWinConvertMIMEToCFHTML((const char *)pvData, cbData, &pszWrapped, &cbWrapped);
    536536                            if (RT_SUCCESS(rc))
    537537                            {
     
    588588            LogFunc(("WM_RENDERALLFORMATS\n"));
    589589
    590             int rc = SharedClipboardWinHandleWMRenderAllFormats(pWinCtx, hwnd);
     590            int rc = ShClWinHandleWMRenderAllFormats(pWinCtx, hwnd);
    591591            AssertRC(rc);
    592592
     
    613613            if (fFormats != VBOX_SHCL_FMT_NONE) /* Could arrive with some older GA versions. */
    614614            {
    615                 int rc = SharedClipboardWinClearAndAnnounceFormats(pWinCtx, fFormats, hwnd);
     615                int rc = ShClWinClearAndAnnounceFormats(pWinCtx, fFormats, hwnd);
    616616#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    617617                if (   RT_SUCCESS(rc)
     
    622622                     * That way Windows will recognize that there is a data transfer available.
    623623                     */
    624                     SharedClipboardWinDataObject::CALLBACKS Callbacks;
     624                    ShClWinDataObject::CALLBACKS Callbacks;
    625625                    RT_ZERO(Callbacks);
    626626                    Callbacks.pfnTransferBegin = vbtrShClDataObjectTransferBeginCallback;
    627627
    628                     rc = SharedClipboardWinTransferCreateAndSetDataObject(pWinCtx, pCtx, &Callbacks);
     628                    rc = ShClWinTransferCreateAndSetDataObject(pWinCtx, pCtx, &Callbacks);
    629629                }
    630630#else
     
    653653            RTStrFree(pszFmts);
    654654#endif
    655             int rc = SharedClipboardWinOpen(hwnd);
     655            int rc = ShClWinOpen(hwnd);
    656656            HANDLE hClip = NULL;
    657657            if (RT_SUCCESS(rc))
     
    704704
    705705                                /* Unwrap clipboard content from CF_HTML format if needed. */
    706                                 if (SharedClipboardWinIsCFHTML((const char *)pvClip))
     706                                if (ShClWinIsCFHTML((const char *)pvClip))
    707707                                {
    708708                                    char        *pszBuf = NULL;
    709709                                    uint32_t    cbBuf   = 0;
    710                                     rc = SharedClipboardWinConvertCFHTMLToMIME((const char *)pvClip, cbClip, &pszBuf, &cbBuf);
     710                                    rc = ShClWinConvertCFHTMLToMIME((const char *)pvClip, cbClip, &pszBuf, &cbBuf);
    711711                                    if (RT_SUCCESS(rc))
    712712                                    {
     
    731731                    LogFunc(("SHCL_WIN_WM_READ_DATA: hClip=NULL, lastError=%ld\n", GetLastError()));
    732732
    733                 SharedClipboardWinClose();
     733                ShClWinClose();
    734734            }
    735735
     
    744744            LogFunc(("WM_DESTROY\n"));
    745745
    746             int rc = SharedClipboardWinHandleWMDestroy(pWinCtx);
     746            int rc = ShClWinHandleWMDestroy(pWinCtx);
    747747            AssertRC(rc);
    748748
     
    816816                         SWP_NOACTIVATE | SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOREDRAW | SWP_NOSIZE);
    817817
    818             rc = SharedClipboardWinChainAdd(pWinCtx);
     818            rc = ShClWinChainAdd(pWinCtx);
    819819            if (RT_SUCCESS(rc))
    820820            {
    821                 if (!SharedClipboardWinIsNewAPI(&pWinCtx->newAPI))
     821                if (!ShClWinIsNewAPI(&pWinCtx->newAPI))
    822822                    pWinCtx->oldAPI.timerRefresh = SetTimer(pWinCtx->hWnd, 0, 10 * 1000 /* 10s */, NULL);
    823823            }
     
    933933    AssertRCReturn(rc, rc);
    934934
    935     rc = SharedClipboardWinCtxInit(&pCtx->Win);
     935    rc = ShClWinCtxInit(&pCtx->Win);
    936936    if (RT_SUCCESS(rc))
    937937        rc = VbglR3ClipboardConnectEx(&pCtx->CmdCtx, VBOX_SHCL_GF_0_CONTEXT_ID);
     
    11981198    UnregisterClass(s_szClipWndClassName, pCtx->pEnv->hInstance);
    11991199
    1200     SharedClipboardWinCtxDestroy(&pCtx->Win);
     1200    ShClWinCtxDestroy(&pCtx->Win);
    12011201
    12021202#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp

    r103615 r103631  
    6262//#define VBOX_CLIPBOARD_WITH_UNICODE_SUPPORT 1
    6363
    64 SharedClipboardWinDataObject::SharedClipboardWinDataObject(void)
     64ShClWinDataObject::ShClWinDataObject(void)
    6565    : m_pCtx(NULL)
    6666    , m_enmStatus(Uninitialized)
     
    8080}
    8181
    82 SharedClipboardWinDataObject::~SharedClipboardWinDataObject(void)
     82ShClWinDataObject::~ShClWinDataObject(void)
    8383{
    8484    Destroy();
     
    102102 * @param   cFormats            Number of formats in \a pFormatEtc and \a pStgMed. Optional.
    103103 */
    104 int SharedClipboardWinDataObject::Init(PSHCLCONTEXT pCtx, SharedClipboardWinDataObject::PCALLBACKS pCallbacks,
    105                                        LPFORMATETC pFormatEtc /* = NULL */, LPSTGMEDIUM pStgMed /* = NULL */,
    106                                        ULONG cFormats /* = 0 */)
     104int ShClWinDataObject::Init(PSHCLCONTEXT pCtx, ShClWinDataObject::PCALLBACKS pCallbacks,
     105                            LPFORMATETC pFormatEtc /* = NULL */, LPSTGMEDIUM pStgMed /* = NULL */,
     106                            ULONG cFormats /* = 0 */)
    107107{
    108108    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
     
    117117     * Set up callback context + table.
    118118     */
    119     memcpy(&m_Callbacks, pCallbacks, sizeof(SharedClipboardWinDataObject::CALLBACKS));
     119    memcpy(&m_Callbacks, pCallbacks, sizeof(ShClWinDataObject::CALLBACKS));
    120120    m_CallbackCtx.pvUser = pCtx;
    121121    m_CallbackCtx.pThis  = this;
     
    199199 * Uninitialized a data object instance, internal version.
    200200 */
    201 void SharedClipboardWinDataObject::uninitInternal(void)
     201void ShClWinDataObject::uninitInternal(void)
    202202{
    203203    LogFlowFuncEnter();
     
    230230 * Uninitialized a data object instance.
    231231 */
    232 void SharedClipboardWinDataObject::Uninit(void)
     232void ShClWinDataObject::Uninit(void)
    233233{
    234234    LogFlowFuncEnter();
     
    240240 * Destroys a data object instance.
    241241 */
    242 void SharedClipboardWinDataObject::Destroy(void)
     242void ShClWinDataObject::Destroy(void)
    243243{
    244244    LogFlowFuncEnter();
     
    295295 ********************************************************************************************************************************/
    296296
    297 STDMETHODIMP_(ULONG) SharedClipboardWinDataObject::AddRef(void)
     297STDMETHODIMP_(ULONG) ShClWinDataObject::AddRef(void)
    298298{
    299299    ULONG ulCount = InterlockedIncrement(&m_lRefCount);
     
    302302}
    303303
    304 STDMETHODIMP_(ULONG) SharedClipboardWinDataObject::Release(void)
     304STDMETHODIMP_(ULONG) ShClWinDataObject::Release(void)
    305305{
    306306    ULONG ulCount = InterlockedDecrement(&m_lRefCount);
     
    315315}
    316316
    317 STDMETHODIMP SharedClipboardWinDataObject::QueryInterface(REFIID iid, void **ppvObject)
     317STDMETHODIMP ShClWinDataObject::QueryInterface(REFIID iid, void **ppvObject)
    318318{
    319319    AssertPtrReturn(ppvObject, E_INVALIDARG);
     
    340340 * @param   phGlobal            Where to store the allocated HGLOBAL object.
    341341 */
    342 int SharedClipboardWinDataObject::copyToHGlobal(const void *pvData, size_t cbData, UINT fFlags, HGLOBAL *phGlobal)
     342int ShClWinDataObject::copyToHGlobal(const void *pvData, size_t cbData, UINT fFlags, HGLOBAL *phGlobal)
    343343{
    344344    AssertPtrReturn(phGlobal, VERR_INVALID_POINTER);
     
    363363}
    364364
    365 inline int SharedClipboardWinDataObject::lock(void)
     365inline int ShClWinDataObject::lock(void)
    366366{
    367367    int rc = RTCritSectEnter(&m_CritSect);
     
    371371}
    372372
    373 inline int SharedClipboardWinDataObject::unlock(void)
     373inline int ShClWinDataObject::unlock(void)
    374374{
    375375    int rc = RTCritSectLeave(&m_CritSect);
     
    387387 * @param   strDir              Directory path to handle.
    388388 */
    389 int SharedClipboardWinDataObject::readDir(PSHCLTRANSFER pTransfer, const Utf8Str &strDir)
     389int ShClWinDataObject::readDir(PSHCLTRANSFER pTransfer, const Utf8Str &strDir)
    390390{
    391391    LogFlowFunc(("strDir=%s\n", strDir.c_str()));
     
    482482 * @returns VBox status code.
    483483 * @param   pTransfer           Pointer to transfer.
    484  * @param   pvUser              Pointer to user-provided data. Of type SharedClipboardWinDataObject.
     484 * @param   pvUser              Pointer to user-provided data. Of type ShClWinDataObject.
    485485 */
    486486/* static */
    487 DECLCALLBACK(int) SharedClipboardWinDataObject::readThread(PSHCLTRANSFER pTransfer, void *pvUser)
     487DECLCALLBACK(int) ShClWinDataObject::readThread(PSHCLTRANSFER pTransfer, void *pvUser)
    488488{
    489489    LogFlowFuncEnter();
    490490
    491     SharedClipboardWinDataObject *pThis = (SharedClipboardWinDataObject *)pvUser;
     491    ShClWinDataObject *pThis = (ShClWinDataObject *)pvUser;
    492492
    493493    LogRel2(("Shared Clipboard: Calculating transfer ...\n"));
     
    639639 * @param   phGlobal            Where to store the allocated HGLOBAL object on success.
    640640 */
    641 int SharedClipboardWinDataObject::createFileGroupDescriptorFromTransfer(PSHCLTRANSFER pTransfer,
     641int ShClWinDataObject::createFileGroupDescriptorFromTransfer(PSHCLTRANSFER pTransfer,
    642642                                                                        bool fUnicode, HGLOBAL *phGlobal)
    643643{
     
    764764 * @thread  Windows event thread.
    765765 */
    766 STDMETHODIMP SharedClipboardWinDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
     766STDMETHODIMP ShClWinDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
    767767{
    768768    AssertPtrReturn(pFormatEtc, DV_E_FORMATETC);
     
    861861                    if (RT_SUCCESS(rc))
    862862                    {
    863                         rc = ShClTransferRun(m_pTransfer, &SharedClipboardWinDataObject::readThread, this /* pvUser */);
     863                        rc = ShClTransferRun(m_pTransfer, &ShClWinDataObject::readThread, this /* pvUser */);
    864864                        if (RT_SUCCESS(rc))
    865865                        {
     
    932932
    933933                /* Hand-in the provider so that our IStream implementation can continue working with it. */
    934                 hr = SharedClipboardWinStreamImpl::Create(this /* pParent */, m_pTransfer,
     934                hr = ShClWinStreamImpl::Create(this /* pParent */, m_pTransfer,
    935935                                                          fsObjEntry.pszPath /* File name */, &fsObjEntry.objInfo /* PSHCLFSOBJINFO */,
    936936                                                          &m_pStream);
     
    978978 * @param   pMedium
    979979 */
    980 STDMETHODIMP SharedClipboardWinDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
     980STDMETHODIMP ShClWinDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
    981981{
    982982    RT_NOREF(pFormatEtc, pMedium);
     
    992992 * @param   pFormatEtc
    993993 */
    994 STDMETHODIMP SharedClipboardWinDataObject::QueryGetData(LPFORMATETC pFormatEtc)
     994STDMETHODIMP ShClWinDataObject::QueryGetData(LPFORMATETC pFormatEtc)
    995995{
    996996    LogFlowFunc(("\n"));
     
    998998}
    999999
    1000 STDMETHODIMP SharedClipboardWinDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatEtc, LPFORMATETC pFormatEtcOut)
     1000STDMETHODIMP ShClWinDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatEtc, LPFORMATETC pFormatEtcOut)
    10011001{
    10021002    RT_NOREF(pFormatEtc);
     
    10081008}
    10091009
    1010 STDMETHODIMP SharedClipboardWinDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease)
     1010STDMETHODIMP ShClWinDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease)
    10111011{
    10121012    if (   pFormatEtc == NULL
     
    10551055}
    10561056
    1057 STDMETHODIMP SharedClipboardWinDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc)
     1057STDMETHODIMP ShClWinDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc)
    10581058{
    10591059    LogFlowFunc(("dwDirection=%RI32, mcFormats=%RI32, mpFormatEtc=%p\n", dwDirection, m_cFormats, m_pFormatEtc));
     
    10611061    HRESULT hr;
    10621062    if (dwDirection == DATADIR_GET)
    1063         hr = SharedClipboardWinEnumFormatEtc::CreateEnumFormatEtc(m_cFormats, m_pFormatEtc, ppEnumFormatEtc);
     1063        hr = ShClWinEnumFormatEtc::CreateEnumFormatEtc(m_cFormats, m_pFormatEtc, ppEnumFormatEtc);
    10641064    else
    10651065        hr = E_NOTIMPL;
     
    10691069}
    10701070
    1071 STDMETHODIMP SharedClipboardWinDataObject::DAdvise(LPFORMATETC pFormatEtc, DWORD fAdvise, IAdviseSink *pAdvSink, DWORD *pdwConnection)
     1071STDMETHODIMP ShClWinDataObject::DAdvise(LPFORMATETC pFormatEtc, DWORD fAdvise, IAdviseSink *pAdvSink, DWORD *pdwConnection)
    10721072{
    10731073    RT_NOREF(pFormatEtc, fAdvise, pAdvSink, pdwConnection);
     
    10751075}
    10761076
    1077 STDMETHODIMP SharedClipboardWinDataObject::DUnadvise(DWORD dwConnection)
     1077STDMETHODIMP ShClWinDataObject::DUnadvise(DWORD dwConnection)
    10781078{
    10791079    RT_NOREF(dwConnection);
     
    10811081}
    10821082
    1083 STDMETHODIMP SharedClipboardWinDataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise)
     1083STDMETHODIMP ShClWinDataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise)
    10841084{
    10851085    RT_NOREF(ppEnumAdvise);
     
    10921092 */
    10931093
    1094 STDMETHODIMP SharedClipboardWinDataObject::EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects)
     1094STDMETHODIMP ShClWinDataObject::EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects)
    10951095{
    10961096     RT_NOREF(hResult, pbcReserved, dwEffects);
     
    10981098}
    10991099
    1100 STDMETHODIMP SharedClipboardWinDataObject::GetAsyncMode(BOOL *pfIsOpAsync)
     1100STDMETHODIMP ShClWinDataObject::GetAsyncMode(BOOL *pfIsOpAsync)
    11011101{
    11021102     RT_NOREF(pfIsOpAsync);
     
    11041104}
    11051105
    1106 STDMETHODIMP SharedClipboardWinDataObject::InOperation(BOOL *pfInAsyncOp)
     1106STDMETHODIMP ShClWinDataObject::InOperation(BOOL *pfInAsyncOp)
    11071107{
    11081108     RT_NOREF(pfInAsyncOp);
     
    11101110}
    11111111
    1112 STDMETHODIMP SharedClipboardWinDataObject::SetAsyncMode(BOOL fDoOpAsync)
     1112STDMETHODIMP ShClWinDataObject::SetAsyncMode(BOOL fDoOpAsync)
    11131113{
    11141114     RT_NOREF(fDoOpAsync);
     
    11161116}
    11171117
    1118 STDMETHODIMP SharedClipboardWinDataObject::StartOperation(IBindCtx *pbcReserved)
     1118STDMETHODIMP ShClWinDataObject::StartOperation(IBindCtx *pbcReserved)
    11191119{
    11201120     RT_NOREF(pbcReserved);
     
    11341134 *                              When set to NULL, the transfer will be released from the object.
    11351135 */
    1136 int SharedClipboardWinDataObject::setTransferLocked(PSHCLTRANSFER pTransfer)
     1136int ShClWinDataObject::setTransferLocked(PSHCLTRANSFER pTransfer)
    11371137{
    11381138    AssertReturn(RTCritSectIsOwned(&m_CritSect), VERR_WRONG_ORDER);
     
    11501150            m_pTransfer = pTransfer;
    11511151
    1152             SharedClipboardWinTransferCtx *pWinURITransferCtx = (SharedClipboardWinTransferCtx *)pTransfer->pvUser;
     1152            ShClWinTransferCtx *pWinURITransferCtx = (ShClWinTransferCtx *)pTransfer->pvUser;
    11531153            AssertPtr(pWinURITransferCtx);
    11541154
     
    11641164        if (m_pTransfer)
    11651165        {
    1166             SharedClipboardWinTransferCtx *pWinURITransferCtx = (SharedClipboardWinTransferCtx *)m_pTransfer->pvUser;
     1166            ShClWinTransferCtx *pWinURITransferCtx = (ShClWinTransferCtx *)m_pTransfer->pvUser;
    11671167            AssertPtr(pWinURITransferCtx);
    11681168
     
    11881188 *                              When set to NULL, the transfer will be released from the object.
    11891189 */
    1190 int SharedClipboardWinDataObject::SetTransfer(PSHCLTRANSFER pTransfer)
     1190int ShClWinDataObject::SetTransfer(PSHCLTRANSFER pTransfer)
    11911191{
    11921192    lock();
     
    12061206 * @param   rcSts               Result code. Optional.
    12071207 *
    1208  * @note    Called by the main clipboard thread + SharedClipboardWinStreamImpl.
    1209  */
    1210 int SharedClipboardWinDataObject::SetStatus(Status enmStatus, int rcSts /* = VINF_SUCCESS */)
     1208 * @note    Called by the main clipboard thread + ShClWinStreamImpl.
     1209 */
     1210int ShClWinDataObject::SetStatus(Status enmStatus, int rcSts /* = VINF_SUCCESS */)
    12111211{
    12121212    lock();
     
    12191219
    12201220/* static */
    1221 void SharedClipboardWinDataObject::logFormat(CLIPFORMAT fmt)
     1221void ShClWinDataObject::logFormat(CLIPFORMAT fmt)
    12221222{
    12231223    char szFormat[128];
     
    12301230}
    12311231
    1232 bool SharedClipboardWinDataObject::lookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex)
     1232bool ShClWinDataObject::lookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex)
    12331233{
    12341234    AssertReturn(pFormatEtc, false);
     
    12581258}
    12591259
    1260 void SharedClipboardWinDataObject::registerFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat,
     1260void ShClWinDataObject::registerFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat,
    12611261                                                  TYMED tyMed, LONG lIndex, DWORD dwAspect,
    12621262                                                  DVTARGETDEVICE *pTargetDevice)
     
    12851285 * @note    Caller must have taken the critical section.
    12861286 */
    1287 int SharedClipboardWinDataObject::setStatusLocked(Status enmStatus, int rc /* = VINF_SUCCESS */)
     1287int ShClWinDataObject::setStatusLocked(Status enmStatus, int rc /* = VINF_SUCCESS */)
    12881288{
    12891289    AssertReturn(enmStatus == Error || RT_SUCCESS(rc), VERR_INVALID_PARAMETER);
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardEnumFormatEtcImpl-win.cpp

    r100665 r103631  
    5656
    5757
    58 SharedClipboardWinEnumFormatEtc::SharedClipboardWinEnumFormatEtc(void)
     58ShClWinEnumFormatEtc::ShClWinEnumFormatEtc(void)
    5959    : m_lRefCount(1),
    6060      m_nIndex(0)
     
    6666}
    6767
    68 SharedClipboardWinEnumFormatEtc::~SharedClipboardWinEnumFormatEtc(void)
     68ShClWinEnumFormatEtc::~ShClWinEnumFormatEtc(void)
    6969{
    7070    Destroy();
     
    8585 * @param   cFormats            Number of formats in \a pFormatEtc.
    8686 */
    87 int SharedClipboardWinEnumFormatEtc::Init(LPFORMATETC pFormatEtc, ULONG cFormats)
     87int ShClWinEnumFormatEtc::Init(LPFORMATETC pFormatEtc, ULONG cFormats)
    8888{
    8989    LogFlowFunc(("pFormatEtc=%p, cFormats=%RU32\n", pFormatEtc, cFormats));
     
    9696                     i, pFormatEtc[i].cfFormat, pFormatEtc[i].tymed, pFormatEtc[i].dwAspect));
    9797
    98         SharedClipboardWinDataObject::logFormat(pFormatEtc[i].cfFormat);
    99 
    100         SharedClipboardWinEnumFormatEtc::CopyFormat(&m_pFormatEtc[i], &pFormatEtc[i]);
     98        ShClWinDataObject::logFormat(pFormatEtc[i].cfFormat);
     99
     100        ShClWinEnumFormatEtc::CopyFormat(&m_pFormatEtc[i], &pFormatEtc[i]);
    101101    }
    102102
     
    109109 * Destroys an IEnumFORMATETC instance.
    110110 */
    111 void SharedClipboardWinEnumFormatEtc::Destroy(void)
     111void ShClWinEnumFormatEtc::Destroy(void)
    112112{
    113113    if (m_pFormatEtc)
     
    130130 */
    131131
    132 STDMETHODIMP_(ULONG) SharedClipboardWinEnumFormatEtc::AddRef(void)
     132STDMETHODIMP_(ULONG) ShClWinEnumFormatEtc::AddRef(void)
    133133{
    134134    return InterlockedIncrement(&m_lRefCount);
    135135}
    136136
    137 STDMETHODIMP_(ULONG) SharedClipboardWinEnumFormatEtc::Release(void)
     137STDMETHODIMP_(ULONG) ShClWinEnumFormatEtc::Release(void)
    138138{
    139139    LONG lCount = InterlockedDecrement(&m_lRefCount);
     
    148148}
    149149
    150 STDMETHODIMP SharedClipboardWinEnumFormatEtc::QueryInterface(REFIID iid, void **ppvObject)
     150STDMETHODIMP ShClWinEnumFormatEtc::QueryInterface(REFIID iid, void **ppvObject)
    151151{
    152152    if (   iid == IID_IEnumFORMATETC
     
    162162}
    163163
    164 STDMETHODIMP SharedClipboardWinEnumFormatEtc::Next(ULONG cFormats, LPFORMATETC pFormatEtc, ULONG *pcFetched)
     164STDMETHODIMP ShClWinEnumFormatEtc::Next(ULONG cFormats, LPFORMATETC pFormatEtc, ULONG *pcFetched)
    165165{
    166166    ULONG ulCopied  = 0;
     
    172172           && ulCopied < cFormats)
    173173    {
    174         SharedClipboardWinEnumFormatEtc::CopyFormat(&pFormatEtc[ulCopied], &m_pFormatEtc[m_nIndex]);
     174        ShClWinEnumFormatEtc::CopyFormat(&pFormatEtc[ulCopied], &m_pFormatEtc[m_nIndex]);
    175175        ulCopied++;
    176176        m_nIndex++;
     
    183183}
    184184
    185 STDMETHODIMP SharedClipboardWinEnumFormatEtc::Skip(ULONG cFormats)
     185STDMETHODIMP ShClWinEnumFormatEtc::Skip(ULONG cFormats)
    186186{
    187187    m_nIndex += cFormats;
     
    189189}
    190190
    191 STDMETHODIMP SharedClipboardWinEnumFormatEtc::Reset(void)
     191STDMETHODIMP ShClWinEnumFormatEtc::Reset(void)
    192192{
    193193    m_nIndex = 0;
     
    195195}
    196196
    197 STDMETHODIMP SharedClipboardWinEnumFormatEtc::Clone(IEnumFORMATETC **ppEnumFormatEtc)
     197STDMETHODIMP ShClWinEnumFormatEtc::Clone(IEnumFORMATETC **ppEnumFormatEtc)
    198198{
    199199    HRESULT hResult = CreateEnumFormatEtc(m_nNumFormats, m_pFormatEtc, ppEnumFormatEtc);
    200200    if (hResult == S_OK)
    201         ((SharedClipboardWinEnumFormatEtc *) *ppEnumFormatEtc)->m_nIndex = m_nIndex;
     201        ((ShClWinEnumFormatEtc *) *ppEnumFormatEtc)->m_nIndex = m_nIndex;
    202202
    203203    return hResult;
     
    205205
    206206/* static */
    207 void SharedClipboardWinEnumFormatEtc::CopyFormat(LPFORMATETC pDest, LPFORMATETC pSource)
     207void ShClWinEnumFormatEtc::CopyFormat(LPFORMATETC pDest, LPFORMATETC pSource)
    208208{
    209209    AssertPtrReturnVoid(pDest);
     
    220220
    221221/* static */
    222 HRESULT SharedClipboardWinEnumFormatEtc::CreateEnumFormatEtc(UINT nNumFormats, LPFORMATETC pFormatEtc, IEnumFORMATETC **ppEnumFormatEtc)
     222HRESULT ShClWinEnumFormatEtc::CreateEnumFormatEtc(UINT nNumFormats, LPFORMATETC pFormatEtc, IEnumFORMATETC **ppEnumFormatEtc)
    223223{
    224224    AssertReturn(nNumFormats, E_INVALIDARG);
     
    228228    HRESULT hr;
    229229
    230     SharedClipboardWinEnumFormatEtc *pEnumFormatEtc = new SharedClipboardWinEnumFormatEtc();
     230    ShClWinEnumFormatEtc *pEnumFormatEtc = new ShClWinEnumFormatEtc();
    231231    if (pEnumFormatEtc)
    232232    {
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardStreamImpl-win.cpp

    r103480 r103631  
    6060
    6161
    62 SharedClipboardWinStreamImpl::SharedClipboardWinStreamImpl(SharedClipboardWinDataObject *pParent, PSHCLTRANSFER pTransfer,
    63                                                            const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo)
     62ShClWinStreamImpl::ShClWinStreamImpl(ShClWinDataObject *pParent, PSHCLTRANSFER pTransfer,
     63                                     const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo)
    6464    : m_pParent(pParent)
    6565    , m_lRefCount(1) /* Our IDataObjct *always* holds the last reference to this object; needed for the callbacks. */
     
    8181}
    8282
    83 SharedClipboardWinStreamImpl::~SharedClipboardWinStreamImpl(void)
     83ShClWinStreamImpl::~ShClWinStreamImpl(void)
    8484{
    8585    LogFlowThisFuncEnter();
     
    9595 */
    9696
    97 STDMETHODIMP SharedClipboardWinStreamImpl::QueryInterface(REFIID iid, void **ppvObject)
     97STDMETHODIMP ShClWinStreamImpl::QueryInterface(REFIID iid, void **ppvObject)
    9898{
    9999    AssertPtrReturn(ppvObject, E_INVALIDARG);
     
    124124}
    125125
    126 STDMETHODIMP_(ULONG) SharedClipboardWinStreamImpl::AddRef(void)
     126STDMETHODIMP_(ULONG) ShClWinStreamImpl::AddRef(void)
    127127{
    128128    LONG lCount = InterlockedIncrement(&m_lRefCount);
     
    131131}
    132132
    133 STDMETHODIMP_(ULONG) SharedClipboardWinStreamImpl::Release(void)
     133STDMETHODIMP_(ULONG) ShClWinStreamImpl::Release(void)
    134134{
    135135    LONG lCount = InterlockedDecrement(&m_lRefCount);
     
    148148 */
    149149
    150 STDMETHODIMP SharedClipboardWinStreamImpl::Clone(IStream** ppStream)
     150STDMETHODIMP ShClWinStreamImpl::Clone(IStream** ppStream)
    151151{
    152152    RT_NOREF(ppStream);
     
    156156}
    157157
    158 STDMETHODIMP SharedClipboardWinStreamImpl::Commit(DWORD dwFrags)
     158STDMETHODIMP ShClWinStreamImpl::Commit(DWORD dwFrags)
    159159{
    160160    RT_NOREF(dwFrags);
     
    164164}
    165165
    166 STDMETHODIMP SharedClipboardWinStreamImpl::CopyTo(IStream *pDestStream, ULARGE_INTEGER nBytesToCopy, ULARGE_INTEGER *nBytesRead,
     166STDMETHODIMP ShClWinStreamImpl::CopyTo(IStream *pDestStream, ULARGE_INTEGER nBytesToCopy, ULARGE_INTEGER *nBytesRead,
    167167                                                  ULARGE_INTEGER *nBytesWritten)
    168168{
     
    173173}
    174174
    175 STDMETHODIMP SharedClipboardWinStreamImpl::LockRegion(ULARGE_INTEGER nStart, ULARGE_INTEGER nBytes,DWORD dwFlags)
     175STDMETHODIMP ShClWinStreamImpl::LockRegion(ULARGE_INTEGER nStart, ULARGE_INTEGER nBytes,DWORD dwFlags)
    176176{
    177177    RT_NOREF(nStart, nBytes, dwFlags);
     
    182182
    183183/* Note: Windows seems to assume EOF if nBytesRead < nBytesToRead. */
    184 STDMETHODIMP SharedClipboardWinStreamImpl::Read(void *pvBuffer, ULONG nBytesToRead, ULONG *nBytesRead)
     184STDMETHODIMP ShClWinStreamImpl::Read(void *pvBuffer, ULONG nBytesToRead, ULONG *nBytesRead)
    185185{
    186186    LogFlowThisFunc(("Enter: m_cbProcessed=%RU64\n", m_cbProcessed));
     
    249249
    250250            if (m_pParent)
    251                 m_pParent->SetStatus(SharedClipboardWinDataObject::Completed);
     251                m_pParent->SetStatus(ShClWinDataObject::Completed);
    252252        }
    253253    }
     
    256256    {
    257257        if (m_pParent)
    258             m_pParent->SetStatus(SharedClipboardWinDataObject::Error, rc /* Propagate rc */);
     258            m_pParent->SetStatus(ShClWinDataObject::Error, rc /* Propagate rc */);
    259259    }
    260260
     
    271271}
    272272
    273 STDMETHODIMP SharedClipboardWinStreamImpl::Revert(void)
    274 {
    275     LogFlowThisFuncEnter();
    276     return E_NOTIMPL;
    277 }
    278 
    279 STDMETHODIMP SharedClipboardWinStreamImpl::Seek(LARGE_INTEGER nMove, DWORD dwOrigin, ULARGE_INTEGER* nNewPos)
     273STDMETHODIMP ShClWinStreamImpl::Revert(void)
     274{
     275    LogFlowThisFuncEnter();
     276    return E_NOTIMPL;
     277}
     278
     279STDMETHODIMP ShClWinStreamImpl::Seek(LARGE_INTEGER nMove, DWORD dwOrigin, ULARGE_INTEGER* nNewPos)
    280280{
    281281    RT_NOREF(nMove, dwOrigin, nNewPos);
     
    286286}
    287287
    288 STDMETHODIMP SharedClipboardWinStreamImpl::SetSize(ULARGE_INTEGER nNewSize)
     288STDMETHODIMP ShClWinStreamImpl::SetSize(ULARGE_INTEGER nNewSize)
    289289{
    290290    RT_NOREF(nNewSize);
     
    294294}
    295295
    296 STDMETHODIMP SharedClipboardWinStreamImpl::Stat(STATSTG *pStatStg, DWORD dwFlags)
     296STDMETHODIMP ShClWinStreamImpl::Stat(STATSTG *pStatStg, DWORD dwFlags)
    297297{
    298298    HRESULT hr = S_OK;
     
    355355}
    356356
    357 STDMETHODIMP SharedClipboardWinStreamImpl::UnlockRegion(ULARGE_INTEGER nStart, ULARGE_INTEGER nBytes, DWORD dwFlags)
     357STDMETHODIMP ShClWinStreamImpl::UnlockRegion(ULARGE_INTEGER nStart, ULARGE_INTEGER nBytes, DWORD dwFlags)
    358358{
    359359    RT_NOREF(nStart, nBytes, dwFlags);
     
    363363}
    364364
    365 STDMETHODIMP SharedClipboardWinStreamImpl::Write(const void *pvBuffer, ULONG nBytesToRead, ULONG *nBytesRead)
     365STDMETHODIMP ShClWinStreamImpl::Write(const void *pvBuffer, ULONG nBytesToRead, ULONG *nBytesRead)
    366366{
    367367    RT_NOREF(pvBuffer, nBytesToRead, nBytesRead);
     
    386386 */
    387387/* static */
    388 HRESULT SharedClipboardWinStreamImpl::Create(SharedClipboardWinDataObject *pParent, PSHCLTRANSFER pTransfer,
     388HRESULT ShClWinStreamImpl::Create(ShClWinDataObject *pParent, PSHCLTRANSFER pTransfer,
    389389                                             const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo,
    390390                                             IStream **ppStream)
     
    392392    AssertPtrReturn(pTransfer, E_POINTER);
    393393
    394     SharedClipboardWinStreamImpl *pStream = new SharedClipboardWinStreamImpl(pParent, pTransfer, strPath, pObjInfo);
     394    ShClWinStreamImpl *pStream = new ShClWinStreamImpl(pParent, pTransfer, strPath, pObjInfo);
    395395    if (pStream)
    396396    {
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp

    r103615 r103631  
    5454
    5555#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    56 int SharedClipboardWinTransferDropFilesToStringList(DROPFILES *pDropFiles, char **ppszList, uint32_t *pcbList);
     56int ShClWinTransferDropFilesToStringList(DROPFILES *pDropFiles, char **ppszList, uint32_t *pcbList);
    5757#endif
    5858
     
    6464 * @param   hWnd                Handle of window to open clipboard for.
    6565 */
    66 int SharedClipboardWinOpen(HWND hWnd)
     66int ShClWinOpen(HWND hWnd)
    6767{
    6868    /* "OpenClipboard fails if another window has the clipboard open."
     
    112112 * @returns VBox status code.
    113113 */
    114 int SharedClipboardWinClose(void)
     114int ShClWinClose(void)
    115115{
    116116    int rc;
     
    142142 * @returns VBox status code.
    143143 */
    144 int SharedClipboardWinClear(void)
     144int ShClWinClear(void)
    145145{
    146146    LogFlowFuncEnter();
     
    164164 * @param   pWinCtx             Shared Clipboard Windows context to initialize.
    165165 */
    166 int SharedClipboardWinCtxInit(PSHCLWINCTX pWinCtx)
     166int ShClWinCtxInit(PSHCLWINCTX pWinCtx)
    167167{
    168168    int rc = RTCritSectInit(&pWinCtx->CritSect);
     
    170170    {
    171171        /* Check that new Clipboard API is available. */
    172         SharedClipboardWinCheckAndInitNewAPI(&pWinCtx->newAPI);
     172        ShClWinCheckAndInitNewAPI(&pWinCtx->newAPI);
    173173        /* Do *not* check the rc, as the call might return VERR_SYMBOL_NOT_FOUND is the new API isn't available. */
    174174
     
    191191 * @param   pWinCtx             Shared Clipboard Windows context to destroy.
    192192 */
    193 void SharedClipboardWinCtxDestroy(PSHCLWINCTX pWinCtx)
     193void ShClWinCtxDestroy(PSHCLWINCTX pWinCtx)
    194194{
    195195    if (!pWinCtx)
     
    213213 *                              Will be set to NULL if the new API is not available.
    214214 */
    215 int SharedClipboardWinCheckAndInitNewAPI(PSHCLWINAPINEW pAPI)
     215int ShClWinCheckAndInitNewAPI(PSHCLWINAPINEW pAPI)
    216216{
    217217    RTLDRMOD hUser32 = NIL_RTLDRMOD;
     
    248248 * @param   pAPI                Structure used for checking if the new clipboard API is available or not.
    249249 */
    250 bool SharedClipboardWinIsNewAPI(PSHCLWINAPINEW pAPI)
     250bool ShClWinIsNewAPI(PSHCLWINAPINEW pAPI)
    251251{
    252252    if (!pAPI)
     
    261261 * @param   pCtx                Windows clipboard context to use to add ourselves.
    262262 */
    263 int SharedClipboardWinChainAdd(PSHCLWINCTX pCtx)
     263int ShClWinChainAdd(PSHCLWINCTX pCtx)
    264264{
    265265    const PSHCLWINAPINEW pAPI = &pCtx->newAPI;
    266266
    267267    BOOL fRc;
    268     if (SharedClipboardWinIsNewAPI(pAPI))
     268    if (ShClWinIsNewAPI(pAPI))
    269269        fRc = pAPI->pfnAddClipboardFormatListener(pCtx->hWnd);
    270270    else
     
    293293 * @param   pCtx                Windows clipboard context to use to remove ourselves.
    294294 */
    295 int SharedClipboardWinChainRemove(PSHCLWINCTX pCtx)
     295int ShClWinChainRemove(PSHCLWINCTX pCtx)
    296296{
    297297    if (!pCtx->hWnd)
     
    301301
    302302    BOOL fRc;
    303     if (SharedClipboardWinIsNewAPI(pAPI))
     303    if (ShClWinIsNewAPI(pAPI))
    304304    {
    305305        fRc = pAPI->pfnRemoveClipboardFormatListener(pCtx->hWnd);
     
    335335 * @param   lResult             Additional data to pass. Not used currently.
    336336 */
    337 VOID CALLBACK SharedClipboardWinChainPingProc(HWND hWnd, UINT uMsg, ULONG_PTR dwData, LRESULT lResult) RT_NOTHROW_DEF
     337VOID CALLBACK ShClWinChainPingProc(HWND hWnd, UINT uMsg, ULONG_PTR dwData, LRESULT lResult) RT_NOTHROW_DEF
    338338{
    339339    RT_NOREF(hWnd);
     
    357357 * @param   lParam              LPARAM to pass.
    358358 */
    359 LRESULT SharedClipboardWinChainPassToNext(PSHCLWINCTX pWinCtx,
     359LRESULT ShClWinChainPassToNext(PSHCLWINCTX pWinCtx,
    360360                                          UINT msg, WPARAM wParam, LPARAM lParam)
    361361{
     
    386386 * @param   uFormat             Windows clipboard format to convert.
    387387 */
    388 SHCLFORMAT SharedClipboardWinClipboardFormatToVBox(UINT uFormat)
     388SHCLFORMAT ShClWinClipboardFormatToVBox(UINT uFormat)
    389389{
    390390    /* Insert the requested clipboard format data into the clipboard. */
     
    445445 * @param   pfFormats           Where to store the retrieved formats.
    446446 */
    447 int SharedClipboardWinGetFormats(PSHCLWINCTX pCtx, PSHCLFORMATS pfFormats)
     447int ShClWinGetFormats(PSHCLWINCTX pCtx, PSHCLFORMATS pfFormats)
    448448{
    449449    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
     
    453453
    454454    /* Query list of available formats and report to host. */
    455     int rc = SharedClipboardWinOpen(pCtx->hWnd);
     455    int rc = ShClWinOpen(pCtx->hWnd);
    456456    if (RT_SUCCESS(rc))
    457457    {
    458458        UINT uCurFormat = 0; /* Must be set to zero for EnumClipboardFormats(). */
    459459        while ((uCurFormat = EnumClipboardFormats(uCurFormat)) != 0)
    460             fFormats |= SharedClipboardWinClipboardFormatToVBox(uCurFormat);
    461 
    462         int rc2 = SharedClipboardWinClose();
     460            fFormats |= ShClWinClipboardFormatToVBox(uCurFormat);
     461
     462        int rc2 = ShClWinClose();
    463463        AssertRC(rc2);
    464464        LogFlowFunc(("fFormats=%#x\n", fFormats));
     
    479479 * @param   puValue     Where to return extracted value of CF_HTML field.
    480480 */
    481 int SharedClipboardWinGetCFHTMLHeaderValue(const char *pszSrc, const char *pszOption, uint32_t *puValue)
     481int ShClWinGetCFHTMLHeaderValue(const char *pszSrc, const char *pszOption, uint32_t *puValue)
    482482{
    483483    AssertPtrReturn(pszSrc, VERR_INVALID_POINTER);
     
    503503 * @param   pszSource   Source string to check.
    504504 */
    505 bool SharedClipboardWinIsCFHTML(const char *pszSource)
     505bool ShClWinIsCFHTML(const char *pszSource)
    506506{
    507507    return    RTStrStr(pszSource, "Version:") != NULL
     
    520520 * @param   pcbOutput   Where to the return length of the result (bytes/chars).
    521521 */
    522 int SharedClipboardWinConvertCFHTMLToMIME(const char *pszSource, const uint32_t cch, char **ppszOutput, uint32_t *pcbOutput)
     522int ShClWinConvertCFHTMLToMIME(const char *pszSource, const uint32_t cch, char **ppszOutput, uint32_t *pcbOutput)
    523523{
    524524    Assert(pszSource);
     
    528528
    529529    uint32_t offStart;
    530     int rc = SharedClipboardWinGetCFHTMLHeaderValue(pszSource, "StartFragment:", &offStart);
     530    int rc = ShClWinGetCFHTMLHeaderValue(pszSource, "StartFragment:", &offStart);
    531531    if (RT_SUCCESS(rc))
    532532    {
    533533        uint32_t offEnd;
    534         rc = SharedClipboardWinGetCFHTMLHeaderValue(pszSource, "EndFragment:", &offEnd);
     534        rc = ShClWinGetCFHTMLHeaderValue(pszSource, "EndFragment:", &offEnd);
    535535        if (RT_SUCCESS(rc))
    536536        {
     
    612612 * @note    Everything inside of fragment can be UTF8. Windows allows it. Everything in header should be Latin1.
    613613 */
    614 int SharedClipboardWinConvertMIMEToCFHTML(const char *pszSource, size_t cb, char **ppszOutput, uint32_t *pcbOutput)
     614int ShClWinConvertMIMEToCFHTML(const char *pszSource, size_t cb, char **ppszOutput, uint32_t *pcbOutput)
    615615{
    616616    Assert(ppszOutput);
     
    709709 * @param   lParam              lParam to pass on.
    710710 */
    711 LRESULT SharedClipboardWinHandleWMChangeCBChain(PSHCLWINCTX pWinCtx,
     711LRESULT ShClWinHandleWMChangeCBChain(PSHCLWINCTX pWinCtx,
    712712                                              HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
    713713{
     
    716716    LogFlowFuncEnter();
    717717
    718     if (SharedClipboardWinIsNewAPI(&pWinCtx->newAPI))
     718    if (ShClWinIsNewAPI(&pWinCtx->newAPI))
    719719    {
    720720        lresultRc = DefWindowProc(hWnd, msg, wParam, lParam);
     
    757757 * @param   pWinCtx             Windows context to use.
    758758 */
    759 int SharedClipboardWinHandleWMDestroy(PSHCLWINCTX pWinCtx)
     759int ShClWinHandleWMDestroy(PSHCLWINCTX pWinCtx)
    760760{
    761761    LogFlowFuncEnter();
     
    764764
    765765    /* MS recommends to remove from Clipboard chain in this callback. */
    766     SharedClipboardWinChainRemove(pWinCtx);
     766    ShClWinChainRemove(pWinCtx);
    767767
    768768    if (pWinCtx->oldAPI.timerRefresh)
     
    783783 * @param   hWnd                Window handle to use.
    784784 */
    785 int SharedClipboardWinHandleWMRenderAllFormats(PSHCLWINCTX pWinCtx, HWND hWnd)
     785int ShClWinHandleWMRenderAllFormats(PSHCLWINCTX pWinCtx, HWND hWnd)
    786786{
    787787    RT_NOREF(pWinCtx);
     
    792792     * windows is to be destroyed and therefore the guest side becomes inactive.
    793793     */
    794     int rc = SharedClipboardWinOpen(hWnd);
     794    int rc = ShClWinOpen(hWnd);
    795795    if (RT_SUCCESS(rc))
    796796    {
    797         SharedClipboardWinClear();
    798         SharedClipboardWinClose();
     797        ShClWinClear();
     798        ShClWinClose();
    799799    }
    800800
     
    810810 * @param   pWinCtx             Windows context to use.
    811811 */
    812 int SharedClipboardWinHandleWMTimer(PSHCLWINCTX pWinCtx)
     812int ShClWinHandleWMTimer(PSHCLWINCTX pWinCtx)
    813813{
    814814    int rc = VINF_SUCCESS;
    815815
    816     if (!SharedClipboardWinIsNewAPI(&pWinCtx->newAPI)) /* Only run when using the "old" Windows API. */
     816    if (!ShClWinIsNewAPI(&pWinCtx->newAPI)) /* Only run when using the "old" Windows API. */
    817817    {
    818818        LogFlowFuncEnter();
     
    824824        if (!hViewer || pWinCtx->oldAPI.fCBChainPingInProcess)
    825825        {
    826             SharedClipboardWinChainRemove(pWinCtx);
    827             SharedClipboardWinChainAdd(pWinCtx);
     826            ShClWinChainRemove(pWinCtx);
     827            ShClWinChainAdd(pWinCtx);
    828828       }
    829829
     
    835835       if (hViewer)
    836836           SendMessageCallback(hViewer, WM_CHANGECBCHAIN, (WPARAM)pWinCtx->hWndNextInChain, (LPARAM)pWinCtx->hWndNextInChain,
    837                                SharedClipboardWinChainPingProc, (ULONG_PTR)pWinCtx);
     837                               ShClWinChainPingProc, (ULONG_PTR)pWinCtx);
    838838    }
    839839
     
    853853 * @param   fFormats            Clipboard format(s) to announce.
    854854 */
    855 static int sharedClipboardWinAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats)
     855static int shClWinAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats)
    856856{
    857857    LogFunc(("fFormats=0x%x\n", fFormats));
     
    960960 * @param   hWnd        The window handle to use as owner.
    961961 */
    962 int SharedClipboardWinClearAndAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats, HWND hWnd)
    963 {
    964     int rc = SharedClipboardWinOpen(hWnd);
     962int ShClWinClearAndAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats, HWND hWnd)
     963{
     964    int rc = ShClWinOpen(hWnd);
    965965    if (RT_SUCCESS(rc))
    966966    {
    967         SharedClipboardWinClear();
    968 
    969         rc = sharedClipboardWinAnnounceFormats(pWinCtx, fFormats);
     967        ShClWinClear();
     968
     969        rc = shClWinAnnounceFormats(pWinCtx, fFormats);
    970970        Assert(pWinCtx->hWndClipboardOwnerUs == hWnd || pWinCtx->hWndClipboardOwnerUs == NULL);
    971971
    972         SharedClipboardWinClose();
     972        ShClWinClose();
    973973    }
    974974    return rc;
     
    985985 * @note    ASSUMES that the clipboard has already been opened.
    986986 */
    987 int SharedClipboardWinDataWrite(UINT cfFormat, void *pvData, uint32_t cbData)
     987int ShClWinDataWrite(UINT cfFormat, void *pvData, uint32_t cbData)
    988988{
    989989    AssertPtrReturn(pvData, VERR_INVALID_POINTER);
     
    10531053 * @param   pCallbacks          Callbacks table to use.
    10541054 */
    1055 int SharedClipboardWinTransferCreateAndSetDataObject(PSHCLWINCTX pWinCtx,
    1056                                                      PSHCLCONTEXT pCtx, SharedClipboardWinDataObject::PCALLBACKS pCallbacks)
     1055int ShClWinTransferCreateAndSetDataObject(PSHCLWINCTX pWinCtx,
     1056                                                     PSHCLCONTEXT pCtx, ShClWinDataObject::PCALLBACKS pCallbacks)
    10571057{
    10581058    AssertPtrReturn(pWinCtx, VERR_INVALID_POINTER);
     
    10721072         * The data object will be deleted automatically once its refcount reaches 0.
    10731073         */
    1074         SharedClipboardWinDataObject *pObj = new SharedClipboardWinDataObject();
     1074        ShClWinDataObject *pObj = new ShClWinDataObject();
    10751075        if (pObj)
    10761076        {
     
    10871087        if (RT_SUCCESS(rc))
    10881088        {
    1089             SharedClipboardWinClose();
     1089            ShClWinClose();
    10901090            /* Note: Clipboard must be closed first before calling OleSetClipboard(). */
    10911091
    1092             /** @todo There is a potential race between SharedClipboardWinClose() and OleSetClipboard(),
     1092            /** @todo There is a potential race between ShClWinClose() and OleSetClipboard(),
    10931093             *        where another application could own the clipboard (open), and thus the call to
    10941094             *        OleSetClipboard() will fail. Needs (better) fixing. */
     
    11391139 * @param   pTransfer           Shared Clipboard transfer to create implementation-specific data for.
    11401140 */
    1141 int SharedClipboardWinTransferCreate(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
     1141int ShClWinTransferCreate(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
    11421142{
    11431143    RT_NOREF(pWinCtx);
     
    11461146                    && pTransfer->cbUser == 0, ("Already initialized Windows-specific data\n"), VERR_WRONG_ORDER);
    11471147
    1148     pTransfer->pvUser = new SharedClipboardWinTransferCtx();  /** @todo Can this throw? */
     1148    pTransfer->pvUser = new ShClWinTransferCtx();  /** @todo Can this throw? */
    11491149    AssertPtrReturn(pTransfer->pvUser, VERR_INVALID_POINTER);
    1150     pTransfer->cbUser = sizeof(SharedClipboardWinTransferCtx);
     1150    pTransfer->cbUser = sizeof(ShClWinTransferCtx);
    11511151
    11521152    return VINF_SUCCESS;
     
    11601160 * @param   pTransfer           Shared Clipboard transfer to destroy implementation-specific data for.
    11611161 */
    1162 void SharedClipboardWinTransferDestroy(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
     1162void ShClWinTransferDestroy(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
    11631163{
    11641164    RT_NOREF(pWinCtx);
     
    11711171    if (pTransfer->pvUser)
    11721172    {
    1173         Assert(pTransfer->cbUser == sizeof(SharedClipboardWinTransferCtx));
    1174         SharedClipboardWinTransferCtx *pWinURITransferCtx = (SharedClipboardWinTransferCtx *)pTransfer->pvUser;
     1173        Assert(pTransfer->cbUser == sizeof(ShClWinTransferCtx));
     1174        ShClWinTransferCtx *pWinURITransferCtx = (ShClWinTransferCtx *)pTransfer->pvUser;
    11751175        AssertPtr(pWinURITransferCtx);
    11761176
     
    11991199 * @param   pObj                Data object to initialize transfer for.
    12001200 */
    1201 static int sharedClipboardWinTransferInitializeInternal(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer,
    1202                                                         SharedClipboardWinDataObject *pObj)
     1201static int shClWinTransferInitializeInternal(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer,
     1202                                             ShClWinDataObject *pObj)
    12031203{
    12041204    RT_NOREF(pWinCtx);
     
    12151215 * @param   pTransfer           Transfer to initialize for the data object.
    12161216 */
    1217 int SharedClipboardWinTransferInitialize(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
     1217int ShClWinTransferInitialize(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
    12181218{
    12191219    int rc = RTCritSectEnter(&pWinCtx->CritSect);
    12201220    if (RT_SUCCESS(rc))
    12211221    {
    1222         SharedClipboardWinDataObject *pObj = pWinCtx->pDataObjInFlight;
     1222        ShClWinDataObject *pObj = pWinCtx->pDataObjInFlight;
    12231223        if (pObj)
    12241224        {
    1225             rc = sharedClipboardWinTransferInitializeInternal(pWinCtx, pTransfer, pObj);
     1225            rc = shClWinTransferInitializeInternal(pWinCtx, pTransfer, pObj);
    12261226        }
    12271227        else /* No current in-flight data object. */
     
    12421242 * @param   pObj                Data object to start transfer for.
    12431243 */
    1244 static int sharedClipboardWinTransferStartInternal(PSHCLWINCTX pWinCtx, SharedClipboardWinDataObject *pObj)
     1244static int shClWinTransferStartInternal(PSHCLWINCTX pWinCtx, ShClWinDataObject *pObj)
    12451245{
    12461246    RT_NOREF(pWinCtx);
    12471247
    1248     return pObj->SetStatus(SharedClipboardWinDataObject::Running);
     1248    return pObj->SetStatus(ShClWinDataObject::Running);
    12491249}
    12501250
     
    12591259 * @param   pTransfer           Transfer to initialize for the data object.
    12601260 */
    1261 int SharedClipboardWinTransferStart(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
     1261int ShClWinTransferStart(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
    12621262{
    12631263    RT_NOREF(pTransfer);
     
    12661266    if (RT_SUCCESS(rc))
    12671267    {
    1268         SharedClipboardWinDataObject *pObj = pWinCtx->pDataObjInFlight;
     1268        ShClWinDataObject *pObj = pWinCtx->pDataObjInFlight;
    12691269        if (pObj)
    12701270        {
    1271             rc = sharedClipboardWinTransferStartInternal(pWinCtx, pObj);
     1271            rc = shClWinTransferStartInternal(pWinCtx, pObj);
    12721272            if (RT_SUCCESS(rc))
    12731273                pWinCtx->pDataObjInFlight = NULL; /* Hand off to Windows on success. */
     
    12911291 * @param   pTransfer           Transfer to get roots for.
    12921292 */
    1293 int SharedClipboardWinTransferGetRootsFromClipboard(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
     1293int ShClWinTransferGetRootsFromClipboard(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
    12941294{
    12951295    AssertPtrReturn(pWinCtx,   VERR_INVALID_POINTER);
     
    12981298    Assert(ShClTransferGetSource(pTransfer) == SHCLSOURCE_LOCAL); /* Sanity. */
    12991299
    1300     int rc = SharedClipboardWinOpen(pWinCtx->hWnd);
     1300    int rc = ShClWinOpen(pWinCtx->hWnd);
    13011301    if (RT_SUCCESS(rc))
    13021302    {
     
    13111311                char    *pszList = NULL;
    13121312                uint32_t cbList;
    1313                 rc = SharedClipboardWinTransferDropFilesToStringList((DROPFILES *)hDrop, &pszList, &cbList);
     1313                rc = ShClWinTransferDropFilesToStringList((DROPFILES *)hDrop, &pszList, &cbList);
    13141314
    13151315                GlobalUnlock(hClip);
     
    13281328                    GetLastError()));
    13291329
    1330         SharedClipboardWinClose();
     1330        ShClWinClose();
    13311331    }
    13321332
     
    13461346 *                              Includes zero terminator.
    13471347 */
    1348 int SharedClipboardWinTransferDropFilesToStringList(DROPFILES *pDropFiles, char **ppszList, uint32_t *pcbList)
     1348int ShClWinTransferDropFilesToStringList(DROPFILES *pDropFiles, char **ppszList, uint32_t *pcbList)
    13491349{
    13501350    AssertPtrReturn(pDropFiles, VERR_INVALID_POINTER);
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp

    r103630 r103631  
    132132
    133133    if (   u32Format == VBOX_SHCL_FMT_HTML
    134         && SharedClipboardWinIsCFHTML((const char *)pvSrc))
     134        && ShClWinIsCFHTML((const char *)pvSrc))
    135135    {
    136136        /** @todo r=bird: Why the double conversion? */
    137137        char *pszBuf = NULL;
    138138        uint32_t cbBuf = 0;
    139         int rc = SharedClipboardWinConvertCFHTMLToMIME((const char *)pvSrc, cbSrc, &pszBuf, &cbBuf);
     139        int rc = ShClWinConvertCFHTMLToMIME((const char *)pvSrc, cbSrc, &pszBuf, &cbBuf);
    140140        if (RT_SUCCESS(rc))
    141141        {
     
    180180static int vboxClipboardSvcWinReadDataFromGuest(PSHCLCONTEXT pCtx, UINT uWinFormat, void **ppvData, uint32_t *pcbData)
    181181{
    182     SHCLFORMAT uVBoxFmt = SharedClipboardWinClipboardFormatToVBox(uWinFormat);
     182    SHCLFORMAT uVBoxFmt = ShClWinClipboardFormatToVBox(uWinFormat);
    183183    if (uVBoxFmt == VBOX_SHCL_FMT_NONE)
    184184    {
     
    282282        rc = ShClTransferSetProvider(pTransfer, &pClient->Transfers.Provider);
    283283        if (RT_SUCCESS(rc))
    284             rc = SharedClipboardWinTransferCreate(&pCtx->Win, pTransfer);
     284            rc = ShClWinTransferCreate(&pCtx->Win, pTransfer);
    285285    }
    286286
     
    312312        case SHCLTRANSFERDIR_FROM_REMOTE: /* G->H */
    313313        {
    314             rc = SharedClipboardWinTransferInitialize(&pCtx->Win, pTransfer);
     314            rc = ShClWinTransferInitialize(&pCtx->Win, pTransfer);
    315315            break;
    316316        }
     
    356356        case SHCLTRANSFERDIR_FROM_REMOTE: /* H->G */
    357357        {
    358             rc = SharedClipboardWinTransferStart(&pCtx->Win, pTransfer);
     358            rc = ShClWinTransferStart(&pCtx->Win, pTransfer);
    359359            break;
    360360        }
     
    385385    AssertPtr(pTransfer);
    386386
    387     SharedClipboardWinTransferDestroy(&pCtx->Win, pTransfer);
    388 }
    389 
    390 /**
    391  * @copydoc SharedClipboardWinDataObject::CALLBACKS::pfnTransferBegin
    392  *
    393  * Called by SharedClipboardWinDataObject::GetData() when the user wants to paste data.
     387    ShClWinTransferDestroy(&pCtx->Win, pTransfer);
     388}
     389
     390/**
     391 * @copydoc ShClWinDataObject::CALLBACKS::pfnTransferBegin
     392 *
     393 * Called by ShClWinDataObject::GetData() when the user wants to paste data.
    394394 * This then creates and initializes a new transfer on the host + lets the guest know about that new transfer.
    395395 *
    396396 * @thread  Service main thread.
    397397 */
    398 static DECLCALLBACK(int) shClSvcWinDataObjectTransferBeginCallback(SharedClipboardWinDataObject::PCALLBACKCTX pCbCtx)
     398static DECLCALLBACK(int) shClSvcWinDataObjectTransferBeginCallback(ShClWinDataObject::PCALLBACKCTX pCbCtx)
    399399{
    400400    LogFlowFuncEnter();
     
    466466        {
    467467            LogFunc(("WM_CHANGECBCHAIN\n"));
    468             lresultRc = SharedClipboardWinHandleWMChangeCBChain(pWinCtx, hWnd, uMsg, wParam, lParam);
     468            lresultRc = ShClWinHandleWMChangeCBChain(pWinCtx, hWnd, uMsg, wParam, lParam);
    469469            break;
    470470        }
     
    497497            }
    498498
    499             lresultRc = SharedClipboardWinChainPassToNext(pWinCtx, uMsg, wParam, lParam);
     499            lresultRc = ShClWinChainPassToNext(pWinCtx, uMsg, wParam, lParam);
    500500            break;
    501501        }
     
    503503        case WM_TIMER:
    504504        {
    505             int rc = SharedClipboardWinHandleWMTimer(pWinCtx);
     505            int rc = ShClWinHandleWMTimer(pWinCtx);
    506506            AssertRC(rc);
    507507
     
    513513            /* Insert the requested clipboard format data into the clipboard. */
    514514            const UINT       uFmtWin  = (UINT)wParam;
    515             const SHCLFORMAT uFmtVBox = SharedClipboardWinClipboardFormatToVBox(uFmtWin);
     515            const SHCLFORMAT uFmtVBox = ShClWinClipboardFormatToVBox(uFmtWin);
    516516
    517517            LogFunc(("WM_RENDERFORMAT: uFmtWin=%u -> uFmtVBox=0x%x\n", uFmtWin, uFmtVBox));
     
    527527                /* Unsupported clipboard format is requested. */
    528528                LogFunc(("WM_RENDERFORMAT unsupported format requested or client is not active\n"));
    529                 SharedClipboardWinClear();
     529                ShClWinClear();
    530530            }
    531531            else
     
    538538                    /* Wrap HTML clipboard content info CF_HTML format if needed. */
    539539                    if (uFmtVBox == VBOX_SHCL_FMT_HTML
    540                         && !SharedClipboardWinIsCFHTML((char *)pvData))
     540                        && !ShClWinIsCFHTML((char *)pvData))
    541541                    {
    542542                        char *pszWrapped = NULL;
    543543                        uint32_t cbWrapped = 0;
    544                         rc = SharedClipboardWinConvertMIMEToCFHTML((char *)pvData, cbData, &pszWrapped, &cbWrapped);
     544                        rc = ShClWinConvertMIMEToCFHTML((char *)pvData, cbData, &pszWrapped, &cbWrapped);
    545545                        if (RT_SUCCESS(rc))
    546546                        {
     
    554554                    }
    555555
    556                     rc = SharedClipboardWinDataWrite(uFmtWin, pvData, cbData);
     556                    rc = ShClWinDataWrite(uFmtWin, pvData, cbData);
    557557                    if (RT_FAILURE(rc))
    558558                        LogRel(("Shared Clipboard: Setting clipboard data for Windows host failed with %Rrc\n", rc));
     
    563563
    564564                if (RT_FAILURE(rc))
    565                     SharedClipboardWinClear();
     565                    ShClWinClear();
    566566            }
    567567
     
    573573            LogFunc(("WM_RENDERALLFORMATS\n"));
    574574
    575             int rc = SharedClipboardWinHandleWMRenderAllFormats(pWinCtx, hWnd);
     575            int rc = ShClWinHandleWMRenderAllFormats(pWinCtx, hWnd);
    576576            AssertRC(rc);
    577577
     
    585585            LogFunc(("SHCL_WIN_WM_REPORT_FORMATS: fFormats=%#xn", fFormats));
    586586
    587             int rc = SharedClipboardWinClearAndAnnounceFormats(pWinCtx, fFormats, hWnd);
     587            int rc = ShClWinClearAndAnnounceFormats(pWinCtx, fFormats, hWnd);
    588588#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    589589            if (   RT_SUCCESS(rc)
     
    594594                 * That way Windows will recognize that there is a data transfer available.
    595595                 */
    596                 SharedClipboardWinDataObject::CALLBACKS Callbacks;
     596                ShClWinDataObject::CALLBACKS Callbacks;
    597597                RT_ZERO(Callbacks);
    598598                Callbacks.pfnTransferBegin = shClSvcWinDataObjectTransferBeginCallback;
    599599
    600                 rc = SharedClipboardWinTransferCreateAndSetDataObject(pWinCtx, pCtx, &Callbacks);
     600                rc = ShClWinTransferCreateAndSetDataObject(pWinCtx, pCtx, &Callbacks);
    601601            }
    602602#else
     
    611611            LogFunc(("WM_DESTROY\n"));
    612612
    613             int rc = SharedClipboardWinHandleWMDestroy(pWinCtx);
     613            int rc = ShClWinHandleWMDestroy(pWinCtx);
    614614            AssertRC(rc);
    615615
     
    718718                         SWP_NOACTIVATE | SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOREDRAW | SWP_NOSIZE);
    719719
    720             rc = SharedClipboardWinChainAdd(&pCtx->Win);
     720            rc = ShClWinChainAdd(&pCtx->Win);
    721721            if (RT_SUCCESS(rc))
    722722            {
    723                 if (!SharedClipboardWinIsNewAPI(&pWinCtx->newAPI))
     723                if (!ShClWinIsNewAPI(&pWinCtx->newAPI))
    724724                    pWinCtx->oldAPI.timerRefresh = SetTimer(pWinCtx->hWnd, 0, 10 * 1000, NULL);
    725725            }
     
    801801    {
    802802        SHCLFORMATS fFormats = 0;
    803         rc = SharedClipboardWinGetFormats(&pCtx->Win, &fFormats);
     803        rc = ShClWinGetFormats(&pCtx->Win, &fFormats);
    804804        if (RT_SUCCESS(rc))
    805805            rc = ShClSvcReportFormats(pCtx->pClient, fFormats);
     
    854854    if (pCtx)
    855855    {
    856         rc = SharedClipboardWinCtxInit(&pCtx->Win);
     856        rc = ShClWinCtxInit(&pCtx->Win);
    857857        if (RT_SUCCESS(rc))
    858858        {
     
    928928        }
    929929
    930         SharedClipboardWinCtxDestroy(&pCtx->Win);
     930        ShClWinCtxDestroy(&pCtx->Win);
    931931
    932932        if (RT_SUCCESS(rc))
     
    984984     * The guest wants to read data in the given format.
    985985     */
    986     int rc = SharedClipboardWinOpen(pWinCtx->hWnd);
     986    int rc = ShClWinOpen(pWinCtx->hWnd);
    987987    if (RT_SUCCESS(rc))
    988988    {
     
    10661066                    char    *pszList = NULL;
    10671067                    uint32_t cbList;
    1068                     rc = SharedClipboardWinTransferDropFilesToStringList((DROPFILES *)hDrop, &pszList, &cbList);
     1068                    rc = ShClWinTransferDropFilesToStringList((DROPFILES *)hDrop, &pszList, &cbList);
    10691069
    10701070                    GlobalUnlock(hClip);
     
    10891089        }
    10901090#endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
    1091         SharedClipboardWinClose();
     1091        ShClWinClose();
    10921092    }
    10931093
     
    11391139    PSHCLWINCTX pWin = &pClient->State.pCtx->Win;
    11401140
    1141     int rc = SharedClipboardWinTransferGetRootsFromClipboard(pWin, pCtx->pTransfer);
     1141    int rc = ShClWinTransferGetRootsFromClipboard(pWin, pCtx->pTransfer);
    11421142
    11431143    LogFlowFuncLeaveRC(rc);
  • trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardMockHGCM.cpp

    r99968 r103631  
    605605    ShClBackendSetCallbacks(pBackend, &ShClCallbacks);
    606606#elif defined (RT_OS_WINDOWS)
    607     rc = SharedClipboardWinOpen(GetDesktopWindow());
     607    rc = ShClWinOpen(GetDesktopWindow());
    608608    if (RT_SUCCESS(rc))
    609609    {
    610         rc = SharedClipboardWinDataWrite(CF_UNICODETEXT, pTask->pvData, (uint32_t)pTask->cbData);
    611         SharedClipboardWinClose();
     610        rc = ShClWinDataWrite(CF_UNICODETEXT, pTask->pvData, (uint32_t)pTask->cbData);
     611        ShClWinClose();
    612612    }
    613613#endif /* defined (RT_OS_LINUX) || defined (RT_OS_SOLARIS) */
  • trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceImpl.cpp

    r98103 r103631  
    106106    uint32_t cbOutput  = UINT32_MAX/2;
    107107    RTTestIDisableAssertions();
    108     RTTESTI_CHECK_RC(SharedClipboardWinConvertCFHTMLToMIME("", 0, &pszOutput, &cbOutput), VERR_INVALID_PARAMETER);
     108    RTTESTI_CHECK_RC(ShClWinConvertCFHTMLToMIME("", 0, &pszOutput, &cbOutput), VERR_INVALID_PARAMETER);
    109109    RTTestIRestoreAssertions();
    110110
    111111    pszOutput = NULL;
    112112    cbOutput  = UINT32_MAX/2;
    113     RTTESTI_CHECK_RC(SharedClipboardWinConvertCFHTMLToMIME((char *)&g_abVBoxOrgCfHtml1[0], g_cbVBoxOrgCfHtml1,
     113    RTTESTI_CHECK_RC(ShClWinConvertCFHTMLToMIME((char *)&g_abVBoxOrgCfHtml1[0], g_cbVBoxOrgCfHtml1,
    114114                                                           &pszOutput, &cbOutput), VINF_SUCCESS);
    115115    RTTESTI_CHECK(cbOutput == g_cbVBoxOrgMimeHtml1);
     
    141141        char    *pszCfHtml = NULL;
    142142        uint32_t cbCfHtml  = UINT32_MAX/2;
    143         rc = SharedClipboardWinConvertMIMEToCFHTML(s_aRoundTrips[i].psz, s_aRoundTrips[i].cch + 1, &pszCfHtml, &cbCfHtml);
     143        rc = ShClWinConvertMIMEToCFHTML(s_aRoundTrips[i].psz, s_aRoundTrips[i].cch + 1, &pszCfHtml, &cbCfHtml);
    144144        if (rc == VINF_SUCCESS)
    145145        {
    146146            if (strlen(pszCfHtml) + 1 != cbCfHtml)
    147                 RTTestIFailed("#%u: SharedClipboardWinConvertMIMEToCFHTML(%s, %#zx,,) returned incorrect length: %#x, actual %#zx",
     147                RTTestIFailed("#%u: ShClWinConvertMIMEToCFHTML(%s, %#zx,,) returned incorrect length: %#x, actual %#zx",
    148148                              i, s_aRoundTrips[i].psz, s_aRoundTrips[i].cch, cbCfHtml, strlen(pszCfHtml) + 1);
    149149
    150150            char     *pszHtml = NULL;
    151151            uint32_t  cbHtml  = UINT32_MAX/4;
    152             rc = SharedClipboardWinConvertCFHTMLToMIME(pszCfHtml, (uint32_t)strlen(pszCfHtml), &pszHtml, &cbHtml);
     152            rc = ShClWinConvertCFHTMLToMIME(pszCfHtml, (uint32_t)strlen(pszCfHtml), &pszHtml, &cbHtml);
    153153            if (rc == VINF_SUCCESS)
    154154            {
    155155                if (strlen(pszHtml) + 1 != cbHtml)
    156                     RTTestIFailed("#%u: SharedClipboardWinConvertCFHTMLToMIME(%s, %#zx,,) returned incorrect length: %#x, actual %#zx",
     156                    RTTestIFailed("#%u: ShClWinConvertCFHTMLToMIME(%s, %#zx,,) returned incorrect length: %#x, actual %#zx",
    157157                                  i, pszHtml, strlen(pszHtml), cbHtml, strlen(pszHtml) + 1);
    158158                if (strcmp(pszHtml, s_aRoundTrips[i].psz) != 0)
     
    162162            }
    163163            else
    164                 RTTestIFailed("#%u: SharedClipboardWinConvertCFHTMLToMIME(%s, %#zx,,) returned %Rrc, expected VINF_SUCCESS",
     164                RTTestIFailed("#%u: ShClWinConvertCFHTMLToMIME(%s, %#zx,,) returned %Rrc, expected VINF_SUCCESS",
    165165                              i, pszCfHtml, strlen(pszCfHtml), rc);
    166166            RTMemFree(pszCfHtml);
    167167        }
    168168        else
    169             RTTestIFailed("#%u: SharedClipboardWinConvertMIMEToCFHTML(%s, %#zx,,) returned %Rrc, expected VINF_SUCCESS",
     169            RTTestIFailed("#%u: ShClWinConvertMIMEToCFHTML(%s, %#zx,,) returned %Rrc, expected VINF_SUCCESS",
    170170                          i, s_aRoundTrips[i].psz, s_aRoundTrips[i].cch, rc);
    171171    }
Note: See TracChangeset for help on using the changeset viewer.

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