Changeset 94184 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Mar 11, 2022 6:24:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestProperties/VBoxGuestPropSvc.cpp
r93891 r94184 425 425 int getNotification(uint32_t u32ClientId, VBOXHGCMCALLHANDLE callHandle, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 426 426 int getOldNotificationInternal(const char *pszPattern, uint64_t nsTimestamp, Property *pProp); 427 int getNotificationWriteOut(uint32_t cParms, VBOXHGCMSVCPARM paParms[], Property const &prop );427 int getNotificationWriteOut(uint32_t cParms, VBOXHGCMSVCPARM paParms[], Property const &prop, bool fWasDeleted); 428 428 int doNotifications(const char *pszProperty, uint64_t nsTimestamp); 429 429 int notifyHost(const char *pszName, const char *pszValue, uint64_t nsTimestamp, const char *pszFlags); … … 1040 1040 1041 1041 /** Helper query used by getNotification */ 1042 int Service::getNotificationWriteOut(uint32_t cParms, VBOXHGCMSVCPARM paParms[], Property const &rProp )1042 int Service::getNotificationWriteOut(uint32_t cParms, VBOXHGCMSVCPARM paParms[], Property const &rProp, bool fWasDeleted) 1043 1043 { 1044 1044 AssertReturn(cParms == 4, VERR_INVALID_PARAMETER); /* Basic sanity checking. */ … … 1051 1051 { 1052 1052 char szFlags[GUEST_PROP_MAX_FLAGS_LEN]; 1053 char szWasDeleted[2] = { fWasDeleted ? '1' : '0', '\0' }; 1054 1053 1055 rc = GuestPropWriteFlags(rProp.mFlags, szFlags); 1054 1056 if (RT_SUCCESS(rc)) … … 1059 1061 size_t const cbName = rProp.mName.length() + 1; 1060 1062 size_t const cbValue = rProp.mValue.length() + 1; 1061 size_t const cbNeeded = cbName + cbValue + cbFlags; 1063 size_t const cbWasDeleted = strlen(szWasDeleted) + 1; 1064 size_t const cbNeeded = cbName + cbValue + cbFlags + cbWasDeleted; 1062 1065 HGCMSvcSetU32(&paParms[3], (uint32_t)cbNeeded); 1063 1066 if (cbNeeded <= cbBuf) 1064 1067 { 1068 /* Buffer layout: Name\0Value\0Flags\0fWasDeleted\0. */ 1065 1069 memcpy(pchBuf, rProp.mName.c_str(), cbName); 1066 1070 pchBuf += cbName; … … 1068 1072 pchBuf += cbValue; 1069 1073 memcpy(pchBuf, szFlags, cbFlags); 1074 pchBuf += cbFlags; 1075 memcpy(pchBuf, szWasDeleted, cbWasDeleted); 1070 1076 } 1071 1077 else … … 1185 1191 else 1186 1192 { 1187 int rc2 = getNotificationWriteOut(cParms, paParms, prop );1193 int rc2 = getNotificationWriteOut(cParms, paParms, prop, !getPropertyInternal(prop.mName.c_str())); 1188 1194 if (RT_FAILURE(rc2)) 1189 1195 rc = rc2; … … 1252 1258 if (prop.Matches(pszPatterns)) 1253 1259 { 1254 int rc2 = getNotificationWriteOut(it->mParmsCnt, it->mParms, prop );1260 int rc2 = getNotificationWriteOut(it->mParmsCnt, it->mParms, prop, !pProp); 1255 1261 if (RT_SUCCESS(rc2)) 1256 1262 rc2 = it->mRc;
Note:
See TracChangeset
for help on using the changeset viewer.