Changeset 63289 in vbox for trunk/src/VBox
- Timestamp:
- Aug 10, 2016 3:24:06 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxAutostart
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp
r62679 r63289 89 89 90 90 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; 97 92 Bstr bstrOperationDescription; 98 93 … … 114 109 while (SUCCEEDED(hrc)) 115 110 { 116 progress->COMGETTER(Percent(&u lCurrentPercent));111 progress->COMGETTER(Percent(&uCurrentPercent)); 117 112 118 113 if (fCompleted) … … 183 178 apsz, /* lpStrings */ 184 179 NULL); /* lpRawData */ 185 AssertMsg(fRc, ("% d\n", GetLastError()));180 AssertMsg(fRc, ("%u\n", GetLastError())); NOREF(fRc); 186 181 DeregisterEventSource(hEventLog); 187 182 } … … 233 228 */ 234 229 static SC_HANDLE autostartSvcWinOpenService(const char *pszAction, DWORD dwSCMAccess, DWORD dwSVCAccess, 235 unsigned cIgnoredErrors, ...)230 unsigned cIgnoredErrors, ...) 236 231 { 237 232 SC_HANDLE hSCM = autostartSvcWinOpenSCManager(pszAction, dwSCMAccess); … … 252 247 va_start(va, cIgnoredErrors); 253 248 while (!fIgnored && cIgnoredErrors-- > 0) 254 fIgnored = va_arg(va, long) == err;249 fIgnored = (DWORD)va_arg(va, int) == err; 255 250 va_end(va); 256 251 if (!fIgnored) … … 278 273 static RTEXITCODE autostartSvcWinInterrogate(int argc, char **argv) 279 274 { 275 RT_NOREF(argc, argv); 280 276 RTPrintf("VBoxAutostartSvc: The \"interrogate\" action is not implemented.\n"); 281 277 return RTEXITCODE_FAILURE; … … 285 281 static RTEXITCODE autostartSvcWinStop(int argc, char **argv) 286 282 { 283 RT_NOREF(argc, argv); 287 284 RTPrintf("VBoxAutostartSvc: The \"stop\" action is not implemented.\n"); 288 285 return RTEXITCODE_FAILURE; … … 292 289 static RTEXITCODE autostartSvcWinContinue(int argc, char **argv) 293 290 { 291 RT_NOREF(argc, argv); 294 292 RTPrintf("VBoxAutostartSvc: The \"continue\" action is not implemented.\n"); 295 293 return RTEXITCODE_FAILURE; … … 299 297 static RTEXITCODE autostartSvcWinPause(int argc, char **argv) 300 298 { 299 RT_NOREF(argc, argv); 301 300 RTPrintf("VBoxAutostartSvc: The \"pause\" action is not implemented.\n"); 302 301 return RTEXITCODE_FAILURE; … … 306 305 static RTEXITCODE autostartSvcWinStart(int argc, char **argv) 307 306 { 307 RT_NOREF(argc, argv); 308 308 RTPrintf("VBoxAutostartSvc: The \"start\" action is not implemented.\n"); 309 309 return RTEXITCODE_SUCCESS; … … 313 313 static RTEXITCODE autostartSvcWinQueryDescription(int argc, char **argv) 314 314 { 315 RT_NOREF(argc, argv); 315 316 RTPrintf("VBoxAutostartSvc: The \"qdescription\" action is not implemented.\n"); 316 317 return RTEXITCODE_FAILURE; … … 320 321 static RTEXITCODE autostartSvcWinQueryConfig(int argc, char **argv) 321 322 { 323 RT_NOREF(argc, argv); 322 324 RTPrintf("VBoxAutostartSvc: The \"qconfig\" action is not implemented.\n"); 323 325 return RTEXITCODE_FAILURE; … … 327 329 static RTEXITCODE autostartSvcWinDisable(int argc, char **argv) 328 330 { 331 RT_NOREF(argc, argv); 329 332 RTPrintf("VBoxAutostartSvc: The \"disable\" action is not implemented.\n"); 330 333 return RTEXITCODE_FAILURE; … … 333 336 static RTEXITCODE autostartSvcWinEnable(int argc, char **argv) 334 337 { 338 RT_NOREF(argc, argv); 335 339 RTPrintf("VBoxAutostartSvc: The \"enable\" action is not implemented.\n"); 336 340 return RTEXITCODE_FAILURE; … … 623 627 NOREF(pvEventData); 624 628 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 632 static 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); 636 641 637 642 return rc; … … 649 654 static VOID WINAPI autostartSvcWinServiceMain(DWORD cArgs, LPTSTR *papszArgs) 650 655 { 656 RT_NOREF(papszArgs); 651 657 LogFlowFuncEnter(); 652 658 … … 677 683 LogFlow(("autostartSvcWinServiceMain: calling RTSemEventMultiWait\n")); 678 684 RTTHREAD hWorker; 679 RTThreadCreate(&hWorker, autostartWorker , NULL, 0, RTTHREADTYPE_DEFAULT, 0, "WorkerThread");685 RTThreadCreate(&hWorker, autostartWorkerThread, NULL, 0, RTTHREADTYPE_DEFAULT, 0, "WorkerThread"); 680 686 681 687 LogFlow(("autostartSvcWinServiceMain: woke up\n")); -
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartCfg.cpp
r62493 r63289 72 72 unsigned iLine; 73 73 /** Starting character of the token in the stream. */ 74 unsignedcchStart;74 size_t cchStart; 75 75 /** Type dependen token data. */ 76 76 union … … 107 107 unsigned iLine; 108 108 /** Current character of the line. */ 109 unsignedcchCurr;109 size_t cchCurr; 110 110 /** Flag whether the end of the config stream is reached. */ 111 111 bool fEof; … … 410 410 return "<Invalid>"; 411 411 } 412 413 AssertFailed(); 414 return NULL; 412 /* not reached */ 415 413 } 416 414 … … 452 450 return 0; 453 451 } 454 455 AssertFailed(); 456 return 0; 452 /* not reached */ 457 453 } 458 454 … … 596 592 PCFGAST *ppCfgAst) 597 593 { 598 int rc = VINF_SUCCESS;599 594 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])); 604 596 if (!pCfgAst) 605 597 return VERR_NO_MEMORY; … … 614 606 } 615 607 608 int rc = VINF_SUCCESS; 616 609 do 617 610 { -
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStop.cpp
r62493 r63289 107 107 DECLHIDDEN(RTEXITCODE) autostartStopMain(PCFGAST pCfgAst) 108 108 { 109 RT_NOREF(pCfgAst); 109 110 RTEXITCODE rcExit = RTEXITCODE_SUCCESS; 110 int vrc = VINF_SUCCESS;111 111 std::list<AUTOSTOPVM> listVM; 112 112 -
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartUtils.cpp
r62493 r63289 218 218 } 219 219 220 DECLHIDDEN(RTEXITCODE) autostartSvcDisplayGetOptError(const char *pszAction, int rc, int argc, char **argv, int iArg, PCRTGETOPTUNION pValue) 221 { 220 DECLHIDDEN(RTEXITCODE) autostartSvcDisplayGetOptError(const char *pszAction, int rc, int argc, char **argv, int iArg, 221 PCRTGETOPTUNION pValue) 222 { 223 RT_NOREF(pValue); 222 224 autostartSvcDisplayError("%s - RTGetOpt failure, %Rrc (%d): %s\n", 223 225 pszAction, rc, rc, iArg < argc ? argv[iArg] : "<null>"); … … 227 229 DECLHIDDEN(RTEXITCODE) autostartSvcDisplayTooManyArgsError(const char *pszAction, int argc, char **argv, int iArg) 228 230 { 231 RT_NOREF(argc); 229 232 Assert(iArg < argc); 230 233 autostartSvcDisplayError("%s - Too many arguments: %s\n", pszAction, argv[iArg]);
Note:
See TracChangeset
for help on using the changeset viewer.