VirtualBox

Ignore:
Timestamp:
Oct 9, 2008 12:13:02 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37625
Message:

Additions/Windows: guest property fix for LoggedInUsersList and new NoLoggedInUsers property which only gets updated when transitioning from/to no users. Important for timestamp.

Location:
trunk/src/VBox/Additions/WINNT/VBoxService
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxService/VBoxVMInfo.cpp

    r12810 r13127  
    8080    gCtx.pEnv = pEnv;
    8181    gCtx.fFirstRun = TRUE;
     82    gCtx.iUserCount = INT32_MAX; /* value which isn't reached in real life. */
    8283
    8384    int rc = VbglR3GuestPropConnect(&gCtx.iInfoSvcClientID);
     
    115116     * Needs to be replaced with "temporary properties" later. */
    116117
    117     vboxVMInfoWriteProp(pCtx, "GuestInfo/OS/LoggedInUsersList", "");
     118    vboxVMInfoWriteProp(pCtx, "GuestInfo/OS/LoggedInUsersList", NULL);
    118119    vboxVMInfoWritePropInt(pCtx, "GuestInfo/OS/LoggedInUsers", 0);
     120    if (pCtx->iUserCount != 0)
     121        vboxVMInfoWriteProp(pCtx, "GuestInfo/OS/NoLoggedInUsers", "true");
    119122
    120123    const char *apszPat[1] = { "/VirtualBox/GuestInfo/Net/*" };
  • trunk/src/VBox/Additions/WINNT/VBoxService/VBoxVMInfo.h

    r11982 r13127  
    3232    fnWTSGetActiveConsoleSessionId pfnWTSGetActiveConsoleSessionId;
    3333    BOOL fFirstRun;
     34    uint32_t iUserCount;
    3435} VBOXINFORMATIONCONTEXT;
    3536
  • trunk/src/VBox/Additions/WINNT/VBoxService/VBoxVMInfoUser.cpp

    r11982 r13127  
    334334    vboxVMInfoWriteProp(a_pCtx, "GuestInfo/OS/LoggedInUsersList", (iUserCount > 0) ? szUserList : NULL);
    335335    vboxVMInfoWritePropInt(a_pCtx, "GuestInfo/OS/LoggedInUsers", iUserCount);
     336    if (a_pCtx->iUserCount != iUserCount)
     337    {
     338        /* Update this property ONLY if there is a real change from no users to
     339         * users or vice versa. The only exception is that the initialization
     340         * of a_pCtx->iUserCount forces an update, but only once. This ensures
     341         * consistent property settings even if the VM aborted previously. */
     342        if (iUserCount == 0)
     343            vboxVMInfoWriteProp(a_pCtx, "GuestInfo/OS/NoLoggedInUsers", "true");
     344        else if (a_pCtx->iUserCount == 0)
     345            vboxVMInfoWriteProp(a_pCtx, "GuestInfo/OS/NoLoggedInUsers", "false");
     346    }
     347    a_pCtx->iPrevUserCount = iUserCount;
    336348
    337349    return ret;
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