Changeset 69775 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Nov 20, 2017 4:36:34 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119177
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/VirtualBoxSDSImpl.h
r69741 r69775 72 72 }; 73 73 74 #ifdef VBOX_WITH_SDS_PLAN_B 75 /** 76 * Per user data. 77 */ 78 class VBoxSDSPerUserData 79 { 80 public: 81 /** The SID (secure identifier) for the user. This is the key. */ 82 com::Utf8Str m_strUserSid; 83 /** The user name (if we could get it). */ 84 com::Utf8Str m_strUsername; 85 /** The VBoxSVC chosen to instantiate CLSID_VirtualBox. 86 * This is NULL if not set. */ 87 ComPtr<IVBoxSVCRegistration> m_ptrTheChosenOne; 88 /** Critical section protecting everything here. */ 89 RTCRITSECT m_Lock; 90 91 92 public: 93 VBoxSDSPerUserData(com::Utf8Str const &a_rStrUserSid, com::Utf8Str const &a_rStrUsername) 94 : m_strUserSid(a_rStrUserSid), m_strUsername(a_rStrUsername) 95 { 96 RTCritSectInit(&m_Lock); 97 } 98 99 ~VBoxSDSPerUserData() 100 { 101 RTCritSectDelete(&m_Lock); 102 } 103 104 void i_lock() 105 { 106 RTCritSectEnter(&m_Lock); 107 } 108 109 void i_unlock() 110 { 111 RTCritSectLeave(&m_Lock); 112 } 113 }; 114 #endif 115 116 74 117 class ATL_NO_VTABLE VirtualBoxSDS : 75 118 public VirtualBoxSDSWrap … … 78 121 #endif 79 122 { 123 #ifdef VBOX_WITH_SDS_PLAN_B 124 private: 125 typedef std::map<com::Utf8Str, VBoxSDSPerUserData *> UserDataMap_T; 126 /** Per user data map (key is SID string). */ 127 UserDataMap_T m_UserDataMap; 128 /** Lock protecting m_UserDataMap.*/ 129 RTCRITSECTRW m_MapCritSect; 130 #endif 131 80 132 public: 81 133 … … 111 163 112 164 /* SDS plan B interfaces: */ 113 HRESULT registerVBoxSVC(const ComPtr<IVBoxSVC > &aVBoxSVC, LONG aPid, ComPtr<IUnknown> &aExistingVirtualBox);114 HRESULT deregisterVBoxSVC(const ComPtr<IVBoxSVC > &aVBoxSVC, LONG aPid);165 HRESULT registerVBoxSVC(const ComPtr<IVBoxSVCRegistration> &aVBoxSVC, LONG aPid, ComPtr<IUnknown> &aExistingVirtualBox); 166 HRESULT deregisterVBoxSVC(const ComPtr<IVBoxSVCRegistration> &aVBoxSVC, LONG aPid); 115 167 116 168 // Wrapped IVirtualBoxSDS methods 117 169 118 // Inner methods 119 170 // Private methods 171 172 /** 173 * Gets the cliedt user SID of the 174 */ 175 static bool i_getClientUserSID(com::Utf8Str *a_pStrSid, com::Utf8Str *a_pStrUsername); 176 177 #ifdef VBOX_WITH_SDS_PLAN_B 178 /** 179 * Looks up the given user. 180 * 181 * @returns Pointer to the LOCKED per user data. NULL if not found. 182 * @param a_rStrUserSid The user SID. 183 */ 184 VBoxSDSPerUserData *i_lookupPerUserData(com::Utf8Str const &a_rUserSid); 185 186 /** 187 * Looks up the given user, creating it if not found 188 * 189 * @returns Pointer to the LOCKED per user data. NULL on allocation error. 190 * @param a_rStrUserSid The user SID. 191 * @param a_rStrUsername The user name if available. 192 */ 193 VBoxSDSPerUserData *i_lookupOrCreatePerUserData(com::Utf8Str const &a_rStrUserSid, com::Utf8Str const &a_rStrUsername); 194 195 #else 120 196 /** 121 197 * Gets the current user name of current thread … … 131 207 132 208 /** 133 *Thread that periodically checks items in cache and cleans obsolete items134 */209 * Thread that periodically checks items in cache and cleans obsolete items 210 */ 135 211 static DWORD WINAPI CheckCacheThread(LPVOID); 136 212 … … 139 215 static VirtualBoxCache m_cache; 140 216 friend VirtualBoxToken; 141 142 #ifdef VBOX_WITH_SDS_PLAN_B143 // quick and dirty for checking the concept.144 ComPtr<IVBoxSVC> m_ptrVBoxSVC;145 ComPtr<IVBoxSVC> m_ptrOtherVBoxSVC;146 217 #endif 147 218 };
Note:
See TracChangeset
for help on using the changeset viewer.