VirtualBox

Changeset 6716 in vbox


Ignore:
Timestamp:
Feb 1, 2008 12:53:34 PM (17 years ago)
Author:
vboxsync
Message:

adapted BFE to readonly shared folders

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/shflsvc.h

    r6384 r6716  
    946946     * True (default) if the folder is writable.
    947947     */
     948    HGCMFunctionParameter writable;
    948949
    949950} VBoxSFAddMapping;
  • trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp

    r5999 r6716  
    177177static const char *g_pszShareDir[MaxSharedFolders];
    178178static const char *g_pszShareName[MaxSharedFolders];
     179static bool        g_fShareReadOnly[MaxSharedFolders];
    179180static unsigned    g_uNumShares;
    180181static bool        g_fPreAllocRam = false;
     
    361362             "  -restore           Restore the VM if the statefile exists, normal start otherwise\n"
    362363             "  -nofstoggle        Forbid switching to/from fullscreen mode\n"
    363              "  -share <dir><name> Share directory <dir> as name <name>\n"
     364             "  -share <dir> <name> [readonly]\n"
     365             "                     Share directory <dir> as name <name>. Optionally read-only.\n"
    364366             "  -nohostkey         Disable hostkey\n"
    365367             "  -[no]acpi          Enable or disable ACPI (default: enabled)\n"
     
    543545                return SyntaxError("missing 2nd argument for share!\n");
    544546            g_pszShareName[g_uNumShares] = argv[curArg];
     547            if (curArg < argc-1 && strcmp(argv[curArg+1], "readonly") == 0)
     548            {
     549                g_fShareReadOnly[g_uNumShares] = true;
     550                curArg++;
     551            }
    545552            g_uNumShares++;
    546553        }
     
    11721179        for (unsigned i=0; i<g_uNumShares; i++)
    11731180        {
    1174             VBOXHGCMSVCPARM  parms[2];
     1181            VBOXHGCMSVCPARM  parms[SHFL_CPARMS_ADD_MAPPING];
    11751182            SHFLSTRING      *pFolderName, *pMapName;
    11761183            int              cbString;
     
    12071214            parms[1].u.pointer.size = sizeof (SHFLSTRING) + cbString;
    12081215
     1216            parms[2].type = VBOX_HGCM_SVC_PARM_32BIT;
     1217            parms[2].u.uint32 = !g_fShareReadOnly[i];
     1218
    12091219            rc = gVMMDev->hgcmHostCall ("VBoxSharedFolders",
    1210                                         SHFL_FN_ADD_MAPPING, 2, &parms[0]);
     1220                                        SHFL_FN_ADD_MAPPING, SHFL_CPARMS_ADD_MAPPING, &parms[0]);
    12111221            AssertRC(rc);
    12121222            LogRel(("Added share %s: (%s)\n", g_pszShareName[i], g_pszShareDir[i]));
  • trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflSizes.cpp

    r6329 r6716  
    7676    STRUCT(VBoxSFRemove, 52);
    7777    STRUCT(VBoxSFRename, 64);
    78     STRUCT(VBoxSFAddMapping, 40);
     78    STRUCT(VBoxSFAddMapping, 44); /* changed after 1.5.4, not critical since only used by the host */
    7979    STRUCT(VBoxSFRemoveMapping, 28);
    8080
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette