VirtualBox

Changeset 58766 in vbox


Ignore:
Timestamp:
Nov 19, 2015 1:28:58 PM (9 years ago)
Author:
vboxsync
Message:

RTFileOpen: Introduced RTFILE_O_ATTR_ONLY for windows only.

Location:
trunk
Files:
3 edited

Legend:

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

    r58760 r58766  
    47974797 * @returns 0 if all bits are cleared.
    47984798 * @param   u32     Integer to search for set bits.
    4799  * @remark  Similar to ffs() in BSD.
     4799 * @remarks Similar to ffs() in BSD.
    48004800 */
    48014801#if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN
     
    48564856
    48574857/**
     4858 * Finds the first bit which is set in the given 16-bit integer.
     4859 *
     4860 * Bits are numbered from 1 (least significant) to 16.
     4861 *
     4862 * @returns index [1..16] of the first set bit.
     4863 * @returns 0 if all bits are cleared.
     4864 * @param   u16     Integer to search for set bits.
     4865 * @remarks For 16-bit bs3kit code.
     4866 */
     4867#if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN
     4868DECLASM(unsigned) ASMBitFirstSetU16(uint32_t u16);
     4869#else
     4870DECLINLINE(unsigned) ASMBitFirstSetU16(uint32_t u16)
     4871{
     4872    return ASMBitFirstSetU32((uint32_t)u16);
     4873}
     4874#endif
     4875
     4876
     4877/**
    48584878 * Finds the last bit which is set in the given 32-bit integer.
    48594879 * Bits are numbered from 1 (least significant) to 32.
     
    49184938    return ASMBitLastSetU32((uint32_t)i32);
    49194939}
     4940
     4941
     4942/**
     4943 * Finds the last bit which is set in the given 16-bit integer.
     4944 *
     4945 * Bits are numbered from 1 (least significant) to 16.
     4946 *
     4947 * @returns index [1..16] of the last set bit.
     4948 * @returns 0 if all bits are cleared.
     4949 * @param   u16     Integer to search for set bits.
     4950 * @remarks For 16-bit bs3kit code.
     4951 */
     4952#if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN
     4953DECLASM(unsigned) ASMBitLastSetU16(uint32_t u16);
     4954#else
     4955DECLINLINE(unsigned) ASMBitLastSetU16(uint32_t u16)
     4956{
     4957    return ASMBitLastSetU32((uint32_t)u16);
     4958}
     4959#endif
     4960
    49204961
    49214962/**
  • trunk/include/iprt/file.h

    r57926 r58766  
    9898/** @name Open flags
    9999 * @{ */
     100/** Attribute access only.
     101 * @remarks Only accepted on windows, requires RTFILE_O_ACCESS_ATTR_MASK
     102 *          to yield a non-zero result.  Otherwise, this is invalid. */
     103#define RTFILE_O_ATTR_ONLY              UINT32_C(0x00000000)
    100104/** Open the file with read access. */
    101105#define RTFILE_O_READ                   UINT32_C(0x00000001)
     
    105109#define RTFILE_O_READWRITE              UINT32_C(0x00000003)
    106110/** The file access mask.
    107  * @remarks The value 0 is invalid. */
     111 * @remarks The value 0 is invalid, except for windows special case. */
    108112#define RTFILE_O_ACCESS_MASK            UINT32_C(0x00000003)
    109113
  • trunk/src/VBox/Runtime/r3/win/fileio-win.cpp

    r57634 r58766  
    213213                            : FILE_GENERIC_READ | FILE_GENERIC_WRITE;
    214214            break;
     215        case RTFILE_O_ATTR_ONLY:
     216            if (fOpen & RTFILE_O_ACCESS_ATTR_MASK)
     217            {
     218                dwDesiredAccess = 0;
     219                break;
     220            }
     221            /* fall thru */
    215222        default:
    216223            AssertMsgFailed(("Impossible fOpen=%#llx\n", fOpen));
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