- Timestamp:
- Nov 13, 2017 3:29:43 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/dir.h
r69105 r69674 30 30 #include <iprt/types.h> 31 31 #include <iprt/fs.h> 32 #include <iprt/symlink.h> 32 33 33 34 … … 343 344 RTDECL(int) RTDirOpen(PRTDIR *ppDir, const char *pszPath); 344 345 345 /** @name RTD irOpenFilteredflags.346 /** @name RTDIR_F_XXX - RTDirOpenFiltered flags. 346 347 * @{ */ 347 348 /** Don't allow symbolic links as part of the path. 348 349 * @remarks this flag is currently not implemented and will be ignored. */ 349 #define RTDIROPEN_FLAGS_NO_SYMLINKS RT_BIT(0) 350 #define RTDIR_F_NO_SYMLINKS RT_BIT_32(0) 351 /** Deny relative opening of anything above this directory. */ 352 #define RTDIR_F_DENY_ASCENT RT_BIT_32(1) 353 /** Valid flag mask. */ 354 #define RTDIR_F_VALID_MASK UINT32_C(0x00000003) 350 355 /** @} */ 351 356 352 357 /** 353 * Opens a directory filtering the entries using dos style wildcards.358 * Opens a directory with flags and optional filtering. 354 359 * 355 360 * @returns iprt status code. … … 358 363 * @param enmFilter The kind of filter to apply. Setting this to RTDIRFILTER_NONE makes 359 364 * this function behave like RTDirOpen. 360 * @param f Open Open flags, RTDIROPENFILTERED_FLAGS_*.361 */ 362 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t f Open);365 * @param fFlags Open flags, RTDIR_F_XXX. 366 */ 367 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags); 363 368 364 369 /** … … 369 374 */ 370 375 RTDECL(int) RTDirClose(PRTDIR pDir); 376 377 /** 378 * Checks if the supplied directory handle is valid. 379 * 380 * @returns true if valid. 381 * @returns false if invalid. 382 * @param hDir The directory handle. 383 */ 384 RTDECL(bool) RTDirIsValid(PRTDIR hDir); 371 385 372 386 /** … … 533 547 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime); 534 548 549 550 /** @defgroup grp_rt_dir_rel Directory relative APIs 551 * 552 * This group of APIs allows working with paths that are relative to an open 553 * directory, therebye eliminating some classic path related race conditions on 554 * systems with native support for these kinds of operations. 555 * 556 * @{ */ 557 558 /** 559 * Open a file relative to @a hDir. 560 * 561 * @returns IPRT status code. 562 * @param hDir The directory to open relative to. 563 * @param pszRelFilename The relative path to the file. 564 * @param fOpen Open flags, i.e a combination of the RTFILE_O_XXX 565 * defines. The ACCESS, ACTION and DENY flags are 566 * mandatory! 567 * @param phFile Where to store the handle to the opened file. 568 * 569 * @sa RTFileOpen 570 */ 571 RTDECL(int) RTDirRelFileOpen(PRTDIR hDir, const char *pszRelFilename, uint64_t fOpen, PRTFILE phFile); 572 573 574 575 /** 576 * Opens a directory relative to @a hDir. 577 * 578 * @returns IPRT status code. 579 * @param hDir The directory to open relative to. 580 * @param pszDir The relative path to the directory to open. 581 * @param phDir Where to store the directory handle. 582 * 583 * @sa RTDirOpen 584 */ 585 RTDECL(int) RTDirRelDirOpen(PRTDIR hDir, const char *pszDir, PRTDIR *phDir); 586 587 /** 588 * Opens a directory relative to @a hDir, with flags and optional filtering. 589 * 590 * @returns IPRT status code. 591 * @param hDir The directory to open relative to. 592 * @param pszDirAndFilter The relative path to the directory to search, this 593 * must include wildcards. 594 * @param enmFilter The kind of filter to apply. Setting this to 595 * RTDIRFILTER_NONE makes this function behave like 596 * RTDirOpen. 597 * @param fFlags Open flags, RTDIR_F_XXX. 598 * @param phDir Where to store the directory handle. 599 * 600 * @sa RTDirOpenFiltered 601 */ 602 RTDECL(int) RTDirRelDirOpenFiltered(PRTDIR hDir, const char *pszDirAndFilter, RTDIRFILTER enmFilter, 603 uint32_t fFlags, PRTDIR *phDir); 604 605 /** 606 * Creates a directory relative to @a hDir. 607 * 608 * @returns IPRT status code. 609 * @param hDir The directory @a pszRelPath is relative to. 610 * @param pszRelPath The relative path to the directory to create. 611 * @param fMode The mode of the new directory. 612 * @param fCreate Create flags, RTDIRCREATE_FLAGS_XXX. 613 * 614 * @sa RTDirCreate 615 */ 616 RTDECL(int) RTDirRelDirCreate(PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fCreate); 617 618 /** 619 * Removes a directory relative to @a hDir if empty. 620 * 621 * @returns IPRT status code. 622 * @param hDir The directory @a pszRelPath is relative to. 623 * @param pszRelPath The relative path to the directory to remove. 624 * 625 * @sa RTDirRemove 626 */ 627 RTDECL(int) RTDirRelDirRemove(PRTDIR hDir, const char *pszRelPath); 628 629 630 /** 631 * Query information about a file system object relative to @a hDir. 632 * 633 * @returns IPRT status code. 634 * @retval VINF_SUCCESS if the object exists, information returned. 635 * @retval VERR_PATH_NOT_FOUND if any but the last component in the specified 636 * path was not found or was not a directory. 637 * @retval VERR_FILE_NOT_FOUND if the object does not exist (but path to the 638 * parent directory exists). 639 * 640 * @param hDir The directory @a pszRelPath is relative to. 641 * @param pszRelPath The relative path to the file system object. 642 * @param pObjInfo Object information structure to be filled on successful 643 * return. 644 * @param enmAddAttr Which set of additional attributes to request. 645 * Use RTFSOBJATTRADD_NOTHING if this doesn't matter. 646 * @param fFlags RTPATH_F_ON_LINK or RTPATH_F_FOLLOW_LINK. 647 * 648 * @sa RTPathQueryInfoEx 649 */ 650 RTDECL(int) RTDirRelPathQueryInfo(PRTDIR hDir, const char *pszRelPath, PRTFSOBJINFO pObjInfo, 651 RTFSOBJATTRADD enmAddAttr, uint32_t fFlags); 652 653 /** 654 * Changes the mode flags of a file system object relative to @a hDir. 655 * 656 * The API requires at least one of the mode flag sets (Unix/Dos) to 657 * be set. The type is ignored. 658 * 659 * @returns IPRT status code. 660 * @param hDir The directory @a pszRelPath is relative to. 661 * @param pszRelPath The relative path to the file system object. 662 * @param fMode The new file mode, see @ref grp_rt_fs for details. 663 * @param fFlags RTPATH_F_ON_LINK or RTPATH_F_FOLLOW_LINK. 664 * 665 * @sa RTPathSetMode 666 */ 667 RTDECL(int) RTDirRelPathSetMode(PRTDIR hDir, const char *pszRelPath, RTFMODE fMode, uint32_t fFlags); 668 669 /** 670 * Changes one or more of the timestamps associated of file system object 671 * relative to @a hDir. 672 * 673 * @returns IPRT status code. 674 * @param hDir The directory @a pszRelPath is relative to. 675 * @param pszRelPath The relative path to the file system object. 676 * @param pAccessTime Pointer to the new access time. 677 * @param pModificationTime Pointer to the new modification time. 678 * @param pChangeTime Pointer to the new change time. NULL if not to be changed. 679 * @param pBirthTime Pointer to the new time of birth. NULL if not to be changed. 680 * @param fFlags RTPATH_F_ON_LINK or RTPATH_F_FOLLOW_LINK. 681 * 682 * @remark The file system might not implement all these time attributes, 683 * the API will ignore the ones which aren't supported. 684 * 685 * @remark The file system might not implement the time resolution 686 * employed by this interface, the time will be chopped to fit. 687 * 688 * @remark The file system may update the change time even if it's 689 * not specified. 690 * 691 * @remark POSIX can only set Access & Modification and will always set both. 692 * 693 * @sa RTPathSetTimesEx 694 */ 695 RTDECL(int) RTDirRelPathSetTimes(PRTDIR hDir, const char *pszRelPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, 696 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime, uint32_t fFlags); 697 698 /** 699 * Changes the owner and/or group of a file system object relative to @a hDir. 700 * 701 * @returns IPRT status code. 702 * @param hDir The directory @a pszRelPath is relative to. 703 * @param pszRelPath The relative path to the file system object. 704 * @param uid The new file owner user id. Pass NIL_RTUID to leave 705 * this unchanged. 706 * @param gid The new group id. Pass NIL_RTGID to leave this 707 * unchanged. 708 * @param fFlags RTPATH_F_ON_LINK or RTPATH_F_FOLLOW_LINK. 709 * 710 * @sa RTPathSetOwnerEx 711 */ 712 RTDECL(int) RTDirRelPathSetOwner(PRTDIR hDir, const char *pszRelPath, uint32_t uid, uint32_t gid, uint32_t fFlags); 713 714 /** 715 * Renames a directory relative path within a filesystem. 716 * 717 * This will rename symbolic links. If RTPATHRENAME_FLAGS_REPLACE is used and 718 * pszDst is a symbolic link, it will be replaced and not its target. 719 * 720 * @returns IPRT status code. 721 * @param hDirSrc The directory the source path is relative to. 722 * @param pszSrc The source path, relative to @a hDirSrc. 723 * @param hDirSrc The directory the destination path is relative to. 724 * @param pszDst The destination path, relative to @a hDirDst. 725 * @param fRename Rename flags, RTPATHRENAME_FLAGS_XXX. 726 * 727 * @sa RTPathRename 728 */ 729 RTDECL(int) RTDirRelPathRename(PRTDIR hDirSrc, const char *pszSrc, PRTDIR hDirDst, const char *pszDst, unsigned fRename); 730 731 /** 732 * Removes the last component of the directory relative path. 733 * 734 * @returns IPRT status code. 735 * @param hDir The directory @a pszRelPath is relative to. 736 * @param pszRelPath The relative path to the file system object. 737 * @param fUnlink Unlink flags, RTPATHUNLINK_FLAGS_XXX. 738 * 739 * @sa RTPathUnlink 740 */ 741 RTDECL(int) RTDirRelPathUnlink(PRTDIR hDir, const char *pszRelPath, uint32_t fUnlink); 742 743 744 745 /** 746 * Creates a symbolic link (@a pszSymlink) relative to @a hDir targeting @a 747 * pszTarget. 748 * 749 * @returns IPRT status code. 750 * @param hDir The directory @a pszSymlink is relative to. 751 * @param pszSymlink The relative path of the symbolic link. 752 * @param pszTarget The path to the symbolic link target. This is 753 * relative to @a pszSymlink or an absolute path. 754 * @param enmType The symbolic link type. For Windows compatability 755 * it is very important to set this correctly. When 756 * RTSYMLINKTYPE_UNKNOWN is used, the API will try 757 * make a guess and may attempt query information 758 * about @a pszTarget in the process. 759 * @param fCreate Create flags, RTSYMLINKCREATE_FLAGS_XXX. 760 * 761 * @sa RTSymlinkCreate 762 */ 763 RTDECL(int) RTDirRelSymlinkCreate(PRTDIR hDir, const char *pszSymlink, const char *pszTarget, 764 RTSYMLINKTYPE enmType, uint32_t fCreate); 765 766 /** 767 * Read the symlink target relative to @a hDir. 768 * 769 * @returns IPRT status code. 770 * @retval VERR_NOT_SYMLINK if @a pszSymlink does not specify a symbolic link. 771 * @retval VERR_BUFFER_OVERFLOW if the link is larger than @a cbTarget. The 772 * buffer will contain what all we managed to read, fully terminated 773 * if @a cbTarget > 0. 774 * 775 * @param hDir The directory @a pszSymlink is relative to. 776 * @param pszSymlink The relative path to the symbolic link that should 777 * be read. 778 * @param pszTarget The target buffer. 779 * @param cbTarget The size of the target buffer. 780 * @param fRead Read flags, RTSYMLINKREAD_FLAGS_XXX. 781 * 782 * @sa RTSymlinkRead 783 */ 784 RTDECL(int) RTDirRelSymlinkRead(PRTDIR hDir, const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead); 785 535 786 /** @} */ 536 787 788 789 /** @} */ 790 537 791 RT_C_DECLS_END 538 792 -
trunk/include/iprt/mangling.h
r69616 r69674 759 759 # define RTDirFlush RT_MANGLER(RTDirFlush) 760 760 # define RTDirFlushParent RT_MANGLER(RTDirFlushParent) 761 # define RTDirIsValid RT_MANGLER(RTDirIsValid) 761 762 # define RTDirOpen RT_MANGLER(RTDirOpen) 762 763 # define RTDirOpenFiltered RT_MANGLER(RTDirOpenFiltered) … … 770 771 # define RTDirRename RT_MANGLER(RTDirRename) 771 772 # define RTDirSetTimes RT_MANGLER(RTDirSetTimes) 773 # define RTDirRelFileOpen RT_MANGLER(RTDirRelFileOpen) 774 # define RTDirRelDirOpen RT_MANGLER(RTDirRelDirOpen) 775 # define RTDirRelDirOpenFiltered RT_MANGLER(RTDirRelDirOpenFiltered) 776 # define RTDirRelDirCreate RT_MANGLER(RTDirRelDirCreate) 777 # define RTDirRelDirRemove RT_MANGLER(RTDirRelDirRemove) 778 # define RTDirRelPathQueryInfo RT_MANGLER(RTDirRelPathQueryInfo) 779 # define RTDirRelPathSetMode RT_MANGLER(RTDirRelPathSetMode) 780 # define RTDirRelPathSetTimes RT_MANGLER(RTDirRelPathSetTimes) 781 # define RTDirRelPathSetOwner RT_MANGLER(RTDirRelPathSetOwner) 782 # define RTDirRelPathRename RT_MANGLER(RTDirRelPathRename) 783 # define RTDirRelPathUnlink RT_MANGLER(RTDirRelPathUnlink) 784 # define RTDirRelSymlinkCreate RT_MANGLER(RTDirRelSymlinkCreate) 785 # define RTDirRelSymlinkRead RT_MANGLER(RTDirRelSymlinkRead) 786 # define RTVfsDirOpenDir RT_MANGLER(RTVfsDirOpenDir) 787 # define RTVfsDirFromRTDir RT_MANGLER(RTVfsDirFromRTDir) 788 # define RTVfsDirOpenNormal RT_MANGLER(RTVfsDirOpenNormal) 772 789 # define RTDvmCreate RT_MANGLER(RTDvmCreate) 773 790 # define RTDvmCreateFromVfsFile RT_MANGLER(RTDvmCreateFromVfsFile) -
trunk/include/iprt/vfs.h
r69105 r69674 478 478 479 479 /** 480 * Create a VFS directory handle from a standard IPRT directory handle (PRTDIR). 481 * 482 * @returns IPRT status code. 483 * @param hDir The standard IPRT directory handle. 484 * @param fLeaveOpen Whether to leave the handle open when the VFS 485 * directory is released, or to close it (@c false). 486 * @param phVfsDi Where to return the VFS directory handle. 487 */ 488 RTDECL(int) RTVfsDirFromRTDir(PRTDIR hDir, bool fLeaveOpen, PRTVFSDIR phVfsDir); 489 490 /** 491 * RTDirOpen + RTVfsDirFromRTDir. 492 * 493 * @returns IPRT status code. 494 * @param hDir The standard IPRT directory handle. 495 * @param fFlags RTDIR_F_XXX. 496 * @param fLeaveOpen Whether to leave the handle open when the VFS 497 * directory is released, or to close it (@c false). 498 * @param phVfsDi Where to return the VFS directory handle. 499 */ 500 RTDECL(int) RTVfsDirOpenNormal(const char *pszFilename, uint32_t fFlags, PRTVFSDIR phVfsDir); 501 502 /** 480 503 * Queries information about a object in or under the given directory. 481 504 * -
trunk/include/iprt/vfslowlevel.h
r69105 r69674 251 251 DECLCALLBACKMEMBER(int, pfnTraverse)(void *pvThis, const char *pszPath, size_t *poffPath, PRTVFS??? phVfs?, ???* p???); 252 252 #endif 253 254 /** @todo need rename API */ 253 255 254 256 /** Marks the end of the structure (RTVFSOPS_VERSION). */ … … 562 564 * @param pvThis The implementation specific directory data. 563 565 * @param pszSubDir The name of the immediate subdirectory to open. 566 * @param fFlags RTDIR_F_XXX. 564 567 * @param phVfsDir Where to return the handle to the opened directory. 565 568 * @sa RTDirOpen. … … 645 648 * @param pszNewName The new entry name. 646 649 * @sa RTPathRename 650 * 651 * @todo This API is not flexible enough, must be able to rename between 652 * directories within a file system. 647 653 */ 648 654 DECLCALLBACKMEMBER(int, pfnRenameEntry)(void *pvThis, const char *pszEntry, RTFMODE fType, const char *pszNewName); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp
r69500 r69674 196 196 if (pszPathTmp) 197 197 { 198 rc = RTDirOpenFiltered(&pDirCurr, pszPathTmp, RTDIRFILTER_WINNT, 0 );198 rc = RTDirOpenFiltered(&pDirCurr, pszPathTmp, RTDIRFILTER_WINNT, 0 /*fFlags*/); 199 199 RTStrFree(pszPathTmp); 200 200 } … … 289 289 290 290 /* Open the directory */ 291 rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPath, RTDIRFILTER_WINNT, 0 );291 rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPath, RTDIRFILTER_WINNT, 0 /*fFlags*/); 292 292 if (RT_SUCCESS(rc)) 293 293 { … … 378 378 379 379 /* Open the directory */ 380 rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPathDir, RTDIRFILTER_WINNT, 0 );380 rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPathDir, RTDIRFILTER_WINNT, 0 /*fFlags*/); 381 381 if (RT_FAILURE(rc)) 382 382 break; -
trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
r69500 r69674 106 106 }; 107 107 108 int rtDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter )109 { 110 RT_NOREF1(enmFilter );108 int rtDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uitn32_t fFlags) 109 { 110 RT_NOREF1(enmFilter, fFlags); 111 111 if (!strcmp(pszPath, "c:\\*")) 112 112 iDirList = 1; … … 225 225 strcat(pDirEntry->szName, szWildCard); 226 226 227 rc = RTDirOpenFiltered (&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT);227 rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, 0 /*fFlags*/); 228 228 *(pszStartComponent-1) = RTPATH_DELIMITER; 229 229 if (RT_FAILURE(rc)) -
trunk/src/VBox/HostServices/SharedFolders/teststubs.h
r69500 r69674 34 34 extern int testRTDirOpen(PRTDIR *ppDir, const char *pszPath); 35 35 #define RTDirOpenFiltered testRTDirOpenFiltered 36 extern int testRTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t f Open);36 extern int testRTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags); 37 37 #define RTDirQueryInfo testRTDirQueryInfo 38 38 extern int testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs); -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r69500 r69674 668 668 { 669 669 /* Open the directory now */ 670 rc = RTDirOpenFiltered(&pHandle->dir.Handle, pszPath, RTDIRFILTER_NONE, 0 );670 rc = RTDirOpenFiltered(&pHandle->dir.Handle, pszPath, RTDIRFILTER_NONE, 0 /*fFlags*/); 671 671 if (RT_SUCCESS(rc)) 672 672 { … … 1200 1200 if (RT_SUCCESS(rc)) 1201 1201 { 1202 rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath, RTDIRFILTER_WINNT, 0 );1202 rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath, RTDIRFILTER_WINNT, 0 /*fFlags*/); 1203 1203 1204 1204 /* free the path string */ -
trunk/src/VBox/HostServices/SharedFolders/vbsfpath.cpp
r69500 r69674 98 98 { 99 99 PRTDIR hSearch = NULL; 100 rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, 0 );100 rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, 0 /*fFlags*/); 101 101 if (RT_SUCCESS(rc)) 102 102 { -
trunk/src/VBox/Runtime/Makefile.kmk
r69111 r69674 624 624 common/vfs/vfsprogress.cpp \ 625 625 common/vfs/vfsreadahead.cpp \ 626 common/vfs/vfsstddir.cpp \ 626 627 common/vfs/vfsstdfile.cpp \ 627 628 common/vfs/vfsstdpipe.cpp \ … … 679 680 r3/tcp.cpp \ 680 681 r3/udp.cpp \ 682 r3/generic/dirrel-r3-generic.cpp \ 681 683 r3/generic/semspinmutex-r3-generic.cpp \ 682 684 r3/xml.cpp \ -
trunk/src/VBox/Runtime/common/vfs/vfschain.cpp
r69630 r69674 1187 1187 * Path to regular file system. 1188 1188 */ 1189 /** @todo implement system specific standard VFS directory class. */ 1190 rc = VERR_NOT_IMPLEMENTED; 1189 rc = RTVfsDirOpenNormal(pszSpec, fOpen, phVfsDir); 1191 1190 1192 1191 RTVfsChainSpecFree(pSpec); -
trunk/src/VBox/Runtime/include/internal/dir.h
r69474 r69674 73 73 /** The length of the path. */ 74 74 size_t cchPath; 75 /** Set to indicate that the Data member contains unread data. */76 bool fDataUnread;77 75 /** Pointer to the converted filename. 78 76 * This can be NULL. */ … … 86 84 /** The size of this structure. */ 87 85 size_t cbSelf; 86 /** The RTDIR_F_XXX flags passed to RTDirOpenFiltered */ 87 uint32_t fFlags; 88 /** Set to indicate that the Data member contains unread data. */ 89 bool fDataUnread; 88 90 89 91 #ifndef RTDIR_AGNOSTIC -
trunk/src/VBox/Runtime/r3/dir.cpp
r69111 r69674 510 510 * @param pszFilter Pointer to where the filter start in the path. NULL if no filter. 511 511 * @param enmFilter The type of filter to apply. 512 */ 513 static int rtDirOpenCommon(PRTDIR *ppDir, const char *pszPath, const char *pszFilter, RTDIRFILTER enmFilter) 512 * @param fFlags RTDIR_F_XXX. 513 */ 514 static int rtDirOpenCommon(PRTDIR *ppDir, const char *pszPath, const char *pszFilter, RTDIRFILTER enmFilter, uint32_t fFlags) 514 515 { 515 516 /* … … 614 615 pDir->pszPath = (char *)memcpy(pb, szRealPath, cchRealPath + 1); 615 616 Assert(pb - (uint8_t *)pDir + cchRealPath + 1 <= cbAllocated); 616 pDir->fDataUnread = false;617 617 pDir->pszName = NULL; 618 618 pDir->cchName = 0; 619 pDir->fFlags = fFlags; 620 pDir->fDataUnread = false; 619 621 620 622 /* … … 643 645 * Take common cause with RTDirOpenFiltered(). 644 646 */ 645 int rc = rtDirOpenCommon(ppDir, pszPath, NULL, RTDIRFILTER_NONE);647 int rc = rtDirOpenCommon(ppDir, pszPath, NULL, RTDIRFILTER_NONE, 0 /*fFlags*/); 646 648 LogFlow(("RTDirOpen(%p:{%p}, %p:{%s}): return %Rrc\n", ppDir, *ppDir, pszPath, pszPath, rc)); 647 649 return rc; … … 649 651 650 652 651 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t f Open)653 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags) 652 654 { 653 655 /* … … 656 658 AssertMsgReturn(VALID_PTR(ppDir), ("%p\n", ppDir), VERR_INVALID_POINTER); 657 659 AssertMsgReturn(VALID_PTR(pszPath), ("%p\n", pszPath), VERR_INVALID_POINTER); 658 AssertReturn(!(f Open & ~RTDIROPEN_FLAGS_NO_SYMLINKS), VERR_INVALID_FLAGS);660 AssertReturn(!(fFlags & ~RTDIR_F_VALID_MASK), VERR_INVALID_FLAGS); 659 661 switch (enmFilter) 660 662 { … … 687 689 * and initialize the handle, and finally call the backend. 688 690 */ 689 int rc = rtDirOpenCommon(ppDir, pszPath, pszFilter, enmFilter );690 691 LogFlow(("RTDirOpenFiltered(%p:{%p}, %p:{%s}, %d ): return %Rrc\n",692 ppDir, *ppDir, pszPath, pszPath, enmFilter, rc));691 int rc = rtDirOpenCommon(ppDir, pszPath, pszFilter, enmFilter, fFlags); 692 693 LogFlow(("RTDirOpenFiltered(%p:{%p}, %p:{%s}, %d, %#x): return %Rrc\n", 694 ppDir, *ppDir, pszPath, pszPath, enmFilter, fFlags, rc)); 693 695 return rc; 696 } 697 698 699 RTDECL(bool) RTDirIsValid(PRTDIR hDir) 700 { 701 return RT_VALID_PTR(hDir) 702 && hDir->u32Magic == RTDIR_MAGIC; 694 703 } 695 704 -
trunk/src/VBox/Runtime/testcase/tstDir-2.cpp
r69111 r69674 42 42 /* open */ 43 43 PRTDIR pDir; 44 int rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT, 0 );44 int rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT, 0 /*fFlags*/); 45 45 if (RT_SUCCESS(rc)) 46 46 { -
trunk/src/VBox/Runtime/testcase/tstDir-3.cpp
r69434 r69674 37 37 unsigned cFilesMatch = 0; 38 38 PRTDIR pDir; 39 int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT, 0 );39 int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT, 0 /*fFlags*/); 40 40 if (RT_SUCCESS(rc)) 41 41 { -
trunk/src/VBox/Runtime/testcase/tstDir.cpp
r69111 r69674 86 86 rc = RTDirOpen(&pDir, argv[i]); 87 87 else 88 rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT, 0 );88 rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT, 0 /*fFlags*/); 89 89 if (RT_SUCCESS(rc)) 90 90 { -
trunk/src/VBox/Storage/VDPlugin.cpp
r69230 r69674 645 645 PRTDIR pPluginDir = NULL; 646 646 size_t cbPluginDirEntry = sizeof(RTDIRENTRYEX); 647 int rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT, 0 );647 int rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT, 0 /*fFlags*/); 648 648 if (RT_SUCCESS(rc)) 649 649 { … … 768 768 PRTDIR pPluginDir = NULL; 769 769 size_t cbPluginDirEntry = sizeof(RTDIRENTRYEX); 770 int rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT, 0 );770 int rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT, 0 /*fFlags*/); 771 771 if (RT_SUCCESS(rc)) 772 772 { -
trunk/src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp
r69111 r69674 472 472 473 473 PRTDIR pDir; 474 rc = RTDirOpenFiltered(&pDir, szPath, RTDIRFILTER_WINNT, 0 );474 rc = RTDirOpenFiltered(&pDir, szPath, RTDIRFILTER_WINNT, 0 /*fFlags*/); 475 475 if (RT_SUCCESS(rc)) 476 476 { -
trunk/src/VBox/ValidationKit/utils/usb/UsbTestServicePlatform-linux.cpp
r69227 r69674 126 126 127 127 PRTDIR pDir = NULL; 128 rc = RTDirOpenFiltered(&pDir, aszPath, RTDIRFILTER_WINNT, 0 );128 rc = RTDirOpenFiltered(&pDir, aszPath, RTDIRFILTER_WINNT, 0 /*fFlags*/); 129 129 if (RT_SUCCESS(rc)) 130 130 { … … 206 206 /* Enumerate the available HCD and their bus numbers. */ 207 207 PRTDIR pDir = NULL; 208 int rc = RTDirOpenFiltered(&pDir, aszPath, RTDIRFILTER_WINNT, 0 );208 int rc = RTDirOpenFiltered(&pDir, aszPath, RTDIRFILTER_WINNT, 0 /*fFlags*/); 209 209 if (RT_SUCCESS(rc)) 210 210 { -
trunk/src/bldprogs/scm.cpp
r69510 r69674 2298 2298 */ 2299 2299 PRTDIR pDir; 2300 rc = RTDirOpenFiltered(&pDir, pszBuf, RTDIRFILTER_NONE, 0 );2300 rc = RTDirOpenFiltered(&pDir, pszBuf, RTDIRFILTER_NONE, 0 /*fFlags*/); 2301 2301 if (RT_FAILURE(rc)) 2302 2302 {
Note:
See TracChangeset
for help on using the changeset viewer.