VirtualBox

Ignore:
Timestamp:
Oct 17, 2024 7:44:43 AM (4 months ago)
Author:
vboxsync
Message:

Additions/VBoxTray: Implemented ability for easier user-controllable logging (also via verbose levels), support for running in foreground mode (with a console window attached to) and selective starting of sub services to easier pinpoint errors in release builds. Cleaned up initialization / termination code a little. See command line help for new options. bugref:10763

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp

    r106061 r106411  
    5959{
    6060    /** Pointer to the service environment. */
    61     const VBOXSERVICEENV      *pEnv;
     61    const VBOXTRAYSVCENV      *pEnv;
    6262    /** Handle for the local IPC server. */
    6363    RTLOCALIPCSERVER           hServer;
     
    170170     * Showing the balloon tooltip is not critical.
    171171     */
    172     int rc2 = hlpShowBalloonTip(g_hInstance, g_hwndToolWindow, ID_TRAYICON,
     172    VBoxTrayHlpShowBalloonTipEx(g_hInstance, g_hwndToolWindow, ID_TRAYICON,
    173173                                pszMsg, pszTitle, Payload.s.cMsTimeout, Payload.s.uType);
    174     LogFlowFunc(("Showing \"%s\" - \"%s\" (type %RU32, %RU32ms), rc=%Rrc\n",
    175                  pszTitle, pszMsg, Payload.s.cMsTimeout, Payload.s.uType, rc2));
    176     RT_NOREF_PV(rc2);
    177174
    178175    return VINF_SUCCESS;
     
    207204
    208205/**
    209  * Initializes the IPC communication.
    210  *
    211  * @return  IPRT status code.
    212  * @param   pEnv                        The IPC service's environment.
    213  * @param   ppInstance                  The instance pointer which refers to this object.
    214  */
    215 DECLCALLBACK(int) VBoxIPCInit(const PVBOXSERVICEENV pEnv, void **ppInstance)
     206 * @interface_method_impl{VBOXSERVICEDESC,pfnPreInit}
     207 */
     208static DECLCALLBACK(int) vbtrIPCPreInit(void)
     209{
     210    return VINF_SUCCESS;
     211}
     212
     213
     214/**
     215 * @interface_method_impl{VBOXSERVICEDESC,pfnOption}
     216 */
     217static DECLCALLBACK(int) vbtrIPCOption(const char **ppszShort, int argc, char **argv, int *pi)
     218{
     219    RT_NOREF(ppszShort, argc, argv, pi);
     220
     221    return -1;
     222}
     223
     224/**
     225 * @interface_method_impl{VBOXSERVICEDESC,pfnInit}
     226 */
     227DECLCALLBACK(int) vbtrIPCInit(const PVBOXTRAYSVCENV pEnv, void **ppInstance)
    216228{
    217229    AssertPtrReturn(pEnv, VERR_INVALID_POINTER);
     
    260272}
    261273
     274/**
     275 * @interface_method_impl{VBOXSERVICEDESC,pfnStop}
     276 */
    262277DECLCALLBACK(void) VBoxIPCStop(void *pInstance)
    263278{
     
    298313}
    299314
    300 DECLCALLBACK(void) VBoxIPCDestroy(void *pInstance)
     315/**
     316 * @interface_method_impl{VBOXSERVICEDESC,pfnDestroy}
     317 */
     318DECLCALLBACK(void) vbtrIPCDestroy(void *pInstance)
    301319{
    302320    AssertPtrReturnVoid(pInstance);
     
    552570 * requests
    553571 */
    554 DECLCALLBACK(int) VBoxIPCWorker(void *pInstance, bool volatile *pfShutdown)
     572DECLCALLBACK(int) vbtrIPCWorker(void *pInstance, bool volatile *pfShutdown)
    555573{
    556574    AssertPtr(pInstance);
     
    606624 * The service description.
    607625 */
    608 VBOXSERVICEDESC g_SvcDescIPC =
     626VBOXTRAYSVCDESC g_SvcDescIPC =
    609627{
    610628    /* pszName. */
     
    612630    /* pszDescription. */
    613631    "Inter-Process Communication",
     632    /* pszUsage. */
     633    NULL,
     634    /* pszOptions. */
     635    NULL,
    614636    /* methods */
    615     VBoxIPCInit,
    616     VBoxIPCWorker,
     637    vbtrIPCPreInit,
     638    vbtrIPCOption,
     639    vbtrIPCInit,
     640    vbtrIPCWorker,
    617641    NULL /* pfnStop */,
    618     VBoxIPCDestroy
     642    vbtrIPCDestroy
    619643};
    620644
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