VirtualBox

Changeset 34287 in vbox for trunk/include/VBox/ExtPack


Ignore:
Timestamp:
Nov 23, 2010 3:20:03 PM (14 years ago)
Author:
vboxsync
Message:

ExtPack: Don't hold any locks when calling extension pack hooks (except for pfnUnload and pfnUninstall).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/ExtPack/ExtPack.h

    r34244 r34287  
    6262} VBOXEXTPACKMODKIND;
    6363
     64/**
     65 * Contexts returned by VBOXEXTPACKHLP::pfnGetContext.
     66 */
     67typedef enum VBOXEXTPACKCTX
     68{
     69    /** Zero is invalid as alwasy. */
     70    VBOXEXTPACKCTX_INVALID = 0,
     71    /** The per-user daemon process (VBoxSVC). */
     72    VBOXEXTPACKCTX_PER_USER_DAEMON,
     73    /** A VM process.
     74     * @remarks This will also include the client processes in v4.0.  */
     75    VBOXEXTPACKCTX_VM_PROCESS,
     76    /** A API client process.
     77     * @remarks This will not be returned by VirtualBox 4.0. */
     78    VBOXEXTPACKCTX_CLIENT_PROCESS,
     79    /** End of the valid values (exclusive). */
     80    VBOXEXTPACKCTX_END,
     81    /** The usual 32-bit type hack. */
     82    VBOXEXTPACKCTX_32BIT_HACK = 0x7fffffff
     83} VBOXEXTPACKCTX;
     84
    6485
    6586/** Pointer to const helpers passed to the VBoxExtPackRegister() call. */
     
    119140    DECLR3CALLBACKMEMBER(int, pfnGetFilePath,(PCVBOXEXTPACKHLP pHlp, const char *pszFilename, char *pszPath, size_t cbPath));
    120141
     142    /**
     143     * Gets the context the extension pack is operating in.
     144     *
     145     * @returns The context.
     146     * @retval  VBOXEXTPACKCTX_INVALID if @a pHlp is invalid.
     147     *
     148     * @param   pHlp            Pointer to this helper structure.
     149     */
     150    DECLR3CALLBACKMEMBER(VBOXEXTPACKCTX, pfnGetContext,(PCVBOXEXTPACKHLP pHlp));
     151
     152    DECLR3CALLBACKMEMBER(int, pfnReserved1,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     153    DECLR3CALLBACKMEMBER(int, pfnReserved2,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     154    DECLR3CALLBACKMEMBER(int, pfnReserved3,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     155    DECLR3CALLBACKMEMBER(int, pfnReserved4,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     156    DECLR3CALLBACKMEMBER(int, pfnReserved5,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     157    DECLR3CALLBACKMEMBER(int, pfnReserved6,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     158    DECLR3CALLBACKMEMBER(int, pfnReserved7,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     159    DECLR3CALLBACKMEMBER(int, pfnReserved8,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     160    DECLR3CALLBACKMEMBER(int, pfnReserved9,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */
     161
    121162    /** End of structure marker (VBOXEXTPACKHLP_VERSION). */
    122163    uint32_t                    u32EndMarker;
    123164} VBOXEXTPACKHLP;
    124165/** Current version of the VBOXEXTPACKHLP structure.  */
    125 #define VBOXEXTPACKHLP_VERSION          RT_MAKE_U32(1, 0)
     166#define VBOXEXTPACKHLP_VERSION          RT_MAKE_U32(0, 1)
    126167
    127168
     
    157198     * @param   pThis       Pointer to this structure.
    158199     * @param   pVirtualBox The VirtualBox interface.
     200     * @todo    This is currently called holding locks making pVirtualBox
     201     *          relatively unusable.
    159202     */
    160203    DECLCALLBACKMEMBER(int, pfnUninstall)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);
     
    163206     * Hook for doing work after the VirtualBox object is ready.
    164207     *
    165      * This is called in the context of the per-user service (VBoxSVC).  There
    166      * will not be any similar call from the VM process.
     208     * This is called in the context of the per-user service (VBoxSVC).  The
     209     * pfnConsoleReady method is the equivalent for the VM/client process.
    167210     *
    168211     * @param   pThis       Pointer to this structure.
     
    170213     */
    171214    DECLCALLBACKMEMBER(void, pfnVirtualBoxReady)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);
     215
     216    /**
     217     * Hook for doing work after the Console object is ready.
     218     *
     219     * This is called in the context of the VM/client process.  The
     220     * pfnVirtualBoxReady method is the equivalent for the per-user service
     221     * (VBoxSVC).
     222     *
     223     * @param   pThis       Pointer to this structure.
     224     * @param   pConsole    The Console interface.
     225     */
     226    DECLCALLBACKMEMBER(void, pfnConsoleReady)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole);
    172227
    173228    /**
     
    248303} VBOXEXTPACKREG;
    249304/** Current version of the VBOXEXTPACKREG structure.  */
    250 #define VBOXEXTPACKREG_VERSION        RT_MAKE_U32(1, 0)
     305#define VBOXEXTPACKREG_VERSION        RT_MAKE_U32(0, 1)
    251306
    252307
     
    275330
    276331
     332/**
     333 * Checks if extension pack interface version is compatible.
     334 *
     335 * @returns true if the do, false if they don't.
     336 * @param   u32Provider     The provider version.
     337 * @param   u32User         The user version.
     338 */
     339#define VBOXEXTPACK_IS_VER_COMPAT(u32Provider, u32User) \
     340    (    VBOXEXTPACK_IS_MAJOR_VER_EQUAL(u32Provider, u32User) \
     341      && RT_LOWORD(u32Provider) >= RT_LOWORD(u32User) )
     342
     343/**
     344 * Check if two extension pack interface versions has the same major version.
     345 *
     346 * @returns true if the do, false if they don't.
     347 * @param   u32Ver1         The first version number.
     348 * @param   u32Ver2         The second version number.
     349 */
     350#define VBOXEXTPACK_IS_MAJOR_VER_EQUAL(u32Ver1, u32Ver2)  (RT_HIWORD(u32Ver1) == RT_HIWORD(u32Ver2))
     351
    277352#endif
    278353
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