Changeset 69782 in vbox
- Timestamp:
- Nov 20, 2017 6:53:29 PM (7 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r69775 r69782 24374 24374 <if target="midl"> 24375 24375 24376 <!-- VBOX_SDS_PLAN_B start -->24377 24376 <!-- 24378 24377 // IVBoxSVC … … 24400 24399 24401 24400 </interface> 24402 <!-- VBOX_SDS_PLAN_B end -->24403 24401 24404 24402 <!-- … … 24407 24405 --> 24408 24406 24407 <!-- This is now an internal interface, it doesn't need to be dual either. --> 24409 24408 <interface 24410 24409 name="IVirtualBoxSDS" extends="$unknown" 24411 uuid=" 28932695-fb72-4708-8904-e1077dac7f9a"24410 uuid="787d20ed-faf3-4170-6697-3a2a7de6e086" 24412 24411 wsmap="suppress" 24413 reservedMethods=" 4" reservedAttributes="8"24412 reservedMethods="0" reservedAttributes="0" 24414 24413 > 24415 24414 <desc> … … 24422 24421 </desc> 24423 24422 24424 <method name="getVirtualBox" >24425 <param name="result" type="IVirtualBox" dir="out" >24426 <desc>24427 Reference to the server-side API root object.24428 </desc>24429 </param>24430 <param name="token" type="IToken" dir="out">24431 <desc>24432 Reference to the token object given to client and linked with IVirtualBox.24433 Client should keep it till the end.24434 </desc>24435 </param>24436 </method>24437 24438 <!-- VBOX_SDS_PLAN_B start -->24439 24423 <method name="registerVBoxSVC"> 24440 24424 <desc>Registers a VBoxSVC instance with the SDS.</desc> … … 24461 24445 </param> 24462 24446 </method> 24463 <!-- VBOX_SDS_PLAN_B end -->24464 24447 24465 24448 </interface> -
trunk/src/VBox/Main/include/VirtualBoxSDSImpl.h
r69775 r69782 26 26 #endif 27 27 28 /**29 * The MediumLockToken class automates cleanup of a Medium lock.30 */31 class ATL_NO_VTABLE VirtualBoxToken :32 public TokenWrap33 {34 public:35 28 36 DECLARE_EMPTY_CTOR_DTOR(VirtualBoxToken)37 38 HRESULT FinalConstruct();39 void FinalRelease();40 41 // public initializer/uninitializer for internal purposes only42 HRESULT init(const std::wstring& wstrUserName);43 void uninit();44 45 /**46 * Fabrique method to create and initialize COM token object.47 *48 * @param aToken Pointer to result Token COM object.49 * @param wstrUserName User name of client for that we create the token50 */51 static HRESULT CreateToken(ComPtr<IToken>& aToken, const std::wstring& wstrUserName);52 53 // Trace COM reference counting in debug mode54 #ifdef RT_STRICT55 virtual ULONG InternalAddRef();56 virtual ULONG InternalRelease();57 #endif58 59 private:60 61 // wrapped IToken methods62 HRESULT abandon(AutoCaller &aAutoCaller);63 HRESULT dummy();64 65 // data66 struct Data67 {68 std::wstring wstrUserName;69 };70 71 Data m;72 };73 74 #ifdef VBOX_WITH_SDS_PLAN_B75 29 /** 76 30 * Per user data. … … 112 66 } 113 67 }; 114 #endif115 68 116 69 … … 121 74 #endif 122 75 { 123 #ifdef VBOX_WITH_SDS_PLAN_B124 76 private: 125 77 typedef std::map<com::Utf8Str, VBoxSDSPerUserData *> UserDataMap_T; … … 128 80 /** Lock protecting m_UserDataMap.*/ 129 81 RTCRITSECTRW m_MapCritSect; 130 #endif131 82 132 83 public: … … 153 104 private: 154 105 155 // Wrapped IVirtualBoxSDS properties 156 157 /** 158 * Returns the instance of VirtualBox for client. 159 * It impersonates client and returns his VirtualBox instance 160 * either from cahce or makes new one. 161 */ 162 HRESULT getVirtualBox(ComPtr<IVirtualBox> &aVirtualBox, ComPtr<IToken> &aToken); 163 164 /* SDS plan B interfaces: */ 106 // Wrapped IVirtualBoxSDS methods 165 107 HRESULT registerVBoxSVC(const ComPtr<IVBoxSVCRegistration> &aVBoxSVC, LONG aPid, ComPtr<IUnknown> &aExistingVirtualBox); 166 108 HRESULT deregisterVBoxSVC(const ComPtr<IVBoxSVCRegistration> &aVBoxSVC, LONG aPid); 167 109 168 // Wrapped IVirtualBoxSDS methods169 110 170 111 // Private methods 171 112 172 113 /** 173 * Gets the clie dt user SID of the114 * Gets the client user SID of the 174 115 */ 175 static bool i_getClientUserS ID(com::Utf8Str *a_pStrSid, com::Utf8Str *a_pStrUsername);116 static bool i_getClientUserSid(com::Utf8Str *a_pStrSid, com::Utf8Str *a_pStrUsername); 176 117 177 #ifdef VBOX_WITH_SDS_PLAN_B178 118 /** 179 119 * Looks up the given user. … … 192 132 */ 193 133 VBoxSDSPerUserData *i_lookupOrCreatePerUserData(com::Utf8Str const &a_rStrUserSid, com::Utf8Str const &a_rStrUsername); 194 195 #else196 /**197 * Gets the current user name of current thread198 */199 int GetCurrentUserName(std::wstring& wstrUserName);200 201 /**202 * Prints current user name of this thread to the log203 * @param prefix string fragment that will be inserted at the beginning204 * of the logging line205 */206 void LogUserName(char *prefix);207 208 /**209 * Thread that periodically checks items in cache and cleans obsolete items210 */211 static DWORD WINAPI CheckCacheThread(LPVOID);212 213 // data fields214 class VirtualBoxCache;215 static VirtualBoxCache m_cache;216 friend VirtualBoxToken;217 #endif218 134 }; 219 135
Note:
See TracChangeset
for help on using the changeset viewer.