VirtualBox

Changeset 19350 in vbox


Ignore:
Timestamp:
May 5, 2009 2:44:04 AM (16 years ago)
Author:
vboxsync
Message:

IPRT,tstDisasm-2: defined flags for RTFileReadAllEx and RTFileReadAllHandleEx.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/file.h

    r19185 r19350  
    714714 * @param   cbMax           The maximum number of bytes to read into memory. Specify RTFOFF_MAX
    715715 *                          to read to the end of the file.
    716  * @param   fFlags          Flags for the future, must be 0.
     716 * @param   fFlags          See RTFILE_RDALL_*.
    717717 * @param   ppvFile         Where to store the pointer to the memory on successful return.
    718718 * @param   pcbFile         Where to store the size of the file on successful return.
     
    746746 * @param   cbMax           The maximum number of bytes to read into memory. Specify RTFOFF_MAX
    747747 *                          to read to the end of the file.
    748  * @param   fFlags          Flags for the future, must be 0.
     748 * @param   fFlags          See RTFILE_RDALL_*.
    749749 * @param   ppvFile         Where to store the pointer to the memory on successful return.
    750750 * @param   pcbFile         Where to store the size of the file on successful return.
     
    763763RTDECL(void) RTFileReadAllFree(void *pvFile, size_t cbFile);
    764764
     765/** @name RTFileReadAllEx and RTFileReadAllHandleEx flags
     766 * The open flags are ignored by RTFileReadAllHandleEx.
     767 * @{ */
     768#define RTFILE_RDALL_O_DENY_NONE            RTFILE_O_DENY_NONE
     769#define RTFILE_RDALL_O_DENY_READ            RTFILE_O_DENY_READ
     770#define RTFILE_RDALL_O_DENY_WRITE           RTFILE_O_DENY_WRITE
     771#define RTFILE_RDALL_O_DENY_READWRITE       RTFILE_O_DENY_READWRITE
     772#define RTFILE_RDALL_O_DENY_ALL             RTFILE_O_DENY_ALL
     773#define RTFILE_RDALL_O_DENY_NOT_DELETE      RTFILE_O_DENY_NOT_DELETE
     774#define RTFILE_RDALL_O_DENY_MASK            RTFILE_O_DENY_MASK
     775/** Mask of valid flags. */
     776#define RTFILE_RDALL_VALID_MASK             RTFILE_RDALL_O_DENY_MASK
     777/** @} */
    765778
    766779
  • trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp

    r18458 r19350  
    990990            void   *pvFile;
    991991            size_t  cbFile;
    992             rc = RTFileReadAllEx(argv[iArg], off, cbMax, 0, &pvFile, &cbFile);
     992            rc = RTFileReadAllEx(argv[iArg], off, cbMax, RTFILE_RDALL_O_DENY_NONE, &pvFile, &cbFile);
    993993            if (RT_FAILURE(rc))
    994994            {
  • trunk/src/VBox/Runtime/generic/RTFileReadAllByHandleEx-generic.cpp

    r8954 r19350  
    4343RTDECL(int) RTFileReadAllByHandleEx(RTFILE File, RTFOFF off, RTFOFF cbMax, uint32_t fFlags, void **ppvFile, size_t *pcbFile)
    4444{
    45     AssertReturn(!fFlags, VERR_INVALID_PARAMETER);
     45    AssertReturn(!(fFlags & ~RTFILE_RDALL_VALID_MASK), VERR_INVALID_PARAMETER);
    4646
    4747    /*
  • trunk/src/VBox/Runtime/generic/RTFileReadAllEx-generic.cpp

    r8925 r19350  
    4141RTDECL(int) RTFileReadAllEx(const char *pszFilename, RTFOFF off, RTFOFF cbMax, uint32_t fFlags, void **ppvFile, size_t *pcbFile)
    4242{
    43     AssertReturn(!fFlags, VERR_INVALID_PARAMETER);
     43    AssertReturn(!(fFlags & ~RTFILE_RDALL_VALID_MASK), VERR_INVALID_PARAMETER);
    4444
    4545    RTFILE File;
    46     int rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
     46    int rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | (fFlags & RTFILE_RDALL_O_DENY_MASK));
    4747    if (RT_SUCCESS(rc))
    4848    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette