VirtualBox

Changeset 42385 in vbox


Ignore:
Timestamp:
Jul 25, 2012 11:52:31 AM (12 years ago)
Author:
vboxsync
Message:

Main/glue: Add a flag to GetVBoxUserHomeDirectory to disable creating the VirtualBox settings directory automatically

Location:
trunk
Files:
2 edited

Legend:

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

    r41040 r42385  
    7373 *  this method will return VERR_BUFFER_OVERFLOW.
    7474 *
    75  *  @param aDir     Buffer to store the directory string in UTF-8 encoding.
    76  *  @param aDirLen  Length of the supplied buffer including space for the
    77  *                  terminating null character, in bytes.
    78  *  @return         VBox status code.
     75 *  @param aDir        Buffer to store the directory string in UTF-8 encoding.
     76 *  @param aDirLen     Length of the supplied buffer including space for the
     77 *                     terminating null character, in bytes.
     78 *  @param fCreateDir  Flag whether to create the returned directory on success if it
     79 *                     doesn't exist.
     80 *  @return            VBox status code.
    7981 */
    80 int GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen);
     82int GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen, bool fCreateDir = true);
    8183
    8284/**
  • trunk/src/VBox/Main/glue/com.cpp

    r41040 r42385  
    182182#endif // VBOX_WITH_XPCOM
    183183
    184 int GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen)
     184int GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen, bool fCreateDir)
    185185{
    186186    AssertReturn(aDir, VERR_INVALID_POINTER);
     
    211211        /* ensure the home directory exists */
    212212        if (RT_SUCCESS(vrc))
    213             if (!RTDirExists(aDir))
     213            if (!RTDirExists(aDir) && fCreateDir)
    214214                vrc = RTDirCreateFullPath(aDir, 0700);
    215215    }
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