Changeset 15978 in vbox
- Timestamp:
- Jan 15, 2009 9:15:35 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 41635
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/SharedFolderImpl.cpp
r15965 r15978 104 104 unconst (mMachine) = aMachine; 105 105 106 HRESULT rc = protectedInit (aMachine, aThat->m .name,107 aThat->m .hostPath, aThat->m.writable);106 HRESULT rc = protectedInit (aMachine, aThat->mData.mName, 107 aThat->mData.mHostPath, aThat->mData.mWritable); 108 108 109 109 /* Confirm a successful initialization when it's the case */ … … 222 222 mParent->addDependentChild (this); 223 223 224 unconst (m .name) = aName;225 unconst (m .hostPath) = hostPath;226 m .writable = aWritable;224 unconst (mData.mName) = aName; 225 unconst (mData.mHostPath) = hostPath; 226 mData.mWritable = aWritable; 227 227 228 228 return S_OK; … … 263 263 264 264 /* mName is constant during life time, no need to lock */ 265 m .name.cloneTo (aName);265 mData.mName.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 .hostPath.cloneTo (aHostPath);278 mData.mHostPath.cloneTo (aHostPath); 279 279 280 280 return S_OK; … … 283 283 STDMETHODIMP SharedFolder::COMGETTER(Accessible) (BOOL *aAccessible) 284 284 { 285 CheckComArgOutPointerValid 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 .hostPath);293 Utf8Str hostPath = Utf8Str (mData.mHostPath); 294 294 char hostPathFull [RTPATH_MAX]; 295 295 int vrc = RTPathExists (hostPath) ? RTPathReal (hostPath, hostPathFull, … … 302 302 } 303 303 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())); 304 LogWarningThisFunc (("'%s' is not accessible (%Rrc)\n", hostPath.raw(), vrc)); 310 305 311 306 *aAccessible = FALSE; … … 317 312 CheckComArgOutPointerValid(aWritable); 318 313 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 314 *aWritable = mData.mWritable; 315 316 return S_OK; 317 } 338 318 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r15965 r15978 11046 11046 <interface 11047 11047 name="ISharedFolder" extends="$unknown" 11048 uuid=" ef41869b-ef31-4b30-8e8f-95af35c0e378"11048 uuid="8b0c5f70-9139-4f97-a421-64d5e9c335d5" 11049 11049 wsmap="struct" 11050 11050 > … … 11121 11121 Whether the folder defined by the host path is writable or 11122 11122 not. 11123 </desc>11124 </attribute>11125 11126 <attribute name="lastAccessError" type="wstring" readonly="yes">11127 <desc>11128 Text message that represents the result of the last accessibility11129 check.11130 11131 Accessibility checks are performed each time the <link to="#accessible"/>11132 attribute is read. A @c null string is returned if the last11133 accessibility check was successful. A non-null string indicates a11134 failure and should normally describe a reason of the failure (for11135 example, a file read error).11136 11123 </desc> 11137 11124 </attribute> -
trunk/src/VBox/Main/include/SharedFolderImpl.h
r15965 r15978 43 43 Data() {} 44 44 45 const Bstr name; 46 const Bstr hostPath; 47 BOOL writable; 48 Bstr lastAccessError; 45 const Bstr mName; 46 const Bstr mHostPath; 47 BOOL mWritable; 49 48 }; 50 49 … … 79 78 STDMETHOD(COMGETTER(Accessible)) (BOOL *aAccessible); 80 79 STDMETHOD(COMGETTER(Writable)) (BOOL *aWritable); 81 STDMETHOD(COMGETTER(LastAccessError)) (BSTR *aLastAccessError);82 80 83 81 // public methods for internal purposes only … … 87 85 // (ensure there is a caller added before calling them!) 88 86 89 const Bstr &name() const { return m .name; }90 const Bstr &hostPath() const { return m .hostPath; }91 BOOL writable() const { return m .writable; }87 const Bstr &name() const { return mData.mName; } 88 const Bstr &hostPath() const { return mData.mHostPath; } 89 BOOL writable() const { return mData.mWritable; } 92 90 93 91 // for VirtualBoxSupportErrorInfoImpl … … 108 106 const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox; 109 107 110 Data m ;108 Data mData; 111 109 }; 112 110
Note:
See TracChangeset
for help on using the changeset viewer.