VirtualBox

Changeset 89320 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 27, 2021 1:59:25 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144667
Message:

VBoxAutostart: bugref:9341: Since we ignore service arguments anyway,
don't even bother to check their number, and don't crash trying to
complain about there being too much.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp

    r89319 r89320  
    907907    LogFlowFuncEnter();
    908908
     909#if 0
     910    for (size_t i = 0; i < cArgs; ++i)
     911        LogRel(("arg[%zu] = %ls\n", i, papwszArgs[i]));
     912#endif
     913
    909914    /*
    910915     * Register the control handler function for the service and report to SCM.
     
    917922        if (autostartSvcWinSetServiceStatus(SERVICE_START_PENDING, 3000, NO_ERROR))
    918923        {
    919             if (cArgs == 1)
     924            /*
     925             * Create the event semaphore we'll be waiting on and
     926             * then instantiate the actual services.
     927             */
     928            int rc = RTSemEventMultiCreate(&g_hSupSvcWinEvent);
     929            if (RT_SUCCESS(rc))
    920930            {
    921931                /*
    922                  * Create the event semaphore we'll be waiting on and
    923                  * then instantiate the actual services.
     932                 * Update the status and enter the work loop.
    924933                 */
    925                 int rc = RTSemEventMultiCreate(&g_hSupSvcWinEvent);
    926                 if (RT_SUCCESS(rc))
     934                if (autostartSvcWinSetServiceStatus(SERVICE_RUNNING, 0, 0))
    927935                {
    928                     /*
    929                      * Update the status and enter the work loop.
    930                      */
    931                     if (autostartSvcWinSetServiceStatus(SERVICE_RUNNING, 0, 0))
     936                    LogFlow(("autostartSvcWinServiceMain: calling autostartStartVMs\n"));
     937                    RTEXITCODE ec = autostartStartVMs();
     938                    if (ec == RTEXITCODE_SUCCESS)
    932939                    {
    933                         LogFlow(("autostartSvcWinServiceMain: calling autostartStartVMs\n"));
    934                         RTEXITCODE ec = autostartStartVMs();
    935                         if (ec == RTEXITCODE_SUCCESS)
     940                        LogFlow(("autostartSvcWinServiceMain: done string VMs\n"));
     941                        err = NO_ERROR;
     942                        rc = RTSemEventMultiWait(g_hSupSvcWinEvent, RT_INDEFINITE_WAIT);
     943                        if (RT_SUCCESS(rc))
    936944                        {
    937                             LogFlow(("autostartSvcWinServiceMain: done string VMs\n"));
     945                            LogFlow(("autostartSvcWinServiceMain: woke up\n"));
     946                            /** @todo Autostop part. */
    938947                            err = NO_ERROR;
    939                             rc = RTSemEventMultiWait(g_hSupSvcWinEvent, RT_INDEFINITE_WAIT);
    940                             if (RT_SUCCESS(rc))
    941                             {
    942                                 LogFlow(("autostartSvcWinServiceMain: woke up\n"));
    943                                 /** @todo Autostop part. */
    944                                 err = NO_ERROR;
    945                             }
    946                             else
    947                                 autostartSvcLogError("RTSemEventWait failed, rc=%Rrc", rc);
    948948                        }
    949 
    950                         autostartShutdown();
     949                        else
     950                            autostartSvcLogError("RTSemEventWait failed, rc=%Rrc", rc);
    951951                    }
    952                     else
    953                     {
    954                         err = GetLastError();
    955                         autostartSvcLogError("SetServiceStatus failed, err=%u", err);
    956                     }
    957 
    958                     RTSemEventMultiDestroy(g_hSupSvcWinEvent);
    959                     g_hSupSvcWinEvent = NIL_RTSEMEVENTMULTI;
     952
     953                    autostartShutdown();
    960954                }
    961955                else
    962                     autostartSvcLogError("RTSemEventMultiCreate failed, rc=%Rrc", rc);
     956                {
     957                    err = GetLastError();
     958                    autostartSvcLogError("SetServiceStatus failed, err=%u", err);
     959                }
     960
     961                RTSemEventMultiDestroy(g_hSupSvcWinEvent);
     962                g_hSupSvcWinEvent = NIL_RTSEMEVENTMULTI;
    963963            }
    964964            else
    965                 autostartSvcLogTooManyArgsError("main", cArgs, NULL, 0);
     965                autostartSvcLogError("RTSemEventMultiCreate failed, rc=%Rrc", rc);
    966966        }
    967967        else
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