VirtualBox

Changeset 52050 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Jul 16, 2014 1:53:24 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95047
Message:

RTMemSafer: Split generic from ring-3 specific page based implementation. Adjusted the ring-3 implementation to use RTMemPage when SUPR3PageAllocEx isn't available, and to separate the real data from the heap metadata to make finding the data just a little bit more difficult.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r51862 r52050  
    921921/** An account is restricted in a certain way. */
    922922#define VINF_ACCOUNT_RESTRICTED             22405
     923/** Not able satisfy all the requirements of the request. */
     924#define VERR_UNABLE_TO_SATISFY_REQUIREMENTS (-22406)
     925/** Not able satisfy all the requirements of the request. */
     926#define VWRN_UNABLE_TO_SATISFY_REQUIREMENTS 22406
     927/** The requested allocation is too big. */
     928#define VERR_ALLOCATION_TOO_BIG             (-22405)
    923929/** @} */
    924930
  • trunk/include/iprt/memsafer.h

    r52018 r52050  
    5757 */
    5858
    59 /** Default memory allocation, non-pageable memory backing, return error
    60  * if not possible to allocate such memor. */
    61 #define RTMEMSAFER_ALLOC_EX_FLAGS_DEFAULT                   (0)
    62 /** Allow pageable memory backing for cases where the content is not that sensitive
    63  * and allocating non-pageable memory failes. Use with care! */
    64 #define RTMEMSAFER_ALLOC_EX_ALLOW_PAGEABLE_BACKING RT_BIT_32(1)
     59/** @name RTMEMSAFER_F_XXX
     60 * @{ */
     61/** Require the memory to not hit the page file.
     62 * @remarks Makes not guarantees with regards to hibernation /
     63 *          suspend-to-disk. */
     64#define RTMEMSAFER_F_REQUIRE_NOT_PAGABLE    RT_BIT_32(0)
     65/** Mask of valid bits.  */
     66#define RTMEMSAFER_F_VALID_MASK             UINT32_C(0x00000001)
     67/** @} */
    6568
    6669/**
     
    9295RTDECL(int) RTMemSaferUnscramble(void *pv, size_t cb);
    9396
    94 
    9597/**
    9698 * Allocates memory for sensitive data.
     
    102104 * @param   ppvNew      Where to return the pointer to the memory.
    103105 * @param   cb          Number of bytes to allocate.
    104  * @param   fFlags      Flags for controlling the allocation. See RTMEMSAFER_ALLOC_EX_FLAGS_* defines.
     106 * @param   fFlags      Flags for controlling the allocation, see
     107 *                      RTMEMSAFER_F_XXX.
    105108 * @param   pszTag      Allocation tag used for statistics and such.
    106109 */
     
    116119 * @param   a_ppvNew    Where to return the pointer to the memory.
    117120 * @param   a_cb        Number of bytes to allocate.
    118  * @param   a_fFlags    Flags for controlling the allocation. See RTMEMSAFER_ALLOC_EX_FLAGS_* defines.
     121 * @param   a_fFlags    Flags for controlling the allocation, see
     122 *                      RTMEMSAFER_F_XXX.
    119123 */
    120124#define RTMemSaferAllocZEx(a_ppvNew, a_cb, a_fFlags) RTMemSaferAllocZExTag(a_ppvNew, a_cb, a_fFlags, RTMEM_TAG)
     
    159163 * @param   cbNew       The size of the new allocation.
    160164 * @param   ppvNew      Where to return the pointer to the new memory.
    161  * @param   fFlags      Flags for controlling the allocation. See RTMEMSAFER_ALLOC_EX_FLAGS_* defines,
    162  *                      this takes only effect when allocating completely new memory, for extending or
    163  *                      shrinking existing allocations the flags of the allocation take precedence.
     165 * @param   a_fFlags    Flags for controlling the allocation, see
     166 *                      RTMEMSAFER_F_XXX.  It is not permitted to drop saftely
     167 *                      requirments after the initial allocation.
    164168 * @param   pszTag      Allocation tag used for statistics and such.
    165169 */
Note: See TracChangeset for help on using the changeset viewer.

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