VirtualBox

Changeset 99085 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Mar 21, 2023 12:15:00 PM (23 months ago)
Author:
vboxsync
Message:

Guest Control: Added directory listing support via IDirectory::list(). Added (randomized) testcase support for it. bugref:9783

Location:
trunk/src/VBox/Main/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h

    r99011 r99085  
    14571457
    14581458
    1459 /*******************************************************************************
    1460 * Callback data structures.                                                    *
    1461 *                                                                              *
    1462 * These structures make up the actual low level HGCM callback data sent from   *
    1463 * the guest back to the host.                                                  *
    1464 *******************************************************************************/
     1459/*********************************************************************************************************************************
     1460 * Callback data structures.                                                                                                     *
     1461 *                                                                                                                               *
     1462 * These structures make up the actual low level HGCM callback data sent from                                                    *
     1463 * the guest back to the host.                                                                                                   *
     1464 ********************************************************************************************************************************/
    14651465
    14661466/**
     
    16361636
    16371637/**
     1638 * Callback data for a single GSTCTLDIRENTRYEX entry.
     1639 */
     1640typedef struct CALLBACKDATA_DIR_ENTRY
     1641{
     1642    /** Pointer to directory entry information. */
     1643    PGSTCTLDIRENTRYEX pDirEntryEx;
     1644    /** Size (in bytes) of directory entry information. */
     1645    uint32_t          cbDirEntryEx;
     1646    /** Resolved user name.
     1647     *  This is the object owner for UNIX-y Oses. */
     1648    char             *pszUser;
     1649    /** Size (in bytes) of \a pszUser. */
     1650    uint32_t          cbUser;
     1651    /** Resolved user group(s). */
     1652    char             *pszGroups;
     1653    /** Size (in bytes) of \a pszGroups. */
     1654    uint32_t          cbGroups;
     1655} CALLBACKDATA_DIR_ENTRY;
     1656/** Pointer to a CALLBACKDATA_DIR_ENTRY struct. */
     1657typedef CALLBACKDATA_DIR_ENTRY *PCALLBACKDATA_DIR_ENTRY;
     1658
     1659/**
    16381660 * Callback data for guest directory operations.
    16391661 */
     
    16611683        struct
    16621684        {
    1663             /** Pointer to directory entry information. */
    1664             PGSTCTLDIRENTRYEX pEntry;
    1665             /** Size (in bytes) of directory entry information. */
    1666             uint32_t          cbEntry;
    1667             /** Resolved user name.
    1668              *  This is the object owner for UNIX-y Oses. */
    1669             char             *pszUser;
    1670             /** Size (in bytes) of \a pszUser. */
    1671             uint32_t          cbUser;
    1672             /** Resolved user group(s). */
    1673             char             *pszGroups;
    1674             /** Size (in bytes) of \a pszGroups. */
    1675             uint32_t          cbGroups;
     1685            /** Single entry read. */
     1686            CALLBACKDATA_DIR_ENTRY Entry;
    16761687        } read;
     1688        struct
     1689        {
     1690            /** Number of entries in \a paEntries. */
     1691            uint32_t                 cEntries;
     1692            /** Array of entries read. */
     1693            CALLBACKDATA_DIR_ENTRY **paEntries;
     1694        } list;
    16771695    } u;
    16781696} CALLBACKDATA_DIR_NOTIFY;
  • trunk/src/VBox/Main/include/GuestDirectoryImpl.h

    r98709 r99085  
    7272    EventSource   *i_getEventSource(void) { return mEventSource; }
    7373    int            i_onDirNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
     74    int            i_listInternal(uint32_t cMaxEntries, uint32_t fFlags, std::vector<GuestFsObjData> &vecObjData, int *pvrcGuest);
     75    int            i_listEx(uint32_t cMaxEntries, uint32_t fFlags, std::vector<ComObjPtr<GuestFsObjInfo>> &vecObjInfo, int *pvrcGuest);
     76    int            i_list(uint32_t cMaxEntries, std::vector<ComObjPtr<GuestFsObjInfo>> &vecObjInfo, int *pvrcGuest);
    7477    int            i_read(ComObjPtr<GuestFsObjInfo> &fsObjInfo, int *pvrcGuest);
    7578    int            i_readInternal(GuestFsObjData &objData, int *pvrcGuest);
     
    8992     * @{ */
    9093    static Utf8Str i_guestErrorToString(int vrcGuest, const char *pcszWhat);
     94    static void    i_dirNotifyDataDestroy(PCALLBACKDATA_DIR_NOTIFY pDirNotify);
    9195    /** @}  */
    9296
     
    105109    HRESULT getId(ULONG *aId);
    106110    HRESULT getStatus(DirectoryStatus_T *aStatus);
     111    HRESULT list(ULONG aMaxEntries, std::vector<ComPtr<IFsObjInfo> > &aObjInfos);
    107112    HRESULT read(ComPtr<IFsObjInfo> &aObjInfo);
    108113    HRESULT rewind(void);
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