class axl::sys::win::VirtualMemory

#include <axl_sys_win_VirtualMemory.h>

class VirtualMemory
{
public:
    // construction

    VirtualMemory();
    ~VirtualMemory();

    // methods

    operator void *() const;

    void*
    p() const;

    size_t
    getSize() const;

    void*
    alloc(
        void* p,
        size_t size,
        uint_t allocationFlags = MEM_RESERVE|MEM_COMMIT,
        uint_t protection = PAGE_READWRITE
        );

    void*
    alloc(
        size_t size,
        uint_t allocationFlags = MEM_RESERVE|MEM_COMMIT,
        uint_t protectionFlags = PAGE_READWRITE
        );

    bool
    commit(uint_t protectionFlags = PAGE_READWRITE);

    bool
    decommit();

    void
    release();

    bool
    protect(
        uint_t protectionFlags,
        uint_t* prevProtectionFlags = NULL
        );

    bool
    lock();

    bool
    unlock();

    bool
    query(MEMORY_BASIC_INFORMATION* information);

    static
    bool
    commit(
        void* p,
        size_t size,
        uint_t protectionFlags = PAGE_READWRITE
        );

    static
    bool
    decommit(
        void* p,
        size_t size
        );

    static
    bool
    lock(
        void* p,
        size_t size
        );

    static
    bool
    unlock(
        void* p,
        size_t size
        );

    static
    bool
    query(
        void* p,
        MEMORY_BASIC_INFORMATION* information
        );
};