Changeset 69753 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Nov 19, 2017 2:27:58 PM (7 years ago)
- 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 659 659 * Enumerate the directory. 660 660 */ 661 PRTDIR hDir;661 RTDIR hDir; 662 662 rc = RTDirOpen(&hDir, pszDir); 663 663 if (RT_SUCCESS(rc)) … … 767 767 * Enumerate the directory. 768 768 */ 769 PRTDIR hDir;769 RTDIR hDir; 770 770 rc = RTDirOpen(&hDir, pszDir); 771 771 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Runtime/common/dbg/dbgcfg.cpp
r69111 r69753 357 357 *pszName = '\0'; 358 358 359 PRTDIR pDir;360 int rc = RTDirOpen(& pDir, pszPath);359 RTDIR hDir; 360 int rc = RTDirOpen(&hDir, pszPath); 361 361 if (RT_FAILURE(rc)) 362 362 return false; … … 373 373 } u; 374 374 size_t cbBuf = sizeof(u); 375 rc = RTDirRead( pDir, &u.Entry, &cbBuf);375 rc = RTDirRead(hDir, &u.Entry, &cbBuf); 376 376 if (RT_FAILURE(rc)) 377 377 break; … … 387 387 if (u.Entry.enmType == enmType) 388 388 { 389 RTDirClose( pDir);389 RTDirClose(hDir); 390 390 return true; 391 391 } … … 393 393 } 394 394 395 RTDirClose( pDir);395 RTDirClose(hDir); 396 396 *pszName = '\0'; 397 397 -
trunk/src/VBox/Runtime/common/path/RTPathGlob.cpp
r69111 r69753 1447 1447 * @param cbNeeded The required entry size. 1448 1448 */ 1449 DECL_NO_INLINE(static, int) rtPathGlobSkipDirEntry( PRTDIR hDir, size_t cbNeeded)1449 DECL_NO_INLINE(static, int) rtPathGlobSkipDirEntry(RTDIR hDir, size_t cbNeeded) 1450 1450 { 1451 1451 int rc = VERR_BUFFER_OVERFLOW; … … 1875 1875 * Enumerate entire directory and match each entry. 1876 1876 */ 1877 PRTDIR hDir;1877 RTDIR hDir; 1878 1878 int rc = RTDirOpen(&hDir, offPath ? pGlob->szPath : "."); 1879 1879 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Runtime/common/path/RTPathRmCmd.cpp
r69111 r69753 270 270 * Traverse the directory. 271 271 */ 272 PRTDIR hDir;272 RTDIR hDir; 273 273 int rc = RTDirOpen(&hDir, pszPath); 274 274 if (RT_FAILURE(rc)) -
trunk/src/VBox/Runtime/common/vfs/vfsstddir.cpp
r69720 r69753 54 54 { 55 55 /** The directory handle. */ 56 PRTDIRhDir;56 RTDIR hDir; 57 57 /** Whether to leave the handle open when the VFS handle is closed. */ 58 58 bool fLeaveOpen; … … 88 88 static DECLCALLBACK(int) rtVfsStdDir_QueryEntryInfo(void *pvThis, const char *pszEntry, 89 89 PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr); 90 static int rtVfsDirFromRTDir( PRTDIR hDir, uint32_t fFlags, bool fLeaveOpen, PRTVFSDIR phVfsDir);90 static int rtVfsDirFromRTDir(RTDIR hDir, uint32_t fFlags, bool fLeaveOpen, PRTVFSDIR phVfsDir); 91 91 92 92 … … 329 329 PRTVFSSTDDIR pThis = (PRTVFSSTDDIR)pvThis; 330 330 /** @todo subdir open flags */ 331 PRTDIR hSubDir;331 RTDIR hSubDir; 332 332 int rc = RTDirRelDirOpenFiltered(pThis->hDir, pszSubDir, RTDIRFILTER_NONE, fFlags, &hSubDir); 333 333 if (RT_SUCCESS(rc)) … … 352 352 else 353 353 { 354 PRTDIR hSubDir;354 RTDIR hSubDir; 355 355 rc = RTDirRelDirCreate(pThis->hDir, pszSubDir, fMode, 0 /* fFlags */, &hSubDir); 356 356 if (RT_SUCCESS(rc)) … … 547 547 * @param phVfsDir Where to return the handle. 548 548 */ 549 static int rtVfsDirFromRTDir( PRTDIR hDir, uint32_t fFlags, bool fLeaveOpen, PRTVFSDIR phVfsDir)549 static int rtVfsDirFromRTDir(RTDIR hDir, uint32_t fFlags, bool fLeaveOpen, PRTVFSDIR phVfsDir) 550 550 { 551 551 PRTVFSSTDDIR pThis; … … 567 567 568 568 569 RTDECL(int) RTVfsDirFromRTDir( PRTDIR hDir, bool fLeaveOpen, PRTVFSDIR phVfsDir)569 RTDECL(int) RTVfsDirFromRTDir(RTDIR hDir, bool fLeaveOpen, PRTVFSDIR phVfsDir) 570 570 { 571 571 AssertReturn(RTDirIsValid(hDir), VERR_INVALID_HANDLE); … … 579 579 * Open the file the normal way and pass it to RTVfsFileFromRTFile. 580 580 */ 581 PRTDIR hDir;581 RTDIR hDir; 582 582 int rc = RTDirOpenFiltered(&hDir, pszPath, RTDIRFILTER_NONE, fFlags); 583 583 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Runtime/generic/RTDirQueryInfo-generic.cpp
r69111 r69753 45 45 46 46 47 RTR3DECL(int) RTDirQueryInfo( PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)47 RTR3DECL(int) RTDirQueryInfo(RTDIR hDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs) 48 48 { 49 49 /* 50 50 * Validate and digest input. 51 51 */ 52 if (!rtDirValidHandle( pDir))52 if (!rtDirValidHandle(hDir)) 53 53 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); 55 55 } 56 56 -
trunk/src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp
r69111 r69753 46 46 47 47 48 RTR3DECL(int) RTDirSetTimes( PRTDIR pDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,48 RTR3DECL(int) RTDirSetTimes(RTDIR hDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, 49 49 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime) 50 50 { … … 52 52 * Validate and digest input. 53 53 */ 54 if (!rtDirValidHandle( pDir))54 if (!rtDirValidHandle(hDir)) 55 55 return VERR_INVALID_PARAMETER; 56 return RTPathSetTimes( pDir->pszPath, pAccessTime, pModificationTime, pChangeTime, pBirthTime);56 return RTPathSetTimes(hDir->pszPath, pAccessTime, pModificationTime, pChangeTime, pBirthTime); 57 57 } 58 58 -
trunk/src/VBox/Runtime/include/internal/dir.h
r69716 r69753 33 33 34 34 35 /** Pointer to the data behind an open directory handle. */ 36 typedef struct RTDIRINTERNAL *PRTDIRINTERNAL; 37 35 38 /** 36 39 * Filter a the filename in the against a filter. … … 41 44 * @param pszName The path to match to the filter. 42 45 */ 43 typedef DECLCALLBACK(bool) FNRTDIRFILTER(PRTDIR pDir, const char *pszName);46 typedef DECLCALLBACK(bool) FNRTDIRFILTER(PRTDIRINTERNAL pDir, const char *pszName); 44 47 /** Pointer to a filter function. */ 45 48 typedef FNRTDIRFILTER *PFNRTDIRFILTER; … … 49 52 * Open directory. 50 53 */ 51 typedef struct RTDIR 54 typedef struct RTDIRINTERNAL 52 55 { 53 56 /** Magic value, RTDIR_MAGIC. */ … … 138 141 # endif 139 142 #endif 140 } RTDIR; 143 } RTDIRINTERNAL; 144 141 145 142 146 … … 146 150 * @returns false if valid after having bitched about it first. 147 151 */ 148 DECLINLINE(bool) rtDirValidHandle(PRTDIR pDir)152 DECLINLINE(bool) rtDirValidHandle(PRTDIRINTERNAL pDir) 149 153 { 150 154 AssertMsgReturn(VALID_PTR(pDir), ("%p\n", pDir), false); … … 169 173 * we're to use (consume) hRelativeDir. 170 174 */ 171 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative);175 int rtDirNativeOpen(PRTDIRINTERNAL pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative); 172 176 173 177 /** … … 180 184 181 185 182 DECLHIDDEN(int) rtDirOpenRelativeOrHandle( PRTDIR *ppDir, const char *pszRelativeAndFilter, RTDIRFILTER enmFilter, uint32_t fFlags,183 uint ptr_t hRelativeDir, void *pvNativeRelative);186 DECLHIDDEN(int) rtDirOpenRelativeOrHandle(RTDIR *phDir, const char *pszRelativeAndFilter, RTDIRFILTER enmFilter, 187 uint32_t fFlags, uintptr_t hRelativeDir, void *pvNativeRelative); 184 188 185 189 #endif -
trunk/src/VBox/Runtime/include/internal/magics.h
r69474 r69753 47 47 /** Magic value for RTDBGKRNLINFOINT::u32Magic. (John Carmack) */ 48 48 #define RTDBGKRNLINFO_MAGIC UINT32_C(0x19700820) 49 /** The value of RTDIR ::u32Magic. (Michael Ende) */49 /** The value of RTDIRINTERNAL::u32Magic. (Michael Ende) */ 50 50 #define RTDIR_MAGIC UINT32_C(0x19291112) 51 /** The value of RTDIR ::u32Magic after RTDirClose(). */51 /** The value of RTDIRINTERNAL::u32Magic after RTDirClose(). */ 52 52 #define RTDIR_MAGIC_DEAD UINT32_C(0x19950829) 53 53 /** The value of RTDVMINTERNAL::u32Magic. (Dan Brown) */ -
trunk/src/VBox/Runtime/r0drv/nt/ntBldSymDb.cpp
r69111 r69753 1003 1003 1004 1004 /* Open directory. */ 1005 PRTDIR pDir;1006 int rc = RTDirOpen(& pDir, pszDir);1005 RTDIR hDir; 1006 int rc = RTDirOpen(&hDir, pszDir); 1007 1007 if (RT_FAILURE(rc)) 1008 1008 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirOpen failed on '%s': %Rrc\n", pszDir, rc); … … 1023 1023 /* Get the next directory. */ 1024 1024 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); 1026 1026 if (RT_FAILURE(rc)) 1027 1027 break; 1028 1028 1029 1029 /* 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)) 1032 1031 continue; 1033 1032 … … 1077 1076 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirReadEx failed: %Rrc\npszDir=%.*s", rc, cchDir, pszDir); 1078 1077 1079 rc = RTDirClose( pDir);1078 rc = RTDirClose(hDir); 1080 1079 if (RT_FAILURE(rc)) 1081 1080 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirClose failed: %Rrc\npszDir=%.*s", rc, cchDir, pszDir); -
trunk/src/VBox/Runtime/r3/dir.cpp
r69716 r69753 47 47 48 48 49 static DECLCALLBACK(bool) rtDirFilterWinNtMatch(PRTDIR pDir, const char *pszName);50 static DECLCALLBACK(bool) rtDirFilterWinNtMatchNoWildcards(PRTDIR pDir, const char *pszName);49 static DECLCALLBACK(bool) rtDirFilterWinNtMatch(PRTDIRINTERNAL pDir, const char *pszName); 50 static DECLCALLBACK(bool) rtDirFilterWinNtMatchNoWildcards(PRTDIRINTERNAL pDir, const char *pszName); 51 51 DECLINLINE(bool) rtDirFilterWinNtMatchEon(PCRTUNICP puszFilter); 52 52 static bool rtDirFilterWinNtMatchDosStar(unsigned iDepth, RTUNICP uc, const char *pszNext, PCRTUNICP puszFilter); … … 117 117 * @param pszName The path to match to the filter. 118 118 */ 119 static DECLCALLBACK(bool) rtDirFilterWinNtMatchNoWildcards(PRTDIR pDir, const char *pszName)119 static DECLCALLBACK(bool) rtDirFilterWinNtMatchNoWildcards(PRTDIRINTERNAL pDir, const char *pszName) 120 120 { 121 121 /* … … 447 447 * @param pszName The path to match to the filter. 448 448 */ 449 static DECLCALLBACK(bool) rtDirFilterWinNtMatch(PRTDIR pDir, const char *pszName)449 static DECLCALLBACK(bool) rtDirFilterWinNtMatch(PRTDIRINTERNAL pDir, const char *pszName) 450 450 { 451 451 return rtDirFilterWinNtMatchBase(0, pszName, pDir->puszFilter); … … 460 460 * @param pDir The directory handle (not yet opened). 461 461 */ 462 static PFNRTDIRFILTER rtDirFilterWinNtInit(PRTDIR pDir)462 static PFNRTDIRFILTER rtDirFilterWinNtInit(PRTDIRINTERNAL pDir) 463 463 { 464 464 /* … … 506 506 * 507 507 * @returns IPRT status code. 508 * @param p pDir Where to store the directory handle.508 * @param phDir Where to store the directory handle. 509 509 * @param pszPath The specified path. 510 510 * @param pszFilter Pointer to where the filter start in the path. … … 517 517 * we're to use (consume) hRelativeDir. 518 518 */ 519 static int rtDirOpenCommon( PRTDIR *ppDir, const char *pszPath, const char *pszFilter, RTDIRFILTER enmFilter, uint32_t fFlags,520 uint ptr_t hRelativeDir, void *pvNativeRelative)519 static int rtDirOpenCommon(RTDIR *phDir, const char *pszPath, const char *pszFilter, RTDIRFILTER enmFilter, 520 uint32_t fFlags, uintptr_t hRelativeDir, void *pvNativeRelative) 521 521 { 522 522 /* … … 576 576 + cbFilter 577 577 + cchRealPath + 1 + 4; 578 PRTDIR pDir = (PRTDIR)RTMemAllocZ(cbAllocated);578 PRTDIRINTERNAL pDir = (PRTDIRINTERNAL)RTMemAllocZ(cbAllocated); 579 579 if (!pDir) 580 580 return VERR_NO_MEMORY; … … 631 631 rc = rtDirNativeOpen(pDir, szRealPath, hRelativeDir, pvNativeRelative); 632 632 if (RT_SUCCESS(rc)) 633 *p pDir = pDir;633 *phDir = pDir; 634 634 else 635 635 RTMemFree(pDir); … … 639 639 640 640 641 RTDECL(int) RTDirOpen( PRTDIR *ppDir, const char *pszPath)641 RTDECL(int) RTDirOpen(RTDIR *phDir, const char *pszPath) 642 642 { 643 643 /* 644 644 * Validate input. 645 645 */ 646 AssertMsgReturn(VALID_PTR(p pDir), ("%p\n", ppDir), VERR_INVALID_POINTER);646 AssertMsgReturn(VALID_PTR(phDir), ("%p\n", phDir), VERR_INVALID_POINTER); 647 647 AssertMsgReturn(VALID_PTR(pszPath), ("%p\n", pszPath), VERR_INVALID_POINTER); 648 648 … … 650 650 * Take common cause with RTDirOpenFiltered(). 651 651 */ 652 int rc = rtDirOpenCommon(p pDir, pszPath, NULL, RTDIRFILTER_NONE, 0 /*fFlags*/, ~(uintptr_t)0, NULL);653 LogFlow(("RTDirOpen(%p:{%p}, %p:{%s}): return %Rrc\n", p pDir, *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)); 654 654 return rc; 655 655 } 656 656 657 657 658 DECLHIDDEN(int) rtDirOpenRelativeOrHandle( PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags,658 DECLHIDDEN(int) rtDirOpenRelativeOrHandle(RTDIR *phDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags, 659 659 uintptr_t hRelativeDir, void *pvNativeRelative) 660 660 { … … 662 662 * Validate input. 663 663 */ 664 AssertMsgReturn(VALID_PTR(p pDir), ("%p\n", ppDir), VERR_INVALID_POINTER);664 AssertMsgReturn(VALID_PTR(phDir), ("%p\n", phDir), VERR_INVALID_POINTER); 665 665 AssertMsgReturn(VALID_PTR(pszPath), ("%p\n", pszPath), VERR_INVALID_POINTER); 666 666 AssertReturn(!(fFlags & ~RTDIR_F_VALID_MASK), VERR_INVALID_FLAGS); … … 695 695 * and initialize the handle, and finally call the backend. 696 696 */ 697 int rc = rtDirOpenCommon(p pDir, pszPath, pszFilter, enmFilter, fFlags, hRelativeDir, pvNativeRelative);697 int rc = rtDirOpenCommon(phDir, pszPath, pszFilter, enmFilter, fFlags, hRelativeDir, pvNativeRelative); 698 698 699 699 LogFlow(("RTDirOpenFiltered(%p:{%p}, %p:{%s}, %d, %#x, %p, %p): return %Rrc\n", 700 p pDir,*ppDir, pszPath, pszPath, enmFilter, fFlags, hRelativeDir, pvNativeRelative, rc));700 phDir,*phDir, pszPath, pszPath, enmFilter, fFlags, hRelativeDir, pvNativeRelative, rc)); 701 701 return rc; 702 702 } 703 703 704 704 705 RTDECL(int) RTDirOpenFiltered( PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags)706 { 707 return rtDirOpenRelativeOrHandle(p pDir, pszPath, enmFilter, fFlags, ~(uintptr_t)0, NULL);708 } 709 710 711 RTDECL(bool) RTDirIsValid( PRTDIR hDir)705 RTDECL(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 711 RTDECL(bool) RTDirIsValid(RTDIR hDir) 712 712 { 713 713 return RT_VALID_PTR(hDir) -
trunk/src/VBox/Runtime/r3/dir2.cpp
r69111 r69753 62 62 * Enumerate the directory content and dispose of it. 63 63 */ 64 PRTDIR pDir;65 int rc = RTDirOpen(& pDir, pszBuf);64 RTDIR hDir; 65 int rc = RTDirOpen(&hDir, pszBuf); 66 66 if (RT_FAILURE(rc)) 67 67 return rc; 68 while (RT_SUCCESS(rc = RTDirRead( pDir, pDirEntry, NULL)))68 while (RT_SUCCESS(rc = RTDirRead(hDir, pDirEntry, NULL))) 69 69 { 70 if ( pDirEntry->szName[0] != '.' 71 || pDirEntry->cbName > 2 72 || ( pDirEntry->cbName == 2 73 && pDirEntry->szName[1] != '.') 74 ) 70 if (!RTDirEntryIsStdDotLink(pDirEntry)) 75 71 { 76 72 /* Construct the full name of the entry. */ … … 130 126 if (rc == VERR_NO_MORE_FILES) 131 127 rc = VINF_SUCCESS; 132 RTDirClose( pDir);128 RTDirClose(hDir); 133 129 return rc; 134 130 } -
trunk/src/VBox/Runtime/r3/generic/dirrel-r3-generic.cpp
r69716 r69753 53 53 * @param pszRelPath The relative path. 54 54 */ 55 static int rtDirRelBuildFullPath(PRTDIR pThis, char *pszPathDst, size_t cbPathDst, const char *pszRelPath)55 static int rtDirRelBuildFullPath(PRTDIRINTERNAL pThis, char *pszPathDst, size_t cbPathDst, const char *pszRelPath) 56 56 { 57 57 AssertMsgReturn(!RTPathStartsWithRoot(pszRelPath), ("pszRelPath='%s'\n", pszRelPath), VERR_PATH_IS_NOT_RELATIVE); … … 121 121 * @sa RTFileOpen 122 122 */ 123 RTDECL(int) RTDirRelFileOpen( PRTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile)124 { 125 PRTDIR pThis = hDir;123 RTDECL(int) RTDirRelFileOpen(RTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile) 124 { 125 PRTDIRINTERNAL pThis = hDir; 126 126 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 127 127 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 158 158 * @sa RTDirOpen 159 159 */ 160 RTDECL(int) RTDirRelDirOpen( PRTDIR hDir, const char *pszDir, PRTDIR *phDir)161 { 162 PRTDIR pThis = hDir;160 RTDECL(int) RTDirRelDirOpen(RTDIR hDir, const char *pszDir, RTDIR *phDir) 161 { 162 PRTDIRINTERNAL pThis = hDir; 163 163 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 164 164 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 188 188 * @sa RTDirOpenFiltered 189 189 */ 190 RTDECL(int) RTDirRelDirOpenFiltered( PRTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter,191 uint32_t fFlags, PRTDIR *phDir)192 { 193 PRTDIR pThis = hDir;190 RTDECL(int) RTDirRelDirOpenFiltered(RTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter, 191 uint32_t fFlags, RTDIR *phDir) 192 { 193 PRTDIRINTERNAL pThis = hDir; 194 194 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 195 195 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 216 216 * @sa RTDirCreate 217 217 */ 218 RTDECL(int) RTDirRelDirCreate( PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate, PRTDIR *phSubDir)219 { 220 PRTDIR pThis = hDir;218 RTDECL(int) RTDirRelDirCreate(RTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate, RTDIR *phSubDir) 219 { 220 PRTDIRINTERNAL pThis = hDir; 221 221 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 222 222 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 243 243 * @sa RTDirRemove 244 244 */ 245 RTDECL(int) RTDirRelDirRemove( PRTDIR hDir, const char *pszRelPath)246 { 247 PRTDIR pThis = hDir;245 RTDECL(int) RTDirRelDirRemove(RTDIR hDir, const char *pszRelPath) 246 { 247 PRTDIRINTERNAL pThis = hDir; 248 248 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 249 249 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 287 287 * @sa RTPathQueryInfoEx 288 288 */ 289 RTDECL(int) RTDirRelPathQueryInfo( PRTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo,289 RTDECL(int) RTDirRelPathQueryInfo(RTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo, 290 290 RTFSOBJATTRADD enmAddAttr, uint32_t fFlags) 291 291 { 292 PRTDIR pThis = hDir;292 PRTDIRINTERNAL pThis = hDir; 293 293 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 294 294 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 316 316 * @sa RTPathSetMode 317 317 */ 318 RTDECL(int) RTDirRelPathSetMode( PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags)319 { 320 PRTDIR pThis = hDir;318 RTDECL(int) RTDirRelPathSetMode(RTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags) 319 { 320 PRTDIRINTERNAL pThis = hDir; 321 321 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 322 322 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 364 364 * @sa RTPathSetTimesEx 365 365 */ 366 RTDECL(int) RTDirRelPathSetTimes( PRTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,366 RTDECL(int) RTDirRelPathSetTimes(RTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, 367 367 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime, uint32_t fFlags) 368 368 { 369 PRTDIR pThis = hDir;369 PRTDIRINTERNAL pThis = hDir; 370 370 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 371 371 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 393 393 * @sa RTPathSetOwnerEx 394 394 */ 395 RTDECL(int) RTDirRelPathSetOwner( PRTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags)396 { 397 PRTDIR pThis = hDir;395 RTDECL(int) RTDirRelPathSetOwner(RTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags) 396 { 397 PRTDIRINTERNAL pThis = hDir; 398 398 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 399 399 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 429 429 * @sa RTPathRename 430 430 */ 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;431 RTDECL(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; 438 438 if (pThat != pThis) 439 439 { … … 465 465 * @sa RTPathUnlink 466 466 */ 467 RTDECL(int) RTDirRelPathUnlink( PRTDIR hDir, const char *pszRelPath, uint32_t fUnlink)468 { 469 PRTDIR pThis = hDir;467 RTDECL(int) RTDirRelPathUnlink(RTDIR hDir, const char *pszRelPath, uint32_t fUnlink) 468 { 469 PRTDIRINTERNAL pThis = hDir; 470 470 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 471 471 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 507 507 * @sa RTSymlinkCreate 508 508 */ 509 RTDECL(int) RTDirRelSymlinkCreate( PRTDIR hDir, const char *pszSymlink, const char *pszTarget,509 RTDECL(int) RTDirRelSymlinkCreate(RTDIR hDir, const char *pszSymlink, const char *pszTarget, 510 510 RTSYMLINKTYPE enmType, uint32_t fCreate) 511 511 { 512 PRTDIR pThis = hDir;512 PRTDIRINTERNAL pThis = hDir; 513 513 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 514 514 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 540 540 * @sa RTSymlinkRead 541 541 */ 542 RTDECL(int) RTDirRelSymlinkRead( PRTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead)543 { 544 PRTDIR pThis = hDir;542 RTDECL(int) RTDirRelSymlinkRead(RTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead) 543 { 544 PRTDIRINTERNAL pThis = hDir; 545 545 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 546 546 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); -
trunk/src/VBox/Runtime/r3/linux/RTProcIsRunningByName-linux.cpp
r69111 r69753 54 54 * Enumerate /proc. 55 55 */ 56 PRTDIR pDir;57 int rc = RTDirOpen(& pDir, "/proc");56 RTDIR hDir; 57 int rc = RTDirOpen(&hDir, "/proc"); 58 58 AssertMsgRCReturn(rc, ("RTDirOpen on /proc failed: rc=%Rrc\n", rc), false); 59 59 if (RT_SUCCESS(rc)) 60 60 { 61 61 RTDIRENTRY DirEntry; 62 while (RT_SUCCESS(RTDirRead( pDir, &DirEntry, NULL)))62 while (RT_SUCCESS(RTDirRead(hDir, &DirEntry, NULL))) 63 63 { 64 64 /* … … 104 104 { 105 105 /* Found it! */ 106 RTDirClose( pDir);106 RTDirClose(hDir); 107 107 return true; 108 108 } -
trunk/src/VBox/Runtime/r3/linux/krnlmod-linux.cpp
r67286 r69753 172 172 uint32_t cKmodsLoaded = 0; 173 173 174 PRTDIR pDir = NULL;175 int rc = RTDirOpen(& pDir, "/sys/module");174 RTDIR hDir = NULL; 175 int rc = RTDirOpen(&hDir, "/sys/module"); 176 176 if (RT_SUCCESS(rc)) 177 177 { 178 178 RTDIRENTRY DirEnt; 179 rc = RTDirRead( pDir, &DirEnt, NULL);179 rc = RTDirRead(hDir, &DirEnt, NULL); 180 180 while (RT_SUCCESS(rc)) 181 181 { 182 if ( RTStrCmp(DirEnt.szName, ".") 183 && RTStrCmp(DirEnt.szName, "..")) 182 if (!RTDirEntryIsStdDotLink(&DirEntry)) 184 183 cKmodsLoaded++; 185 rc = RTDirRead( pDir, &DirEnt, NULL);184 rc = RTDirRead(hDir, &DirEnt, NULL); 186 185 } 187 186 188 RTDirClose( pDir);187 RTDirClose(hDir); 189 188 } 190 189 … … 207 206 } 208 207 209 PRTDIR pDir = NULL;208 RTDIR hDir = NULL; 210 209 int rc = RTDirOpen(&pDir, "/sys/module"); 211 210 if (RT_SUCCESS(rc)) … … 214 213 RTDIRENTRY DirEnt; 215 214 216 rc = RTDirRead( pDir, &DirEnt, NULL);215 rc = RTDirRead(hDir, &DirEnt, NULL); 217 216 while (RT_SUCCESS(rc)) 218 217 { 219 if ( RTStrCmp(DirEnt.szName, ".") 220 && RTStrCmp(DirEnt.szName, "..")) 218 if (!RTDirEntryIsStdDotLink(&DirEnt)) 221 219 { 222 220 rc = rtKrnlModLinuxInfoCreate(DirEnt.szName, &pahKrnlModInfo[idxKrnlModInfo]); … … 226 224 227 225 if (RT_SUCCESS(rc)) 228 rc = RTDirRead( pDir, &DirEnt, NULL);226 rc = RTDirRead(hDir, &DirEnt, NULL); 229 227 } 230 228 … … 241 239 *pcEntries = cKmodsLoaded; 242 240 243 RTDirClose( pDir);241 RTDirClose(hDir); 244 242 } 245 243 -
trunk/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp
r69716 r69753 48 48 * Defined Constants And Macros * 49 49 *********************************************************************************************************************************/ 50 /** Whether to return a single record (TRUE) or multiple (FALSE) o. */50 /** Whether to return a single record (TRUE) or multiple (FALSE). */ 51 51 #define RTDIR_NT_SINGLE_RECORD FALSE 52 52 … … 77 77 { 78 78 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 83 int rtDirNativeOpen(PRTDIRINTERNAL pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative) 84 84 { 85 85 /* … … 155 155 156 156 157 RTDECL(int) RTDirClose(PRTDIR pDir) 158 { 157 RTDECL(int) RTDirClose(RTDIR hDir) 158 { 159 PRTDIRINTERNAL pDir = hDir; 160 159 161 /* 160 162 * Validate input. … … 196 198 * @param pThis The directory instance data. 197 199 */ 198 static int rtDirNtCheckRecord(PRTDIR pThis)200 static int rtDirNtCheckRecord(PRTDIRINTERNAL pThis) 199 201 { 200 202 #ifdef RTDIR_NT_STRICT … … 232 234 * @param pThis The directory instance data. 233 235 */ 234 static int rtDirNtAdvanceBuffer(PRTDIR pThis)236 static int rtDirNtAdvanceBuffer(PRTDIRINTERNAL pThis) 235 237 { 236 238 int rc; … … 275 277 * @param pThis The directory instance data. 276 278 */ 277 static int rtDirNtFetchMore(PRTDIR pThis)279 static int rtDirNtFetchMore(PRTDIRINTERNAL pThis) 278 280 { 279 281 Assert(!pThis->fDataUnread); … … 496 498 * @param pwsName The file name, not terminated. 497 499 */ 498 static int rtDirNtConvertName(PRTDIR pThis, uint32_t cbName, PCRTUTF16 pwsName)500 static int rtDirNtConvertName(PRTDIRINTERNAL pThis, uint32_t cbName, PCRTUTF16 pwsName) 499 501 { 500 502 int rc = RTUtf16ToUtf8Ex(pwsName, cbName / 2, &pThis->pszName, pThis->cbNameAlloc, &pThis->cchName); … … 525 527 * @param pThis The directory instance data. 526 528 */ 527 static int rtDirNtConvertCurName(PRTDIR pThis)529 static int rtDirNtConvertCurName(PRTDIRINTERNAL pThis) 528 530 { 529 531 switch (pThis->enmInfoClass) … … 544 546 545 547 546 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry) 547 { 548 RTDECL(int) RTDirRead(RTDIR hDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry) 549 { 550 PRTDIRINTERNAL pDir = hDir; 548 551 int rc; 549 552 … … 642 645 643 646 644 RTDECL(int) RTDirReadEx( PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry,647 RTDECL(int) RTDirReadEx(RTDIR hDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, 645 648 RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags) 646 649 { 650 PRTDIRINTERNAL pDir = hDir; 647 651 int rc; 648 652 … … 823 827 824 828 825 RTR3DECL(int) RTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs) 826 { 829 RTR3DECL(int) RTDirQueryInfo(RTDIR hDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs) 830 { 831 PRTDIRINTERNAL pDir = hDir; 827 832 AssertPtrReturn(pDir, VERR_INVALID_POINTER); 828 833 AssertReturn(pDir->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); -
trunk/src/VBox/Runtime/r3/nt/dirrel-r3-nt.cpp
r69720 r69753 63 63 * @param pszRelPath The relative path. 64 64 */ 65 static int rtDirRelBuildFullPath(PRTDIR pThis, char *pszPathDst, size_t cbPathDst, const char *pszRelPath)65 static int rtDirRelBuildFullPath(PRTDIRINTERNAL pThis, char *pszPathDst, size_t cbPathDst, const char *pszRelPath) 66 66 { 67 67 AssertMsgReturn(!RTPathStartsWithRoot(pszRelPath), ("pszRelPath='%s'\n", pszRelPath), VERR_PATH_IS_NOT_RELATIVE); … … 116 116 117 117 118 RTDECL(int) RTDirRelFileOpen( PRTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile)119 { 120 PRTDIR pThis = hDir;118 RTDECL(int) RTDirRelFileOpen(RTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile) 119 { 120 PRTDIRINTERNAL pThis = hDir; 121 121 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 122 122 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 188 188 189 189 190 RTDECL(int) RTDirRelDirOpen( PRTDIR hDir, const char *pszDir, PRTDIR *phDir)190 RTDECL(int) RTDirRelDirOpen(RTDIR hDir, const char *pszDir, RTDIR *phDir) 191 191 { 192 192 return RTDirRelDirOpenFiltered(hDir, pszDir, RTDIRFILTER_NONE, 0 /*fFlags*/, phDir); … … 194 194 195 195 196 RTDECL(int) RTDirRelDirOpenFiltered( PRTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter,197 uint32_t fFlags, PRTDIR *phDir)198 { 199 PRTDIR pThis = hDir;196 RTDECL(int) RTDirRelDirOpenFiltered(RTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter, 197 uint32_t fFlags, RTDIR *phDir) 198 { 199 PRTDIRINTERNAL pThis = hDir; 200 200 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 201 201 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 217 217 218 218 219 RTDECL(int) RTDirRelDirCreate( PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate, PRTDIR *phSubDir)220 { 221 PRTDIR pThis = hDir;219 RTDECL(int) RTDirRelDirCreate(RTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate, RTDIR *phSubDir) 220 { 221 PRTDIRINTERNAL pThis = hDir; 222 222 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 223 223 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 308 308 309 309 310 RTDECL(int) RTDirRelDirRemove( PRTDIR hDir, const char *pszRelPath)311 { 312 PRTDIR pThis = hDir;310 RTDECL(int) RTDirRelDirRemove(RTDIR hDir, const char *pszRelPath) 311 { 312 PRTDIRINTERNAL pThis = hDir; 313 313 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 314 314 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 372 372 373 373 374 RTDECL(int) RTDirRelPathQueryInfo( PRTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo,374 RTDECL(int) RTDirRelPathQueryInfo(RTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo, 375 375 RTFSOBJATTRADD enmAddAttr, uint32_t fFlags) 376 376 { 377 PRTDIR pThis = hDir;377 PRTDIRINTERNAL pThis = hDir; 378 378 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 379 379 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 409 409 * @sa RTPathSetMode 410 410 */ 411 RTDECL(int) RTDirRelPathSetMode( PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags)412 { 413 PRTDIR pThis = hDir;411 RTDECL(int) RTDirRelPathSetMode(RTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags) 412 { 413 PRTDIRINTERNAL pThis = hDir; 414 414 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 415 415 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 458 458 * @sa RTPathSetTimesEx 459 459 */ 460 RTDECL(int) RTDirRelPathSetTimes( PRTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,460 RTDECL(int) RTDirRelPathSetTimes(RTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, 461 461 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime, uint32_t fFlags) 462 462 { 463 PRTDIR pThis = hDir;463 PRTDIRINTERNAL pThis = hDir; 464 464 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 465 465 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 490 490 * @sa RTPathSetOwnerEx 491 491 */ 492 RTDECL(int) RTDirRelPathSetOwner( PRTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags)493 { 494 PRTDIR pThis = hDir;492 RTDECL(int) RTDirRelPathSetOwner(RTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags) 493 { 494 PRTDIRINTERNAL pThis = hDir; 495 495 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 496 496 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 527 527 * @sa RTPathRename 528 528 */ 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;529 RTDECL(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; 536 536 if (pThat != pThis) 537 537 { … … 566 566 * @sa RTPathUnlink 567 567 */ 568 RTDECL(int) RTDirRelPathUnlink( PRTDIR hDir, const char *pszRelPath, uint32_t fUnlink)569 { 570 PRTDIR pThis = hDir;568 RTDECL(int) RTDirRelPathUnlink(RTDIR hDir, const char *pszRelPath, uint32_t fUnlink) 569 { 570 PRTDIRINTERNAL pThis = hDir; 571 571 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 572 572 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 611 611 * @sa RTSymlinkCreate 612 612 */ 613 RTDECL(int) RTDirRelSymlinkCreate( PRTDIR hDir, const char *pszSymlink, const char *pszTarget,613 RTDECL(int) RTDirRelSymlinkCreate(RTDIR hDir, const char *pszSymlink, const char *pszTarget, 614 614 RTSYMLINKTYPE enmType, uint32_t fCreate) 615 615 { 616 PRTDIR pThis = hDir;616 PRTDIRINTERNAL pThis = hDir; 617 617 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 618 618 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); … … 647 647 * @sa RTSymlinkRead 648 648 */ 649 RTDECL(int) RTDirRelSymlinkRead( PRTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead)650 { 651 PRTDIR pThis = hDir;649 RTDECL(int) RTDirRelSymlinkRead(RTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead) 650 { 651 PRTDIRINTERNAL pThis = hDir; 652 652 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 653 653 AssertReturn(pThis->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE); -
trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp
r69691 r69753 215 215 cbNameMax = _XOPEN_NAME_MAX; 216 216 # 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); 220 220 cbDir = RT_ALIGN_Z(cbDir, 8); 221 221 … … 224 224 225 225 226 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative)226 int rtDirNativeOpen(PRTDIRINTERNAL pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative) 227 227 { 228 228 NOREF(pszPathBuf); /* only used on windows */ … … 255 255 256 256 257 RTDECL(int) RTDirClose(PRTDIR pDir) 258 { 257 RTDECL(int) RTDirClose(RTDIR hDir) 258 { 259 PRTDIRINTERNAL pDir = hDir; 260 259 261 /* 260 262 * Validate input. … … 291 293 * @param pDir the open directory. Fully validated. 292 294 */ 293 static int rtDirReadMore(PRTDIR pDir)295 static int rtDirReadMore(PRTDIRINTERNAL pDir) 294 296 { 295 297 /** @todo try avoid the rematching on buffer overflow errors. */ … … 377 379 378 380 379 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry) 380 { 381 RTDECL(int) RTDirRead(RTDIR hDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry) 382 { 383 PRTDIRINTERNAL pDir = hDir; 384 381 385 /* 382 386 * Validate and digest input. … … 474 478 475 479 476 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags) 477 { 480 RTDECL(int) RTDirReadEx(RTDIR hDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, 481 RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags) 482 { 483 PRTDIRINTERNAL pDir = hDir; 484 478 485 /* 479 486 * Validate and digest input. -
trunk/src/VBox/Runtime/r3/win/direnum-win.cpp
r69691 r69753 47 47 { 48 48 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 53 int rtDirNativeOpen(PRTDIRINTERNAL pDir, char *pszPathBuf, uintptr_t hRelativeDir, void *pvNativeRelative)) 54 54 { 55 55 RT_NOREF(hRelativeDir, pvNativeRelative); … … 107 107 108 108 109 RTDECL(int) RTDirClose(PRTDIR pDir)109 RTDECL(int) RTDirClose(PRTDIRINTERNAL pDir) 110 110 { 111 111 /* … … 138 138 139 139 140 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry) 141 { 140 RTDECL(int) RTDirRead(RTDIR hDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry) 141 { 142 PPRTDIRINTERNAL pDir = hDir; 143 142 144 /* 143 145 * Validate input. … … 222 224 223 225 224 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags) 225 { 226 RTDECL(int) RTDirReadEx(RTDIR hDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags) 227 { 228 PPRTDIRINTERNAL pDir = hDir; 226 229 /** @todo Symlinks: Find[First|Next]FileW will return info about 227 230 the link, so RTPATH_F_FOLLOW_LINK is not handled correctly. */ -
trunk/src/VBox/Runtime/testcase/tstDir-2.cpp
r69674 r69753 41 41 { 42 42 /* 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*/); 45 45 if (RT_SUCCESS(rc)) 46 46 { … … 48 48 { 49 49 RTDIRENTRY DirEntry; 50 rc = RTDirRead( pDir, &DirEntry, NULL);50 rc = RTDirRead(hDir, &DirEntry, NULL); 51 51 if (RT_FAILURE(rc)) 52 52 break; … … 78 78 79 79 /* close up */ 80 rc = RTDirClose( pDir);80 rc = RTDirClose(hDir); 81 81 if (RT_FAILURE(rc)) 82 82 { -
trunk/src/VBox/Runtime/testcase/tstDir-3.cpp
r69674 r69753 36 36 int rcRet = 0; 37 37 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*/); 40 40 if (RT_SUCCESS(rc)) 41 41 { … … 43 43 { 44 44 RTDIRENTRY DirEntry; 45 rc = RTDirRead( pDir, &DirEntry, NULL);45 rc = RTDirRead(hDir, &DirEntry, NULL); 46 46 if (RT_FAILURE(rc)) 47 47 break; … … 56 56 57 57 /* close up */ 58 rc = RTDirClose( pDir);58 rc = RTDirClose(hDir); 59 59 if (RT_FAILURE(rc)) 60 60 { -
trunk/src/VBox/Runtime/testcase/tstDir.cpp
r69674 r69753 81 81 { 82 82 /* open */ 83 PRTDIR pDir;83 RTDIR hDir; 84 84 int rc; 85 85 if (!fFiltered) 86 rc = RTDirOpen(& pDir, argv[i]);86 rc = RTDirOpen(&hDir, argv[i]); 87 87 else 88 rc = RTDirOpenFiltered(& pDir, argv[i], RTDIRFILTER_WINNT, 0 /*fFlags*/);88 rc = RTDirOpenFiltered(&hDir, argv[i], RTDIRFILTER_WINNT, 0 /*fFlags*/); 89 89 if (RT_SUCCESS(rc)) 90 90 { … … 95 95 { 96 96 RTDIRENTRY DirEntry; 97 rc = RTDirRead( pDir, &DirEntry, NULL);97 rc = RTDirRead(hDir, &DirEntry, NULL); 98 98 if (RT_FAILURE(rc)) 99 99 break; … … 126 126 { 127 127 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); 129 129 if (RT_FAILURE(rc)) 130 130 break; … … 208 208 209 209 /* close up */ 210 rc = RTDirClose( pDir);210 rc = RTDirClose(hDir); 211 211 if (RT_FAILURE(rc)) 212 212 { -
trunk/src/VBox/Runtime/testcase/tstRTNtPath-1.cpp
r69111 r69753 66 66 67 67 uint32_t cLeftToTest = 2; 68 PRTDIR hDir;68 RTDIR hDir; 69 69 int rc = RTDirOpen(&hDir, pThis->szLongPath); 70 70 if (RT_FAILURE(rc)) -
trunk/src/VBox/Runtime/tools/RTDbgSymCache.cpp
r69434 r69753 948 948 * Open the directory. 949 949 */ 950 PRTDIR pDir;950 RTDIR hDir; 951 951 int rc, rc2; 952 952 if (pCfg->pszFilter) … … 958 958 return RTMsgErrorRc(rc, "Filename too long (%Rrc): '%s" RTPATH_SLASH_STR "%s'", rc, pszPath, pCfg->pszFilter); 959 959 } 960 rc = RTDirOpenFiltered(& pDir, pszPath, RTDIRFILTER_WINNT, 0 /*fFlags*/);960 rc = RTDirOpenFiltered(&hDir, pszPath, RTDIRFILTER_WINNT, 0 /*fFlags*/); 961 961 } 962 962 else 963 rc = RTDirOpen(& pDir, pszPath);963 rc = RTDirOpen(&hDir, pszPath); 964 964 if (RT_FAILURE(rc)) 965 965 return RTMsgErrorRc(rc, "RTDirOpen%s failed on '%s': %Rrc", pCfg->pszFilter ? "Filtered" : "", pszPath, rc); … … 970 970 for (;;) 971 971 { 972 rc2 = RTDirReadEx( pDir, pDirEntry, NULL, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);972 rc2 = RTDirReadEx(hDir, pDirEntry, NULL, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK); 973 973 if (RT_FAILURE(rc2)) 974 974 { … … 1049 1049 * Clean up. 1050 1050 */ 1051 rc2 = RTDirClose( pDir);1051 rc2 = RTDirClose(hDir); 1052 1052 if (RT_FAILURE(rc2)) 1053 1053 {
Note:
See TracChangeset
for help on using the changeset viewer.