VirtualBox

Changeset 79503 in vbox


Ignore:
Timestamp:
Jul 3, 2019 2:05:53 PM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/URI: Mac build fix.

Location:
trunk/src/VBox/HostServices/SharedClipboard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h

    r79501 r79503  
    7676/**
    7777 * Structure for keeping generic client state data within the Shared Clipboard host service.
    78  * This structure needs to be serializable by SSM.
     78 * This structure needs to be serializable by SSM (must be a POD type).
    7979 */
    8080typedef struct VBOXCLIPBOARDCLIENTSTATE
     
    125125    uint32_t u32AvailableFormats;
    126126    uint32_t u32RequestedFormat;
    127 
     127} VBOXCLIPBOARDCLIENTSTATE, *PVBOXCLIPBOARDCLIENTSTATE;
     128
     129/**
     130 * Structure for keeping a HGCM client state within the Shared Clipboard host service.
     131 */
     132typedef struct _VBOXCLIPBOARDCLIENTDATA
     133{
     134    /** General client state data. */
     135    VBOXCLIPBOARDCLIENTSTATE          State;
    128136    /** The client's message queue (FIFO). */
    129137    RTCList<VBOXCLIPBOARDCLIENTMSG *> queueMsg;
    130 } VBOXCLIPBOARDCLIENTSTATE, *PVBOXCLIPBOARDCLIENTSTATE;
    131 
    132 /**
    133  * Structure for keeping a HGCM client state within the Shared Clipboard host service.
    134  */
    135 typedef struct _VBOXCLIPBOARDCLIENTDATA
    136 {
    137     /** General client state data. */
    138     VBOXCLIPBOARDCLIENTSTATE       State;
    139138#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
    140139    /** URI context data. */
    141     SHAREDCLIPBOARDURICTX          URI;
     140    SHAREDCLIPBOARDURICTX             URI;
    142141#endif
    143142} VBOXCLIPBOARDCLIENTDATA, *PVBOXCLIPBOARDCLIENTDATA;
     
    191190int vboxSvcClipboardClientDeferredSetMsgInfo(PVBOXCLIPBOARDCLIENT pClient, uint32_t uMsg, uint32_t cParms);
    192191
    193 void vboxSvcClipboardMsgQueueReset(PVBOXCLIPBOARDCLIENTSTATE pState);
     192void vboxSvcClipboardMsgQueueReset(PVBOXCLIPBOARDCLIENTDATA pClientData);
    194193PVBOXCLIPBOARDCLIENTMSG vboxSvcClipboardMsgAlloc(uint32_t uMsg, uint32_t cParms);
    195194void vboxSvcClipboardMsgFree(PVBOXCLIPBOARDCLIENTMSG pMsg);
    196 int vboxSvcClipboardMsgAdd(PVBOXCLIPBOARDCLIENTSTATE pState, PVBOXCLIPBOARDCLIENTMSG pMsg, bool fAppend);
    197 int vboxSvcClipboardMsgGetNextInfo(PVBOXCLIPBOARDCLIENTSTATE pState, uint32_t *puType, uint32_t *pcParms);
    198 int vboxSvcClipboardMsgGetNext(PVBOXCLIPBOARDCLIENTSTATE pState,
     195int vboxSvcClipboardMsgAdd(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDCLIENTMSG pMsg, bool fAppend);
     196int vboxSvcClipboardMsgGetNextInfo(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t *puType, uint32_t *pcParms);
     197int vboxSvcClipboardMsgGetNext(PVBOXCLIPBOARDCLIENTDATA pClientData,
    199198                               uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    200199
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r79502 r79503  
    159159*   Prototypes                                                                                                                   *
    160160*********************************************************************************************************************************/
    161 static int vboxSvcClipboardClientStateInit(PVBOXCLIPBOARDCLIENTSTATE pState, uint32_t uClientID);
    162 static int vboxSvcClipboardClientStateDestroy(PVBOXCLIPBOARDCLIENTSTATE pState);
    163 static void vboxSvcClipboardClientStateReset(PVBOXCLIPBOARDCLIENTSTATE pState);
     161static int vboxSvcClipboardClientStateInit(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t uClientID);
     162static int vboxSvcClipboardClientStateDestroy(PVBOXCLIPBOARDCLIENTDATA pClientData);
     163static void vboxSvcClipboardClientStateReset(PVBOXCLIPBOARDCLIENTDATA pClientData);
    164164
    165165
     
    265265 * Resets a client's state message queue.
    266266 *
    267  * @param   pState              Pointer to the client's state structure to reset message queue for.
    268  */
    269 void vboxSvcClipboardMsgQueueReset(PVBOXCLIPBOARDCLIENTSTATE pState)
     267 * @param   pClientData         Pointer to the client data structure to reset message queue for.
     268 */
     269void vboxSvcClipboardMsgQueueReset(PVBOXCLIPBOARDCLIENTDATA pClientData)
    270270{
    271271    LogFlowFuncEnter();
    272272
    273     while (!pState->queueMsg.isEmpty())
    274     {
    275         RTMemFree(pState->queueMsg.last());
    276         pState->queueMsg.removeLast();
     273    while (!pClientData->queueMsg.isEmpty())
     274    {
     275        RTMemFree(pClientData->queueMsg.last());
     276        pClientData->queueMsg.removeLast();
    277277    }
    278278}
     
    326326 *
    327327 * @returns IPRT status code.
    328  * @param   pState              Pointer to the client's state structure to add new message to.
     328 * @param   pClientData         Pointer to the client data structure to add new message to.
    329329 * @param   pMsg                Pointer to message to add. The queue then owns the pointer.
    330330 * @param   fAppend             Whether to append or prepend the message to the queue.
    331331 */
    332 int vboxSvcClipboardMsgAdd(PVBOXCLIPBOARDCLIENTSTATE pState, PVBOXCLIPBOARDCLIENTMSG pMsg, bool fAppend)
     332int vboxSvcClipboardMsgAdd(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDCLIENTMSG pMsg, bool fAppend)
    333333{
    334334    AssertPtrReturn(pMsg, VERR_INVALID_POINTER);
     
    337337
    338338    if (fAppend)
    339         pState->queueMsg.append(pMsg);
     339        pClientData->queueMsg.append(pMsg);
    340340    else
    341         pState->queueMsg.prepend(pMsg);
     341        pClientData->queueMsg.prepend(pMsg);
    342342
    343343    /** @todo Catch / handle OOM? */
     
    350350 *
    351351 * @returns IPRT status code. VERR_NO_DATA if no next message is available.
    352  * @param   pState              Pointer to the client's state structure to get message info for.
     352 * @param   pClientDAta         Pointer to the client data structure to get message info for.
    353353 * @param   puType              Where to store the message type.
    354354 * @param   pcParms             Where to store the message parameter count.
    355355 */
    356 int vboxSvcClipboardMsgGetNextInfo(PVBOXCLIPBOARDCLIENTSTATE pState, uint32_t *puType, uint32_t *pcParms)
     356int vboxSvcClipboardMsgGetNextInfo(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t *puType, uint32_t *pcParms)
    357357{
    358358    AssertPtrReturn(puType, VERR_INVALID_POINTER);
     
    361361    int rc;
    362362
    363     if (pState->queueMsg.isEmpty())
     363    if (pClientData->queueMsg.isEmpty())
    364364    {
    365365        rc = VERR_NO_DATA;
     
    367367    else
    368368    {
    369         PVBOXCLIPBOARDCLIENTMSG pMsg = pState->queueMsg.first();
     369        PVBOXCLIPBOARDCLIENTMSG pMsg = pClientData->queueMsg.first();
    370370        AssertPtr(pMsg);
    371371
     
    385385 *
    386386 * @returns IPRT status code.
    387  * @param   pState              Pointer to the client's state structure to get message for.
     387 * @param   pClientData         Pointer to the client data structure to get message for.
    388388 * @param   uMsg                Message type to retrieve.
    389389 * @param   cParms              Number of parameters the \@a paParms array can store.
    390390 * @param   paParms             Where to store the message parameters.
    391391 */
    392 int vboxSvcClipboardMsgGetNext(PVBOXCLIPBOARDCLIENTSTATE pState,
     392int vboxSvcClipboardMsgGetNext(PVBOXCLIPBOARDCLIENTDATA pClientData,
    393393                               uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    394394{
     
    396396
    397397    /* Check for pending messages in our queue. */
    398     if (pState->queueMsg.isEmpty())
     398    if (pClientData->queueMsg.isEmpty())
    399399        return VERR_NO_DATA;
    400400
    401401    /* Get the current message. */
    402     PVBOXCLIPBOARDCLIENTMSG pMsg = pState->queueMsg.first();
     402    PVBOXCLIPBOARDCLIENTMSG pMsg = pClientData->queueMsg.first();
    403403    AssertPtr(pMsg);
    404404
     
    422422
    423423        /** @todo Only remove on success? */
    424         pState->queueMsg.removeFirst(); /* Remove the current message from the queue. */
     424        pClientData->queueMsg.removeFirst(); /* Remove the current message from the queue. */
    425425    }
    426426    else
    427427    {
    428         vboxSvcClipboardMsgQueueReset(pState);
     428        vboxSvcClipboardMsgQueueReset(pClientData);
    429429        /** @todo Cleanup, send notification to guest. */
    430430    }
     
    706706    VBoxClipboardSvcImplDisconnect(pClientData);
    707707
    708     vboxSvcClipboardClientStateReset(&pClientData->State);
    709     vboxSvcClipboardClientStateDestroy(&pClientData->State);
     708    vboxSvcClipboardClientStateReset(pClientData);
     709    vboxSvcClipboardClientStateDestroy(pClientData);
    710710
    711711    RTMemFree(itClient->second);
     
    738738
    739739            /* Reset the client state. */
    740             vboxSvcClipboardClientStateReset(&pClient->pData->State);
     740            vboxSvcClipboardClientStateReset(pClient->pData);
    741741
    742742            /* (Re-)initialize the client state. */
    743             vboxSvcClipboardClientStateInit(&pClient->pData->State, u32ClientID);
     743            vboxSvcClipboardClientStateInit(pClient->pData, u32ClientID);
    744744
    745745            rc = VBoxClipboardSvcImplConnect(pClient->pData, VBoxSvcClipboardGetHeadless());
     
    13461346 *
    13471347 * @returns VBox status code.
    1348  * @param   pState              Client state to initialize.
     1348 * @param   pClientData         Client state to initialize.
    13491349 * @param   uClientID           Client ID (HGCM) to use for this client state.
    13501350 */
    1351 static int vboxSvcClipboardClientStateInit(PVBOXCLIPBOARDCLIENTSTATE pState, uint32_t uClientID)
     1351static int vboxSvcClipboardClientStateInit(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t uClientID)
    13521352{
    13531353    LogFlowFuncEnter();
     
    13551355    /* Register the client.
    13561356     * Note: Do *not* memset the struct, as it contains classes (for caching). */
    1357     pState->u32ClientID = uClientID;
     1357    pClientData->State.u32ClientID = uClientID;
    13581358
    13591359    return VINF_SUCCESS;
     
    13641364 *
    13651365 * @returns VBox status code.
    1366  * @param   pState              Client state to destroy.
    1367  */
    1368 static int vboxSvcClipboardClientStateDestroy(PVBOXCLIPBOARDCLIENTSTATE pState)
     1366 * @param   pClientData         Client state to destroy.
     1367 */
     1368static int vboxSvcClipboardClientStateDestroy(PVBOXCLIPBOARDCLIENTDATA pClientData)
    13691369{
    13701370    LogFlowFuncEnter();
    13711371
    1372     vboxSvcClipboardMsgQueueReset(pState);
     1372    vboxSvcClipboardMsgQueueReset(pClientData);
    13731373
    13741374    return VINF_SUCCESS;
     
    13781378 * Resets a Shared Clipboard service's client state.
    13791379 *
    1380  * @param   pState              Client state to reset.
    1381  */
    1382 static void vboxSvcClipboardClientStateReset(PVBOXCLIPBOARDCLIENTSTATE pState)
     1380 * @param   pClientData         Client state to reset.
     1381 */
     1382static void vboxSvcClipboardClientStateReset(PVBOXCLIPBOARDCLIENTDATA pClientData)
    13831383{
    13841384    LogFlowFuncEnter();
    13851385
    13861386    /** @todo Clear async / asynRead / ... data? */
    1387     vboxSvcClipboardMsgQueueReset(pState);
    1388 
    1389     pState->u32ClientID                  = 0;
    1390     pState->fAsync                       = false;
    1391     pState->fReadPending                 = false;
    1392 
    1393     pState->fHostMsgQuit                 = false;
    1394     pState->fHostMsgReadData             = false;
    1395     pState->fHostMsgFormats              = false;
     1387    vboxSvcClipboardMsgQueueReset(pClientData);
     1388
     1389    pClientData->State.u32ClientID                  = 0;
     1390    pClientData->State.fAsync                       = false;
     1391    pClientData->State.fReadPending                 = false;
     1392
     1393    pClientData->State.fHostMsgQuit                 = false;
     1394    pClientData->State.fHostMsgReadData             = false;
     1395    pClientData->State.fHostMsgFormats              = false;
    13961396#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
    1397     pState->URI.fTransferStart = false;
    1398     pState->URI.enmTransferDir = SHAREDCLIPBOARDURITRANSFERDIR_UNKNOWN;
     1397    pClientData->State.URI.fTransferStart = false;
     1398    pClientData->State.URI.enmTransferDir = SHAREDCLIPBOARDURITRANSFERDIR_UNKNOWN;
    13991399#endif
    14001400
    1401     pState->u32AvailableFormats = 0;
    1402     pState->u32RequestedFormat = 0;
     1401    pClientData->State.u32AvailableFormats = 0;
     1402    pClientData->State.u32RequestedFormat = 0;
    14031403}
    14041404
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