Changeset 16215 in vbox
- Timestamp:
- Jan 24, 2009 11:11:56 AM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/SharedFolderImpl.cpp
r15978 r16215 104 104 unconst (mMachine) = aMachine; 105 105 106 HRESULT rc = protectedInit (aMachine, aThat->m Data.mName,107 aThat->m Data.mHostPath, aThat->mData.mWritable);106 HRESULT rc = protectedInit (aMachine, aThat->m.name, 107 aThat->m.hostPath, aThat->m.writable); 108 108 109 109 /* Confirm a successful initialization when it's the case */ … … 222 222 mParent->addDependentChild (this); 223 223 224 unconst (m Data.mName) = aName;225 unconst (m Data.mHostPath) = hostPath;226 m Data.mWritable = aWritable;224 unconst (m.name) = aName; 225 unconst (m.hostPath) = hostPath; 226 m.writable = aWritable; 227 227 228 228 return S_OK; … … 263 263 264 264 /* mName is constant during life time, no need to lock */ 265 m Data.mName.cloneTo (aName);265 m.name.cloneTo (aName); 266 266 267 267 return S_OK; … … 276 276 277 277 /* mHostPath is constant during life time, no need to lock */ 278 m Data.mHostPath.cloneTo (aHostPath);278 m.hostPath.cloneTo (aHostPath); 279 279 280 280 return S_OK; … … 283 283 STDMETHODIMP SharedFolder::COMGETTER(Accessible) (BOOL *aAccessible) 284 284 { 285 CheckComArgOutPointerValid (aAccessible);285 CheckComArgOutPointerValid (aAccessible); 286 286 287 287 AutoCaller autoCaller (this); … … 291 291 292 292 /* check whether the host path exists */ 293 Utf8Str hostPath = Utf8Str (m Data.mHostPath);293 Utf8Str hostPath = Utf8Str (m.hostPath); 294 294 char hostPathFull [RTPATH_MAX]; 295 295 int vrc = RTPathExists (hostPath) ? RTPathReal (hostPath, hostPathFull, … … 302 302 } 303 303 304 LogWarningThisFunc (("'%s' is not accessible (%Rrc)\n", hostPath.raw(), vrc)); 304 AutoWriteLock alock (this); 305 306 m.lastAccessError = BstrFmt ( 307 tr ("'%s' is not accessible (%Rrc)"), hostPath.raw(), vrc); 308 309 LogWarningThisFunc (("m.lastAccessError=\"%ls\"\n", m.lastAccessError.raw())); 305 310 306 311 *aAccessible = FALSE; … … 312 317 CheckComArgOutPointerValid(aWritable); 313 318 314 *aWritable = mData.mWritable; 315 316 return S_OK; 317 } 319 *aWritable = m.writable; 320 321 return S_OK; 322 } 323 324 STDMETHODIMP SharedFolder::COMGETTER(LastAccessError) (BSTR *aLastAccessError) 325 { 326 CheckComArgOutPointerValid (aLastAccessError); 327 328 AutoCaller autoCaller (this); 329 CheckComRCReturnRC (autoCaller.rc()); 330 331 AutoReadLock alock (this); 332 333 m.lastAccessError.cloneTo (aLastAccessError); 334 335 return S_OK; 336 } 337 318 338 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r16212 r16215 11419 11419 <interface 11420 11420 name="ISharedFolder" extends="$unknown" 11421 uuid=" 8b0c5f70-9139-4f97-a421-64d5e9c335d5"11421 uuid="ef41869b-ef31-4b30-8e8f-95af35c0e378" 11422 11422 wsmap="struct" 11423 11423 > … … 11494 11494 Whether the folder defined by the host path is writable or 11495 11495 not. 11496 </desc> 11497 </attribute> 11498 11499 <attribute name="lastAccessError" type="wstring" readonly="yes"> 11500 <desc> 11501 Text message that represents the result of the last accessibility 11502 check. 11503 11504 Accessibility checks are performed each time the <link to="#accessible"/> 11505 attribute is read. A @c null string is returned if the last 11506 accessibility check was successful. A non-null string indicates a 11507 failure and should normally describe a reason of the failure (for 11508 example, a file read error). 11496 11509 </desc> 11497 11510 </attribute> -
trunk/src/VBox/Main/include/SharedFolderImpl.h
r15978 r16215 43 43 Data() {} 44 44 45 const Bstr mName; 46 const Bstr mHostPath; 47 BOOL mWritable; 45 const Bstr name; 46 const Bstr hostPath; 47 BOOL writable; 48 Bstr lastAccessError; 48 49 }; 49 50 … … 78 79 STDMETHOD(COMGETTER(Accessible)) (BOOL *aAccessible); 79 80 STDMETHOD(COMGETTER(Writable)) (BOOL *aWritable); 81 STDMETHOD(COMGETTER(LastAccessError)) (BSTR *aLastAccessError); 80 82 81 83 // public methods for internal purposes only … … 85 87 // (ensure there is a caller added before calling them!) 86 88 87 const Bstr &name() const { return m Data.mName; }88 const Bstr &hostPath() const { return m Data.mHostPath; }89 BOOL writable() const { return m Data.mWritable; }89 const Bstr &name() const { return m.name; } 90 const Bstr &hostPath() const { return m.hostPath; } 91 BOOL writable() const { return m.writable; } 90 92 91 93 // for VirtualBoxSupportErrorInfoImpl … … 106 108 const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox; 107 109 108 Data m Data;110 Data m; 109 111 }; 110 112
Note:
See TracChangeset
for help on using the changeset viewer.