mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-04-15 11:48:22 +00:00
30 lines
462 B
C++
30 lines
462 B
C++
#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>;
|
|
}
|