VirtualBox

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


Ignore:
Timestamp:
May 21, 2021 12:12:38 PM (4 years ago)
Author:
vboxsync
Message:

FE/VBoxHeadless: Wait until WM_ENDSESSION and check that its wParam is
true before we actually initiating VM termination. bugref:8161.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r89108 r89219  
    870870                    (unsigned long)lParam));
    871871
     872            /* do not block windows session termination */
     873            lResult = TRUE;
     874            break;
     875
     876        case WM_ENDSESSION:
     877            lResult = 0;
     878            LogRel(("WM_ENDSESSION:%s%s%s%s%s (%s/0x%08lx)\n",
     879                    lParam == 0                  ? " shutdown"  : "",
     880                    lParam & ENDSESSION_CRITICAL ? " critical"  : "",
     881                    lParam & ENDSESSION_LOGOFF   ? " logoff"    : "",
     882                    lParam & ENDSESSION_CLOSEAPP ? " close"     : "",
     883                    wParam == FALSE              ? " cancelled" : "",
     884                    wParam ? "TRUE" : "FALSE",
     885                    (unsigned long)lParam));
     886            if (wParam == FALSE)
     887                break;
     888
    872889            /* tell the user what we are doing */
    873890            ::ShutdownBlockReasonCreate(hwnd, L"Waiting for VM to terminate");
     
    877894            gEventQ->interruptEventQueueProcessing();
    878895
    879             /* do not block windows session termination */
    880             lResult = TRUE;
    881             break;
    882 
    883         case WM_ENDSESSION:
    884896            if (g_hCanQuit != NIL_RTSEMEVENT)
    885897            {
     
    896908                LogRel(("VBoxHeadless: WM_ENDSESSION: cannot wait for VM termination\n"));
    897909            }
    898             lResult = TRUE;
    899910            break;
    900911
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