This commit is contained in:
Yasser Tahiri 2020-12-12 23:02:14 +01:00
parent ff64060957
commit c01b961423
12 changed files with 734 additions and 0 deletions

View file

@ -0,0 +1,29 @@
#pragma once
#include <memory>
#include <ntifs.h>
namespace impl
{
struct unique_pool
{
void operator( )( void* pool )
{
if ( pool )
ExFreePoolWithTag( pool, 0 );
}
};
using pool = std::unique_ptr<void, unique_pool>;
struct unique_object
{
void operator( )( void* object )
{
if ( object )
ObfDereferenceObject( object );
}
};
template <typename T>
using object = std::unique_ptr<std::remove_pointer_t<T>, unique_object>;
}