Changeset 44407 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jan 28, 2013 9:04:31 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/VRDEServerImpl.cpp
r38365 r44407 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 73 73 * @param aParent Handle of the parent object. 74 74 */ 75 HRESULT VRDEServer::init 75 HRESULT VRDEServer::init(Machine *aParent) 76 76 { 77 77 LogFlowThisFunc(("aParent=%p\n", aParent)); … … 112 112 * @note Locks @a aThat object for reading. 113 113 */ 114 HRESULT VRDEServer::init 114 HRESULT VRDEServer::init(Machine *aParent, VRDEServer *aThat) 115 115 { 116 116 LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat)); … … 125 125 unconst(mPeer) = aThat; 126 126 127 AutoCaller thatCaller 127 AutoCaller thatCaller(aThat); 128 128 AssertComRCReturnRC(thatCaller.rc()); 129 129 130 130 AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS); 131 mData.share 131 mData.share(aThat->mData); 132 132 133 133 /* Confirm a successful initialization */ … … 144 144 * @note Locks @a aThat object for reading. 145 145 */ 146 HRESULT VRDEServer::initCopy 146 HRESULT VRDEServer::initCopy(Machine *aParent, VRDEServer *aThat) 147 147 { 148 148 LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat)); … … 157 157 /* mPeer is left null */ 158 158 159 AutoCaller thatCaller 159 AutoCaller thatCaller(aThat); 160 160 AssertComRCReturnRC(thatCaller.rc()); 161 161 162 162 AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS); 163 mData.attachCopy 163 mData.attachCopy(aThat->mData); 164 164 165 165 /* Confirm a successful initialization */ … … 246 246 ///////////////////////////////////////////////////////////////////////////// 247 247 248 STDMETHODIMP VRDEServer::COMGETTER(Enabled) 248 STDMETHODIMP VRDEServer::COMGETTER(Enabled)(BOOL *aEnabled) 249 249 { 250 250 CheckComArgOutPointerValid(aEnabled); … … 258 258 } 259 259 260 STDMETHODIMP VRDEServer::COMSETTER(Enabled) 260 STDMETHODIMP VRDEServer::COMSETTER(Enabled)(BOOL aEnabled) 261 261 { 262 262 AutoCaller autoCaller(this); … … 264 264 265 265 /* the machine can also be in saved state for this property to change */ 266 AutoMutableOrSavedStateDependency adep 266 AutoMutableOrSavedStateDependency adep(mParent); 267 267 if (FAILED(adep.rc())) return adep.rc(); 268 268 … … 374 374 } 375 375 376 STDMETHODIMP VRDEServer::SetVRDEProperty 376 STDMETHODIMP VRDEServer::SetVRDEProperty(IN_BSTR aKey, IN_BSTR aValue) 377 377 { 378 378 LogFlowThisFunc(("\n")); … … 381 381 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 382 382 383 /* The machine needs to be mutable.*/384 AutoMutable StateDependency adep(mParent);383 /* the machine can also be in saved state for this property to change */ 384 AutoMutableOrSavedStateDependency adep(mParent); 385 385 if (FAILED(adep.rc())) return adep.rc(); 386 386 … … 461 461 } 462 462 463 STDMETHODIMP VRDEServer::GetVRDEProperty 463 STDMETHODIMP VRDEServer::GetVRDEProperty(IN_BSTR aKey, BSTR *aValue) 464 464 { 465 465 CheckComArgOutPointerValid(aValue); … … 628 628 } 629 629 630 STDMETHODIMP VRDEServer::COMGETTER(AuthType) 630 STDMETHODIMP VRDEServer::COMGETTER(AuthType)(AuthType_T *aType) 631 631 { 632 632 CheckComArgOutPointerValid(aType); … … 642 642 } 643 643 644 STDMETHODIMP VRDEServer::COMSETTER(AuthType) 645 { 646 AutoCaller autoCaller(this); 647 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 648 649 /* the machine needs to be mutable */650 AutoMutable StateDependency adep(mParent);644 STDMETHODIMP VRDEServer::COMSETTER(AuthType)(AuthType_T aType) 645 { 646 AutoCaller autoCaller(this); 647 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 648 649 /* the machine can also be in saved state for this property to change */ 650 AutoMutableOrSavedStateDependency adep(mParent); 651 651 if (FAILED(adep.rc())) return adep.rc(); 652 652 … … 671 671 } 672 672 673 STDMETHODIMP VRDEServer::COMGETTER(AuthTimeout) 673 STDMETHODIMP VRDEServer::COMGETTER(AuthTimeout)(ULONG *aTimeout) 674 674 { 675 675 CheckComArgOutPointerValid(aTimeout); … … 685 685 } 686 686 687 STDMETHODIMP VRDEServer::COMSETTER(AuthTimeout) 688 { 689 AutoCaller autoCaller(this); 690 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 691 692 /* the machine needs to be mutable */693 AutoMutable StateDependency adep(mParent);687 STDMETHODIMP VRDEServer::COMSETTER(AuthTimeout)(ULONG aTimeout) 688 { 689 AutoCaller autoCaller(this); 690 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 691 692 /* the machine can also be in saved state for this property to change */ 693 AutoMutableOrSavedStateDependency adep(mParent); 694 694 if (FAILED(adep.rc())) return adep.rc(); 695 695 … … 718 718 } 719 719 720 STDMETHODIMP VRDEServer::COMGETTER(AuthLibrary) 720 STDMETHODIMP VRDEServer::COMGETTER(AuthLibrary)(BSTR *aLibrary) 721 721 { 722 722 CheckComArgOutPointerValid(aLibrary); … … 749 749 } 750 750 751 STDMETHODIMP VRDEServer::COMSETTER(AuthLibrary) 752 { 753 AutoCaller autoCaller(this); 754 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 755 756 /* the machine needs to be mutable */757 AutoMutable StateDependency adep(mParent);751 STDMETHODIMP VRDEServer::COMSETTER(AuthLibrary)(IN_BSTR aLibrary) 752 { 753 AutoCaller autoCaller(this); 754 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 755 756 /* the machine can also be in saved state for this property to change */ 757 AutoMutableOrSavedStateDependency adep(mParent); 758 758 if (FAILED(adep.rc())) return adep.rc(); 759 759 … … 780 780 } 781 781 782 STDMETHODIMP VRDEServer::COMGETTER(AllowMultiConnection) ( 783 BOOL *aAllowMultiConnection) 782 STDMETHODIMP VRDEServer::COMGETTER(AllowMultiConnection)(BOOL *aAllowMultiConnection) 784 783 { 785 784 CheckComArgOutPointerValid(aAllowMultiConnection); … … 795 794 } 796 795 797 STDMETHODIMP VRDEServer::COMSETTER(AllowMultiConnection) ( 798 BOOL aAllowMultiConnection) 799 { 800 AutoCaller autoCaller(this); 801 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 802 803 /* the machine needs to be mutable */ 804 AutoMutableStateDependency adep(mParent); 796 STDMETHODIMP VRDEServer::COMSETTER(AllowMultiConnection)(BOOL aAllowMultiConnection) 797 { 798 AutoCaller autoCaller(this); 799 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 800 801 /* the machine can also be in saved state for this property to change */ 802 AutoMutableOrSavedStateDependency adep(mParent); 805 803 if (FAILED(adep.rc())) return adep.rc(); 806 804 … … 825 823 } 826 824 827 STDMETHODIMP VRDEServer::COMGETTER(ReuseSingleConnection) ( 828 BOOL *aReuseSingleConnection) 825 STDMETHODIMP VRDEServer::COMGETTER(ReuseSingleConnection)(BOOL *aReuseSingleConnection) 829 826 { 830 827 CheckComArgOutPointerValid(aReuseSingleConnection); … … 840 837 } 841 838 842 STDMETHODIMP VRDEServer::COMSETTER(ReuseSingleConnection) ( 843 BOOL aReuseSingleConnection) 844 { 845 AutoCaller autoCaller(this); 846 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 847 848 /* the machine needs to be mutable */ 849 AutoMutableStateDependency adep(mParent); 839 STDMETHODIMP VRDEServer::COMSETTER(ReuseSingleConnection)(BOOL aReuseSingleConnection) 840 { 841 AutoCaller autoCaller(this); 842 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 843 844 /* the machine can also be in saved state for this property to change */ 845 AutoMutableOrSavedStateDependency adep(mParent); 850 846 if (FAILED(adep.rc())) return adep.rc(); 851 847 … … 870 866 } 871 867 872 STDMETHODIMP VRDEServer::COMGETTER(VRDEExtPack) 868 STDMETHODIMP VRDEServer::COMGETTER(VRDEExtPack)(BSTR *aExtPack) 873 869 { 874 870 CheckComArgOutPointerValid(aExtPack); … … 920 916 if (SUCCEEDED(hrc)) 921 917 { 922 /* the machine needs to be mutable */923 AutoMutable StateDependency adep(mParent);918 /* the machine can also be in saved state for this property to change */ 919 AutoMutableOrSavedStateDependency adep(mParent); 924 920 hrc = adep.rc(); 925 921 if (SUCCEEDED(hrc)) … … 995 991 /* sanity */ 996 992 AutoCaller autoCaller(this); 997 AssertComRCReturnVoid 993 AssertComRCReturnVoid(autoCaller.rc()); 998 994 999 995 /* sanity too */ 1000 AutoCaller peerCaller 1001 AssertComRCReturnVoid 996 AutoCaller peerCaller(mPeer); 997 AssertComRCReturnVoid(peerCaller.rc()); 1002 998 1003 999 /* lock both for writing since we modify both (mPeer is "master" so locked … … 1011 1007 { 1012 1008 /* attach new data to the peer and reshare it */ 1013 mPeer->mData.attach 1009 mPeer->mData.attach(mData); 1014 1010 } 1015 1011 } … … 1020 1016 * represented by @a aThat (locked for reading). 1021 1017 */ 1022 void VRDEServer::copyFrom 1023 { 1024 AssertReturnVoid 1018 void VRDEServer::copyFrom(VRDEServer *aThat) 1019 { 1020 AssertReturnVoid(aThat != NULL); 1025 1021 1026 1022 /* sanity */ 1027 1023 AutoCaller autoCaller(this); 1028 AssertComRCReturnVoid 1024 AssertComRCReturnVoid(autoCaller.rc()); 1029 1025 1030 1026 /* sanity too */ 1031 AutoCaller thatCaller 1032 AssertComRCReturnVoid 1027 AutoCaller thatCaller(aThat); 1028 AssertComRCReturnVoid(thatCaller.rc()); 1033 1029 1034 1030 /* peer is not modified, lock it for reading (aThat is "master" so locked … … 1038 1034 1039 1035 /* this will back up current data */ 1040 mData.assignCopy 1036 mData.assignCopy(aThat->mData); 1041 1037 } 1042 1038 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note:
See TracChangeset
for help on using the changeset viewer.