Changeset 31002 in vbox
- Timestamp:
- Jul 22, 2010 2:45:41 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63916
- Location:
- trunk
- Files:
-
- 32 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r30779 r31002 4 4 5 5 /* 6 * Copyright (C) 2006-20 09Oracle Corporation6 * Copyright (C) 2006-2010 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 507 507 /** @} */ 508 508 # endif /* VBOX_WITH_GUEST_PROPS defined */ 509 510 # ifdef VBOX_WITH_SHARED_FOLDERS 511 /** @name Shared folders 512 * @{ */ 513 /** 514 * Structure containing mapping information for a shared folder. 515 */ 516 struct VBGLR3SHAREDFOLDERMAPPING 517 { 518 /** Mapping status. */ 519 uint32_t u32Status; 520 /** Root handle. */ 521 uint32_t u32Root; 522 }; 523 typedef VBGLR3SHAREDFOLDERMAPPING *PVBGLR3SHAREDFOLDERMAPPING; 524 /** @todo Docs. */ 525 VBGLR3DECL(int) VbglR3SharedFolderConnect(uint32_t *pu32ClientId); 526 VBGLR3DECL(int) VbglR3SharedFolderDisconnect(uint32_t u32ClientId); 527 VBGLR3DECL(int) VbglR3SharedFolderGetMappings(uint32_t u32ClientId, bool bAutoMountOnly, 528 VBGLR3SHAREDFOLDERMAPPING paMappings[], uint32_t cbMappings, 529 uint32_t *pcMapCount); 530 VBGLR3DECL(int) VbglR3SharedFolderGetName(uint32_t u32ClientId,uint32_t u32Root, 531 char **ppszName, uint32_t *pcbLen); 532 /** @} */ 533 # endif /* VBOX_WITH_SHARED_FOLDERS defined */ 509 534 510 535 # ifdef VBOX_WITH_GUEST_CONTROL -
trunk/include/VBox/settings.h
r30934 r31002 537 537 SharedFolder() 538 538 : fWritable(false) 539 , fAutoMount(false) 539 540 {} 540 541 … … 544 545 strHostPath; 545 546 bool fWritable; 547 bool fAutoMount; 546 548 }; 547 549 typedef std::list<SharedFolder> SharedFoldersList; -
trunk/include/VBox/shflsvc.h
r28800 r31002 1 1 /** @file 2 * Shared Folders: Common header for host service and guest clients. (ADD,HSvc)2 * Shared Folders: Common header for host service and guest clients. 3 3 */ 4 4 5 5 /* 6 * Copyright (C) 2006-20 07Oracle Corporation6 * Copyright (C) 2006-2010 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 134 134 #define SHFL_HANDLE_ROOT ((SHFLHANDLE)0LL) 135 135 136 /** Hardcoded maximum length (in chars) of a shared folder name. */ 137 #define SHFL_MAX_LEN (256) 136 138 /** Hardcoded maximum number of shared folder mapping available to the guest. */ 137 139 #define SHFL_MAX_MAPPINGS (64) … … 166 168 167 169 /** Calculate size of the string. */ 168 DECLINLINE(uint32_t) ShflStringSizeOfBuffer 170 DECLINLINE(uint32_t) ShflStringSizeOfBuffer(PCSHFLSTRING pString) 169 171 { 170 172 return pString? sizeof (SHFLSTRING) - sizeof (pString->String) + pString->u16Size: 0; 171 173 } 172 174 173 DECLINLINE(uint32_t) ShflStringLength 175 DECLINLINE(uint32_t) ShflStringLength(PCSHFLSTRING pString) 174 176 { 175 177 return pString? pString->u16Length: 0; … … 420 422 * SHFL_FN_QUERY_MAPPINGS 421 423 */ 422 423 #define SHFL_MF_UCS2 (0x00000000) 424 /** Validation mask. Needs to be adjusted 425 * whenever a new SHFL_MF_ flag is added. */ 426 #define SHFL_MF_MASK (0x00000011) 427 /** UC2 enconded strings. */ 428 #define SHFL_MF_UCS2 (0x00000000) 424 429 /** Guest uses UTF8 strings, if not set then the strings are unicode (UCS2). */ 425 #define SHFL_MF_UTF8 (0x00000001) 430 #define SHFL_MF_UTF8 (0x00000001) 431 /** Just handle the auto-mounted folders. */ 432 #define SHFL_MF_AUTOMOUNT (0x00000010) 426 433 427 434 /** Type of guest system. For future system dependent features. */ … … 992 999 993 1000 /** 1001 * SHFL_FN_ADD_MAPPING, with auto-mount flag. 1002 * Host call, no guest structure is used. 1003 */ 1004 1005 #define SHFL_CPARMS_ADD_MAPPING2 (4) 1006 1007 /** 994 1008 * SHFL_FN_REMOVE_MAPPING 995 1009 * Host call, no guest structure is used. -
trunk/src/VBox/Additions/WINNT/VBoxTray/Makefile.kmk
r29746 r31002 5 5 6 6 # 7 # Copyright (C) 2006-20 07Oracle Corporation7 # Copyright (C) 2006-2010 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 42 42 VBoxHostVersion.cpp 43 43 endif 44 ifdef VBOX_WITH_SHARED_FOLDERS 45 VBoxTray_DEFS += VBOX_WITH_SHARED_FOLDERS 46 VBoxTray_SOURCES += \ 47 VBoxSharedFolders.cpp 48 VBoxTray_LIBS.win += \ 49 mpr.lib 50 endif 44 51 45 52 VBoxTray_LIBS = \ -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHostVersion.cpp
r28800 r31002 6 6 7 7 /* 8 * Copyright (C) 20 09Oracle Corporation8 * Copyright (C) 2010 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 45 45 char szTitle[64]; 46 46 47 /** @todo add some translation macros here*/47 /** @todo Add some translation macros here. */ 48 48 _snprintf(szTitle, sizeof(szTitle), "VirtualBox Guest Additions update available!"); 49 49 _snprintf(szMsg, sizeof(szMsg), "Your guest is currently running the Guest Additions version %s. " … … 56 56 } 57 57 58 /* Store host version to not notify again */58 /* Store host version to not notify again. */ 59 59 rc = VbglR3HostVersionLastCheckedStore(uGuestPropSvcClientID, pszHostVersion); 60 60 -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHostVersion.h
r28800 r31002 1 1 /** @file 2 * VBoxRestore - Restore notification 2 * VBoxHostVersion - Checks the host's VirtualBox version and notifies 3 * the user in case of an update. 3 4 */ 4 5 5 6 /* 6 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 7 8 * 8 9 * This file is part of VirtualBox Open Source Edition (OSE), as -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r30928 r31002 22 22 #include "VBoxVRDP.h" 23 23 #include "VBoxHostVersion.h" 24 #include "VBoxSharedFolders.h" 24 25 #include <VBoxHook.h> 25 26 #include "resource.h" … … 454 455 NULL /* No timerproc */); 455 456 } 457 458 VBoxSharedFoldersAutoMount(); 456 459 457 460 /* Boost thread priority to make sure we wake up early for seamless window notifications (not sure if it actually makes any difference though) */ -
trunk/src/VBox/Additions/WINNT/VBoxTray/helpers.cpp
r28800 r31002 254 254 return 0; 255 255 } 256 -
trunk/src/VBox/Additions/common/VBoxControl/Makefile.kmk
r28800 r31002 5 5 6 6 # 7 # Copyright (C) 20 08Oracle Corporation7 # Copyright (C) 2010 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 33 33 endif 34 34 VBoxControl_DEFS += \ 35 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS VBOX_WITH_HGCM,) 35 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \ 36 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \ 37 $(if $(VBOX_WITH_SHARED_FOLDERS),VBOX_WITH_SHARED_FOLDERS,) 36 38 VBoxControl_SOURCES = \ 37 39 VBoxControl.cpp -
trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
r28800 r31002 78 78 GUEST_PROP, 79 79 #endif 80 #ifdef VBOX_WITH_SHARED_FOLDERS 81 GUEST_SHAREDFOLDERS, 82 #endif 80 83 USAGE_ALL = UINT32_MAX 81 84 }; … … 113 116 doUsage("[-timestamp <last timestamp>]"); 114 117 doUsage("[-timeout <timeout in ms>"); 118 } 119 #endif 120 #ifdef VBOX_WITH_SHARED_FOLDERS 121 if ((GUEST_SHAREDFOLDERS == eWhich) || (USAGE_ALL == eWhich)) 122 { 123 doUsage("list [-automount]", g_pszProgName, "sharedfolder"); 115 124 } 116 125 #endif … … 1255 1264 return 1; 1256 1265 } 1257 1266 #endif 1267 1268 #ifdef VBOX_WITH_SHARED_FOLDERS 1269 /** 1270 * Lists the Shared Folders provided by the host. 1271 */ 1272 int listSharedFolders(int argc, char **argv) 1273 { 1274 bool usageOK = true; 1275 bool fOnlyShowAutoMount = false; 1276 if ( argc == 1 1277 && ( RTStrICmp(argv[0], "-automount") == 0 1278 || RTStrICmp(argv[0], "/automount") == 0) 1279 ) 1280 { 1281 fOnlyShowAutoMount = true; 1282 } 1283 else if (argc > 1) 1284 usageOK = false; 1285 1286 if (!usageOK) 1287 { 1288 usage(GUEST_SHAREDFOLDERS); 1289 return 1; 1290 } 1291 1292 uint32_t u32ClientId; 1293 int rc = VbglR3SharedFolderConnect(&u32ClientId); 1294 if (!RT_SUCCESS(rc)) 1295 VBoxControlError("Failed to connect to the shared folder service, error %Rrc\n", rc); 1296 else 1297 { 1298 uint32_t cMappings = 64; /* See shflsvc.h for define; should be used later. */ 1299 uint32_t cbMappings = cMappings * sizeof(VBGLR3SHAREDFOLDERMAPPING); 1300 VBGLR3SHAREDFOLDERMAPPING *pMappings = (VBGLR3SHAREDFOLDERMAPPING*)RTMemAlloc(cbMappings); 1301 1302 if (pMappings) 1303 { 1304 rc = VbglR3SharedFolderGetMappings(u32ClientId, fOnlyShowAutoMount, 1305 pMappings, cbMappings, 1306 &cMappings); 1307 if (RT_SUCCESS(rc)) 1308 { 1309 RT_CLAMP(cMappings, 0, 64); /* Maximum mappings, see shflsvc.h */ 1310 RTPrintf("Shared Folder Mappings (%u):\n\n", cMappings); 1311 for (uint32_t i = 0; i < cMappings; i++) 1312 { 1313 char *ppszName = NULL; 1314 uint32_t pcbLen = 0; 1315 rc = VbglR3SharedFolderGetName(u32ClientId, pMappings[i].u32Root, 1316 &ppszName, &pcbLen); 1317 if (RT_SUCCESS(rc)) 1318 { 1319 RTPrintf("%02u - %s\n", i + 1, ppszName); 1320 RTStrFree(ppszName); 1321 } 1322 else 1323 VBoxControlError("Error while getting the shared folder name for root node = %u, rc = %Rrc\n", 1324 pMappings[i].u32Root, rc); 1325 } 1326 if (cMappings == 0) 1327 RTPrintf("No Shared Folders available.\n"); 1328 } 1329 else 1330 VBoxControlError("Error while getting the shared folder mappings, rc = %Rrc\n", rc); 1331 RTMemFree(pMappings); 1332 } 1333 else 1334 rc = VERR_NO_MEMORY; 1335 VbglR3SharedFolderDisconnect(u32ClientId); 1336 } 1337 return RT_SUCCESS(rc) ? 0 : 1; 1338 } 1339 1340 /** 1341 * Handles Shared Folders control. 1342 * 1343 * @returns 0 on success, 1 on failure 1344 * @note see the command line API description for parameters 1345 */ 1346 static int handleSharedFolder(int argc, char *argv[]) 1347 { 1348 if (0 == argc) 1349 { 1350 usage(GUEST_SHAREDFOLDERS); 1351 return 1; 1352 } 1353 if (0 == strcmp(argv[0], "list")) 1354 return listSharedFolders(argc - 1, argv + 1); 1355 /* else */ 1356 usage(GUEST_SHAREDFOLDERS); 1357 return 1; 1358 } 1258 1359 #endif 1259 1360 … … 1279 1380 #ifdef VBOX_WITH_GUEST_PROPS 1280 1381 { "guestproperty", handleGuestProperty }, 1382 #endif 1383 #ifdef VBOX_WITH_SHARED_FOLDERS 1384 { "sharedfolder", handleSharedFolder }, 1281 1385 #endif 1282 1386 { NULL, NULL } /* terminator */ -
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r29535 r31002 61 61 VMMDev.cpp \ 62 62 HGCM.cpp \ 63 VBox Calls.c \63 VBoxGuestR0LibSharedFolders.c \ 64 64 VbglR0CanUsePhysPageList.cpp 65 65 … … 88 88 VBOX_WITH_HGCM \ 89 89 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \ 90 $(if $(VBOX_WITH_SHARED_FOLDERS),VBOX_WITH_SHARED_FOLDERS,) \ 90 91 $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL,) 91 92 VBoxGuestR3Lib_SOURCES = \ … … 114 115 VBoxGuestR3LibGuestProp.cpp \ 115 116 VBoxGuestR3LibHostVersion.cpp 117 endif 118 ifdef VBOX_WITH_SHARED_FOLDERS 119 VBoxGuestR3Lib_SOURCES += \ 120 VBoxGuestR3LibSharedFolders.cpp 116 121 endif 117 122 ifdef VBOX_WITH_GUEST_CONTROL -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
r30907 r31002 1 1 /* $Revision$ */ 2 2 /** @file 3 * VBoxGuest LibR0 - Centralcalls.3 * VBoxGuestR0LibSharedFolders - Ring 0 Shared Folders calls. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 29 29 30 30 #ifdef RT_OS_LINUX 31 # include "VBox Calls.h"31 # include "VBoxGuestR0LibSharedFolders.h" 32 32 # define DbgPrint RTAssertMsg2Weak 33 33 #else 34 # include "VBox Calls.h"34 # include "VBoxGuestR0LibSharedFolders.h" 35 35 #endif 36 36 #include <iprt/time.h> -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r30976 r31002 602 602 RTPrintf("VBoxManage sharedfolder add <vmname>|<uuid>\n" 603 603 " --name <name> --hostpath <hostpath>\n" 604 " [--transient] [--readonly] \n"604 " [--transient] [--readonly] [--automount]\n" 605 605 "\n"); 606 606 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r30956 r31002 684 684 bool fTransient = false; 685 685 bool fWritable = true; 686 bool fAutoMount = false; 686 687 687 688 for (int i = 2; i < a->argc; i++) … … 712 713 { 713 714 fTransient = true; 715 } 716 else if ( !strcmp(a->argv[i], "--automount") 717 || !strcmp(a->argv[i], "-automount")) 718 { 719 fAutoMount = true; 714 720 } 715 721 else … … 737 743 CHECK_ERROR_RET(a->session, COMGETTER(Console)(console.asOutParam()), 1); 738 744 739 CHECK_ERROR(console, CreateSharedFolder(Bstr(name), Bstr(hostpath), fWritable));740 745 CHECK_ERROR(console, CreateSharedFolder(Bstr(name), Bstr(hostpath), 746 fWritable, fAutoMount)); 741 747 if (console) 742 748 a->session->Close(); … … 750 756 a->session->COMGETTER(Machine)(machine.asOutParam()); 751 757 752 CHECK_ERROR(machine, CreateSharedFolder(Bstr(name), Bstr(hostpath), fWritable));753 758 CHECK_ERROR(machine, CreateSharedFolder(Bstr(name), Bstr(hostpath), 759 fWritable, fAutoMount)); 754 760 if (SUCCEEDED(rc)) 755 761 CHECK_ERROR(machine, SaveSettings()); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSF.cpp
r30193 r31002 7 7 8 8 /* 9 * Copyright (C) 2008-20 09Oracle Corporation9 * Copyright (C) 2008-2010 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 345 345 mTrFull = tr ("Full"); 346 346 mTrReadOnly = tr ("Read-only"); 347 mTrYes = tr ("Yes"); /** @todo Need to figure out if this string is necessary at all! */ 347 348 } 348 349 … … 364 365 QStringList fields; 365 366 fields << name /* name */ << path /* path */ 367 << (dlg.isAutoMounted() ? mTrYes : "" /* auto mount? */) 366 368 << (dlg.isWriteable() ? mTrFull : mTrReadOnly /* writable? */) 367 369 << "edited" /* mark item as edited */; … … 392 394 dlg.setName (item->getText (0)); 393 395 dlg.setPermanent ((SFDialogType)item->parent()->text (1).toInt() != ConsoleType); 394 dlg.setWriteable (item->getText (2) == mTrFull); 396 dlg.setAutoMount (item->getText (2) == mTrYes); 397 dlg.setWriteable (item->getText (3) == mTrFull); 395 398 if (dlg.exec() == QDialog::Accepted) 396 399 { … … 406 409 QStringList fields; 407 410 fields << name /* name */ << path /* path */ 411 << (dlg.isAutoMounted() ? mTrYes : "" /* auto mount? */) 408 412 << (dlg.isWriteable() ? mTrFull : mTrReadOnly /* writable? */) 409 413 << "edited" /* mark item as edited */; … … 516 520 } 517 521 518 void VBoxVMSettingsSF::createSharedFolder (const QString &aName, const QString &aPath, bool aWritable, SFDialogType aType) 522 void VBoxVMSettingsSF::createSharedFolder (const QString &aName, const QString &aPath, 523 bool aWritable, bool aAutoMount, SFDialogType aType) 519 524 { 520 525 switch (aType) … … 529 534 { 530 535 Assert (!mMachine.isNull()); 531 mMachine.CreateSharedFolder (aName, aPath, aWritable );536 mMachine.CreateSharedFolder (aName, aPath, aWritable, aAutoMount); 532 537 if (!mMachine.isOk()) 533 538 vboxProblem().cannotCreateSharedFolder (this, mMachine, aName, aPath); … … 537 542 { 538 543 Assert (!mConsole.isNull()); 539 mConsole.CreateSharedFolder (aName, aPath, aWritable );544 mConsole.CreateSharedFolder (aName, aPath, aWritable, aAutoMount); 540 545 if (!mConsole.isOk()) 541 546 vboxProblem().cannotCreateSharedFolder (this, mConsole, aName, aPath); … … 589 594 QStringList fields; 590 595 fields << sf.GetName() /* name */ << sf.GetHostPath() /* path */ 591 << (sf.GetWritable() ? mTrFull : mTrReadOnly /* writable? */) 596 << (sf.GetAutoMount() ? mTrYes : "") /* auto mount? */ 597 << (sf.GetWritable() ? mTrFull : mTrReadOnly) /* writable? */ 592 598 << "not edited" /* initially not edited */; 593 599 new SFTreeViewItem (aRoot, fields, SFTreeViewItem::EllipsisFile); … … 604 610 SFDialogType type = (SFDialogType) aRoot->text (1).toInt(); 605 611 612 /** @todo Use enums rather than numbers for the text fields (like item->getText (4)). */ 613 606 614 /* Delete all changed folders from vm */ 607 615 for (int idx = 0; idx < aVec.size(); ++ idx) … … 614 622 { 615 623 SFTreeViewItem *item = aRoot->child (i); 616 if (item->getText (0) == sf.GetName() && item->getText ( 3) == "not edited")624 if (item->getText (0) == sf.GetName() && item->getText (4) == "not edited") 617 625 break; 618 626 } … … 627 635 SFTreeViewItem *item = aRoot->child (i); 628 636 629 if (!item->getText (0).isNull() && !item->getText (1).isNull() && item->getText (3) == "edited") 630 createSharedFolder (item->getText (0), item->getText (1), item->getText (2) == mTrFull ? true : false, type); 637 if (!item->getText (0).isNull() && !item->getText (1).isNull() && item->getText (4) == "edited") 638 createSharedFolder (item->getText (0), item->getText (1), 639 item->getText (3) == mTrFull ? true : false, item->getText (2) == mTrYes ? true : false, 640 type); 631 641 } 632 642 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSF.h
r28800 r31002 81 81 void showEvent (QShowEvent *aEvent); 82 82 83 void createSharedFolder (const QString &aName, const QString &aPath, bool aWritable, SFDialogType aType);83 void createSharedFolder (const QString &aName, const QString &aPath, bool aWritable, bool aAutoMount, SFDialogType aType); 84 84 void removeSharedFolder (const QString &aName, const QString &aPath, SFDialogType aType); 85 85 … … 100 100 QString mTrFull; 101 101 QString mTrReadOnly; 102 QString mTrYes; 102 103 }; 103 104 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSF.ui
r28800 r31002 77 77 <column> 78 78 <property name="text"> 79 <string>Auto-Mount</string> 80 </property> 81 </column> 82 <column> 83 <property name="text"> 79 84 <string>Access</string> 80 85 </property> -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSFDetails.cpp
r30990 r31002 7 7 8 8 /* 9 * Copyright (C) 20 08Oracle Corporation9 * Copyright (C) 2010 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 100 100 } 101 101 102 void VBoxVMSettingsSFDetails::setAutoMount (bool aAutoMount) 103 { 104 mCbAutoMount->setChecked (aAutoMount); 105 } 106 107 bool VBoxVMSettingsSFDetails::isAutoMounted() const 108 { 109 return mCbAutoMount->isChecked(); 110 } 111 102 112 void VBoxVMSettingsSFDetails::setPermanent (bool aPermanent) 103 113 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSFDetails.h
r28800 r31002 52 52 bool isWriteable() const; 53 53 54 void setAutoMount (bool aAutoMount); 55 bool isAutoMounted() const; 56 54 57 void setPermanent (bool aPermanent); 55 58 bool isPermanent() const; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSFDetails.ui
r28800 r31002 68 68 </item> 69 69 <item row="3" column="1" > 70 <widget class="QCheckBox" name="mCbAutoMount" > 71 <property name="toolTip" > 72 <string>When checked, the guest OS will try to automatically mount the shared folder on startup.</string> 73 </property> 74 <property name="text" > 75 <string>&Auto-mount</string> 76 </property> 77 </widget> 78 </item> 79 <item row="4" column="1" > 70 80 <widget class="QCheckBox" name="mCbPermanent" > 71 81 <property name="text" > -
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r28800 r31002 171 171 172 172 /* 173 *174 173 * We are always executed from one specific HGCM thread. So thread safe. 175 *176 174 */ 177 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName, uint32_t fWritable) 175 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName, 176 uint32_t fWritable, uint32_t fAutoMount) 178 177 { 179 178 unsigned i; … … 218 217 memcpy(FolderMapping[i].pMapName->String.ucs2, pMapName->String.ucs2, pMapName->u16Size); 219 218 220 FolderMapping[i].fValid = true; 221 FolderMapping[i].cMappings = 0; 222 FolderMapping[i].fWritable = !!fWritable; 219 FolderMapping[i].fValid = true; 220 FolderMapping[i].cMappings = 0; 221 FolderMapping[i].fWritable = !!fWritable; 222 FolderMapping[i].fAutoMount = !!fAutoMount; 223 223 224 224 /* Check if the host file system is case sensitive */ … … 343 343 { 344 344 MAPPING *pFolderMapping = vbsfMappingGetByRoot(i); 345 if (pFolderMapping != NULL && pFolderMapping->fValid == true) 346 { 345 if ( pFolderMapping != NULL 346 && pFolderMapping->fValid == true) 347 { 348 /* Skip mappings which are not marked for auto-mounting if 349 * the SHFL_MF_AUTOMOUNT flag ist set. */ 350 if ( (pClient->fu32Flags & SHFL_MF_AUTOMOUNT) 351 && !pFolderMapping->fAutoMount) 352 continue; 353 347 354 pMappings[*pcMappings].u32Status = SHFL_MS_NEW; 348 355 pMappings[*pcMappings].root = i; … … 350 357 } 351 358 } 352 353 359 LogFlow(("vbsfMappingsQuery: return rc = %Rrc\n", rc)); 354 355 360 return rc; 356 361 } … … 371 376 if (BIT_FLAG(pClient->fu32Flags, SHFL_CF_UTF8)) 372 377 { 373 /* not implemented*/378 /* Not implemented. */ 374 379 AssertFailed(); 375 380 return VERR_INVALID_PARAMETER; … … 412 417 } 413 418 419 int vbsfMappingsQueryAutoMount (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fAutoMount) 420 { 421 int rc = VINF_SUCCESS; 422 423 LogFlow(("vbsfMappingsQueryAutoMount: pClient = %p, root = %d\n", 424 pClient, root)); 425 426 MAPPING *pFolderMapping = vbsfMappingGetByRoot(root); 427 if (pFolderMapping == NULL) 428 { 429 return VERR_INVALID_PARAMETER; 430 } 431 432 if (pFolderMapping->fValid == true) 433 *fAutoMount = pFolderMapping->fAutoMount; 434 else 435 rc = VERR_FILE_NOT_FOUND; 436 437 LogFlow(("vbsfMappingsQueryAutoMount:Writable return rc = %Rrc\n", rc)); 438 439 return rc; 440 } 441 414 442 int vbsfMapFolder (SHFLCLIENTDATA *pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter, bool fCaseSensitive, SHFLROOT *pRoot) 415 443 { -
trunk/src/VBox/HostServices/SharedFolders/mappings.h
r28800 r31002 4 4 5 5 /* 6 * Copyright (C) 2006-20 07Oracle Corporation6 * Copyright (C) 2006-2010 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 30 30 bool fGuestCaseSensitive; 31 31 bool fWritable; 32 bool fAutoMount; 32 33 } MAPPING, *PMAPPING; 33 34 … … 36 37 bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping); 37 38 38 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName, uint32_t fWritable);39 int vbsfMappingsRemove 39 int vbsfMappingsAdd(PSHFLSTRING pFolderName, PSHFLSTRING pMapName, uint32_t fWritable, uint32_t fAutoMount); 40 int vbsfMappingsRemove(PSHFLSTRING pMapName); 40 41 41 int vbsfMappingsQuery 42 int vbsfMappingsQueryName 43 int vbsfMappingsQueryWritable 42 int vbsfMappingsQuery(SHFLCLIENTDATA *pClient, SHFLMAPPING *pMappings, uint32_t *pcMappings); 43 int vbsfMappingsQueryName(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pString); 44 int vbsfMappingsQueryWritable(SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable); 44 45 45 int vbsfMapFolder 46 int vbsfUnmapFolder 46 int vbsfMapFolder(SHFLCLIENTDATA *pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter, bool fCaseSensitive, SHFLROOT *pRoot); 47 int vbsfUnmapFolder(SHFLCLIENTDATA *pClient, SHFLROOT root); 47 48 48 PCRTUTF16 49 bool 50 bool 49 PCRTUTF16 vbsfMappingsQueryHostRoot (SHFLROOT root, uint32_t *pcbRoot); 50 bool vbsfIsGuestMappingCaseSensitive (SHFLROOT root); 51 bool vbsfIsHostMappingCaseSensitive (SHFLROOT root); 51 52 52 53 int vbsfMappingLoaded (const MAPPING *pLoadedMapping, SHFLROOT root); -
trunk/src/VBox/HostServices/SharedFolders/service.cpp
r30502 r31002 310 310 311 311 /* Verify parameters values. */ 312 if ( (fu32Flags & ~SHFL_MF_ UTF8) != 0313 || cbMappings / sizeof (SHFLMAPPING) <cMappings312 if ( (fu32Flags & ~SHFL_MF_MASK) != 0 313 || cbMappings / sizeof (SHFLMAPPING) != cMappings 314 314 ) 315 315 { … … 320 320 /* Execute the function. */ 321 321 if (fu32Flags & SHFL_MF_UTF8) 322 {323 322 pClient->fu32Flags |= SHFL_CF_UTF8; 324 }325 326 rc = vbsfMappingsQuery (pClient, pMappings, &cMappings); 327 328 if (RT_SUCCESS(rc)) 329 { 330 /* Update parameters. */323 if (fu32Flags & SHFL_MF_AUTOMOUNT) 324 pClient->fu32Flags |= SHFL_MF_AUTOMOUNT; 325 326 rc = vbsfMappingsQuery(pClient, pMappings, &cMappings); 327 if (RT_SUCCESS(rc)) 328 { 329 /* Update parameters. */ 331 330 paParms[1].u.uint32 = cMappings; 332 331 } … … 346 345 rc = VERR_INVALID_PARAMETER; 347 346 } 348 else if ( paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* root*/349 || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* name*/347 else if ( paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* Root. */ 348 || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* Name. */ 350 349 ) 351 350 { … … 366 365 { 367 366 /* Execute the function. */ 368 rc = vbsfMappingsQueryName 367 rc = vbsfMappingsQueryName(pClient, root, pString); 369 368 370 369 if (RT_SUCCESS(rc)) 371 370 { 372 371 /* Update parameters.*/ 373 ; /* none*/372 ; /* None. */ 374 373 } 375 374 } … … 1162 1161 1163 1162 /* Verify parameter count and types. */ 1164 if (cParms != SHFL_CPARMS_ADD_MAPPING) 1163 if ( (cParms != SHFL_CPARMS_ADD_MAPPING) 1164 && (cParms != SHFL_CPARMS_ADD_MAPPING2) /* With auto-mount flag. */ 1165 ) 1165 1166 { 1166 1167 rc = VERR_INVALID_PARAMETER; … … 1169 1170 || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* guest map name */ 1170 1171 || paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* fWritable */ 1171 ) 1172 /* With auto-mount flag? */ 1173 || ( cParms == SHFL_CPARMS_ADD_MAPPING2 1174 && paParms[3].type != VBOX_HGCM_SVC_PARM_32BIT)) 1172 1175 { 1173 1176 rc = VERR_INVALID_PARAMETER; … … 1179 1182 SHFLSTRING *pMapName = (SHFLSTRING *)paParms[1].u.pointer.addr; 1180 1183 uint32_t fWritable = paParms[2].u.uint32; 1184 uint32_t fAutoMount = 0; /* Disabled by default. */ 1185 1186 /* Handle auto-mount flag if present. */ 1187 if (cParms == SHFL_CPARMS_ADD_MAPPING2) 1188 fAutoMount = paParms[3].u.uint32; 1181 1189 1182 1190 /* Verify parameters values. */ … … 1190 1198 { 1191 1199 /* Execute the function. */ 1192 rc = vbsfMappingsAdd (pFolderName, pMapName, fWritable); 1193 1200 rc = vbsfMappingsAdd(pFolderName, pMapName, fWritable, fAutoMount); 1194 1201 if (RT_SUCCESS(rc)) 1195 1202 { -
trunk/src/VBox/Main/ConsoleImpl.cpp
r30907 r31002 1174 1174 vrc = SSMR3PutBool(pSSM, !!folder->isWritable()); 1175 1175 AssertRC(vrc); 1176 1177 vrc = SSMR3PutBool(pSSM, !!folder->isAutoMounted()); 1178 AssertRC(vrc); 1176 1179 } 1177 1180 … … 1236 1239 Bstr hostPath; 1237 1240 bool writable = true; 1241 bool autoMount = false; 1238 1242 1239 1243 uint32_t szBuf = 0; … … 1259 1263 SSMR3GetBool(pSSM, &writable); 1260 1264 1265 if (u32Version > 0x00010000) // ??? 1266 SSMR3GetBool(pSSM, &autoMount); 1267 1261 1268 ComObjPtr<SharedFolder> sharedFolder; 1262 1269 sharedFolder.createObject(); 1263 HRESULT rc = sharedFolder->init(this, name, hostPath, writable );1270 HRESULT rc = sharedFolder->init(this, name, hostPath, writable, autoMount); 1264 1271 AssertComRCReturn(rc, VERR_INTERNAL_ERROR); 1265 1272 … … 2660 2667 2661 2668 STDMETHODIMP 2662 Console::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable )2669 Console::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount) 2663 2670 { 2664 2671 CheckComArgStrNotEmptyOrNull(aName); … … 2692 2699 2693 2700 sharedFolder.createObject(); 2694 rc = sharedFolder->init(this, aName, aHostPath, aWritable );2701 rc = sharedFolder->init(this, aName, aHostPath, aWritable, aAutoMount); 2695 2702 if (FAILED(rc)) return rc; 2696 2703 … … 2712 2719 2713 2720 /* second, create the given folder */ 2714 rc = createSharedFolder(aName, SharedFolderData(aHostPath, aWritable ));2721 rc = createSharedFolder(aName, SharedFolderData(aHostPath, aWritable, aAutoMount)); 2715 2722 if (FAILED(rc)) return rc; 2716 2723 } … … 5123 5130 for (SharedFolderMap::const_iterator it = mSharedFolders.begin(); 5124 5131 it != mSharedFolders.end(); ++ it) 5125 sharedFolders[it->first] = SharedFolderData(it->second->getHostPath(), it->second->isWritable()); 5132 sharedFolders[it->first] = SharedFolderData(it->second->getHostPath(), 5133 it->second->isWritable(), 5134 it->second->isAutoMounted()); 5126 5135 } 5127 5136 … … 5751 5760 Bstr hostPath; 5752 5761 BOOL writable; 5762 BOOL autoMount; 5753 5763 5754 5764 rc = folder->COMGETTER(Name)(name.asOutParam()); … … 5757 5767 if (FAILED(rc)) break; 5758 5768 rc = folder->COMGETTER(Writable)(&writable); 5759 5760 mMachineSharedFolders.insert(std::make_pair(name, SharedFolderData(hostPath, writable))); 5769 if (FAILED(rc)) break; 5770 rc = folder->COMGETTER(AutoMount)(&autoMount); 5771 if (FAILED(rc)) break; 5772 5773 mMachineSharedFolders.insert(std::make_pair(name, SharedFolderData(hostPath, writable, autoMount))); 5761 5774 5762 5775 /* send changes to HGCM if the VM is running */ … … 5780 5793 rc = removeSharedFolder(name); 5781 5794 /* create the new machine folder */ 5782 rc = createSharedFolder(name, SharedFolderData(hostPath, writable ));5795 rc = createSharedFolder(name, SharedFolderData(hostPath, writable, autoMount)); 5783 5796 } 5784 5797 } … … 5868 5881 AssertReturn(mVMMDev->isShFlActive(), E_FAIL); 5869 5882 5870 VBOXHGCMSVCPARM parms[SHFL_CPARMS_ADD_MAPPING ];5883 VBOXHGCMSVCPARM parms[SHFL_CPARMS_ADD_MAPPING2]; 5871 5884 SHFLSTRING *pFolderName, *pMapName; 5872 5885 size_t cbString; … … 5908 5921 parms[2].u.uint32 = aData.mWritable; 5909 5922 5923 /* 5924 * Auto-mount flag; is indicated by using the SHFL_CPARMS_ADD_MAPPING2 5925 * define below. This shows the host service that we have supplied 5926 * an additional parameter (auto-mount) and keeps the actual command 5927 * backwards compatible. 5928 */ 5929 parms[3].type = VBOX_HGCM_SVC_PARM_32BIT; 5930 parms[3].u.uint32 = aData.mAutoMount; 5931 5910 5932 int vrc = mVMMDev->hgcmHostCall("VBoxSharedFolders", 5911 5933 SHFL_FN_ADD_MAPPING, 5912 SHFL_CPARMS_ADD_MAPPING , &parms[0]);5934 SHFL_CPARMS_ADD_MAPPING2, &parms[0]); 5913 5935 RTMemFree(pFolderName); 5914 5936 RTMemFree(pMapName); -
trunk/src/VBox/Main/MachineImpl.cpp
r30958 r31002 3938 3938 } 3939 3939 3940 STDMETHODIMP Machine::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable )3940 STDMETHODIMP Machine::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount) 3941 3941 { 3942 3942 CheckComArgStrNotEmptyOrNull(aName); … … 3959 3959 3960 3960 sharedFolder.createObject(); 3961 rc = sharedFolder->init(getMachine(), aName, aHostPath, aWritable );3961 rc = sharedFolder->init(getMachine(), aName, aHostPath, aWritable, aAutoMount); 3962 3962 if (FAILED(rc)) return rc; 3963 3963 … … 6895 6895 { 6896 6896 const settings::SharedFolder &sf = *it; 6897 rc = CreateSharedFolder(Bstr(sf.strName), Bstr(sf.strHostPath), sf.fWritable );6897 rc = CreateSharedFolder(Bstr(sf.strName), Bstr(sf.strHostPath), sf.fWritable, sf.fAutoMount); 6898 6898 if (FAILED(rc)) return rc; 6899 6899 } … … 7959 7959 sf.strHostPath = pFolder->getHostPath(); 7960 7960 sf.fWritable = !!pFolder->isWritable(); 7961 sf.fAutoMount = !!pFolder->isAutoMounted(); 7961 7962 7962 7963 data.llSharedFolders.push_back(sf); -
trunk/src/VBox/Main/SharedFolderImpl.cpp
r28800 r31002 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 63 63 * @param aHostPath full path to the shared folder on the host 64 64 * @param aWritable writable if true, readonly otherwise 65 * @param aAutoMount if auto mounted by guest true, false otherwise 65 66 * 66 67 * @return COM result indicator 67 68 */ 68 69 HRESULT SharedFolder::init (Machine *aMachine, 69 CBSTR aName, CBSTR aHostPath, BOOL aWritable )70 CBSTR aName, CBSTR aHostPath, BOOL aWritable, BOOL aAutoMount) 70 71 { 71 72 /* Enclose the state transition NotReady->InInit->Ready */ … … 75 76 unconst(mMachine) = aMachine; 76 77 77 HRESULT rc = protectedInit(aMachine, aName, aHostPath, aWritable );78 HRESULT rc = protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount); 78 79 79 80 /* Confirm a successful initialization when it's the case */ … … 105 106 106 107 HRESULT rc = protectedInit (aMachine, aThat->m.name, 107 aThat->m.hostPath, aThat->m.writable );108 aThat->m.hostPath, aThat->m.writable, aThat->m.autoMount); 108 109 109 110 /* Confirm a successful initialization when it's the case */ … … 125 126 */ 126 127 HRESULT SharedFolder::init(Console *aConsole, 127 CBSTR aName, CBSTR aHostPath, BOOL aWritable )128 CBSTR aName, CBSTR aHostPath, BOOL aWritable, BOOL aAutoMount) 128 129 { 129 130 /* Enclose the state transition NotReady->InInit->Ready */ … … 133 134 unconst(mConsole) = aConsole; 134 135 135 HRESULT rc = protectedInit(aConsole, aName, aHostPath, aWritable );136 HRESULT rc = protectedInit(aConsole, aName, aHostPath, aWritable, aAutoMount); 136 137 137 138 /* Confirm a successful initialization when it's the case */ … … 153 154 */ 154 155 HRESULT SharedFolder::init (VirtualBox *aVirtualBox, 155 CBSTR aName, CBSTR aHostPath, BOOL aWritable )156 CBSTR aName, CBSTR aHostPath, BOOL aWritable, BOOL aAutoMount) 156 157 { 157 158 /* Enclose the state transition NotReady->InInit->Ready */ … … 161 162 unconst(mVirtualBox) = aVirtualBox; 162 163 163 HRESULT rc = protectedInit(aVirtualBox, aName, aHostPath, aWritable );164 HRESULT rc = protectedInit(aVirtualBox, aName, aHostPath, aWritable, aAutoMount); 164 165 165 166 /* Confirm a successful initialization when it's the case */ … … 177 178 */ 178 179 HRESULT SharedFolder::protectedInit(VirtualBoxBase *aParent, 179 CBSTR aName, 180 CBSTR aHostPath, 181 BOOL aWritable) 182 { 183 LogFlowThisFunc(("aName={%ls}, aHostPath={%ls}, aWritable={%d}\n", 184 aName, aHostPath, aWritable)); 180 CBSTR aName, 181 CBSTR aHostPath, 182 BOOL aWritable, 183 BOOL aAutoMount) 184 { 185 LogFlowThisFunc(("aName={%ls}, aHostPath={%ls}, aWritable={%d}, aAutoMount={%d}\n", 186 aName, aHostPath, aWritable, aAutoMount)); 185 187 186 188 ComAssertRet(aParent && aName && aHostPath, E_INVALIDARG); … … 228 230 unconst(m.hostPath) = hostPath; 229 231 m.writable = aWritable; 232 m.autoMount = aAutoMount; 230 233 231 234 return S_OK; … … 318 321 CheckComArgOutPointerValid(aWritable); 319 322 323 AutoCaller autoCaller(this); 324 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 325 326 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 327 320 328 *aWritable = m.writable; 321 329 … … 323 331 } 324 332 333 STDMETHODIMP SharedFolder::COMGETTER(AutoMount) (BOOL *aAutoMount) 334 { 335 CheckComArgOutPointerValid(aAutoMount); 336 337 AutoCaller autoCaller(this); 338 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 339 340 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 341 342 *aAutoMount = m.autoMount; 343 344 return S_OK; 345 } 346 325 347 STDMETHODIMP SharedFolder::COMGETTER(LastAccessError) (BSTR *aLastAccessError) 326 348 { -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r30956 r31002 1719 1719 } 1720 1720 1721 STDMETHODIMP VirtualBox::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, BOOL /* aWritable */) 1721 STDMETHODIMP VirtualBox::CreateSharedFolder(IN_BSTR aName, IN_BSTR aHostPath, 1722 BOOL /* aWritable */, BOOL /* aAutoMount */) 1722 1723 { 1723 1724 CheckComArgStrNotEmptyOrNull(aName); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r30976 r31002 1324 1324 <interface 1325 1325 name="IVirtualBox" extends="$unknown" 1326 uuid=" 2275c97d-31b0-41c7-a138-c77d3c28406e"1326 uuid="ec6cc7e7-06a2-4c5d-8993-1e3619c53817" 1327 1327 wsmap="managed" 1328 1328 > … … 2173 2173 <param name="writable" type="boolean" dir="in"> 2174 2174 <desc>Whether the share is writable or readonly</desc> 2175 </param> 2176 <param name="automount" type="boolean" dir="in"> 2177 <desc>Whether the share gets automatically mounted by the guest 2178 or not.</desc> 2175 2179 </param> 2176 2180 </method> … … 3876 3880 <interface 3877 3881 name="IMachine" extends="$unknown" 3878 uuid=" 276e0f43-889b-4b87-b05f-35f1db814700"3882 uuid="de8f0b23-f285-4779-acf4-08eddda7ec75" 3879 3883 wsmap="managed" 3880 3884 > … … 5382 5386 </param> 5383 5387 <param name="writable" type="boolean" dir="in"> 5384 <desc>Whether the share is writable or readonly</desc> 5388 <desc>Whether the share is writable or readonly.</desc> 5389 </param> 5390 <param name="automount" type="boolean" dir="in"> 5391 <desc>Whether the share gets automatically mounted by the guest 5392 or not.</desc> 5385 5393 </param> 5386 5394 </method> … … 5957 5965 <interface 5958 5966 name="IConsole" extends="$unknown" 5959 uuid=" 6375231a-c17c-464b-92cb-ae9e128d71c3"5967 uuid="9e467cff-98fc-4f5b-83aa-048d903694c9" 5960 5968 wsmap="managed" 5961 5969 > … … 6470 6478 <param name="writable" type="boolean" dir="in"> 6471 6479 <desc>Whether the share is writable or readonly</desc> 6480 </param> 6481 <param name="automount" type="boolean" dir="in"> 6482 <desc>Whether the share gets automatically mounted by the guest 6483 or not.</desc> 6472 6484 </param> 6473 6485 </method> … … 12259 12271 <interface 12260 12272 name="ISharedFolder" extends="$unknown" 12261 uuid=" 64637bb2-9e17-471c-b8f3-f8968dd9884e"12273 uuid="8388da11-b559-4574-a5b7-2bd7acd5cef8" 12262 12274 wsmap="struct" 12263 12275 > … … 12334 12346 Whether the folder defined by the host path is writable or 12335 12347 not. 12348 </desc> 12349 </attribute> 12350 12351 <attribute name="autoMount" type="boolean" readonly="yes"> 12352 <desc> 12353 Whether the folder gets automatically mounted by the guest or not. 12336 12354 </desc> 12337 12355 </attribute> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r30832 r31002 145 145 STDMETHOD(FindUSBDeviceByAddress)(IN_BSTR aAddress, IUSBDevice **aDevice); 146 146 STDMETHOD(FindUSBDeviceById)(IN_BSTR aId, IUSBDevice **aDevice); 147 STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable );147 STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount); 148 148 STDMETHOD(RemoveSharedFolder)(IN_BSTR aName); 149 149 STDMETHOD(TakeSnapshot)(IN_BSTR aName, IN_BSTR aDescription, … … 389 389 public: 390 390 SharedFolderData() {} 391 SharedFolderData(Bstr aHostPath, BOOL aWritable )391 SharedFolderData(Bstr aHostPath, BOOL aWritable, BOOL aAutoMount) 392 392 : mHostPath(aHostPath) 393 , mWritable(aWritable) {} 393 , mWritable(aWritable) 394 , mAutoMount(aAutoMount) {} 394 395 SharedFolderData(const SharedFolderData& aThat) 395 396 : mHostPath(aThat.mHostPath) 396 , mWritable(aThat.mWritable) {} 397 , mWritable(aThat.mWritable) 398 , mAutoMount(aThat.mAutoMount) {} 397 399 Bstr mHostPath; 398 400 BOOL mWritable; 401 BOOL mAutoMount; 399 402 }; 400 403 typedef std::map <Bstr, ComObjPtr<SharedFolder> > SharedFolderMap; -
trunk/src/VBox/Main/include/MachineImpl.h
r30956 r31002 487 487 STDMETHOD(FindSnapshot)(IN_BSTR aName, ISnapshot **aSnapshot); 488 488 STDMETHOD(SetCurrentSnapshot)(IN_BSTR aId); 489 STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable );489 STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount); 490 490 STDMETHOD(RemoveSharedFolder)(IN_BSTR aName); 491 491 STDMETHOD(CanShowConsoleWindow)(BOOL *aCanShow); -
trunk/src/VBox/Main/include/SharedFolderImpl.h
r30764 r31002 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 37 37 const Bstr hostPath; 38 38 BOOL writable; 39 BOOL autoMount; 39 40 Bstr lastAccessError; 40 41 }; … … 58 59 59 60 // public initializer/uninitializer for internal purposes only 60 HRESULT init(Machine *aMachine, CBSTR aName, CBSTR aHostPath, BOOL aWritable );61 HRESULT init(Machine *aMachine, CBSTR aName, CBSTR aHostPath, BOOL aWritable, BOOL aAutoMount); 61 62 HRESULT initCopy(Machine *aMachine, SharedFolder *aThat); 62 HRESULT init(Console *aConsole, CBSTR aName, CBSTR aHostPath, BOOL aWritable );63 HRESULT init(VirtualBox *aVirtualBox, CBSTR aName, CBSTR aHostPath, BOOL aWritable );63 HRESULT init(Console *aConsole, CBSTR aName, CBSTR aHostPath, BOOL aWritable, BOOL aAutoMount); 64 HRESULT init(VirtualBox *aVirtualBox, CBSTR aName, CBSTR aHostPath, BOOL aWritable, BOOL aAutoMount); 64 65 void uninit(); 65 66 … … 69 70 STDMETHOD(COMGETTER(Accessible)) (BOOL *aAccessible); 70 71 STDMETHOD(COMGETTER(Writable)) (BOOL *aWritable); 72 STDMETHOD(COMGETTER(AutoMount)) (BOOL *aAutoMount); 71 73 STDMETHOD(COMGETTER(LastAccessError)) (BSTR *aLastAccessError); 72 74 … … 80 82 const Bstr& getHostPath() const { return m.hostPath; } 81 83 BOOL isWritable() const { return m.writable; } 84 BOOL isAutoMounted() const { return m.autoMount; } 82 85 83 86 protected: 84 87 85 88 HRESULT protectedInit(VirtualBoxBase *aParent, 86 CBSTR aName, CBSTR aHostPath, BOOL aWritable);87 89 CBSTR aName, CBSTR aHostPath, 90 BOOL aWritable, BOOL aAutoMount); 88 91 private: 89 92 -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r30956 r31002 150 150 151 151 STDMETHOD(GetGuestOSType) (IN_BSTR aId, IGuestOSType **aType); 152 STDMETHOD(CreateSharedFolder) (IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable );152 STDMETHOD(CreateSharedFolder) (IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount); 153 153 STDMETHOD(RemoveSharedFolder) (IN_BSTR aName); 154 154 STDMETHOD(GetExtraDataKeys) (ComSafeArrayOut(BSTR, aKeys)); -
trunk/src/VBox/Main/xml/Settings.cpp
r30983 r31002 1438 1438 && (strHostPath == g.strHostPath) 1439 1439 && (fWritable == g.fWritable) 1440 && (fAutoMount == g.fAutoMount) 1440 1441 ) 1441 1442 ); … … 2497 2498 pelmFolder->getAttributeValue("hostPath", sf.strHostPath); 2498 2499 pelmFolder->getAttributeValue("writable", sf.fWritable); 2500 pelmFolder->getAttributeValue("autoMount", sf.fAutoMount); 2499 2501 hw.llSharedFolders.push_back(sf); 2500 2502 } … … 3540 3542 pelmThis->setAttribute("hostPath", sf.strHostPath); 3541 3543 pelmThis->setAttribute("writable", sf.fWritable); 3544 pelmThis->setAttribute("autoMount", sf.fAutoMount); 3542 3545 } 3543 3546
Note:
See TracChangeset
for help on using the changeset viewer.