Changeset 6379 in vbox for trunk/src/VBox
- Timestamp:
- Jan 18, 2008 5:25:20 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27322
- Location:
- trunk/src/VBox
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r6285 r6379 592 592 RTPrintf("VBoxManage sharedfolder add <vmname>|<uuid>\n" 593 593 " -name <name> -hostpath <hostpath>\n" 594 " [-transient] \n"594 " [-transient] [-readonly]\n" 595 595 "\n"); 596 596 } … … 1907 1907 CHECK_ERROR_RET(sfEnum, GetNext(sf.asOutParam()), rc); 1908 1908 Bstr name, hostPath; 1909 BOOL writable; 1909 1910 sf->COMGETTER(Name)(name.asOutParam()); 1910 1911 sf->COMGETTER(HostPath)(hostPath.asOutParam()); 1912 sf->COMGETTER(Writable)(&writable); 1911 1913 if (!numSharedFolders && details != VMINFO_MACHINEREADABLE) 1912 1914 RTPrintf("\n\n"); … … 1919 1921 } 1920 1922 else 1921 RTPrintf("Name: '%lS', Host path: '%lS' (machine mapping)\n", name.raw(), hostPath.raw()); 1923 RTPrintf("Name: '%lS', Host path: '%lS' (machine mapping), %s\n", 1924 name.raw(), hostPath.raw(), writable ? "writable" : "readonly"); 1922 1925 ++numSharedFolders; 1923 1926 CHECK_ERROR_RET(sfEnum, HasMore(&fMore), rc); … … 7022 7025 char *hostpath = NULL; 7023 7026 bool fTransient = false; 7027 bool fWritable = true; 7024 7028 7025 7029 for (int i = 2; i < argc; i++) … … 7042 7046 i++; 7043 7047 hostpath = argv[i]; 7044 7048 } 7049 else if (strcmp(argv[i], "-readonly") == 0) 7050 { 7051 fWritable = false; 7045 7052 } 7046 7053 else if (strcmp(argv[i], "-transient") == 0) … … 7071 7078 CHECK_ERROR_RET(aSession, COMGETTER(Console)(console.asOutParam()), 1); 7072 7079 7073 CHECK_ERROR(console, CreateSharedFolder(Bstr(name), Bstr(hostpath) ));7080 CHECK_ERROR(console, CreateSharedFolder(Bstr(name), Bstr(hostpath), fWritable)); 7074 7081 7075 7082 if (console) … … 7084 7091 aSession->COMGETTER(Machine)(machine.asOutParam()); 7085 7092 7086 CHECK_ERROR(machine, CreateSharedFolder(Bstr(name), Bstr(hostpath) ));7093 CHECK_ERROR(machine, CreateSharedFolder(Bstr(name), Bstr(hostpath), fWritable)); 7087 7094 7088 7095 if (SUCCEEDED(rc)) -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui
r6039 r6379 241 241 <function returnType="int">dialogType() {return mDialogType;}</function> 242 242 <function access="private">removeSharedFolder( const QString &, const QString &, VBoxSharedFoldersSettings::SFDialogType )</function> 243 <function access="private">createSharedFolder( const QString &, const QString &, VBoxSharedFoldersSettings::SFDialogType )</function>243 <function access="private">createSharedFolder( const QString &, const QString &, bool, VBoxSharedFoldersSettings::SFDialogType )</function> 244 244 <function>getFromGlobal()</function> 245 245 <function>getFromMachine( const CMachine & )</function> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui.h
r5999 r6379 404 404 void VBoxSharedFoldersSettings::createSharedFolder (const QString & aName, 405 405 const QString & aPath, 406 bool aWritable, 406 407 SFDialogType aType) 407 408 { … … 417 418 { 418 419 Assert (!mMachine.isNull()); 419 mMachine.CreateSharedFolder (aName, aPath );420 mMachine.CreateSharedFolder (aName, aPath, aWritable); 420 421 if (!mMachine.isOk()) 421 422 vboxProblem().cannotCreateSharedFolder (this, mMachine, … … 426 427 { 427 428 Assert (!mConsole.isNull()); 428 mConsole.CreateSharedFolder (aName, aPath );429 mConsole.CreateSharedFolder (aName, aPath, aWritable); 429 430 if (!mConsole.isOk()) 430 431 vboxProblem().cannotCreateSharedFolder (this, mConsole, … … 573 574 if (item && !item->getText (0).isNull() && !item->getText (1).isNull() 574 575 && item->getText (2) == "edited") 575 createSharedFolder (item->getText (0), item->getText (1), t ype);576 createSharedFolder (item->getText (0), item->getText (1), true, type); 576 577 iterator = iterator->nextSibling(); 577 578 } -
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r5999 r6379 28 28 * 29 29 */ 30 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName )30 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName, uint32_t fWritable) 31 31 { 32 32 int i; … … 73 73 FolderMapping[i].fValid = true; 74 74 FolderMapping[i].cMappings = 0; 75 FolderMapping[i].fWritable = fWritable; 75 76 76 77 /* Check if the host file system is case sensitive */ … … 232 233 } 233 234 235 int vbsfMappingsQueryWritable (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable) 236 { 237 int rc = VINF_SUCCESS; 238 239 LogFlow(("vbsfMappingsQueryWritable: pClient = %p, root = %d\n", 240 pClient, root)); 241 242 if (root >= SHFL_MAX_MAPPINGS) 243 return VERR_INVALID_PARAMETER; 244 245 if (FolderMapping[root].fValid == true) 246 *fWritable = FolderMapping[root].fWritable; 247 else 248 rc = VERR_FILE_NOT_FOUND; 249 250 LogFlow(("vbsfMappingsQuery:Writable return rc = %Vrc\n", rc)); 251 252 return rc; 253 } 254 234 255 static int vbsfQueryMappingIndex (PRTUTF16 utf16Name, size_t *pIndex) 235 256 { -
trunk/src/VBox/HostServices/SharedFolders/mappings.h
r5999 r6379 31 31 bool fHostCaseSensitive; 32 32 bool fGuestCaseSensitive; 33 bool fWritable; 33 34 } MAPPING, *PMAPPING; 34 35 … … 37 38 bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping); 38 39 39 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName );40 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName, uint32_t fWritable); 40 41 int vbsfMappingsRemove (PSHFLSTRING pMapName); 41 42 42 43 int vbsfMappingsQuery (SHFLCLIENTDATA *pClient, SHFLMAPPING *pMappings, uint32_t *pcMappings); 43 44 int vbsfMappingsQueryName (SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pString); 45 int vbsfMappingsQueryWritable (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable); 44 46 45 47 int vbsfMapFolder (SHFLCLIENTDATA *pClient, PSHFLSTRING pszMapName, RTUCS2 delimiter, bool fCaseSensitive, SHFLROOT *pRoot); -
trunk/src/VBox/HostServices/SharedFolders/service.cpp
r5999 r6379 1097 1097 else if ( paParms[0].type != VBOX_HGCM_SVC_PARM_PTR /* host folder name */ 1098 1098 || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* guest map name */ 1099 || paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* fWritable */ 1099 1100 ) 1100 1101 { … … 1108 1109 SHFLSTRING *pMapName = (SHFLSTRING *)paParms[1].u.pointer.addr; 1109 1110 uint32_t cbStringMap = paParms[1].u.pointer.size; 1111 uint32_t fWritable = paParms[2].u.uint32; 1110 1112 1111 1113 /* Verify parameters values. */ … … 1121 1123 { 1122 1124 /* Execute the function. */ 1123 rc = vbsfMappingsAdd (pFolderName, pMapName );1125 rc = vbsfMappingsAdd (pFolderName, pMapName, fWritable); 1124 1126 1125 1127 if (VBOX_SUCCESS(rc)) -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r5999 r6379 1018 1018 } 1019 1019 } 1020 1021 /* write access requested? */ 1022 if (pParms->CreateFlags & ( SHFL_CF_ACT_REPLACE_IF_EXISTS 1023 | SHFL_CF_ACT_OVERWRITE_IF_EXISTS 1024 | SHFL_CF_ACT_CREATE_IF_NEW 1025 | SHFL_CF_ACCESS_WRITE)) 1026 { 1027 /* is the guest allowed to write to this share? */ 1028 bool fWritable; 1029 rc = vbsfMappingsQueryWritable (pClient, root, &fWritable); 1030 if (RT_FAILURE(rc) || !fWritable) 1031 return VERR_WRITE_PROTECT; 1032 } 1033 1020 1034 if (BIT_FLAG(pParms->CreateFlags, SHFL_CF_DIRECTORY)) 1021 1035 { -
trunk/src/VBox/Main/ConsoleImpl.cpp
r6375 r6379 882 882 vrc = SSMR3PutStrZ (pSSM, hostPath); 883 883 AssertRC (vrc); 884 885 // XXX 886 // vrc = SSMR3PutBool (pSSM, folder->writable()); 887 // AssertRC (vrc); 884 888 } 885 889 … … 953 957 ComObjPtr <SharedFolder> sharedFolder; 954 958 sharedFolder.createObject(); 955 HRESULT rc = sharedFolder->init (that, name, hostPath );959 HRESULT rc = sharedFolder->init (that, name, hostPath, PR_TRUE); /* TODO: fWritable */ 956 960 AssertComRCReturn (rc, VERR_INTERNAL_ERROR); 957 961 … … 1315 1319 for (SharedFolderMap::const_iterator it = mSharedFolders.begin(); 1316 1320 it != mSharedFolders.end(); ++ it) 1317 sharedFolders [it->first] = it->second->hostPath();1321 sharedFolders [it->first] = SharedFolderData(it->second->hostPath(), it->second->writable()); 1318 1322 } 1319 1323 … … 1991 1995 1992 1996 STDMETHODIMP 1993 Console::CreateSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath )1997 Console::CreateSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable) 1994 1998 { 1995 1999 if (!aName || !aHostPath) … … 2019 2023 2020 2024 sharedFolder.createObject(); 2021 rc = sharedFolder->init (this, aName, aHostPath );2025 rc = sharedFolder->init (this, aName, aHostPath, aWritable); 2022 2026 CheckComRCReturnRC (rc); 2023 2027 … … 2047 2051 2048 2052 /* second, create the given folder */ 2049 rc = createSharedFolder (aName, aHostPath);2053 rc = createSharedFolder (aName, SharedFolderData (aHostPath, aWritable)); 2050 2054 CheckComRCReturnRC (rc); 2051 2055 } … … 4195 4199 Bstr name; 4196 4200 Bstr hostPath; 4201 BOOL writable; 4197 4202 4198 4203 rc = folder->COMGETTER(Name) (name.asOutParam()); … … 4200 4205 rc = folder->COMGETTER(HostPath) (hostPath.asOutParam()); 4201 4206 CheckComRCBreakRC (rc); 4202 4203 mMachineSharedFolders.insert (std::make_pair (name, hostPath)); 4207 rc = folder->COMGETTER(Writable) (&writable); 4208 4209 mMachineSharedFolders.insert (std::make_pair (name, SharedFolderData (hostPath, writable))); 4204 4210 4205 4211 /* send changes to HGCM if the VM is running */ … … 4208 4214 { 4209 4215 SharedFolderDataMap::iterator it = oldFolders.find (name); 4210 if (it == oldFolders.end() || it->second != hostPath)4216 if (it == oldFolders.end() || it->second.mHostPath != hostPath) 4211 4217 { 4212 4218 /* a new machine folder is added or … … 4223 4229 rc = removeSharedFolder (name); 4224 4230 /* create the new machine folder */ 4225 rc = createSharedFolder (name, hostPath);4231 rc = createSharedFolder (name, SharedFolderData (hostPath, writable)); 4226 4232 } 4227 4233 } … … 4302 4308 * @note Doesn't lock anything. 4303 4309 */ 4304 HRESULT Console::createSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath)4310 HRESULT Console::createSharedFolder (INPTR BSTR aName, SharedFolderData aData) 4305 4311 { 4306 4312 ComAssertRet (aName && *aName, E_FAIL); 4307 ComAssertRet (a HostPath && *aHostPath, E_FAIL);4313 ComAssertRet (aData.mHostPath && *aData.mHostPath, E_FAIL); 4308 4314 4309 4315 /* sanity checks */ … … 4311 4317 AssertReturn (mVMMDev->isShFlActive(), E_FAIL); 4312 4318 4313 VBOXHGCMSVCPARM parms[ 2];4319 VBOXHGCMSVCPARM parms[SHFL_CPARMS_ADD_MAPPING]; 4314 4320 SHFLSTRING *pFolderName, *pMapName; 4315 4321 size_t cbString; … … 4317 4323 Log (("Adding shared folder '%ls' -> '%ls'\n", aName, aHostPath)); 4318 4324 4319 cbString = (RTStrUcs2Len (a HostPath) + 1) * sizeof (RTUCS2);4325 cbString = (RTStrUcs2Len (aData.mHostPath) + 1) * sizeof (RTUCS2); 4320 4326 if (cbString >= UINT16_MAX) 4321 4327 return setError (E_INVALIDARG, tr ("The name is too long")); 4322 4328 pFolderName = (SHFLSTRING *) RTMemAllocZ (sizeof (SHFLSTRING) + cbString); 4323 4329 Assert (pFolderName); 4324 memcpy (pFolderName->String.ucs2, a HostPath, cbString);4330 memcpy (pFolderName->String.ucs2, aData.mHostPath, cbString); 4325 4331 4326 4332 pFolderName->u16Size = (uint16_t)cbString; … … 4348 4354 parms[1].u.pointer.size = sizeof (SHFLSTRING) + (uint16_t)cbString; 4349 4355 4356 parms[2].type = VBOX_HGCM_SVC_PARM_32BIT; 4357 parms[2].u.uint32 = aData.mWritable; 4358 4350 4359 int vrc = mVMMDev->hgcmHostCall ("VBoxSharedFolders", 4351 4360 SHFL_FN_ADD_MAPPING, 4352 2, &parms[0]);4361 SHFL_CPARMS_ADD_MAPPING, &parms[0]); 4353 4362 RTMemFree (pFolderName); 4354 4363 RTMemFree (pMapName); … … 4358 4367 tr ("Could not create a shared folder '%ls' " 4359 4368 "mapped to '%ls' (%Vrc)"), 4360 aName, a HostPath, vrc);4369 aName, aData.mHostPath.raw(), vrc); 4361 4370 4362 4371 return S_OK; -
trunk/src/VBox/Main/MachineImpl.cpp
r6367 r6379 2372 2372 2373 2373 STDMETHODIMP 2374 Machine::CreateSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath )2374 Machine::CreateSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable) 2375 2375 { 2376 2376 if (!aName || !aHostPath) … … 2392 2392 2393 2393 sharedFolder.createObject(); 2394 rc = sharedFolder->init (machine(), aName, aHostPath );2394 rc = sharedFolder->init (machine(), aName, aHostPath, aWritable); 2395 2395 CheckComRCReturnRC (rc); 2396 2396 … … 4314 4314 Bstr hostPath = (*it).stringValue ("hostPath"); 4315 4315 4316 rc = CreateSharedFolder (name, hostPath); 4316 bool writable = (*it).value <bool> ("writable"); 4317 4318 rc = CreateSharedFolder (name, hostPath, writable); 4317 4319 CheckComRCReturnRC (rc); 4318 4320 } … … 5661 5663 folderNode.setValue <Bstr> ("name", folder->name()); 5662 5664 folderNode.setValue <Bstr> ("hostPath", folder->hostPath()); 5665 folderNode.setValue <bool> ("writable", folder->writable()); 5663 5666 } 5664 5667 } -
trunk/src/VBox/Main/SharedFolderImpl.cpp
r5999 r6379 58 58 * @param aName logical name of the shared folder 59 59 * @param aHostPath full path to the shared folder on the host 60 * @param aWritable writable if true, readonly otherwise 60 61 * 61 62 * @return COM result indicator 62 63 */ 63 64 HRESULT SharedFolder::init (Machine *aMachine, 64 const BSTR aName, const BSTR aHostPath )65 const BSTR aName, const BSTR aHostPath, bool aWritable) 65 66 { 66 67 /* Enclose the state transition NotReady->InInit->Ready */ … … 70 71 unconst (mMachine) = aMachine; 71 72 72 HRESULT rc = protectedInit (aMachine, aName, aHostPath );73 HRESULT rc = protectedInit (aMachine, aName, aHostPath, aWritable); 73 74 74 75 /* Confirm a successful initialization when it's the case */ … … 100 101 101 102 HRESULT rc = protectedInit (aMachine, aThat->mData.mName, 102 aThat->mData.mHostPath );103 aThat->mData.mHostPath, aThat->mData.mWritable); 103 104 104 105 /* Confirm a successful initialization when it's the case */ … … 115 116 * @param aName logical name of the shared folder 116 117 * @param aHostPath full path to the shared folder on the host 118 * @param aWritable writable if true, readonly otherwise 117 119 * 118 120 * @return COM result indicator 119 121 */ 120 122 HRESULT SharedFolder::init (Console *aConsole, 121 const BSTR aName, const BSTR aHostPath )123 const BSTR aName, const BSTR aHostPath, bool aWritable) 122 124 { 123 125 /* Enclose the state transition NotReady->InInit->Ready */ … … 127 129 unconst (mConsole) = aConsole; 128 130 129 HRESULT rc = protectedInit (aConsole, aName, aHostPath );131 HRESULT rc = protectedInit (aConsole, aName, aHostPath, aWritable); 130 132 131 133 /* Confirm a successful initialization when it's the case */ … … 142 144 * @param aName logical name of the shared folder 143 145 * @param aHostPath full path to the shared folder on the host 146 * @param aWritable writable if true, readonly otherwise 144 147 * 145 148 * @return COM result indicator 146 149 */ 147 150 HRESULT SharedFolder::init (VirtualBox *aVirtualBox, 148 const BSTR aName, const BSTR aHostPath )151 const BSTR aName, const BSTR aHostPath, bool aWritable) 149 152 { 150 153 /* Enclose the state transition NotReady->InInit->Ready */ … … 154 157 unconst (mVirtualBox) = aVirtualBox; 155 158 156 HRESULT rc = protectedInit (aVirtualBox, aName, aHostPath );159 HRESULT rc = protectedInit (aVirtualBox, aName, aHostPath, aWritable); 157 160 158 161 /* Confirm a successful initialization when it's the case */ … … 170 173 */ 171 174 HRESULT SharedFolder::protectedInit (VirtualBoxBaseWithChildrenNEXT *aParent, 172 const BSTR aName, const BSTR aHostPath) 173 { 174 LogFlowThisFunc (("aName={%ls}, aHostPath={%ls}\n", aName, aHostPath)); 175 const BSTR aName, const BSTR aHostPath, bool aWritable) 176 { 177 LogFlowThisFunc (("aName={%ls}, aHostPath={%ls}, aWritable={%d}\n", 178 aName, aHostPath, aWritable)); 175 179 176 180 ComAssertRet (aParent && aName && aHostPath, E_INVALIDARG); … … 216 220 unconst (mData.mName) = aName; 217 221 unconst (mData.mHostPath) = hostPath; 222 mData.mWritable = aWritable; 218 223 219 224 return S_OK; … … 307 312 } 308 313 314 STDMETHODIMP SharedFolder::COMGETTER(Writable) (BOOL *aWritable) 315 { 316 if (!aWritable) 317 return E_POINTER; 318 319 *aWritable = mData.mWritable; 320 321 return S_OK; 322 } -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r6367 r6379 1575 1575 1576 1576 STDMETHODIMP 1577 VirtualBox::CreateSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath )1577 VirtualBox::CreateSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable) 1578 1578 { 1579 1579 if (!aName || !aHostPath) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r6265 r6379 1573 1573 <desc>Full path to the shared folder in the host file system.</desc> 1574 1574 </param> 1575 <param name="writable" type="boolean" dir="in"> 1576 <desc>Whether the share is writable or readonly</desc> 1577 </param> 1575 1578 </method> 1576 1579 … … 3046 3049 <desc>Full path to the shared folder in the host file system.</desc> 3047 3050 </param> 3051 <param name="writable" type="boolean" dir="in"> 3052 <desc>Whether the share is writable or readonly</desc> 3053 </param> 3048 3054 </method> 3049 3055 … … 3901 3907 <param name="hostPath" type="wstring" dir="in"> 3902 3908 <desc>Full path to the shared folder in the host file system.</desc> 3909 </param> 3910 <param name="writable" type="boolean" dir="in"> 3911 <desc>Whether the share is writable or readonly</desc> 3903 3912 </param> 3904 3913 </method> … … 9037 9046 </desc> 9038 9047 </attribute> 9048 9049 <attribute name="writable" type="boolean" readonly="yes"> 9050 <desc> 9051 Whether the folder defined by the host path is writable or 9052 not. 9053 </desc> 9054 </attribute> 9039 9055 9040 9056 </interface> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r6156 r6379 134 134 STDMETHOD(AttachUSBDevice) (INPTR GUIDPARAM aId); 135 135 STDMETHOD(DetachUSBDevice) (INPTR GUIDPARAM aId, IUSBDevice **aDevice); 136 STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath );136 STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable); 137 137 STDMETHOD(RemoveSharedFolder) (INPTR BSTR aName); 138 138 STDMETHOD(TakeSnapshot) (INPTR BSTR aName, INPTR BSTR aDescription, … … 353 353 typedef SafeVMPtrBase <true> SafeVMPtrQuiet; 354 354 355 class SharedFolderData 356 { 357 public: 358 SharedFolderData() {} 359 SharedFolderData(Bstr aHostPath, BOOL aWritable) 360 : mHostPath (aHostPath) 361 , mWritable (aWritable) {} 362 SharedFolderData(const SharedFolderData& aThat) 363 : mHostPath (aThat.mHostPath) 364 , mWritable (aThat.mWritable) {} 365 Bstr mHostPath; 366 BOOL mWritable; 367 }; 355 368 typedef std::map <Bstr, ComObjPtr <SharedFolder> > SharedFolderMap; 356 typedef std::map <Bstr, Bstr> SharedFolderDataMap;369 typedef std::map <Bstr, SharedFolderData> SharedFolderDataMap; 357 370 358 371 private: … … 386 399 SharedFolderDataMap::const_iterator &aIt); 387 400 388 HRESULT createSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath);401 HRESULT createSharedFolder (INPTR BSTR aName, SharedFolderData aData); 389 402 HRESULT removeSharedFolder (INPTR BSTR aName); 390 403 -
trunk/src/VBox/Main/include/MachineImpl.h
r6076 r6379 498 498 STDMETHOD(FindSnapshot) (INPTR BSTR aName, ISnapshot **aSnapshot); 499 499 STDMETHOD(SetCurrentSnapshot) (INPTR GUIDPARAM aId); 500 STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath );500 STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable); 501 501 STDMETHOD(RemoveSharedFolder) (INPTR BSTR aName); 502 502 STDMETHOD(CanShowConsoleWindow) (BOOL *aCanShow); -
trunk/src/VBox/Main/include/SharedFolderImpl.h
r5999 r6379 41 41 const Bstr mName; 42 42 const Bstr mHostPath; 43 bool mWritable; 43 44 }; 44 45 … … 62 63 63 64 // public initializer/uninitializer for internal purposes only 64 HRESULT init (Machine *aMachine, const BSTR aName, const BSTR aHostPath );65 HRESULT init (Machine *aMachine, const BSTR aName, const BSTR aHostPath, bool aWritable); 65 66 HRESULT initCopy (Machine *aMachine, SharedFolder *aThat); 66 HRESULT init (Console *aConsole, const BSTR aName, const BSTR aHostPath );67 HRESULT init (VirtualBox *aVirtualBox, const BSTR aName, const BSTR aHostPath );67 HRESULT init (Console *aConsole, const BSTR aName, const BSTR aHostPath, bool aWritable); 68 HRESULT init (VirtualBox *aVirtualBox, const BSTR aName, const BSTR aHostPath, bool aWritable); 68 69 void uninit(); 69 70 … … 72 73 STDMETHOD(COMGETTER(HostPath)) (BSTR *aHostPath); 73 74 STDMETHOD(COMGETTER(Accessible)) (BOOL *aAccessible); 75 STDMETHOD(COMGETTER(Writable)) (BOOL *aWritable); 74 76 75 77 // public methods for internal purposes only … … 81 83 const Bstr &name() const { return mData.mName; } 82 84 const Bstr &hostPath() const { return mData.mHostPath; } 85 BOOL writable() const { return mData.mWritable; } 83 86 84 87 // for VirtualBoxSupportErrorInfoImpl … … 88 91 89 92 HRESULT protectedInit (VirtualBoxBaseWithChildrenNEXT *aParent, 90 const BSTR aName, const BSTR aHostPath );93 const BSTR aName, const BSTR aHostPath, bool aWritable); 91 94 92 95 private: -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r6076 r6379 161 161 162 162 STDMETHOD(GetGuestOSType) (INPTR BSTR aId, IGuestOSType **aType); 163 STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath );163 STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable); 164 164 STDMETHOD(RemoveSharedFolder) (INPTR BSTR aName); 165 165 STDMETHOD(GetNextExtraDataKey) (INPTR BSTR aKey, BSTR *aNextKey, BSTR *aNextValue); -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r6173 r6379 630 630 <xsd:attribute name="name" type="TNonEmptyString" use="required"/> 631 631 <xsd:attribute name="hostPath" type="TLocalFile" use="required"/> 632 <xsd:attribute name="writable" type="xsd:boolean" default="true"/> 632 633 </xsd:complexType> 633 634
Note:
See TracChangeset
for help on using the changeset viewer.