- Timestamp:
- Mar 11, 2022 6:24:17 PM (3 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 16 edited
-
Additions/WINNT/VBoxTray/VBoxLA.cpp (modified) (1 diff)
-
Additions/common/VBoxControl/VBoxControl.cpp (modified) (3 diffs)
-
Additions/common/VBoxControl/testcase/tstVBoxControl.cpp (modified) (2 diffs)
-
Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestProp.cpp (modified) (5 diffs)
-
Additions/common/pam/pam_vbox.cpp (modified) (1 diff)
-
Additions/linux/lightdm-greeter/vbox-greeter.cpp (modified) (1 diff)
-
Additions/x11/VBoxClient/display-drm.cpp (modified) (2 diffs)
-
Frontends/VBoxManage/VBoxManageGuestProp.cpp (modified) (1 diff)
-
Frontends/VBoxShell/vboxshell.py (modified) (1 diff)
-
HostServices/GuestProperties/VBoxGuestPropSvc.cpp (modified) (7 diffs)
-
Main/idl/VirtualBox.xidl (modified) (2 diffs)
-
Main/include/VirtualBoxImpl.h (modified) (1 diff)
-
Main/src-client/ConsoleImpl.cpp (modified) (2 diffs)
-
Main/src-server/MachineImpl.cpp (modified) (2 diffs)
-
Main/src-server/VirtualBoxImpl.cpp (modified) (1 diff)
-
ValidationKit/testdriver/vbox.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxLA.cpp
r93115 r94184 831 831 pu64Timestamp, 832 832 NULL /* ppszFlags */, 833 &cbBuf); 833 &cbBuf, 834 NULL /* pfWasDeleted */); 834 835 835 836 if (rc != VERR_BUFFER_OVERFLOW) -
trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
r93300 r94184 1515 1515 uint64_t u64TimestampOut = 0; 1516 1516 char *pszFlags = NULL; 1517 bool fWasDeleted = false; 1517 1518 /* The buffer for storing the data and its initial size. We leave a bit 1518 1519 * of space here in case the maximum values are raised. */ … … 1538 1539 u64TimestampIn, u32Timeout, 1539 1540 &pszName, &pszValue, &u64TimestampOut, 1540 &pszFlags, &cbBuf );1541 &pszFlags, &cbBuf, &fWasDeleted); 1541 1542 } 1542 1543 if (VERR_BUFFER_OVERFLOW == rc) … … 1562 1563 else if (RT_SUCCESS(rc)) 1563 1564 { 1564 RTPrintf("Name: %s\n", pszName); 1565 RTPrintf("Value: %s\n", pszValue); 1566 RTPrintf("Timestamp: %lld ns\n", u64TimestampOut); 1567 RTPrintf("Flags: %s\n", pszFlags); 1565 if (fWasDeleted) 1566 { 1567 RTPrintf("Property %s was deleted\n", pszName); 1568 } 1569 else 1570 { 1571 RTPrintf("Name: %s\n", pszName); 1572 RTPrintf("Value: %s\n", pszValue); 1573 RTPrintf("Timestamp: %lld ns\n", u64TimestampOut); 1574 RTPrintf("Flags: %s\n", pszFlags); 1575 } 1568 1576 } 1569 1577 -
trunk/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp
r93115 r94184 177 177 uint64_t *pu64Timestamp, 178 178 char **ppszFlags, 179 uint32_t *pcbBufActual) 179 uint32_t *pcbBufActual, 180 bool *pfWasDeleted) 180 181 { 181 182 RT_NOREF2(pvBuf, cbBuf); … … 201 202 if (pcbBufActual) 202 203 *pcbBufActual = 256; 204 if (pfWasDeleted) 205 *pfWasDeleted = false; 203 206 return VINF_SUCCESS; 204 207 } -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestProp.cpp
r93453 r94184 937 937 * @param pcbBufActual If @a pcBuf is not large enough, the size needed. 938 938 * Optional. 939 * @param pfWasDeleted A flag which indicates that property was deleted. 940 * Optional. 939 941 */ 940 942 VBGLR3DECL(int) VbglR3GuestPropWait(HGCMCLIENTID idClient, … … 944 946 char ** ppszName, char **ppszValue, 945 947 uint64_t *pu64Timestamp, char **ppszFlags, 946 uint32_t *pcbBufActual )948 uint32_t *pcbBufActual, bool *pfWasDeleted) 947 949 { 948 950 /* … … 973 975 974 976 /* 975 * Buffer layout: Name\0Value\0Flags\0 .977 * Buffer layout: Name\0Value\0Flags\0fWasDeleted\0. 976 978 * 977 979 * If the caller cares about any of these strings, make sure things are … … 979 981 */ 980 982 if ( RT_SUCCESS(rc) 981 && (ppszName != NULL || ppszValue != NULL || ppszFlags != NULL ))983 && (ppszName != NULL || ppszValue != NULL || ppszFlags != NULL || pfWasDeleted != NULL)) 982 984 { 983 985 /* Validate / skip 'Name'. */ … … 994 996 995 997 if (ppszFlags) 998 *ppszFlags = pszFlags; 999 1000 /* Validate / skip 'Flags'. */ 1001 char *pszWasDeleted = RTStrEnd(pszFlags, cbBuf - (pszFlags - (char *)pvBuf)) + 1; 1002 AssertPtrReturn(pszWasDeleted, VERR_TOO_MUCH_DATA); 1003 if (pfWasDeleted) 996 1004 { 997 /* Validate 'Flags'. */ 998 char *pszEos = RTStrEnd(pszFlags, cbBuf - (pszFlags - (char *)pvBuf)); 999 AssertPtrReturn(pszEos, VERR_TOO_MUCH_DATA); 1000 *ppszFlags = pszFlags; 1005 AssertReturn(pszWasDeleted[0] == '0' || pszWasDeleted[0] == '1', VERR_PARSE_ERROR); 1006 *pfWasDeleted = pszWasDeleted[0] == '0' ? false : true; 1001 1007 } 1008 1009 /* Validate end of buffer string. */ 1010 char *pszEos = RTStrEnd(pszWasDeleted, cbBuf - (pszWasDeleted - (char *)pvBuf)); 1011 AssertPtrReturn(pszEos, VERR_TOO_MUCH_DATA); 1002 1012 } 1003 1013 -
trunk/src/VBox/Additions/common/pam/pam_vbox.cpp
r93115 r94184 529 529 0 /* Last timestamp; just wait for next event */, uTimeoutMS, 530 530 &pszName, &pszValue, &u64TimestampOut, 531 &pszFlags, &cbBuf );531 &pszFlags, &cbBuf, NULL /* pfWasDeleted */); 532 532 } 533 533 else -
trunk/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp
r93115 r94184 328 328 0 /* Last timestamp; just wait for next event */, uTimeoutMS, 329 329 &pszName, &pszValue, &u64TimestampOut, 330 &pszFlags, &cbBuf );330 &pszFlags, &cbBuf, NULL); 331 331 } 332 332 else -
trunk/src/VBox/Additions/x11/VBoxClient/display-drm.cpp
r94121 r94184 900 900 static DECLCALLBACK(int) vbDrmIpcClientWorker(RTTHREAD ThreadSelf, void *pvUser) 901 901 { 902 VBOX_DRMIPC_CLIENT hClient = VBOX_DRMIPC_CLIENT_INITIALIZER;902 VBOX_DRMIPC_CLIENT hClient = VBOX_DRMIPC_CLIENT_INITIALIZER; 903 903 RTLOCALIPCSESSION hSession = (RTLOCALIPCSESSION)pvUser; 904 904 int rc; … … 1133 1133 1134 1134 rc = VbglR3GuestPropWait(idClient, VBGLR3DRMIPCPROPRESTRICT, achBuf, sizeof(achBuf), u64Timestamp, 1135 VBOX_DRMIPC_RX_TIMEOUT_MS, NULL, NULL, &u64Timestamp, NULL, NULL );1135 VBOX_DRMIPC_RX_TIMEOUT_MS, NULL, NULL, &u64Timestamp, NULL, NULL, NULL); 1136 1136 if (RT_SUCCESS(rc)) 1137 1137 vbDrmSetIpcServerAccessPermissions(hIpcServer); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
r93700 r94184 370 370 { 371 371 Bstr aNextValue, aNextFlags; 372 BOOL aNextWasDeleted; 372 373 gpcev->COMGETTER(Value)(aNextValue.asOutParam()); 373 374 gpcev->COMGETTER(Flags)(aNextFlags.asOutParam()); 374 RTPrintf(GuestProp::tr("Name: %ls, value: %ls, flags: %ls\n"), 375 aNextName.raw(), aNextValue.raw(), aNextFlags.raw()); 375 gpcev->COMGETTER(FWasDeleted)(&aNextWasDeleted); 376 if (aNextWasDeleted) 377 RTPrintf(GuestProp::tr("Property %ls was deleted\n"), aNextName.raw()); 378 else 379 RTPrintf(GuestProp::tr("Name: %ls, value: %ls, flags: %ls\n"), 380 aNextName.raw(), aNextValue.raw(), aNextFlags.raw()); 376 381 fSignalled = true; 377 382 } -
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r93115 r94184 365 365 gpcev = ctx['global'].queryInterface(event, 'IGuestPropertyChangedEvent') 366 366 if gpcev: 367 print("guest property change: name=%s value=%s" % (gpcev.name, gpcev.value)) 367 if (gpcev.fWasDeleted) 368 print("property %s was deleted" % (gpcev.name)) 369 else 370 print("guest property change: name=%s value=%s flags='%s'" % 371 (gpcev.name, gpcev.value, gpcev.flags)) 368 372 elif evtype == ctx['global'].constants.VBoxEventType_OnMousePointerShapeChanged: 369 373 psev = ctx['global'].queryInterface(event, 'IMousePointerShapeChangedEvent') -
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; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r94075 r94184 25869 25869 <interface 25870 25870 name="IGuestPropertyChangedEvent" extends="IMachineEvent" 25871 uuid=" 3f63597a-26f1-4edb-8dd2-6bddd0912368"25871 uuid="2d0f4c6f-a77e-45c5-96d2-7ca7daae63a9" 25872 25872 wsmap="managed" autogen="VBoxEvent" id="OnGuestPropertyChanged" 25873 25873 > … … 25891 25891 <desc> 25892 25892 The new property flags. 25893 </desc> 25894 </attribute> 25895 25896 <attribute name="fWasDeleted" readonly="yes" type="boolean"> 25897 <desc> 25898 A flag which indicates that property was deleted. 25893 25899 </desc> 25894 25900 </attribute> -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r93115 r94184 175 175 void i_onSnapshotChanged(const Guid &aMachineId, const Guid &aSnapshotId); 176 176 177 void i_onGuestPropertyChanged(const Guid &aMachineId, const Utf8Str &aName, const Utf8Str &aValue, const Utf8Str &aFlags); 177 void i_onGuestPropertyChanged(const Guid &aMachineId, const Utf8Str &aName, const Utf8Str &aValue, const Utf8Str &aFlags, 178 const BOOL &fWasDeleted); 178 179 void i_onNatRedirectChanged(const Guid &aMachineId, ULONG ulSlot, bool fRemove, const Utf8Str &aName, 179 180 NATProtocol_T aProto, const Utf8Str &aHostIp, uint16_t aHostPort, -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r93891 r94184 1845 1845 Bstr value(pCBData->pcszValue); 1846 1846 Bstr flags(pCBData->pcszFlags); 1847 BOOL fWasDeleted = !pCBData->pcszValue; 1847 1848 ComObjPtr<Console> pConsole = reinterpret_cast<Console *>(pvExtension); 1848 1849 HRESULT hrc = pConsole->mControl->PushGuestProperty(name.raw(), … … 1850 1851 pCBData->u64Timestamp, 1851 1852 flags.raw(), 1852 !pCBData->pcszValue);1853 fWasDeleted); 1853 1854 if (SUCCEEDED(hrc)) 1854 1855 { 1855 ::FireGuestPropertyChangedEvent(pConsole->mEventSource, pConsole->i_getId().raw(), name.raw(), value.raw(), flags.raw()); 1856 ::FireGuestPropertyChangedEvent(pConsole->mEventSource, pConsole->i_getId().raw(), name.raw(), value.raw(), flags.raw(), 1857 fWasDeleted); 1856 1858 rc = VINF_SUCCESS; 1857 1859 } -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r94092 r94184 5622 5622 alock.release(); 5623 5623 5624 mParent->i_onGuestPropertyChanged(mData->mUuid, aName, aValue, aFlags );5624 mParent->i_onGuestPropertyChanged(mData->mUuid, aName, aValue, aFlags, fDelete); 5625 5625 } 5626 5626 } … … 13677 13677 alock.release(); 13678 13678 13679 mParent->i_onGuestPropertyChanged(mData->mUuid, aName, aValue, aFlags );13679 mParent->i_onGuestPropertyChanged(mData->mUuid, aName, aValue, aFlags, fWasDeleted); 13680 13680 } 13681 13681 catch (...) -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r93115 r94184 3609 3609 */ 3610 3610 void VirtualBox::i_onGuestPropertyChanged(const Guid &aMachineId, const Utf8Str &aName, const Utf8Str &aValue, 3611 const Utf8Str &aFlags )3611 const Utf8Str &aFlags, const BOOL &fWasDeleted) 3612 3612 { 3613 3613 ComPtr<IEvent> ptrEvent; 3614 3614 HRESULT hrc = ::CreateGuestPropertyChangedEvent(ptrEvent.asOutParam(), m->pEventSource, 3615 aMachineId.toString(), aName, aValue, aFlags );3615 aMachineId.toString(), aName, aValue, aFlags, fWasDeleted); 3616 3616 AssertComRCReturnVoid(hrc); 3617 3617 i_postEvent(new AsyncEvent(this, ptrEvent)); -
trunk/src/VBox/ValidationKit/testdriver/vbox.py
r94126 r94184 806 806 try: 807 807 oEvtIt = self.oVBoxMgr.queryInterface(oEvtBase, 'IGuestPropertyChangedEvent'); 808 return self.onGuestPropertyChange(oEvtIt.machineId, oEvtIt.name, oEvtIt.value, oEvtIt.flags );808 return self.onGuestPropertyChange(oEvtIt.machineId, oEvtIt.name, oEvtIt.value, oEvtIt.flags, oEvtIt.fWasDeleted); 809 809 except: 810 810 reporter.logXcpt();
Note:
See TracChangeset
for help on using the changeset viewer.

