VirtualBox

Changeset 69753 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Nov 19, 2017 2:27:58 PM (7 years ago)
Author:
vboxsync
Message:

iprt/dir: Morphing PRTDIR into a handle named RTDIR. (Been wanting to correct this for years. Don't know why I makde it a pointer rather than an abstrct handle like everything else.)

Location:
trunk/src/VBox/Runtime
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/store-cert-add-basic.cpp

    r69111 r69753  
    659659             * Enumerate the directory.
    660660             */
    661             PRTDIR hDir;
     661            RTDIR hDir;
    662662            rc = RTDirOpen(&hDir, pszDir);
    663663            if (RT_SUCCESS(rc))
     
    767767             * Enumerate the directory.
    768768             */
    769             PRTDIR hDir;
     769            RTDIR hDir;
    770770            rc = RTDirOpen(&hDir, pszDir);
    771771            if (RT_SUCCESS(rc))
  • trunk/src/VBox/Runtime/common/dbg/dbgcfg.cpp

    r69111 r69753  
    357357    *pszName = '\0';
    358358
    359     PRTDIR pDir;
    360     int rc = RTDirOpen(&pDir, pszPath);
     359    RTDIR hDir;
     360    int rc = RTDirOpen(&hDir, pszPath);
    361361    if (RT_FAILURE(rc))
    362362        return false;
     
    373373        } u;
    374374        size_t cbBuf = sizeof(u);
    375         rc = RTDirRead(pDir, &u.Entry, &cbBuf);
     375        rc = RTDirRead(hDir, &u.Entry, &cbBuf);
    376376        if (RT_FAILURE(rc))
    377377            break;
     
    387387            if (u.Entry.enmType == enmType)
    388388            {
    389                 RTDirClose(pDir);
     389                RTDirClose(hDir);
    390390                return true;
    391391            }
     
    393393    }
    394394
    395     RTDirClose(pDir);
     395    RTDirClose(hDir);
    396396    *pszName = '\0';
    397397
  • trunk/src/VBox/Runtime/common/path/RTPathGlob.cpp

    r69111 r69753  
    14471447 * @param   cbNeeded    The required entry size.
    14481448 */
    1449 DECL_NO_INLINE(static, int) rtPathGlobSkipDirEntry(PRTDIR hDir, size_t cbNeeded)
     1449DECL_NO_INLINE(static, int) rtPathGlobSkipDirEntry(RTDIR hDir, size_t cbNeeded)
    14501450{
    14511451    int rc = VERR_BUFFER_OVERFLOW;
     
    18751875     * Enumerate entire directory and match each entry.
    18761876     */
    1877     PRTDIR hDir;
     1877    RTDIR hDir;
    18781878    int rc = RTDirOpen(&hDir, offPath ? pGlob->szPath : ".");
    18791879    if (RT_SUCCESS(rc))
  • trunk/src/VBox/Runtime/common/path/RTPathRmCmd.cpp

    r69111 r69753  
    270270     * Traverse the directory.
    271271     */
    272     PRTDIR hDir;
     272    RTDIR hDir;
    273273    int rc = RTDirOpen(&hDir, pszPath);
    274274    if (RT_FAILURE(rc))
  • trunk/src/VBox/Runtime/common/vfs/vfsstddir.cpp

    r69720 r69753  
    5454{
    5555    /** The directory handle. */
    56     PRTDIR          hDir;
     56    RTDIR           hDir;
    5757    /** Whether to leave the handle open when the VFS handle is closed. */
    5858    bool            fLeaveOpen;
     
    8888static DECLCALLBACK(int) rtVfsStdDir_QueryEntryInfo(void *pvThis, const char *pszEntry,
    8989                                                    PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr);
    90 static int rtVfsDirFromRTDir(PRTDIR hDir, uint32_t fFlags, bool fLeaveOpen, PRTVFSDIR phVfsDir);
     90static int rtVfsDirFromRTDir(RTDIR hDir, uint32_t fFlags, bool fLeaveOpen, PRTVFSDIR phVfsDir);
    9191
    9292
     
    329329    PRTVFSSTDDIR pThis = (PRTVFSSTDDIR)pvThis;
    330330    /** @todo subdir open flags */
    331     PRTDIR hSubDir;
     331    RTDIR hSubDir;
    332332    int rc = RTDirRelDirOpenFiltered(pThis->hDir, pszSubDir, RTDIRFILTER_NONE, fFlags, &hSubDir);
    333333    if (RT_SUCCESS(rc))
     
    352352    else
    353353    {
    354         PRTDIR hSubDir;
     354        RTDIR hSubDir;
    355355        rc = RTDirRelDirCreate(pThis->hDir, pszSubDir, fMode, 0 /* fFlags */, &hSubDir);
    356356        if (RT_SUCCESS(rc))
     
    547547 * @param   phVfsDir            Where to return the handle.
    548548 */
    549 static int rtVfsDirFromRTDir(PRTDIR hDir, uint32_t fFlags, bool fLeaveOpen, PRTVFSDIR phVfsDir)
     549static int rtVfsDirFromRTDir(RTDIR hDir, uint32_t fFlags, bool fLeaveOpen, PRTVFSDIR phVfsDir)
    550550{
    551551    PRTVFSSTDDIR    pThis;
     
    567567
    568568
    569 RTDECL(int) RTVfsDirFromRTDir(PRTDIR hDir, bool fLeaveOpen, PRTVFSDIR phVfsDir)
     569RTDECL(int) RTVfsDirFromRTDir(RTDIR hDir, bool fLeaveOpen, PRTVFSDIR phVfsDir)
    570570{
    571571    AssertReturn(RTDirIsValid(hDir), VERR_INVALID_HANDLE);
     
    579579     * Open the file the normal way and pass it to RTVfsFileFromRTFile.
    580580     */
    581     PRTDIR hDir;
     581    RTDIR hDir;
    582582    int rc = RTDirOpenFiltered(&hDir, pszPath, RTDIRFILTER_NONE, fFlags);
    583583    if (RT_SUCCESS(rc))
  • trunk/src/VBox/Runtime/generic/RTDirQueryInfo-generic.cpp

    r69111 r69753  
    4545
    4646
    47 RTR3DECL(int) RTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
     47RTR3DECL(int) RTDirQueryInfo(RTDIR hDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
    4848{
    4949    /*
    5050     * Validate and digest input.
    5151     */
    52     if (!rtDirValidHandle(pDir))
     52    if (!rtDirValidHandle(hDir))
    5353        return VERR_INVALID_PARAMETER;
    54     return RTPathQueryInfoEx(pDir->pszPath, pObjInfo, enmAdditionalAttribs, RTPATH_F_FOLLOW_LINK);
     54    return RTPathQueryInfoEx(hDir->pszPath, pObjInfo, enmAdditionalAttribs, RTPATH_F_FOLLOW_LINK);
    5555}
    5656
  • trunk/src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp

    r69111 r69753  
    4646
    4747
    48 RTR3DECL(int) RTDirSetTimes(PRTDIR pDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
     48RTR3DECL(int) RTDirSetTimes(RTDIR hDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
    4949                            PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime)
    5050{
     
    5252     * Validate and digest input.
    5353     */
    54     if (!rtDirValidHandle(pDir))
     54    if (!rtDirValidHandle(hDir))
    5555        return VERR_INVALID_PARAMETER;
    56     return RTPathSetTimes(pDir->pszPath, pAccessTime, pModificationTime, pChangeTime, pBirthTime);
     56    return RTPathSetTimes(hDir->pszPath, pAccessTime, pModificationTime, pChangeTime, pBirthTime);
    5757}
    5858
  • trunk/src/VBox/Runtime/include/internal/dir.h

    r69716 r69753  
    3333
    3434
     35/** Pointer to the data behind an open directory handle. */
     36typedef struct RTDIRINTERNAL *PRTDIRINTERNAL;
     37
    3538/**
    3639 * Filter a the filename in the against a filter.
     
    4144 * @param   pszName     The path to match to the filter.
    4245 */
    43 typedef DECLCALLBACK(bool) FNRTDIRFILTER(PRTDIR pDir, const char *pszName);
     46typedef DECLCALLBACK(bool) FNRTDIRFILTER(PRTDIRINTERNAL pDir, const char *pszName);
    4447/** Pointer to a filter function. */
    4548typedef FNRTDIRFILTER *PFNRTDIRFILTER;
     
    4952 * Open directory.
    5053 */
    51 typedef struct RTDIR
     54typedef struct RTDIRINTERNAL
    5255{
    5356    /** Magic value, RTDIR_MAGIC. */
     
    138141# endif
    139142#endif
    140 } RTDIR;
     143} RTDIRINTERNAL;
     144
    141145
    142146
     
    146150 * @returns false if valid after having bitched about it first.
    147151 */
    148 DECLINLINE(bool) rtDirValidHandle(PRTDIR pDir)
     152DECLINLINE(bool) rtDirValidHandle(PRTDIRINTERNAL pDir)
    149153{
    150154    AssertMsgReturn(VALID_PTR(pDir), ("%p\n", pDir), false);
     
    169173 *                              we're to use (consume) hRelativeDir.
    170174 */
    171 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative);
     175int rtDirNativeOpen(PRTDIRINTERNAL pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative);
    172176
    173177/**
     
    180184
    181185
    182 DECLHIDDEN(int) rtDirOpenRelativeOrHandle(PRTDIR *ppDir, const char *pszRelativeAndFilter, RTDIRFILTER enmFilter, uint32_t fFlags,
    183                                           uintptr_t hRelativeDir, void *pvNativeRelative);
     186DECLHIDDEN(int) rtDirOpenRelativeOrHandle(RTDIR *phDir, const char *pszRelativeAndFilter, RTDIRFILTER enmFilter,
     187                                          uint32_t fFlags, uintptr_t hRelativeDir, void *pvNativeRelative);
    184188
    185189#endif
  • trunk/src/VBox/Runtime/include/internal/magics.h

    r69474 r69753  
    4747/** Magic value for RTDBGKRNLINFOINT::u32Magic. (John Carmack) */
    4848#define RTDBGKRNLINFO_MAGIC             UINT32_C(0x19700820)
    49 /** The value of RTDIR::u32Magic. (Michael Ende) */
     49/** The value of RTDIRINTERNAL::u32Magic. (Michael Ende) */
    5050#define RTDIR_MAGIC                     UINT32_C(0x19291112)
    51 /** The value of RTDIR::u32Magic after RTDirClose().  */
     51/** The value of RTDIRINTERNAL::u32Magic after RTDirClose().  */
    5252#define RTDIR_MAGIC_DEAD                UINT32_C(0x19950829)
    5353/** The value of RTDVMINTERNAL::u32Magic. (Dan Brown) */
  • trunk/src/VBox/Runtime/r0drv/nt/ntBldSymDb.cpp

    r69111 r69753  
    10031003
    10041004    /* Open directory. */
    1005     PRTDIR pDir;
    1006     int rc = RTDirOpen(&pDir, pszDir);
     1005    RTDIR hDir;
     1006    int rc = RTDirOpen(&hDir, pszDir);
    10071007    if (RT_FAILURE(rc))
    10081008        return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirOpen failed on '%s': %Rrc\n", pszDir, rc);
     
    10231023        /* Get the next directory. */
    10241024        size_t cbDirEntry = MY_DIRENTRY_BUF_SIZE;
    1025         rc = RTDirReadEx(pDir, pDirEntry, &cbDirEntry, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK);
     1025        rc = RTDirReadEx(hDir, pDirEntry, &cbDirEntry, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK);
    10261026        if (RT_FAILURE(rc))
    10271027            break;
    10281028
    10291029        /* Skip the dot and dot-dot links. */
    1030         if (   (pDirEntry->cbName == 1 && pDirEntry->szName[0] == '.')
    1031             || (pDirEntry->cbName == 2 && pDirEntry->szName[0] == '.' && pDirEntry->szName[1] == '.'))
     1030        if (RTDirEntryExIsStdDotLink(pDirEntry))
    10321031            continue;
    10331032
     
    10771076        rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirReadEx failed: %Rrc\npszDir=%.*s", rc, cchDir, pszDir);
    10781077
    1079     rc = RTDirClose(pDir);
     1078    rc = RTDirClose(hDir);
    10801079    if (RT_FAILURE(rc))
    10811080        rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirClose failed: %Rrc\npszDir=%.*s", rc, cchDir, pszDir);
  • trunk/src/VBox/Runtime/r3/dir.cpp

    r69716 r69753  
    4747
    4848
    49 static DECLCALLBACK(bool) rtDirFilterWinNtMatch(PRTDIR pDir, const char *pszName);
    50 static DECLCALLBACK(bool) rtDirFilterWinNtMatchNoWildcards(PRTDIR pDir, const char *pszName);
     49static DECLCALLBACK(bool) rtDirFilterWinNtMatch(PRTDIRINTERNAL pDir, const char *pszName);
     50static DECLCALLBACK(bool) rtDirFilterWinNtMatchNoWildcards(PRTDIRINTERNAL pDir, const char *pszName);
    5151DECLINLINE(bool) rtDirFilterWinNtMatchEon(PCRTUNICP puszFilter);
    5252static bool rtDirFilterWinNtMatchDosStar(unsigned iDepth, RTUNICP uc, const char *pszNext, PCRTUNICP puszFilter);
     
    117117 * @param   pszName     The path to match to the filter.
    118118 */
    119 static DECLCALLBACK(bool) rtDirFilterWinNtMatchNoWildcards(PRTDIR pDir, const char *pszName)
     119static DECLCALLBACK(bool) rtDirFilterWinNtMatchNoWildcards(PRTDIRINTERNAL pDir, const char *pszName)
    120120{
    121121    /*
     
    447447 * @param   pszName     The path to match to the filter.
    448448 */
    449 static DECLCALLBACK(bool) rtDirFilterWinNtMatch(PRTDIR pDir, const char *pszName)
     449static DECLCALLBACK(bool) rtDirFilterWinNtMatch(PRTDIRINTERNAL pDir, const char *pszName)
    450450{
    451451    return rtDirFilterWinNtMatchBase(0, pszName, pDir->puszFilter);
     
    460460 * @param   pDir        The directory handle (not yet opened).
    461461 */
    462 static PFNRTDIRFILTER rtDirFilterWinNtInit(PRTDIR pDir)
     462static PFNRTDIRFILTER rtDirFilterWinNtInit(PRTDIRINTERNAL pDir)
    463463{
    464464    /*
     
    506506 *
    507507 * @returns IPRT status code.
    508  * @param   ppDir               Where to store the directory handle.
     508 * @param   phDir               Where to store the directory handle.
    509509 * @param   pszPath             The specified path.
    510510 * @param   pszFilter           Pointer to where the filter start in the path.
     
    517517 *                              we're to use (consume) hRelativeDir.
    518518 */
    519 static int rtDirOpenCommon(PRTDIR *ppDir, const char *pszPath, const char *pszFilter, RTDIRFILTER enmFilter, uint32_t fFlags,
    520                            uintptr_t hRelativeDir, void *pvNativeRelative)
     519static int rtDirOpenCommon(RTDIR *phDir, const char *pszPath, const char *pszFilter, RTDIRFILTER enmFilter,
     520                           uint32_t fFlags, uintptr_t hRelativeDir, void *pvNativeRelative)
    521521{
    522522    /*
     
    576576                             + cbFilter
    577577                             + cchRealPath + 1 + 4;
    578     PRTDIR pDir = (PRTDIR)RTMemAllocZ(cbAllocated);
     578    PRTDIRINTERNAL pDir = (PRTDIRINTERNAL)RTMemAllocZ(cbAllocated);
    579579    if (!pDir)
    580580        return VERR_NO_MEMORY;
     
    631631    rc = rtDirNativeOpen(pDir, szRealPath, hRelativeDir, pvNativeRelative);
    632632    if (RT_SUCCESS(rc))
    633         *ppDir = pDir;
     633        *phDir = pDir;
    634634    else
    635635        RTMemFree(pDir);
     
    639639
    640640
    641 RTDECL(int) RTDirOpen(PRTDIR *ppDir, const char *pszPath)
     641RTDECL(int) RTDirOpen(RTDIR *phDir, const char *pszPath)
    642642{
    643643    /*
    644644     * Validate input.
    645645     */
    646     AssertMsgReturn(VALID_PTR(ppDir), ("%p\n", ppDir), VERR_INVALID_POINTER);
     646    AssertMsgReturn(VALID_PTR(phDir), ("%p\n", phDir), VERR_INVALID_POINTER);
    647647    AssertMsgReturn(VALID_PTR(pszPath), ("%p\n", pszPath), VERR_INVALID_POINTER);
    648648
     
    650650     * Take common cause with RTDirOpenFiltered().
    651651     */
    652     int rc = rtDirOpenCommon(ppDir, pszPath, NULL, RTDIRFILTER_NONE, 0 /*fFlags*/, ~(uintptr_t)0, NULL);
    653     LogFlow(("RTDirOpen(%p:{%p}, %p:{%s}): return %Rrc\n", ppDir, *ppDir, pszPath, pszPath, rc));
     652    int rc = rtDirOpenCommon(phDir, pszPath, NULL, RTDIRFILTER_NONE, 0 /*fFlags*/, ~(uintptr_t)0, NULL);
     653    LogFlow(("RTDirOpen(%p:{%p}, %p:{%s}): return %Rrc\n", phDir, *phDir, pszPath, pszPath, rc));
    654654    return rc;
    655655}
    656656
    657657
    658 DECLHIDDEN(int) rtDirOpenRelativeOrHandle(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags,
     658DECLHIDDEN(int) rtDirOpenRelativeOrHandle(RTDIR *phDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags,
    659659                                          uintptr_t hRelativeDir, void *pvNativeRelative)
    660660{
     
    662662     * Validate input.
    663663     */
    664     AssertMsgReturn(VALID_PTR(ppDir), ("%p\n", ppDir), VERR_INVALID_POINTER);
     664    AssertMsgReturn(VALID_PTR(phDir), ("%p\n", phDir), VERR_INVALID_POINTER);
    665665    AssertMsgReturn(VALID_PTR(pszPath), ("%p\n", pszPath), VERR_INVALID_POINTER);
    666666    AssertReturn(!(fFlags & ~RTDIR_F_VALID_MASK), VERR_INVALID_FLAGS);
     
    695695     * and initialize the handle, and finally call the backend.
    696696     */
    697     int rc = rtDirOpenCommon(ppDir, pszPath, pszFilter, enmFilter, fFlags, hRelativeDir, pvNativeRelative);
     697    int rc = rtDirOpenCommon(phDir, pszPath, pszFilter, enmFilter, fFlags, hRelativeDir, pvNativeRelative);
    698698
    699699    LogFlow(("RTDirOpenFiltered(%p:{%p}, %p:{%s}, %d, %#x, %p, %p): return %Rrc\n",
    700              ppDir,*ppDir, pszPath, pszPath, enmFilter, fFlags, hRelativeDir, pvNativeRelative, rc));
     700             phDir,*phDir, pszPath, pszPath, enmFilter, fFlags, hRelativeDir, pvNativeRelative, rc));
    701701    return rc;
    702702}
    703703
    704704
    705 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags)
    706 {
    707     return rtDirOpenRelativeOrHandle(ppDir, pszPath, enmFilter, fFlags, ~(uintptr_t)0, NULL);
    708 }
    709 
    710 
    711 RTDECL(bool) RTDirIsValid(PRTDIR hDir)
     705RTDECL(int) RTDirOpenFiltered(RTDIR *phDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags)
     706{
     707    return rtDirOpenRelativeOrHandle(phDir, pszPath, enmFilter, fFlags, ~(uintptr_t)0, NULL);
     708}
     709
     710
     711RTDECL(bool) RTDirIsValid(RTDIR hDir)
    712712{
    713713    return RT_VALID_PTR(hDir)
  • trunk/src/VBox/Runtime/r3/dir2.cpp

    r69111 r69753  
    6262     * Enumerate the directory content and dispose of it.
    6363     */
    64     PRTDIR pDir;
    65     int rc = RTDirOpen(&pDir, pszBuf);
     64    RTDIR hDir;
     65    int rc = RTDirOpen(&hDir, pszBuf);
    6666    if (RT_FAILURE(rc))
    6767        return rc;
    68     while (RT_SUCCESS(rc = RTDirRead(pDir, pDirEntry, NULL)))
     68    while (RT_SUCCESS(rc = RTDirRead(hDir, pDirEntry, NULL)))
    6969    {
    70         if (   pDirEntry->szName[0] != '.'
    71             || pDirEntry->cbName > 2
    72             || (   pDirEntry->cbName == 2
    73                 && pDirEntry->szName[1] != '.')
    74            )
     70        if (!RTDirEntryIsStdDotLink(pDirEntry))
    7571        {
    7672            /* Construct the full name of the entry. */
     
    130126    if (rc == VERR_NO_MORE_FILES)
    131127        rc = VINF_SUCCESS;
    132     RTDirClose(pDir);
     128    RTDirClose(hDir);
    133129    return rc;
    134130}
  • trunk/src/VBox/Runtime/r3/generic/dirrel-r3-generic.cpp

    r69716 r69753  
    5353 * @param   pszRelPath          The relative path.
    5454 */
    55 static int rtDirRelBuildFullPath(PRTDIR pThis, char *pszPathDst, size_t cbPathDst, const char *pszRelPath)
     55static int rtDirRelBuildFullPath(PRTDIRINTERNAL pThis, char *pszPathDst, size_t cbPathDst, const char *pszRelPath)
    5656{
    5757    AssertMsgReturn(!RTPathStartsWithRoot(pszRelPath), ("pszRelPath='%s'\n", pszRelPath), VERR_PATH_IS_NOT_RELATIVE);
     
    121121 * @sa      RTFileOpen
    122122 */
    123 RTDECL(int)  RTDirRelFileOpen(PRTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile)
    124 {
    125     PRTDIR pThis = hDir;
     123RTDECL(int)  RTDirRelFileOpen(RTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile)
     124{
     125    PRTDIRINTERNAL pThis = hDir;
    126126    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    127127    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    158158 * @sa      RTDirOpen
    159159 */
    160 RTDECL(int) RTDirRelDirOpen(PRTDIR hDir, const char *pszDir, PRTDIR *phDir)
    161 {
    162     PRTDIR pThis = hDir;
     160RTDECL(int) RTDirRelDirOpen(RTDIR hDir, const char *pszDir, RTDIR *phDir)
     161{
     162    PRTDIRINTERNAL pThis = hDir;
    163163    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    164164    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    188188 * @sa      RTDirOpenFiltered
    189189 */
    190 RTDECL(int) RTDirRelDirOpenFiltered(PRTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter,
    191                                     uint32_t fFlags, PRTDIR *phDir)
    192 {
    193     PRTDIR pThis = hDir;
     190RTDECL(int) RTDirRelDirOpenFiltered(RTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter,
     191                                    uint32_t fFlags, RTDIR *phDir)
     192{
     193    PRTDIRINTERNAL pThis = hDir;
    194194    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    195195    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    216216 * @sa      RTDirCreate
    217217 */
    218 RTDECL(int) RTDirRelDirCreate(PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate, PRTDIR *phSubDir)
    219 {
    220     PRTDIR pThis = hDir;
     218RTDECL(int) RTDirRelDirCreate(RTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate, RTDIR *phSubDir)
     219{
     220    PRTDIRINTERNAL pThis = hDir;
    221221    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    222222    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    243243 * @sa      RTDirRemove
    244244 */
    245 RTDECL(int) RTDirRelDirRemove(PRTDIR hDir, const char *pszRelPath)
    246 {
    247     PRTDIR pThis = hDir;
     245RTDECL(int) RTDirRelDirRemove(RTDIR hDir, const char *pszRelPath)
     246{
     247    PRTDIRINTERNAL pThis = hDir;
    248248    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    249249    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    287287 * @sa      RTPathQueryInfoEx
    288288 */
    289 RTDECL(int) RTDirRelPathQueryInfo(PRTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo,
     289RTDECL(int) RTDirRelPathQueryInfo(RTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo,
    290290                                  RTFSOBJATTRADD enmAddAttr, uint32_t fFlags)
    291291{
    292     PRTDIR pThis = hDir;
     292    PRTDIRINTERNAL pThis = hDir;
    293293    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    294294    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    316316 * @sa      RTPathSetMode
    317317 */
    318 RTDECL(int) RTDirRelPathSetMode(PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags)
    319 {
    320     PRTDIR pThis = hDir;
     318RTDECL(int) RTDirRelPathSetMode(RTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags)
     319{
     320    PRTDIRINTERNAL pThis = hDir;
    321321    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    322322    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    364364 * @sa      RTPathSetTimesEx
    365365 */
    366 RTDECL(int) RTDirRelPathSetTimes(PRTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
     366RTDECL(int) RTDirRelPathSetTimes(RTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
    367367                                 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime, uint32_t fFlags)
    368368{
    369     PRTDIR pThis = hDir;
     369    PRTDIRINTERNAL pThis = hDir;
    370370    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    371371    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    393393 * @sa      RTPathSetOwnerEx
    394394 */
    395 RTDECL(int) RTDirRelPathSetOwner(PRTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags)
    396 {
    397     PRTDIR pThis = hDir;
     395RTDECL(int) RTDirRelPathSetOwner(RTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags)
     396{
     397    PRTDIRINTERNAL pThis = hDir;
    398398    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    399399    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    429429 * @sa      RTPathRename
    430430 */
    431 RTDECL(int) RTDirRelPathRename(PRTDIR hDirSrc, const char *pszSrc, PRTDIR hDirDst, const char *pszDst, unsigned fRename)
    432 {
    433     PRTDIR pThis = hDirSrc;
    434     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    435     AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
    436 
    437     PRTDIR pThat = hDirDst;
     431RTDECL(int) RTDirRelPathRename(RTDIR hDirSrc, const char *pszSrc, RTDIR hDirDst, const char *pszDst, unsigned fRename)
     432{
     433    PRTDIRINTERNAL pThis = hDirSrc;
     434    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     435    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     436
     437    PRTDIRINTERNAL pThat = hDirDst;
    438438    if (pThat != pThis)
    439439    {
     
    465465 * @sa      RTPathUnlink
    466466 */
    467 RTDECL(int) RTDirRelPathUnlink(PRTDIR hDir, const char *pszRelPath, uint32_t fUnlink)
    468 {
    469     PRTDIR pThis = hDir;
     467RTDECL(int) RTDirRelPathUnlink(RTDIR hDir, const char *pszRelPath, uint32_t fUnlink)
     468{
     469    PRTDIRINTERNAL pThis = hDir;
    470470    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    471471    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    507507 * @sa      RTSymlinkCreate
    508508 */
    509 RTDECL(int) RTDirRelSymlinkCreate(PRTDIR hDir, const char *pszSymlink, const char *pszTarget,
     509RTDECL(int) RTDirRelSymlinkCreate(RTDIR hDir, const char *pszSymlink, const char *pszTarget,
    510510                                  RTSYMLINKTYPE enmType, uint32_t fCreate)
    511511{
    512     PRTDIR pThis = hDir;
     512    PRTDIRINTERNAL pThis = hDir;
    513513    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    514514    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    540540 * @sa      RTSymlinkRead
    541541 */
    542 RTDECL(int) RTDirRelSymlinkRead(PRTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead)
    543 {
    544     PRTDIR pThis = hDir;
     542RTDECL(int) RTDirRelSymlinkRead(RTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead)
     543{
     544    PRTDIRINTERNAL pThis = hDir;
    545545    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    546546    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
  • trunk/src/VBox/Runtime/r3/linux/RTProcIsRunningByName-linux.cpp

    r69111 r69753  
    5454     * Enumerate /proc.
    5555     */
    56     PRTDIR pDir;
    57     int rc = RTDirOpen(&pDir, "/proc");
     56    RTDIR hDir;
     57    int rc = RTDirOpen(&hDir, "/proc");
    5858    AssertMsgRCReturn(rc, ("RTDirOpen on /proc failed: rc=%Rrc\n", rc), false);
    5959    if (RT_SUCCESS(rc))
    6060    {
    6161        RTDIRENTRY DirEntry;
    62         while (RT_SUCCESS(RTDirRead(pDir, &DirEntry, NULL)))
     62        while (RT_SUCCESS(RTDirRead(hDir, &DirEntry, NULL)))
    6363        {
    6464            /*
     
    104104                    {
    105105                        /* Found it! */
    106                         RTDirClose(pDir);
     106                        RTDirClose(hDir);
    107107                        return true;
    108108                    }
  • trunk/src/VBox/Runtime/r3/linux/krnlmod-linux.cpp

    r67286 r69753  
    172172    uint32_t cKmodsLoaded = 0;
    173173
    174     PRTDIR pDir = NULL;
    175     int rc = RTDirOpen(&pDir, "/sys/module");
     174    RTDIR hDir = NULL;
     175    int rc = RTDirOpen(&hDir, "/sys/module");
    176176    if (RT_SUCCESS(rc))
    177177    {
    178178        RTDIRENTRY DirEnt;
    179         rc = RTDirRead(pDir, &DirEnt, NULL);
     179        rc = RTDirRead(hDir, &DirEnt, NULL);
    180180        while (RT_SUCCESS(rc))
    181181        {
    182             if (   RTStrCmp(DirEnt.szName, ".")
    183                 && RTStrCmp(DirEnt.szName, ".."))
     182            if (!RTDirEntryIsStdDotLink(&DirEntry))
    184183                cKmodsLoaded++;
    185             rc = RTDirRead(pDir, &DirEnt, NULL);
     184            rc = RTDirRead(hDir, &DirEnt, NULL);
    186185        }
    187186
    188         RTDirClose(pDir);
     187        RTDirClose(hDir);
    189188    }
    190189
     
    207206    }
    208207
    209     PRTDIR pDir = NULL;
     208    RTDIR hDir = NULL;
    210209    int rc = RTDirOpen(&pDir, "/sys/module");
    211210    if (RT_SUCCESS(rc))
     
    214213        RTDIRENTRY DirEnt;
    215214
    216         rc = RTDirRead(pDir, &DirEnt, NULL);
     215        rc = RTDirRead(hDir, &DirEnt, NULL);
    217216        while (RT_SUCCESS(rc))
    218217        {
    219             if (   RTStrCmp(DirEnt.szName, ".")
    220                 && RTStrCmp(DirEnt.szName, ".."))
     218            if (!RTDirEntryIsStdDotLink(&DirEnt))
    221219            {
    222220                rc = rtKrnlModLinuxInfoCreate(DirEnt.szName, &pahKrnlModInfo[idxKrnlModInfo]);
     
    226224
    227225            if (RT_SUCCESS(rc))
    228                 rc = RTDirRead(pDir, &DirEnt, NULL);
     226                rc = RTDirRead(hDir, &DirEnt, NULL);
    229227        }
    230228
     
    241239            *pcEntries = cKmodsLoaded;
    242240
    243         RTDirClose(pDir);
     241        RTDirClose(hDir);
    244242    }
    245243
  • trunk/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp

    r69716 r69753  
    4848*   Defined Constants And Macros                                                                                                 *
    4949*********************************************************************************************************************************/
    50 /** Whether to return a single record (TRUE) or multiple (FALSE)o. */
     50/** Whether to return a single record (TRUE) or multiple (FALSE). */
    5151#define RTDIR_NT_SINGLE_RECORD  FALSE
    5252
     
    7777{
    7878    NOREF(pszPath);
    79     return sizeof(RTDIR);
    80 }
    81 
    82 
    83 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative)
     79    return sizeof(RTDIRINTERNAL);
     80}
     81
     82
     83int rtDirNativeOpen(PRTDIRINTERNAL pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative)
    8484{
    8585    /*
     
    155155
    156156
    157 RTDECL(int) RTDirClose(PRTDIR pDir)
    158 {
     157RTDECL(int) RTDirClose(RTDIR hDir)
     158{
     159    PRTDIRINTERNAL pDir = hDir;
     160
    159161    /*
    160162     * Validate input.
     
    196198 * @param   pThis       The directory instance data.
    197199 */
    198 static int rtDirNtCheckRecord(PRTDIR pThis)
     200static int rtDirNtCheckRecord(PRTDIRINTERNAL pThis)
    199201{
    200202#ifdef RTDIR_NT_STRICT
     
    232234 * @param   pThis       The directory instance data.
    233235 */
    234 static int rtDirNtAdvanceBuffer(PRTDIR pThis)
     236static int rtDirNtAdvanceBuffer(PRTDIRINTERNAL pThis)
    235237{
    236238    int rc;
     
    275277 * @param   pThis       The directory instance data.
    276278 */
    277 static int rtDirNtFetchMore(PRTDIR pThis)
     279static int rtDirNtFetchMore(PRTDIRINTERNAL pThis)
    278280{
    279281    Assert(!pThis->fDataUnread);
     
    496498 * @param   pwsName     The file name, not terminated.
    497499 */
    498 static int rtDirNtConvertName(PRTDIR pThis, uint32_t cbName, PCRTUTF16 pwsName)
     500static int rtDirNtConvertName(PRTDIRINTERNAL pThis, uint32_t cbName, PCRTUTF16 pwsName)
    499501{
    500502    int rc = RTUtf16ToUtf8Ex(pwsName, cbName / 2, &pThis->pszName, pThis->cbNameAlloc, &pThis->cchName);
     
    525527 * @param   pThis       The directory instance data.
    526528 */
    527 static int rtDirNtConvertCurName(PRTDIR pThis)
     529static int rtDirNtConvertCurName(PRTDIRINTERNAL pThis)
    528530{
    529531    switch (pThis->enmInfoClass)
     
    544546
    545547
    546 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry)
    547 {
     548RTDECL(int) RTDirRead(RTDIR hDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry)
     549{
     550    PRTDIRINTERNAL pDir = hDir;
    548551    int rc;
    549552
     
    642645
    643646
    644 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry,
     647RTDECL(int) RTDirReadEx(RTDIR hDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry,
    645648                        RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
    646649{
     650    PRTDIRINTERNAL pDir = hDir;
    647651    int rc;
    648652
     
    823827
    824828
    825 RTR3DECL(int) RTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
    826 {
     829RTR3DECL(int) RTDirQueryInfo(RTDIR hDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
     830{
     831    PRTDIRINTERNAL pDir = hDir;
    827832    AssertPtrReturn(pDir, VERR_INVALID_POINTER);
    828833    AssertReturn(pDir->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
  • trunk/src/VBox/Runtime/r3/nt/dirrel-r3-nt.cpp

    r69720 r69753  
    6363 * @param   pszRelPath          The relative path.
    6464 */
    65 static int rtDirRelBuildFullPath(PRTDIR pThis, char *pszPathDst, size_t cbPathDst, const char *pszRelPath)
     65static int rtDirRelBuildFullPath(PRTDIRINTERNAL pThis, char *pszPathDst, size_t cbPathDst, const char *pszRelPath)
    6666{
    6767    AssertMsgReturn(!RTPathStartsWithRoot(pszRelPath), ("pszRelPath='%s'\n", pszRelPath), VERR_PATH_IS_NOT_RELATIVE);
     
    116116
    117117
    118 RTDECL(int)  RTDirRelFileOpen(PRTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile)
    119 {
    120     PRTDIR pThis = hDir;
     118RTDECL(int)  RTDirRelFileOpen(RTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile)
     119{
     120    PRTDIRINTERNAL pThis = hDir;
    121121    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    122122    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    188188
    189189
    190 RTDECL(int) RTDirRelDirOpen(PRTDIR hDir, const char *pszDir, PRTDIR *phDir)
     190RTDECL(int) RTDirRelDirOpen(RTDIR hDir, const char *pszDir, RTDIR *phDir)
    191191{
    192192    return RTDirRelDirOpenFiltered(hDir, pszDir, RTDIRFILTER_NONE, 0 /*fFlags*/, phDir);
     
    194194
    195195
    196 RTDECL(int) RTDirRelDirOpenFiltered(PRTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter,
    197                                     uint32_t fFlags, PRTDIR *phDir)
    198 {
    199     PRTDIR pThis = hDir;
     196RTDECL(int) RTDirRelDirOpenFiltered(RTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter,
     197                                    uint32_t fFlags, RTDIR *phDir)
     198{
     199    PRTDIRINTERNAL pThis = hDir;
    200200    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    201201    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    217217
    218218
    219 RTDECL(int) RTDirRelDirCreate(PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate, PRTDIR *phSubDir)
    220 {
    221     PRTDIR pThis = hDir;
     219RTDECL(int) RTDirRelDirCreate(RTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate, RTDIR *phSubDir)
     220{
     221    PRTDIRINTERNAL pThis = hDir;
    222222    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    223223    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    308308
    309309
    310 RTDECL(int) RTDirRelDirRemove(PRTDIR hDir, const char *pszRelPath)
    311 {
    312     PRTDIR pThis = hDir;
     310RTDECL(int) RTDirRelDirRemove(RTDIR hDir, const char *pszRelPath)
     311{
     312    PRTDIRINTERNAL pThis = hDir;
    313313    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    314314    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    372372
    373373
    374 RTDECL(int) RTDirRelPathQueryInfo(PRTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo,
     374RTDECL(int) RTDirRelPathQueryInfo(RTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo,
    375375                                  RTFSOBJATTRADD enmAddAttr, uint32_t fFlags)
    376376{
    377     PRTDIR pThis = hDir;
     377    PRTDIRINTERNAL pThis = hDir;
    378378    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    379379    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    409409 * @sa      RTPathSetMode
    410410 */
    411 RTDECL(int) RTDirRelPathSetMode(PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags)
    412 {
    413     PRTDIR pThis = hDir;
     411RTDECL(int) RTDirRelPathSetMode(RTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags)
     412{
     413    PRTDIRINTERNAL pThis = hDir;
    414414    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    415415    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    458458 * @sa      RTPathSetTimesEx
    459459 */
    460 RTDECL(int) RTDirRelPathSetTimes(PRTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
     460RTDECL(int) RTDirRelPathSetTimes(RTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
    461461                                 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime, uint32_t fFlags)
    462462{
    463     PRTDIR pThis = hDir;
     463    PRTDIRINTERNAL pThis = hDir;
    464464    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    465465    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    490490 * @sa      RTPathSetOwnerEx
    491491 */
    492 RTDECL(int) RTDirRelPathSetOwner(PRTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags)
    493 {
    494     PRTDIR pThis = hDir;
     492RTDECL(int) RTDirRelPathSetOwner(RTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags)
     493{
     494    PRTDIRINTERNAL pThis = hDir;
    495495    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    496496    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    527527 * @sa      RTPathRename
    528528 */
    529 RTDECL(int) RTDirRelPathRename(PRTDIR hDirSrc, const char *pszSrc, PRTDIR hDirDst, const char *pszDst, unsigned fRename)
    530 {
    531     PRTDIR pThis = hDirSrc;
    532     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    533     AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
    534 
    535     PRTDIR pThat = hDirDst;
     529RTDECL(int) RTDirRelPathRename(RTDIR hDirSrc, const char *pszSrc, RTDIR hDirDst, const char *pszDst, unsigned fRename)
     530{
     531    PRTDIRINTERNAL pThis = hDirSrc;
     532    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     533    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     534
     535    PRTDIRINTERNAL pThat = hDirDst;
    536536    if (pThat != pThis)
    537537    {
     
    566566 * @sa      RTPathUnlink
    567567 */
    568 RTDECL(int) RTDirRelPathUnlink(PRTDIR hDir, const char *pszRelPath, uint32_t fUnlink)
    569 {
    570     PRTDIR pThis = hDir;
     568RTDECL(int) RTDirRelPathUnlink(RTDIR hDir, const char *pszRelPath, uint32_t fUnlink)
     569{
     570    PRTDIRINTERNAL pThis = hDir;
    571571    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    572572    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    611611 * @sa      RTSymlinkCreate
    612612 */
    613 RTDECL(int) RTDirRelSymlinkCreate(PRTDIR hDir, const char *pszSymlink, const char *pszTarget,
     613RTDECL(int) RTDirRelSymlinkCreate(RTDIR hDir, const char *pszSymlink, const char *pszTarget,
    614614                                  RTSYMLINKTYPE enmType, uint32_t fCreate)
    615615{
    616     PRTDIR pThis = hDir;
     616    PRTDIRINTERNAL pThis = hDir;
    617617    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    618618    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
     
    647647 * @sa      RTSymlinkRead
    648648 */
    649 RTDECL(int) RTDirRelSymlinkRead(PRTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead)
    650 {
    651     PRTDIR pThis = hDir;
     649RTDECL(int) RTDirRelSymlinkRead(RTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead)
     650{
     651    PRTDIRINTERNAL pThis = hDir;
    652652    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    653653    AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r69691 r69753  
    215215        cbNameMax = _XOPEN_NAME_MAX;
    216216# endif
    217     size_t cbDir = RT_OFFSETOF(RTDIR, Data.d_name[cbNameMax + 1]);
    218     if (cbDir < sizeof(RTDIR))          /* Ditto. */
    219         cbDir = sizeof(RTDIR);
     217    size_t cbDir = RT_OFFSETOF(RTDIRINTERNAL, Data.d_name[cbNameMax + 1]);
     218    if (cbDir < sizeof(RTDIRINTERNAL))  /* Ditto. */
     219        cbDir = sizeof(RTDIRINTERNAL);
    220220    cbDir = RT_ALIGN_Z(cbDir, 8);
    221221
     
    224224
    225225
    226 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative)
     226int rtDirNativeOpen(PRTDIRINTERNAL pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative)
    227227{
    228228    NOREF(pszPathBuf); /* only used on windows */
     
    255255
    256256
    257 RTDECL(int) RTDirClose(PRTDIR pDir)
    258 {
     257RTDECL(int) RTDirClose(RTDIR hDir)
     258{
     259    PRTDIRINTERNAL pDir = hDir;
     260
    259261    /*
    260262     * Validate input.
     
    291293 * @param   pDir        the open directory. Fully validated.
    292294 */
    293 static int rtDirReadMore(PRTDIR pDir)
     295static int rtDirReadMore(PRTDIRINTERNAL pDir)
    294296{
    295297    /** @todo try avoid the rematching on buffer overflow errors. */
     
    377379
    378380
    379 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry)
    380 {
     381RTDECL(int) RTDirRead(RTDIR hDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry)
     382{
     383    PRTDIRINTERNAL pDir = hDir;
     384
    381385    /*
    382386     * Validate and digest input.
     
    474478
    475479
    476 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
    477 {
     480RTDECL(int) RTDirReadEx(RTDIR hDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry,
     481                        RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
     482{
     483    PRTDIRINTERNAL pDir = hDir;
     484
    478485    /*
    479486     * Validate and digest input.
  • trunk/src/VBox/Runtime/r3/win/direnum-win.cpp

    r69691 r69753  
    4747{
    4848    NOREF(pszPath);
    49     return sizeof(RTDIR);
    50 }
    51 
    52 
    53 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative))
     49    return sizeof(RTDIRINTERNAL);
     50}
     51
     52
     53int rtDirNativeOpen(PRTDIRINTERNAL pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative))
    5454{
    5555    RT_NOREF(hRelativeDir, pvNativeRelative);
     
    107107
    108108
    109 RTDECL(int) RTDirClose(PRTDIR pDir)
     109RTDECL(int) RTDirClose(PRTDIRINTERNAL pDir)
    110110{
    111111    /*
     
    138138
    139139
    140 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry)
    141 {
     140RTDECL(int) RTDirRead(RTDIR hDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry)
     141{
     142    PPRTDIRINTERNAL pDir = hDir;
     143
    142144    /*
    143145     * Validate input.
     
    222224
    223225
    224 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
    225 {
     226RTDECL(int) RTDirReadEx(RTDIR hDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
     227{
     228    PPRTDIRINTERNAL pDir = hDir;
    226229    /** @todo Symlinks: Find[First|Next]FileW will return info about
    227230        the link, so RTPATH_F_FOLLOW_LINK is not handled correctly. */
  • trunk/src/VBox/Runtime/testcase/tstDir-2.cpp

    r69674 r69753  
    4141    {
    4242        /* open */
    43         PRTDIR pDir;
    44         int rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT, 0 /*fFlags*/);
     43        RTDIR hDir;
     44        int rc = RTDirOpenFiltered(&hDir, argv[i], RTDIRFILTER_WINNT, 0 /*fFlags*/);
    4545        if (RT_SUCCESS(rc))
    4646        {
     
    4848            {
    4949                RTDIRENTRY DirEntry;
    50                 rc = RTDirRead(pDir, &DirEntry, NULL);
     50                rc = RTDirRead(hDir, &DirEntry, NULL);
    5151                if (RT_FAILURE(rc))
    5252                    break;
     
    7878
    7979            /* close up */
    80             rc = RTDirClose(pDir);
     80            rc = RTDirClose(hDir);
    8181            if (RT_FAILURE(rc))
    8282            {
  • trunk/src/VBox/Runtime/testcase/tstDir-3.cpp

    r69674 r69753  
    3636    int rcRet = 0;
    3737    unsigned cFilesMatch = 0;
    38     PRTDIR pDir;
    39     int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT, 0 /*fFlags*/);
     38    RTDIR hDir;
     39    int rc = RTDirOpenFiltered(&hDir, pszFilter, RTDIRFILTER_WINNT, 0 /*fFlags*/);
    4040    if (RT_SUCCESS(rc))
    4141    {
     
    4343        {
    4444            RTDIRENTRY DirEntry;
    45             rc = RTDirRead(pDir, &DirEntry, NULL);
     45            rc = RTDirRead(hDir, &DirEntry, NULL);
    4646            if (RT_FAILURE(rc))
    4747                break;
     
    5656
    5757        /* close up */
    58         rc = RTDirClose(pDir);
     58        rc = RTDirClose(hDir);
    5959        if (RT_FAILURE(rc))
    6060        {
  • trunk/src/VBox/Runtime/testcase/tstDir.cpp

    r69674 r69753  
    8181        {
    8282            /* open */
    83             PRTDIR pDir;
     83            RTDIR hDir;
    8484            int rc;
    8585            if (!fFiltered)
    86                 rc = RTDirOpen(&pDir, argv[i]);
     86                rc = RTDirOpen(&hDir, argv[i]);
    8787            else
    88                 rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT, 0 /*fFlags*/);
     88                rc = RTDirOpenFiltered(&hDir, argv[i], RTDIRFILTER_WINNT, 0 /*fFlags*/);
    8989            if (RT_SUCCESS(rc))
    9090            {
     
    9595                    {
    9696                        RTDIRENTRY DirEntry;
    97                         rc = RTDirRead(pDir, &DirEntry, NULL);
     97                        rc = RTDirRead(hDir, &DirEntry, NULL);
    9898                        if (RT_FAILURE(rc))
    9999                            break;
     
    126126                    {
    127127                        RTDIRENTRYEX DirEntry;
    128                         rc = RTDirReadEx(pDir, &DirEntry, NULL, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK);
     128                        rc = RTDirReadEx(hDir, &DirEntry, NULL, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK);
    129129                        if (RT_FAILURE(rc))
    130130                            break;
     
    208208
    209209                /* close up */
    210                 rc = RTDirClose(pDir);
     210                rc = RTDirClose(hDir);
    211211                if (RT_FAILURE(rc))
    212212                {
  • trunk/src/VBox/Runtime/testcase/tstRTNtPath-1.cpp

    r69111 r69753  
    6666
    6767    uint32_t cLeftToTest = 2;
    68     PRTDIR  hDir;
     68    RTDIR  hDir;
    6969    int rc = RTDirOpen(&hDir, pThis->szLongPath);
    7070    if (RT_FAILURE(rc))
  • trunk/src/VBox/Runtime/tools/RTDbgSymCache.cpp

    r69434 r69753  
    948948     * Open the directory.
    949949     */
    950     PRTDIR pDir;
     950    RTDIR hDir;
    951951    int rc, rc2;
    952952    if (pCfg->pszFilter)
     
    958958            return RTMsgErrorRc(rc, "Filename too long (%Rrc): '%s" RTPATH_SLASH_STR "%s'", rc, pszPath, pCfg->pszFilter);
    959959        }
    960         rc = RTDirOpenFiltered(&pDir, pszPath, RTDIRFILTER_WINNT, 0 /*fFlags*/);
     960        rc = RTDirOpenFiltered(&hDir, pszPath, RTDIRFILTER_WINNT, 0 /*fFlags*/);
    961961    }
    962962    else
    963         rc = RTDirOpen(&pDir, pszPath);
     963        rc = RTDirOpen(&hDir, pszPath);
    964964    if (RT_FAILURE(rc))
    965965        return RTMsgErrorRc(rc, "RTDirOpen%s failed on '%s': %Rrc", pCfg->pszFilter ? "Filtered" : "", pszPath, rc);
     
    970970    for (;;)
    971971    {
    972         rc2 = RTDirReadEx(pDir, pDirEntry, NULL, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
     972        rc2 = RTDirReadEx(hDir, pDirEntry, NULL, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
    973973        if (RT_FAILURE(rc2))
    974974        {
     
    10491049     * Clean up.
    10501050     */
    1051     rc2 = RTDirClose(pDir);
     1051    rc2 = RTDirClose(hDir);
    10521052    if (RT_FAILURE(rc2))
    10531053    {
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