Changeset 69753 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Nov 19, 2017 2:27:58 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119153
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
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. */
Note:
See TracChangeset
for help on using the changeset viewer.