VirtualBox

Changeset 63289 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 10, 2016 3:24:06 PM (8 years ago)
Author:
vboxsync
Message:

VBoxAutostart: Warnings

Location:
trunk/src/VBox/Frontends/VBoxAutostart
Files:
4 edited

Legend:

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

    r62679 r63289  
    8989
    9090    BOOL fCompleted = FALSE;
    91     ULONG ulCurrentPercent = 0;
    92     ULONG ulLastPercent = 0;
    93 
    94     ULONG ulLastOperationPercent = (ULONG)-1;
    95 
    96     ULONG ulLastOperation = (ULONG)-1;
     91    ULONG uCurrentPercent = 0;
    9792    Bstr bstrOperationDescription;
    9893
     
    114109    while (SUCCEEDED(hrc))
    115110    {
    116         progress->COMGETTER(Percent(&ulCurrentPercent));
     111        progress->COMGETTER(Percent(&uCurrentPercent));
    117112
    118113        if (fCompleted)
     
    183178                            apsz,                    /* lpStrings */
    184179                            NULL);                   /* lpRawData */
    185     AssertMsg(fRc, ("%d\n", GetLastError()));
     180    AssertMsg(fRc, ("%u\n", GetLastError())); NOREF(fRc);
    186181    DeregisterEventSource(hEventLog);
    187182}
     
    233228 */
    234229static SC_HANDLE autostartSvcWinOpenService(const char *pszAction, DWORD dwSCMAccess, DWORD dwSVCAccess,
    235                                       unsigned cIgnoredErrors, ...)
     230                                            unsigned cIgnoredErrors, ...)
    236231{
    237232    SC_HANDLE hSCM = autostartSvcWinOpenSCManager(pszAction, dwSCMAccess);
     
    252247        va_start(va, cIgnoredErrors);
    253248        while (!fIgnored && cIgnoredErrors-- > 0)
    254             fIgnored = va_arg(va, long) == err;
     249            fIgnored = (DWORD)va_arg(va, int) == err;
    255250        va_end(va);
    256251        if (!fIgnored)
     
    278273static RTEXITCODE autostartSvcWinInterrogate(int argc, char **argv)
    279274{
     275    RT_NOREF(argc, argv);
    280276    RTPrintf("VBoxAutostartSvc: The \"interrogate\" action is not implemented.\n");
    281277    return RTEXITCODE_FAILURE;
     
    285281static RTEXITCODE autostartSvcWinStop(int argc, char **argv)
    286282{
     283    RT_NOREF(argc, argv);
    287284    RTPrintf("VBoxAutostartSvc: The \"stop\" action is not implemented.\n");
    288285    return RTEXITCODE_FAILURE;
     
    292289static RTEXITCODE autostartSvcWinContinue(int argc, char **argv)
    293290{
     291    RT_NOREF(argc, argv);
    294292    RTPrintf("VBoxAutostartSvc: The \"continue\" action is not implemented.\n");
    295293    return RTEXITCODE_FAILURE;
     
    299297static RTEXITCODE autostartSvcWinPause(int argc, char **argv)
    300298{
     299    RT_NOREF(argc, argv);
    301300    RTPrintf("VBoxAutostartSvc: The \"pause\" action is not implemented.\n");
    302301    return RTEXITCODE_FAILURE;
     
    306305static RTEXITCODE autostartSvcWinStart(int argc, char **argv)
    307306{
     307    RT_NOREF(argc, argv);
    308308    RTPrintf("VBoxAutostartSvc: The \"start\" action is not implemented.\n");
    309309    return RTEXITCODE_SUCCESS;
     
    313313static RTEXITCODE autostartSvcWinQueryDescription(int argc, char **argv)
    314314{
     315    RT_NOREF(argc, argv);
    315316    RTPrintf("VBoxAutostartSvc: The \"qdescription\" action is not implemented.\n");
    316317    return RTEXITCODE_FAILURE;
     
    320321static RTEXITCODE autostartSvcWinQueryConfig(int argc, char **argv)
    321322{
     323    RT_NOREF(argc, argv);
    322324    RTPrintf("VBoxAutostartSvc: The \"qconfig\" action is not implemented.\n");
    323325    return RTEXITCODE_FAILURE;
     
    327329static RTEXITCODE autostartSvcWinDisable(int argc, char **argv)
    328330{
     331    RT_NOREF(argc, argv);
    329332    RTPrintf("VBoxAutostartSvc: The \"disable\" action is not implemented.\n");
    330333    return RTEXITCODE_FAILURE;
     
    333336static RTEXITCODE autostartSvcWinEnable(int argc, char **argv)
    334337{
     338    RT_NOREF(argc, argv);
    335339    RTPrintf("VBoxAutostartSvc: The \"enable\" action is not implemented.\n");
    336340    return RTEXITCODE_FAILURE;
     
    623627    NOREF(pvEventData);
    624628    NOREF(pvContext);
    625     return NO_ERROR;
    626 }
    627 
    628 static int autostartWorker(RTTHREAD ThreadSelf, void *pvUser)
    629 {
    630                         int rc = autostartSetup();
    631 
    632                         /** @todo: Implement config options. */
    633                         rc = autostartStartMain(NULL);
    634                         if (RT_FAILURE(rc))
    635                             autostartSvcLogError("Starting VMs failed, rc=%Rrc", rc);
     629    /* not reached */
     630}
     631
     632static DECLCALLBACK(int) autostartWorkerThread(RTTHREAD hThreadSelf, void *pvUser)
     633{
     634    RT_NOREF(hThreadSelf, pvUser);
     635    int rc = autostartSetup();
     636
     637    /** @todo: Implement config options. */
     638    rc = autostartStartMain(NULL);
     639    if (RT_FAILURE(rc))
     640        autostartSvcLogError("Starting VMs failed, rc=%Rrc", rc);
    636641
    637642    return rc;
     
    649654static VOID WINAPI autostartSvcWinServiceMain(DWORD cArgs, LPTSTR *papszArgs)
    650655{
     656    RT_NOREF(papszArgs);
    651657    LogFlowFuncEnter();
    652658
     
    677683                        LogFlow(("autostartSvcWinServiceMain: calling RTSemEventMultiWait\n"));
    678684                        RTTHREAD hWorker;
    679                         RTThreadCreate(&hWorker, autostartWorker, NULL, 0, RTTHREADTYPE_DEFAULT, 0, "WorkerThread");
     685                        RTThreadCreate(&hWorker, autostartWorkerThread, NULL, 0, RTTHREADTYPE_DEFAULT, 0, "WorkerThread");
    680686
    681687                        LogFlow(("autostartSvcWinServiceMain: woke up\n"));
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartCfg.cpp

    r62493 r63289  
    7272    unsigned        iLine;
    7373    /** Starting character of the token in the stream. */
    74     unsigned        cchStart;
     74    size_t          cchStart;
    7575    /** Type dependen token data. */
    7676    union
     
    107107    unsigned   iLine;
    108108    /** Current character of the line. */
    109     unsigned   cchCurr;
     109    size_t     cchCurr;
    110110    /** Flag whether the end of the config stream is reached. */
    111111    bool       fEof;
     
    410410            return "<Invalid>";
    411411    }
    412 
    413     AssertFailed();
    414     return NULL;
     412    /* not reached */
    415413}
    416414
     
    452450            return 0;
    453451    }
    454 
    455     AssertFailed();
    456     return 0;
     452    /* not reached */
    457453}
    458454
     
    596592                                            PCFGAST *ppCfgAst)
    597593{
    598     int rc = VINF_SUCCESS;
    599594    unsigned cAstNodesMax = 10;
    600     unsigned idxAstNodeCur = 0;
    601     PCFGAST pCfgAst = NULL;
    602 
    603     pCfgAst = (PCFGAST)RTMemAllocZ(RT_OFFSETOF(CFGAST, u.Compound.apAstNodes[cAstNodesMax]));
     595    PCFGAST pCfgAst = (PCFGAST)RTMemAllocZ(RT_OFFSETOF(CFGAST, u.Compound.apAstNodes[cAstNodesMax]));
    604596    if (!pCfgAst)
    605597        return VERR_NO_MEMORY;
     
    614606    }
    615607
     608    int rc = VINF_SUCCESS;
    616609    do
    617610    {
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStop.cpp

    r62493 r63289  
    107107DECLHIDDEN(RTEXITCODE) autostartStopMain(PCFGAST pCfgAst)
    108108{
     109    RT_NOREF(pCfgAst);
    109110    RTEXITCODE rcExit = RTEXITCODE_SUCCESS;
    110     int vrc = VINF_SUCCESS;
    111111    std::list<AUTOSTOPVM> listVM;
    112112
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartUtils.cpp

    r62493 r63289  
    218218}
    219219
    220 DECLHIDDEN(RTEXITCODE) autostartSvcDisplayGetOptError(const char *pszAction, int rc, int argc, char **argv, int iArg, PCRTGETOPTUNION pValue)
    221 {
     220DECLHIDDEN(RTEXITCODE) autostartSvcDisplayGetOptError(const char *pszAction, int rc, int argc, char **argv, int iArg,
     221                                                      PCRTGETOPTUNION pValue)
     222{
     223    RT_NOREF(pValue);
    222224    autostartSvcDisplayError("%s - RTGetOpt failure, %Rrc (%d): %s\n",
    223225                       pszAction, rc, rc, iArg < argc ? argv[iArg] : "<null>");
     
    227229DECLHIDDEN(RTEXITCODE) autostartSvcDisplayTooManyArgsError(const char *pszAction, int argc, char **argv, int iArg)
    228230{
     231    RT_NOREF(argc);
    229232    Assert(iArg < argc);
    230233    autostartSvcDisplayError("%s - Too many arguments: %s\n", pszAction, argv[iArg]);
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