VirtualBox

Changeset 47535 in vbox for trunk/src/VBox/Runtime/include


Ignore:
Timestamp:
Aug 5, 2013 1:54:25 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87725
Message:

IPRT: Wrote native NT directory enumeration - not enabled by default. Provides ChangeTime and later file ID (inode no). Can also enumerate object directories, just for the fun of it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/dir.h

    r44528 r47535  
    8484    /** The length of the converted filename. */
    8585    size_t              cchName;
     86    /** The size of this structure. */
     87    size_t              cbSelf;
    8688
    87 #ifdef RT_OS_WINDOWS
     89#ifndef RTDIR_AGNOSTIC
     90# ifdef RT_OS_WINDOWS
    8891    /** Handle to the opened directory search. */
    8992    HANDLE              hDir;
     93#  ifndef RT_USE_NATIVE_NT
    9094    /** Find data buffer.
    9195     * fDataUnread indicates valid data. */
    9296    WIN32_FIND_DATAW    Data;
    93 
    94 #else /* 'POSIX': */
     97#  else
     98    /** The size of the name buffer pszName points to. */
     99    size_t              cbNameAlloc;
     100    /** NT filter string. */
     101    UNICODE_STRING      NtFilterStr;
     102    /** Pointer to NtFilterStr if applicable, otherwise NULL. */
     103    PUNICODE_STRING     pNtFilterStr;
     104    /** The information class we're using. */
     105    FILE_INFORMATION_CLASS enmInfoClass;
     106    /** Object directory context data. */
     107    ULONG               uObjDirCtx;
     108    /** Pointer to the current data entry in the buffer. */
     109    union
     110    {
     111        /** Both file names, no file ID. */
     112        PFILE_BOTH_DIR_INFORMATION      pBoth;
     113        /** Both file names with file ID. */
     114        PFILE_ID_BOTH_DIR_INFORMATION   pBothId;
     115        /** Object directory info. */
     116        POBJECT_DIRECTORY_INFORMATION   pObjDir;
     117        /** Unsigned view. */
     118        uintptr_t                       u;
     119    }                   uCurData;
     120    /** The amount of valid data in the buffer. */
     121    uint32_t            cbBuffer;
     122    /** The allocate buffer size. */
     123    uint32_t            cbBufferAlloc;
     124    /** Find data buffer containing multiple directory entries.
     125     * fDataUnread indicates valid data. */
     126    uint8_t            *pabBuffer;
     127#  endif
     128# else /* 'POSIX': */
    95129    /** What opendir() returned. */
    96130    DIR                *pDir;
    97     /** The max size of the d_name member.
    98      * This includes the 0 terminator of course.*/
    99     size_t              cbMaxName;
    100131    /** Find data buffer.
    101132     * fDataUnread indicates valid data. */
    102133    struct dirent       Data;
     134# endif
    103135#endif
    104136} RTDIR;
     
    131163int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf);
    132164
     165/**
     166 * Returns the size of the directory structure.
     167 *
     168 * @returns The size in bytes.
     169 * @param   pszPath     The path to the directory we're about to open.
     170 */
     171size_t rtDirNativeGetStructSize(const char *pszPath);
     172
    133173#endif
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