VirtualBox

Changeset 18128 in vbox for trunk/src


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).

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r16486 r18128  
    553553            fOpen |= RTFILE_O_READWRITE;
    554554            Log(("FLAG: SHFL_CF_ACCESS_READWRITE\n"));
     555            break;
     556        }
     557    }
     558
     559    switch (BIT_FLAG(fShflFlags, SHFL_CF_ACCESS_MASK_ATTR))
     560    {
     561        default:
     562        case SHFL_CF_ACCESS_ATTR_NONE:
     563        {
     564            fOpen |= RTFILE_O_ACCESS_ATTR_DEFAULT;
     565            Log(("FLAG: SHFL_CF_ACCESS_ATTR_NONE\n"));
     566            break;
     567        }
     568
     569        case SHFL_CF_ACCESS_ATTR_READ:
     570        {
     571            fOpen |= RTFILE_O_ACCESS_ATTR_READ;
     572            Log(("FLAG: SHFL_CF_ACCESS_ATTR_READ\n"));
     573            break;
     574        }
     575
     576        case SHFL_CF_ACCESS_ATTR_WRITE:
     577        {
     578            fOpen |= RTFILE_O_ACCESS_ATTR_WRITE;
     579            Log(("FLAG: SHFL_CF_ACCESS_ATTR_WRITE\n"));
     580            break;
     581        }
     582
     583        case SHFL_CF_ACCESS_ATTR_READWRITE:
     584        {
     585            fOpen |= RTFILE_O_ACCESS_ATTR_READWRITE;
     586            Log(("FLAG: SHFL_CF_ACCESS_ATTR_READWRITE\n"));
    555587            break;
    556588        }
  • 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