VirtualBox

Ignore:
Timestamp:
Nov 15, 2010 5:45:50 PM (14 years ago)
Author:
vboxsync
Message:

Main: Pass more IVirtualBox pointers to the extension pack. VRDE registration hook, VirtualBoxReady hook.

File:
1 edited

Legend:

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

    r34073 r34086  
    2929#include <VBox/types.h>
    3030
    31 #if defined(__cplusplus)
    32 class IConsole;
    33 class IMachine;
     31/** @def VBOXEXTPACK_IF_CS
     32 * Selects 'class' on 'struct' for interface references.
     33 * @param I         The interface name
     34 */
     35#if defined(__cplusplus) && !defined(RT_OS_WINDOWS)
     36# define VBOXEXTPACK_IF_CS(I)   class I
    3437#else
    35 typedef struct IConsole IConsole;
    36 typedef struct IMachine IMachine;
     38# define VBOXEXTPACK_IF_CS(I)   struct I
    3739#endif
     40
     41VBOXEXTPACK_IF_CS(IConsole);
     42VBOXEXTPACK_IF_CS(IMachine);
     43VBOXEXTPACK_IF_CS(IVirtualBox);
    3844
    3945
     
    9298    DECLR3CALLBACKMEMBER(int, pfnGetFilePath,(PCVBOXEXTPACKHLP pHlp, const char *pszFilename, char *pszPath, size_t cbPath));
    9399
     100    /**
     101     * Registers a VRDE library (IVirtualBox::VRDERegisterLibrary wrapper).
     102     *
     103     * @returns VBox status code.
     104     * @param   pHlp            Pointer to this helper structure.
     105     * @param   pszName         The module base name.  This will be found using
     106     *                          the pfnFindModule algorithm.
     107     * @param   fSetDefault     Whether to make it default if no other default
     108     *                          is set.
     109     *
     110     * @remarks This helper should be called from pfnVirtualBoxReady as it may
     111     *          cause trouble when called from pfnInstalled.
     112     */
     113    DECLR3CALLBACKMEMBER(int, pfnRegisterVrde,(PCVBOXEXTPACKHLP pHlp, const char *pszName, bool fSetDefault));
    94114
    95115    /** End of structure marker (VBOXEXTPACKHLP_VERSION). */
     
    119139     *
    120140     * @param   pThis       Pointer to this structure.
    121      */
    122     DECLCALLBACKMEMBER(void, pfnInstalled)(PCVBOXEXTPACKREG pThis);
     141     * @param   pVirtualBox The VirtualBox interface.
     142     */
     143    DECLCALLBACKMEMBER(void, pfnInstalled)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);
    123144
    124145    /**
     
    129150     * @returns VBox status code.
    130151     * @param   pThis       Pointer to this structure.
    131      */
    132     DECLCALLBACKMEMBER(int, pfnUninstall)(PCVBOXEXTPACKREG pThis);
     152     * @param   pVirtualBox The VirtualBox interface.
     153     */
     154    DECLCALLBACKMEMBER(int, pfnUninstall)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);
     155
     156    /**
     157     * Hook for doing work after the VirtualBox object is ready.
     158     *
     159     * This is called in the context of the per-user service (VBoxSVC).  There
     160     * will not be any similar call from the VM process.
     161     *
     162     * @param   pThis       Pointer to this structure.
     163     * @param   pVirtualBox The VirtualBox interface.
     164     */
     165    DECLCALLBACKMEMBER(void, pfnVirtualBoxReady)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);
    133166
    134167    /**
     
    153186     * @returns VBox status code.
    154187     * @param   pThis       Pointer to this structure.
     188     * @param   pVirtualBox The VirtualBox interface.
    155189     * @param   pMachine    The machine interface.
    156190     */
    157     DECLCALLBACKMEMBER(int, pfnVMCreated)(PCVBOXEXTPACKREG pThis, IMachine *pMachine);
     191    DECLCALLBACKMEMBER(int, pfnVMCreated)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox,
     192                                          VBOXEXTPACK_IF_CS(IMachine) *pMachine);
    158193
    159194    /**
     
    167202     * @param   pVM         The VM handle.
    168203     */
    169     DECLCALLBACKMEMBER(int, pfnVMConfigureVMM)(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM);
     204    DECLCALLBACKMEMBER(int, pfnVMConfigureVMM)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM);
    170205
    171206    /**
     
    179214     * @param   pVM         The VM handle.
    180215     */
    181     DECLCALLBACKMEMBER(int, pfnVMPowerOn)(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM);
     216    DECLCALLBACKMEMBER(int, pfnVMPowerOn)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM);
    182217
    183218    /**
     
    190225     * @param   pVM         The VM handle.  Can be NULL.
    191226     */
    192     DECLCALLBACKMEMBER(void, pfnVMPowerOff)(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM);
     227    DECLCALLBACKMEMBER(void, pfnVMPowerOff)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM);
    193228
    194229    /**
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