mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-12-05 03:34:54 +01:00
Summary
This commit is contained in:
parent
ff64060957
commit
c01b961423
12 changed files with 734 additions and 0 deletions
29
watermark WIN10/watermark_disabler/util_raii.hpp
Normal file
29
watermark WIN10/watermark_disabler/util_raii.hpp
Normal 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>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue