VirtualBox

Changeset 82871 in vbox for trunk/src/VBox/GuestHost


Ignore:
Timestamp:
Jan 27, 2020 12:33:01 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135848
Message:

Shared Clipboard/common: Resolved more todos.

File:
1 edited

Legend:

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

    r82534 r82871  
    8989}
    9090
    91 #if 0 /* currently not used */
    92 /**
    93  * Creates (initializes) an event.
    94  *
    95  * @returns VBox status code.
    96  * @param   pEvent              Event to initialize.
    97  * @param   idEvent             Event ID to use.
    98  */
    99 static int shClEventInit(PSHCLEVENT pEvent, SHCLEVENTID idEvent)
    100 {
    101     AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
    102 
    103     LogFlowFunc(("Event %RU32\n", idEvent));
    104 
    105     int rc = RTSemEventMultiCreate(&pEvent->hEvtMulSem);
    106     if (RT_SUCCESS(rc))
    107     {
    108         pEvent->idEvent  = idEvent;
    109         pEvent->pPayload = NULL;
    110     }
    111 
    112     return rc;
    113 }
    114 #endif
    115 
    11691/**
    11792 * Destroys an event, but doesn't free the memory.
     
    216191
    217192    return NULL;
    218 }
    219 
    220 /**
    221  * Generates a new event ID for a specific event source.
    222  *
    223  * @returns New event ID generated, or 0 on error.
    224  * @param   pSource             Event source to generate event for.
    225  * @deprecated as this does not deal with duplicates.
    226  */
    227 SHCLEVENTID ShClEventIDGenerate(PSHCLEVENTSOURCE pSource)
    228 {
    229     AssertPtrReturn(pSource, 0);
    230 
    231     SHCLEVENTID idEvent = ++pSource->idNextEvent;
    232     if (idEvent >= VBOX_SHCL_MAX_EVENTS)
    233         pSource->idNextEvent = idEvent = 1;  /* zero == error, remember! */
    234 
    235     LogFlowFunc(("uSource=%RU16: New event: %RU32\n", pSource->uID, idEvent));
    236     return idEvent;
    237193}
    238194
     
    268224        if (shclEventGet(pSource, idEvent) == NULL)
    269225        {
    270 
    271226            pEvent->idEvent = idEvent;
    272227            RTListAppend(&pSource->lstEvents, &pEvent->Node);
     
    278233        AssertBreak(cTries < 4096);
    279234    }
     235
     236    AssertMsgFailed(("Unable to register a new event ID for event source %RU16\n", pSource->uID));
    280237
    281238    RTMemFree(pEvent);
     
    313270    pEvent->pPayload = NULL;
    314271}
    315 
    316 #if 0 /** @todo fix later */
    317 /**
    318  * Registers an event.
    319  *
    320  * @returns VBox status code.
    321  * @param   pSource             Event source to register event for.
    322  * @param   uID                 Event ID to register.
    323  */
    324 int ShClEventRegister(PSHCLEVENTSOURCE pSource, SHCLEVENTID uID)
    325 {
    326     AssertPtrReturn(pSource, VERR_INVALID_POINTER);
    327 
    328     int rc;
    329 
    330     LogFlowFunc(("uSource=%RU16, uEvent=%RU32\n", pSource->uID, uID));
    331 
    332     if (shclEventGet(pSource, uID) == NULL)
    333     {
    334         PSHCLEVENT pEvent = (PSHCLEVENT)RTMemAllocZ(sizeof(SHCLEVENT));
    335         if (pEvent)
    336         {
    337             rc = shClEventInit(pEvent, uID);
    338             if (RT_SUCCESS(rc))
    339             {
    340                 RTListAppend(&pSource->lstEvents, &pEvent->Node);
    341 
    342                 LogFlowFunc(("Event %RU32\n", uID));
    343             }
    344         }
    345         else
    346             rc = VERR_NO_MEMORY;
    347     }
    348     else
    349         rc = VERR_ALREADY_EXISTS;
    350 
    351 #ifdef DEBUG_andy
    352     AssertRC(rc);
    353 #endif
    354 
    355     LogFlowFuncLeaveRC(rc);
    356     return rc;
    357 }
    358 #endif /* later */
    359272
    360273/**
Note: See TracChangeset for help on using the changeset viewer.

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