VirtualBox

Ignore:
Timestamp:
Jan 10, 2024 5:43:29 PM (12 months ago)
Author:
vboxsync
Message:

Shared Clipboard/X11: Made pcbRead in ShClX11ReadDataFromX11() optional, fixed releasing the created event. bugref:9437

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp

    r102824 r102825  
    26642664
    26652665/**
    2666  * Reads the X11 clipboard.
     2666 * Reads from the X11 clipboard.
    26672667 *
    26682668 * @returns VBox status code.
     
    26752675 * @param   pvBuf               Where to store the received data on success.
    26762676 * @param   cbBuf               Size (in bytes) of \a pvBuf. Also marks maximum data to read (in bytes).
    2677  * @param   pcbRead             Where to return the read bytes on success.
     2677 * @param   pcbRead             Where to return the read bytes on success. Optional.
    26782678 */
    26792679int ShClX11ReadDataFromX11(PSHCLX11CTX pCtx, PSHCLEVENTSOURCE pEventSource, RTMSINTERVAL msTimeout,
     
    26842684    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
    26852685    AssertReturn(cbBuf, VERR_INVALID_PARAMETER);
    2686     AssertPtrReturn(pcbRead, VERR_INVALID_POINTER);
     2686    /* pcbRead is optional. */
    26872687
    26882688    PSHCLEVENT pEvent;
     
    27062706
    27072707                    memcpy(pvBuf, pResp->Read.pvData, RT_MIN(cbBuf, pResp->Read.cbData));
    2708                     *pcbRead = pResp->Read.cbData;
     2708                    if (pcbRead)
     2709                        *pcbRead = pResp->Read.cbData;
    27092710
    27102711                    RTMemFree(pResp->Read.pvData);
     
    27162717                {
    27172718                    rc = VERR_NO_DATA;
    2718                     *pcbRead = 0;
     2719                    if (pcbRead)
     2720                        *pcbRead = 0;
    27192721                }
    27202722            }
     
    27222724                rc = rcEvent;
    27232725        }
     2726
     2727        ShClEventRelease(pEvent);
    27242728    }
    27252729
     
    28052809    return rc;
    28062810}
    2807 
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