Changeset 93048 in vbox for trunk/src/VBox
- Timestamp:
- Dec 21, 2021 2:30:00 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestControl/VBoxGuestControlSvc.cpp
r90805 r93048 1048 1048 1049 1049 /* 1050 * If it's the master disconnecting, we need to reset related globals. 1051 */ 1052 if (idClient == pThis->m_idMasterClient) 1053 { 1054 pThis->m_pMasterClient = NULL; 1055 pThis->m_idMasterClient = UINT32_MAX; 1056 1057 GstCtrlPreparedSession *pCur, *pNext; 1058 RTListForEachSafe(&pThis->m_PreparedSessions, pCur, pNext, GstCtrlPreparedSession, ListEntry) 1059 { 1060 RTListNodeRemove(&pCur->ListEntry); 1061 RTMemFree(pCur); 1062 } 1063 pThis->m_cPreparedSessions = 0; 1064 1065 /* Make sure that the host gets notified about still associated guest sessions going down. 1066 * 1067 * Some guest OSes (like OL8) do reboot / shut down quite abruptly so that 1068 * VBoxService does not have the chance to do so instead. 1069 * 1070 * Note: We do this only when the master disconnects as a last meassure, as this otherwise 1071 * would overwrite formerly sent session statuses on the host. 1072 */ 1073 ClientStateMap::const_iterator itClientState = pThis->m_SessionIdMap.begin(); 1074 while (itClientState != pThis->m_SessionIdMap.end()) 1075 { 1076 VBOXHGCMSVCPARM aParms[4]; 1077 HGCMSvcSetU32(&aParms[0], VBOX_GUESTCTRL_CONTEXTID_MAKE(pCur->idSession, 0 /* uObject */, 0 /* uCount */)); 1078 HGCMSvcSetU32(&aParms[1], GUEST_SESSION_NOTIFYTYPE_DWN); /* type */ 1079 HGCMSvcSetU32(&aParms[2], VINF_SUCCESS); /* result */ 1080 1081 int rc2 = pThis->hostCallback(GUEST_MSG_SESSION_NOTIFY, 3, aParms); 1082 LogFlowFunc(("Notified host about session ID=%RU32 going down -> %Rrc\n", pClient->m_idSession, rc2)); 1083 RT_NOREF(rc2); 1084 1085 ++itClientState; 1086 /* Note: Don't erase the client state -- this will be done when the actual client is disconnecting. */ 1087 } 1088 } 1089 else 1090 Assert(pClient != pThis->m_pMasterClient); 1091 1092 /* 1050 1093 * Delete the client state. 1051 1094 */ … … 1054 1097 pThis->m_SessionIdMap.erase(pClient->m_idSession); 1055 1098 pClient->~ClientState(); 1056 1057 /*1058 * If it's the master disconnecting, we need to reset related globals.1059 */1060 if (idClient == pThis->m_idMasterClient)1061 {1062 pThis->m_pMasterClient = NULL;1063 pThis->m_idMasterClient = UINT32_MAX;1064 1065 GstCtrlPreparedSession *pCur, *pNext;1066 RTListForEachSafe(&pThis->m_PreparedSessions, pCur, pNext, GstCtrlPreparedSession, ListEntry)1067 {1068 RTListNodeRemove(&pCur->ListEntry);1069 RTMemFree(pCur);1070 }1071 pThis->m_cPreparedSessions = 0;1072 }1073 else1074 Assert(pClient != pThis->m_pMasterClient);1075 1099 1076 1100 if (pThis->m_ClientStateMap.empty())
Note:
See TracChangeset
for help on using the changeset viewer.