VirtualBox

Changeset 21528 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jul 13, 2009 11:52:24 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
49994
Message:

Additions: fix updating NoLoggedInUsers when VBoxService is started

File:
1 edited

Legend:

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

    r21246 r21528  
    6767static uint32_t g_VMInfoGuestPropSvcClientID = 0;
    6868/** Number of logged in users in OS. */
    69 static uint32_t g_VMInfoLoggedInUsers = 0;
     69static uint32_t g_VMInfoLoggedInUsers = UINT32_MAX;
    7070#ifdef RT_OS_WINDOWS
    7171/** Function prototypes for dynamic loading. */
     
    229229
    230230        ::LsaFreeReturnBuffer(pSessions);
    231  #endif /* TARGET_NT4 */   
     231 #endif /* TARGET_NT4 */
    232232#else
    233233        utmp* ut_user;
     
    257257        VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/LoggedInUsersList", (uiUserCount > 0) ? szUserList : NULL);
    258258        VboxServiceWritePropInt(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/LoggedInUsers", uiUserCount);
    259         if (g_VMInfoLoggedInUsers != uiUserCount || g_VMInfoLoggedInUsers == INT32_MAX)
     259        if (g_VMInfoLoggedInUsers != uiUserCount || g_VMInfoLoggedInUsers == UINT32_MAX)
    260260        {
    261261            /* Update this property ONLY if there is a real change from no users to
    262262             * users or vice versa. The only exception is that the initialization
    263              * of a_pCtx->cUsers forces an update, but only once. This ensures
    264              * consistent property settings even if the VM aborted previously. */
     263             * forces an update, but only once. This ensures consistent property
     264             * settings even if the VM aborted previously. */
    265265            if (uiUserCount == 0)
    266266                VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/NoLoggedInUsers", "true");
    267             else if (g_VMInfoLoggedInUsers == 0 || uiUserCount == INT32_MAX)
     267            else if (g_VMInfoLoggedInUsers == 0)
    268268                VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, "GuestInfo/OS/NoLoggedInUsers", "false");
    269269        }
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