Changeset 36178 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Mar 7, 2011 9:45:24 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70380
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r36074 r36178 673 673 #ifdef VBOX_WITH_GUEST_PROPS 674 674 675 bool Console::enabledGuestPropertiesVRDP(void) 675 /** 676 * Handles guest properties on a VM reset. 677 * At the moment we only delete properties which have the flag 678 * "TRARESET". 679 */ 680 void Console::guestPropertiesHandleVMReset(void) 681 { 682 com::SafeArray<BSTR> arrNames; 683 com::SafeArray<BSTR> arrValues; 684 com::SafeArray<LONG64> arrTimestamps; 685 com::SafeArray<BSTR> arrFlags; 686 HRESULT hrc = enumerateGuestProperties(Bstr("*").raw(), 687 ComSafeArrayAsOutParam(arrNames), 688 ComSafeArrayAsOutParam(arrValues), 689 ComSafeArrayAsOutParam(arrTimestamps), 690 ComSafeArrayAsOutParam(arrFlags)); 691 if (SUCCEEDED(hrc)) 692 { 693 for (size_t i = 0; i < arrFlags.size(); i++) 694 { 695 /* Delete all properties which have the flag "TRARESET". */ 696 if (Utf8Str(arrFlags[i]).contains("TRANSIENT_RESET", Utf8Str::CaseInsensitive)) 697 { 698 hrc = mMachine->SetGuestProperty(arrNames[i], Bstr("").raw() /* Value */, 699 Bstr("").raw() /* Flags */); 700 if (FAILED(hrc)) 701 LogRel(("RESET: Could not delete transient property \"%ls\", rc=%Rhrc\n", 702 arrNames[i], hrc)); 703 } 704 } 705 } 706 else 707 LogRel(("RESET: Unable to enumerate guest properties, rc=%Rhrc\n", hrc)); 708 } 709 710 bool Console::guestPropertiesVRDPEnabled(void) 676 711 { 677 712 Bstr value; 678 713 HRESULT hrc = mMachine->GetExtraData(Bstr("VBoxInternal2/EnableGuestPropertiesVRDP").raw(), 679 714 value.asOutParam()); 680 if (hrc == S_OK) 681 { 682 if (value == "1") 683 { 684 return true; 685 } 686 } 715 if ( hrc == S_OK 716 && value == "1") 717 return true; 687 718 return false; 688 719 } 689 720 690 void Console::updateGuestPropertiesVRDPLogon(uint32_t u32ClientId, const char *pszUser, const char *pszDomain) 691 { 692 if (!enabledGuestPropertiesVRDP()) 693 { 721 void Console::guestPropertiesVRDPUpdateLogon(uint32_t u32ClientId, const char *pszUser, const char *pszDomain) 722 { 723 if (!guestPropertiesVRDPEnabled()) 694 724 return; 695 }696 725 697 726 char szPropNm[256]; … … 725 754 } 726 755 727 void Console:: updateGuestPropertiesVRDPDisconnect(uint32_t u32ClientId)728 { 729 if (! enabledGuestPropertiesVRDP())756 void Console::guestPropertiesVRDPUpdateDisconnect(uint32_t u32ClientId) 757 { 758 if (!guestPropertiesVRDPEnabled()) 730 759 return; 731 760 … … 961 990 962 991 #ifdef VBOX_WITH_GUEST_PROPS 963 updateGuestPropertiesVRDPLogon(u32ClientId, pszUser, pszDomain);992 guestPropertiesVRDPUpdateLogon(u32ClientId, pszUser, pszDomain); 964 993 #endif /* VBOX_WITH_GUEST_PROPS */ 965 994 … … 1096 1125 1097 1126 #ifdef VBOX_WITH_GUEST_PROPS 1098 updateGuestPropertiesVRDPDisconnect(u32ClientId);1127 guestPropertiesVRDPUpdateDisconnect(u32ClientId); 1099 1128 #endif /* VBOX_WITH_GUEST_PROPS */ 1100 1129 … … 6768 6797 break; 6769 6798 } 6799 break; 6800 } 6801 6802 case VMSTATE_RESETTING: 6803 { 6804 #ifdef VBOX_WITH_GUEST_PROPS 6805 /* Do not take any read/write locks here! */ 6806 that->guestPropertiesHandleVMReset(); 6807 #endif 6770 6808 break; 6771 6809 }
Note:
See TracChangeset
for help on using the changeset viewer.