Skip to content

📦 A simple wrapper for EncodePointer / DecodePointer apis

Notifications You must be signed in to change notification settings

sakiryu/encoded-ptr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About

encoded-ptr is a generic wrapper for EncodePointer / DecodePointer Win32 apis. It was made for learning purposes and may not be a good solution to be used in production as each call to EncodePointer / DecodePointer queries the kernel and introduces a significant run time overhead.

Usage

#include "encoded-ptr.hpp"

int main()
{
    //A pointer to an Object is created and encoded
    auto pObject = encoded_ptr<Object>::create(args);
    
    //operator->() is invoked and the pointer is decoded
    pObject->field = 3;
    
    //operator*() is invoked and the pointer is decoded
    decltype(auto) object = *pObject;
}

About

📦 A simple wrapper for EncodePointer / DecodePointer apis

Topics

Resources

Stars

Watchers

Forks

Languages