Changeset 96451 in vbox for trunk/src/VBox/Additions/common/VBoxService
- Timestamp:
- Aug 24, 2022 9:56:54 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 153295
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
r96407 r96451 58 58 #include "../../WINNT/VBoxTray/VBoxTrayMsg.h" /* For IPC. */ 59 59 60 static uint32_t s_uDebugGuestPropClientID = 0;61 static uint32_t s_uDebugIter = 0;62 /** Whether to skip the logged-in user detection over RDP or not.63 * See notes in this section why we might want to skip this. */64 static bool s_fSkipRDPDetection = false;65 66 60 67 61 /********************************************************************************************************************************* … … 117 111 * Global Variables * 118 112 *********************************************************************************************************************************/ 113 static uint32_t s_uDebugGuestPropClientID = 0; 114 static uint32_t s_uDebugIter = 0; 115 /** Whether to skip the logged-in user detection over RDP or not. 116 * See notes in this section why we might want to skip this. */ 117 static bool s_fSkipRDPDetection = false; 118 119 119 static RTONCE g_vgsvcWinVmInitOnce = RTONCE_INITIALIZER; 120 120 … … 984 984 { 985 985 /* .uMagic = */ VBOXTRAY_IPC_HDR_MAGIC, 986 /* .u HdrVersion = */ 0,987 /* . uMsgType = */ VBOXTRAYIPCMSGTYPE_USERLASTINPUT,988 /* .cb MsgData = */ 0 /* No msg*/986 /* .uVersion = */ VBOXTRAY_IPC_HDR_VERSION, 987 /* .enmMsgType = */ VBOXTRAYIPCMSGTYPE_USER_LAST_INPUT, 988 /* .cbPayload = */ 0 /* No payload */ 989 989 }; 990 990 991 991 rc = RTLocalIpcSessionWrite(hSession, &ipcHdr, sizeof(ipcHdr)); 992 993 992 if (RT_SUCCESS(rc)) 994 993 { 995 VBOXTRAYIPCRE S_USERLASTINPUT ipcRes;996 rc = RTLocalIpcSessionRead(hSession, &ipcRe s, sizeof(ipcRes), NULL /* Exact read */);994 VBOXTRAYIPCREPLY_USER_LAST_INPUT_T ipcReply; 995 rc = RTLocalIpcSessionRead(hSession, &ipcReply, sizeof(ipcReply), NULL /* Exact read */); 997 996 if ( RT_SUCCESS(rc) 998 997 /* If uLastInput is set to UINT32_MAX VBoxTray was not able to retrieve the 999 998 * user's last input time. This might happen when running on Windows NT4 or older. */ 1000 && ipcRe s.uLastInput != UINT32_MAX)999 && ipcReply.cSecSinceLastInput != UINT32_MAX) 1001 1000 { 1002 userState = (ipcRes.uLastInput * 1000)< g_uVMInfoUserIdleThresholdMS1001 userState = ipcReply.cSecSinceLastInput * 1000 < g_uVMInfoUserIdleThresholdMS 1003 1002 ? VBoxGuestUserState_InUse 1004 1003 : VBoxGuestUserState_Idle; … … 1014 1013 fReportToHost = rc == VINF_SUCCESS; 1015 1014 VGSvcVerbose(4, "User '%s' (domain '%s') is idle for %RU32, fReportToHost=%RTbool\n", 1016 pszUser, pszDomain ? pszDomain : "<None>", ipcRe s.uLastInput, fReportToHost);1015 pszUser, pszDomain ? pszDomain : "<None>", ipcReply.cSecSinceLastInput, fReportToHost); 1017 1016 1018 1017 #if 0 /* Do we want to write the idle time as well? */ 1019 1018 /* Also write the user's current idle time, if there is any. */ 1020 1019 if (userState == VBoxGuestUserState_Idle) 1021 rc = vgsvcUserUpdateF(pCache, pszUser, pszDomain, "IdleTimeMs", "%RU32", ipcRe s.uLastInputMs);1020 rc = vgsvcUserUpdateF(pCache, pszUser, pszDomain, "IdleTimeMs", "%RU32", ipcReply.cSecSinceLastInput); 1022 1021 else 1023 1022 rc = vgsvcUserUpdateF(pCache, pszUser, pszDomain, "IdleTimeMs", NULL /* Delete property */); … … 1027 1026 } 1028 1027 #ifdef DEBUG 1029 else if (RT_SUCCESS(rc) && ipcRe s.uLastInput == UINT32_MAX)1028 else if (RT_SUCCESS(rc) && ipcReply.cSecSinceLastInput == UINT32_MAX) 1030 1029 VGSvcVerbose(4, "Last input for user '%s' is not supported, skipping\n", pszUser, rc); 1031 1030 #endif
Note:
See TracChangeset
for help on using the changeset viewer.