VirtualBox

Changeset 99262 in vbox for trunk/include


Ignore:
Timestamp:
Apr 3, 2023 3:17:07 PM (20 months ago)
Author:
vboxsync
Message:

Guest Control: Implements IGuestSession::fsQueryInfo() and IGuestSession::fsQueryFreeSpace(). bugref:10414

Location:
trunk/include/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/GuestControl.h

    r99120 r99262  
    4444
    4545#include <iprt/time.h>
     46#include <iprt/path.h>
    4647#include <iprt/types.h>
    4748
     
    266267    INPUT_STS_OVERFLOW = 30
    267268};
     269
     270/** @name Guest filesystem flags.
     271 *
     272 * @{
     273 */
     274/** No guest file system flags set. */
     275#define GSTCTLFSINFO_F_NONE                         UINT32_C(0)
     276/** If the filesystem is remote or not. */
     277#define GSTCTLFSINFO_F_IS_REMOTE                    RT_BIT(0)
     278/** If the filesystem is case sensitive or not. */
     279#define GSTCTLFSINFO_F_IS_CASE_SENSITIVE            RT_BIT(1)
     280/** If the filesystem is mounted read only or not. */
     281#define GSTCTLFSINFO_F_IS_READ_ONLY                 RT_BIT(2)
     282/** If the filesystem is compressed or not. */
     283#define GSTCTLFSINFO_F_IS_COMPRESSED                RT_BIT(3)
     284/** Valid mask. */
     285#define GSTCTLFSINFO_F_VALID_MASK                   0xF
     286/** @} */
     287
     288/** @name Guest filesystem feature flags.
     289 *
     290 * @{
     291 */
     292/** No guest file system feature flags set. */
     293#define GSTCTLFSINFO_FEATURE_F_NONE                 UINT32_C(0)
     294/** If the filesystem can handle Unicode or not. */
     295#define GSTCTLFSINFO_FEATURE_F_UNICODE              RT_BIT(0)
     296/** If the filesystem supports sparse files or not. */
     297#define GSTCTLFSINFO_FEATURE_F_SPARSE_FILES         RT_BIT(1)
     298/** If the filesystem features compression of individual files or not. */
     299#define GSTCTLFSINFO_FEATURE_F_FILE_COMPRESSION     RT_BIT(2)
     300/** Valid mask. */
     301#define GSTCTLFSINFO_FEATURE_F_VALID_MASK           0x7
     302/** @} */
     303
     304/** Maximum length (in characters) of a guest file name. */
     305#define GSTCTL_FS_NAME_MAX                          255
     306/** Maximum length (in characters) of a guest file label. */
     307#define GSTCTL_FS_LABEL_MAX                         255
     308/** Maximum length (in characters) of a guest filesystem mount point. */
     309#define GSTCTL_FS_MOUNTPOINT_MAX                    RTPATH_MAX
     310
     311/**
     312 * Guest filesystem information.
     313 */
     314#pragma pack(1)
     315typedef struct GSTCTLFSINFO
     316{
     317    /** Remaining free space (in bytes) of the filesystem. */
     318    uint64_t cbFree;
     319    /** Total space (in bytes) of the filesystem. */
     320    uint64_t cbTotalSize;
     321    /** Block size (in bytes) of the filesystem. */
     322    uint32_t cbBlockSize;
     323    /** Sector size (in bytes) of the filesystem. */
     324    uint32_t cbSectorSize;
     325    /** Serial number of the filesystem. */
     326    uint32_t uSerialNumber;
     327    /** Flags (of type GSTCTLFSINFO_F_XXX). */
     328    uint32_t fFlags;
     329    /** Feature flags (of type GSTCTLFSINFO_FEATURE_F_XXX). */
     330    uint32_t fFeatures;
     331    /** The maximum size (in characters) of a filesystem object name. */
     332    uint32_t cMaxComponent;
     333    /** Name of the filesystem type. */
     334    char     szName[GSTCTL_FS_NAME_MAX];
     335    /** Label of the filesystem. */
     336    char     szLabel[GSTCTL_FS_LABEL_MAX];
     337    /** Size (in bytes) of \a szMountpoint. */
     338    uint16_t cbMountpoint;
     339    /** Mount point of the filesystem.
     340     *  Will be dynamically allocated, based on \a cbMountpoint. */
     341    char     szMountpoint[1];
     342} GSTCTLFSINFO;
     343#pragma pack()
     344AssertCompileSize(GSTCTLFSINFO, 553);
     345/** Pointer to a guest filesystem structure. */
     346typedef GSTCTLFSINFO *PGSTCTLFSINFO;
     347/** Pointer to a const guest filesystem structure. */
     348typedef const GSTCTLFSINFO *PCGSTCTLFSINFO;
    268349
    269350/**
  • trunk/include/VBox/HostServices/GuestControlSvc.h

    r99256 r99262  
    268268     */
    269269    HOST_MSG_FS_CREATE_TEMP = 335,
     270    /**
     271     * Retrieves information about a guest file system.
     272     */
     273    HOST_MSG_FS_QUERY_INFO = 336,
    270274#endif /* VBOX_WITH_GSTCTL_TOOLBOX_AS_CMDS */
    271275    /** Blow the type up to 32-bits. */
     
    318322        RT_CASE_RET_STR(HOST_MSG_FS_OBJ_QUERY_INFO);
    319323        RT_CASE_RET_STR(HOST_MSG_FS_CREATE_TEMP);
     324        RT_CASE_RET_STR(HOST_MSG_FS_QUERY_INFO);
    320325#endif /* VBOX_WITH_GSTCTL_TOOLBOX_AS_CMDS */
    321326        RT_CASE_RET_STR(HOST_MSG_32BIT_HACK);
     
    772777{
    773778    /** Unknown fs notification type; do not use. */
    774     GUEST_FS_NOTIFYTYPE_UNKNOWN     = 0,
     779    GUEST_FS_NOTIFYTYPE_UNKNOWN        = 0,
     780    /** Temporary directory creation notification from the guest.
     781     *  @since 7.1 */
     782    GUEST_FS_NOTIFYTYPE_CREATE_TEMP    = 1,
     783    /** File system object query information notification from the guest.
     784     *  @since 7.1 */
     785    GUEST_FS_NOTIFYTYPE_QUERY_OBJ_INFO = 2,
    775786    /** File system query information notification from the guest.
    776787     *  @since 7.1 */
    777     GUEST_FS_NOTIFYTYPE_QUERY_INFO  = 2,
    778     /** Temporary directory creation notification from the guest.
    779      *  @since 7.1 */
    780     GUEST_FS_NOTIFYTYPE_CREATE_TEMP = 1
     788    GUEST_FS_NOTIFYTYPE_QUERY_INFO     = 3
    781789};
    782790
     
    968976    HGCMFunctionParameter mode;
    969977} HGCMMsgFsCreateTemp;
     978
     979/**
     980 * Queries information of a file system on the guest.
     981 */
     982typedef struct HGCMMsgFsQueryInfo
     983{
     984    VBGLIOCHGCMCALL hdr;
     985    /** Context ID. */
     986    HGCMFunctionParameter context;
     987    /** Path to query file system information for. */
     988    HGCMFunctionParameter path;
     989} HGCMMsgFsQueryInfo;
    970990
    971991/**
     
    16181638    {
    16191639        /**
    1620          * Parameters used for \a type GUEST_FS_NOTIFYTYPE_QUERY_INFO.
     1640         * Parameters used for \a type GUEST_FS_NOTIFYTYPE_CREATE_TEMP.
     1641         *
     1642         * @since 7.1
     1643         */
     1644        struct
     1645        {
     1646            /** The create temporary file / directory when \a rc
     1647             *  indicates success. */
     1648            HGCMFunctionParameter path;
     1649        } createtemp;
     1650        /**
     1651         * Parameters used for \a type GUEST_FS_NOTIFYTYPE_QUERY_OBJ_INFO.
    16211652         *
    16221653         * @since 7.1
     
    16331664             *  the first group always is the primary group. */
    16341665            HGCMFunctionParameter groups;
    1635         } queryinfo;
     1666        } queryobjinfo;
    16361667        /**
    1637          * Parameters used for \a type GUEST_FS_NOTIFYTYPE_CREATE_TEMP.
     1668         * Parameters used for \a type GUEST_FS_NOTIFYTYPE_QUERY_INFO.
    16381669         *
    16391670         * @since 7.1
     
    16411672        struct
    16421673        {
    1643             /** The create temporary file / directory when \a rc
    1644              *  indicates success. */
    1645             HGCMFunctionParameter path;
    1646         } createtemp;
     1674            /** File system object information (GSTCTLFSINFO). */
     1675            HGCMFunctionParameter fs_info;
     1676        } queryinfo;
    16471677    } u;
    16481678} HGCMReplyFsNotify;
  • trunk/include/VBox/VBoxGuestLib.h

    r99257 r99262  
    10981098 * @{
    10991099 */
     1100VBGLR3DECL(int) VbglR3GuestCtrlFsGetCreateTemp(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszTemplate, uint32_t cbTemplate, char *pszPath, uint32_t cbPath, uint32_t *pfFlags, uint32_t *pfMode);
     1101VBGLR3DECL(int) VbglR3GuestCtrlFsGetQueryInfo(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszPath, uint32_t cbPath);
     1102/** @} */
     1103
     1104/** @name Guest Control file system object functions.
     1105 * @{
     1106 */
    11001107VBGLR3DECL(int) VbglR3GuestCtrlFsObjGetQueryInfo(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszPath, uint32_t cbPath, GSTCTLFSOBJATTRADD *penmAddAttrib, uint32_t *pfFlags);
    1101 VBGLR3DECL(int) VbglR3GuestCtrlFsGetCreateTemp(PVBGLR3GUESTCTRLCMDCTX pCtx, char *pszTemplate, uint32_t cbTemplate, char *pszPath, uint32_t cbPath, uint32_t *pfFlags, uint32_t *pfMode);
    11021108/** @} */
    11031109#  endif
     1110
    11041111VBGLR3DECL(int) VbglR3GuestCtrlGetShutdown(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *pfAction);
    11051112/* Guest process execution. */
     
    11801187 * @{
    11811188 */
     1189VBGLR3DECL(int) VbglR3GuestCtrlFsCbCreateTemp(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, const char *pszPath);
     1190VBGLR3DECL(int) VbglR3GuestCtrlFsCbQueryInfo(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLFSINFO pFsInfo, uint32_t cbFsInfo);
     1191/** @} */
     1192
     1193/** @name Guest Control file system object callbacks.
     1194 * @{
     1195 */
    11821196VBGLR3DECL(int) VbglR3GuestCtrlFsObjCbQueryInfoEx(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLFSOBJINFO pObjInfo, const char *pszUser, const char *pszGroups);
    11831197VBGLR3DECL(int) VbglR3GuestCtrlFsObjCbQueryInfo(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLFSOBJINFO pObjInfo);
    1184 VBGLR3DECL(int) VbglR3GuestCtrlFsCbCreateTemp(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, const char *pszPath);
    11851198/** @} */
    11861199#  endif /* VBOX_WITH_GSTCTL_TOOLBOX_AS_CMDS */
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