VirtualBox

Ignore:
Timestamp:
Dec 16, 2021 3:50:22 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148967
Message:

Guest Control: Be more specific when reporting session termination statuses.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r92707 r92987  
    16251625
    16261626    uint32_t uSessionStatus = GUEST_SESSION_NOTIFYTYPE_UNDEFINED;
    1627     uint32_t uSessionRc = VINF_SUCCESS; /** uint32_t vs. int. */
     1627    int32_t  iSessionResult = VINF_SUCCESS;
    16281628
    16291629    if (fProcessAlive)
     
    16501650            case RTPROCEXITREASON_NORMAL:
    16511651                uSessionStatus = GUEST_SESSION_NOTIFYTYPE_TEN;
     1652                iSessionResult = ProcessStatus.iStatus; /* Report back the session's exit code. */
    16521653                break;
    16531654
    16541655            case RTPROCEXITREASON_ABEND:
    16551656                uSessionStatus = GUEST_SESSION_NOTIFYTYPE_TEA;
     1657                /* iSessionResult is undefined (0). */
    16561658                break;
    16571659
    16581660            case RTPROCEXITREASON_SIGNAL:
    16591661                uSessionStatus = GUEST_SESSION_NOTIFYTYPE_TES;
     1662                iSessionResult = ProcessStatus.iStatus; /* Report back the signal number. */
    16601663                break;
    16611664
     
    16761679
    16771680    /* Report final status, regardless if we failed to wait above, so that the host knows what's going on. */
    1678     VGSvcVerbose(3, "Reporting final status %RU32 of session ID=%RU32\n", uSessionStatus, idSession);
     1681    VGSvcVerbose(3, "Reporting final status %#x %RU32 of session ID=%RU32\n", uSessionStatus, idSession);
    16791682    Assert(uSessionStatus != GUEST_SESSION_NOTIFYTYPE_UNDEFINED);
    16801683
    16811684    VBGLR3GUESTCTRLCMDCTX ctx = { idClient, VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(idSession),
    16821685                                  0 /* uProtocol, unused */, 0 /* uNumParms, unused */ };
    1683     rc2 = VbglR3GuestCtrlSessionNotify(&ctx, uSessionStatus, uSessionRc);
     1686    rc2 = VbglR3GuestCtrlSessionNotify(&ctx, uSessionStatus, iSessionResult);
    16841687    if (RT_FAILURE(rc2))
    16851688        VGSvcError("Reporting final status of session ID=%RU32 failed with rc=%Rrc\n", idSession, rc2);
    16861689
    1687     VGSvcVerbose(3, "Thread for session ID=%RU32 ended with sessionStatus=%RU32, sessionRc=%Rrc\n",
    1688                  idSession, uSessionStatus, uSessionRc);
     1690    VGSvcVerbose(3, "Thread for session ID=%RU32 ended with sessionStatus=%#x (%RU32), sessionRc=%#x (%Rrc)\n",
     1691                 idSession, uSessionStatus, uSessionStatus, iSessionResult, iSessionResult);
    16891692
    16901693    return VINF_SUCCESS;
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