VirtualBox

Changeset 86058 in vbox for trunk/src


Ignore:
Timestamp:
Sep 7, 2020 11:33:30 PM (4 years ago)
Author:
vboxsync
Message:

Main/ExtPack: belatedly bump VBOXEXTPACKHLP_VERSION for the event
creation callback. While here, as a fore/after-thought add another,
so far not used, callback for creation of IVetoEvent.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ExtPackManagerImpl.h

    r86057 r86058  
    178178                                                   /* VBoxEventType_T */ uint32_t aType, bool aWaitable,
    179179                                                   VBOXEXTPACK_IF_CS(IEvent) **ppEventOut);
     180    static DECLCALLBACK(uint32_t) i_hlpCreateVetoEvent(PCVBOXEXTPACKHLP pHlp,
     181                                                       VBOXEXTPACK_IF_CS(IEventSource) *aSource,
     182                                                       /* VBoxEventType_T */ uint32_t aType,
     183                                                       VBOXEXTPACK_IF_CS(IVetoEvent) **ppEventOut);
    180184    static DECLCALLBACK(int)    i_hlpReservedN(PCVBOXEXTPACKHLP pHlp);
    181185    /** @}  */
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r86057 r86058  
    757757        /* pfnCompleteProgress  = */ ExtPack::i_hlpCompleteProgress,
    758758        /* pfnCreateEvent       = */ ExtPack::i_hlpCreateEvent,
     759        /* pfnCreateVetoEvent   = */ ExtPack::i_hlpCreateVetoEvent,
    759760        /* pfnReserved1         = */ ExtPack::i_hlpReservedN,
    760761        /* pfnReserved2         = */ ExtPack::i_hlpReservedN,
     
    19431944    /* default aSource to pVirtualBox? */
    19441945    hrc = pEvent->init(aSource, static_cast<VBoxEventType_T>(aType), aWaitable);
     1946    if (FAILED(hrc))
     1947        return hrc;
     1948
     1949    return pEvent.queryInterfaceTo(ppEventOut);
     1950}
     1951
     1952
     1953/*static*/ DECLCALLBACK(uint32_t)
     1954ExtPack::i_hlpCreateVetoEvent(PCVBOXEXTPACKHLP pHlp,
     1955                              VBOXEXTPACK_IF_CS(IEventSource) *aSource,
     1956                              /* VBoxEventType_T */ uint32_t aType,
     1957                              VBOXEXTPACK_IF_CS(IVetoEvent) **ppEventOut)
     1958{
     1959    HRESULT hrc;
     1960
     1961    AssertPtrReturn(pHlp, (uint32_t)E_INVALIDARG);
     1962    AssertReturn(pHlp->u32Version == VBOXEXTPACKHLP_VERSION, (uint32_t)E_INVALIDARG);
     1963    AssertPtrReturn(ppEventOut, (uint32_t)E_INVALIDARG);
     1964
     1965    ComObjPtr<VBoxVetoEvent> pEvent;
     1966
     1967    hrc = pEvent.createObject();
     1968    if (FAILED(hrc))
     1969        return hrc;
     1970
     1971    /* default aSource to pVirtualBox? */
     1972    hrc = pEvent->init(aSource, static_cast<VBoxEventType_T>(aType));
    19451973    if (FAILED(hrc))
    19461974        return hrc;
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