VirtualBox

Changeset 18128 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
Mar 23, 2009 9:39:23 AM (16 years ago)
Author:
vboxsync
Message:

IPRT, Shared Folders: Implemented file attributes access flags for RTFileOpen on Windows host (xTracker #3739).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/fileio-win.cpp

    r16650 r18128  
    209209            return VERR_INVALID_PARAMETER;
    210210    }
     211
    211212    /* RTFileSetMode needs following rights as well. */
    212     dwDesiredAccess |= FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE;
     213    switch (fOpen & RTFILE_O_ACCESS_ATTR_MASK)
     214    {
     215        case RTFILE_O_ACCESS_ATTR_READ:      dwDesiredAccess |= FILE_READ_ATTRIBUTES | SYNCHRONIZE; break;
     216        case RTFILE_O_ACCESS_ATTR_WRITE:     dwDesiredAccess |= FILE_WRITE_ATTRIBUTES | SYNCHRONIZE; break;
     217        case RTFILE_O_ACCESS_ATTR_READWRITE: dwDesiredAccess |= FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE; break;
     218        default:
     219            /* Attributes access is the same as the file access. */
     220            switch (fOpen & RTFILE_O_ACCESS_MASK)
     221            {
     222                case RTFILE_O_READ:      dwDesiredAccess |= FILE_READ_ATTRIBUTES | SYNCHRONIZE; break;
     223                case RTFILE_O_WRITE:     dwDesiredAccess |= FILE_WRITE_ATTRIBUTES | SYNCHRONIZE; break;
     224                case RTFILE_O_READWRITE: dwDesiredAccess |= FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE; break;
     225                default:
     226                    AssertMsgFailed(("Impossible fOpen=%#x\n", fOpen));
     227                    return VERR_INVALID_PARAMETER;
     228            }
     229    }
    213230
    214231    DWORD dwShareMode;
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