diff options
Diffstat (limited to 'src/burn/engine/engine.cpp')
| -rw-r--r-- | src/burn/engine/engine.cpp | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp index 628708f5..13d23ecd 100644 --- a/src/burn/engine/engine.cpp +++ b/src/burn/engine/engine.cpp | |||
| @@ -297,6 +297,41 @@ LExit: | |||
| 297 | hr = SUCCEEDED(hr) ? HRESULT_FROM_WIN32(ERROR_SUCCESS_REBOOT_REQUIRED) : HRESULT_FROM_WIN32(ERROR_FAIL_REBOOT_REQUIRED); | 297 | hr = SUCCEEDED(hr) ? HRESULT_FROM_WIN32(ERROR_SUCCESS_REBOOT_REQUIRED) : HRESULT_FROM_WIN32(ERROR_FAIL_REBOOT_REQUIRED); |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | if (fRunNormal) | ||
| 301 | { | ||
| 302 | LogId(REPORT_STANDARD, MSG_EXITING, FAILED(hr) ? (int)hr : *pdwExitCode, LoggingBoolToString(fRestart)); | ||
| 303 | } | ||
| 304 | else if (fRunUntrusted) | ||
| 305 | { | ||
| 306 | LogId(REPORT_STANDARD, MSG_EXITING_CLEAN_ROOM, FAILED(hr) ? (int)hr : *pdwExitCode); | ||
| 307 | } | ||
| 308 | else if (fRunRunOnce) | ||
| 309 | { | ||
| 310 | LogId(REPORT_STANDARD, MSG_EXITING_RUN_ONCE, FAILED(hr) ? (int)hr : *pdwExitCode); | ||
| 311 | } | ||
| 312 | else if (fRunElevated) | ||
| 313 | { | ||
| 314 | LogId(REPORT_STANDARD, MSG_EXITING_ELEVATED, FAILED(hr) ? (int)hr : *pdwExitCode); | ||
| 315 | } | ||
| 316 | |||
| 317 | if (fLogInitialized) | ||
| 318 | { | ||
| 319 | // Leave the log open before calling restart so messages can be logged from there. | ||
| 320 | // Best effort to make sure all previous messages are written to disk in case the restart causes messages to be lost in buffers. | ||
| 321 | LogFlush(); | ||
| 322 | } | ||
| 323 | |||
| 324 | if (fRestart) | ||
| 325 | { | ||
| 326 | LogId(REPORT_STANDARD, MSG_RESTARTING); | ||
| 327 | |||
| 328 | HRESULT hrRestart = Restart(); | ||
| 329 | if (FAILED(hrRestart)) | ||
| 330 | { | ||
| 331 | LogErrorId(hrRestart, MSG_RESTART_FAILED); | ||
| 332 | } | ||
| 333 | } | ||
| 334 | |||
| 300 | UninitializeEngineState(&engineState); | 335 | UninitializeEngineState(&engineState); |
| 301 | 336 | ||
| 302 | if (fXmlInitialized) | 337 | if (fXmlInitialized) |
| @@ -329,42 +364,9 @@ LExit: | |||
| 329 | ::CoUninitialize(); | 364 | ::CoUninitialize(); |
| 330 | } | 365 | } |
| 331 | 366 | ||
| 332 | if (fRunNormal) | ||
| 333 | { | ||
| 334 | LogId(REPORT_STANDARD, MSG_EXITING, FAILED(hr) ? (int)hr : *pdwExitCode, LoggingBoolToString(fRestart)); | ||
| 335 | |||
| 336 | if (fRestart) | ||
| 337 | { | ||
| 338 | LogId(REPORT_STANDARD, MSG_RESTARTING); | ||
| 339 | } | ||
| 340 | } | ||
| 341 | else if (fRunUntrusted) | ||
| 342 | { | ||
| 343 | LogId(REPORT_STANDARD, MSG_EXITING_CLEAN_ROOM, FAILED(hr) ? (int)hr : *pdwExitCode); | ||
| 344 | } | ||
| 345 | else if (fRunRunOnce) | ||
| 346 | { | ||
| 347 | LogId(REPORT_STANDARD, MSG_EXITING_RUN_ONCE, FAILED(hr) ? (int)hr : *pdwExitCode); | ||
| 348 | } | ||
| 349 | else if (fRunElevated) | ||
| 350 | { | ||
| 351 | LogId(REPORT_STANDARD, MSG_EXITING_ELEVATED, FAILED(hr) ? (int)hr : *pdwExitCode); | ||
| 352 | } | ||
| 353 | |||
| 354 | |||
| 355 | if (fLogInitialized) | 367 | if (fLogInitialized) |
| 356 | { | 368 | { |
| 357 | DutilUninitialize(); | 369 | DutilUninitialize(); |
| 358 | LogClose(FALSE); | ||
| 359 | } | ||
| 360 | |||
| 361 | if (fRestart) | ||
| 362 | { | ||
| 363 | Restart(); | ||
| 364 | } | ||
| 365 | |||
| 366 | if (fLogInitialized) | ||
| 367 | { | ||
| 368 | LogUninitialize(FALSE); | 370 | LogUninitialize(FALSE); |
| 369 | } | 371 | } |
| 370 | 372 | ||
