win_handle, process and vmemory helper classes introduced

This commit is contained in:
2016-08-24 16:13:47 +02:00
parent 328fca9257
commit 54ab70b263
2 changed files with 230 additions and 0 deletions

View File

@@ -21,6 +21,23 @@
#include "StdAfx.h"
//////////////////////////////////////////////////////////////////////
// winstd::win_handle
//////////////////////////////////////////////////////////////////////
winstd::win_handle::~win_handle()
{
if (m_h)
CloseHandle(m_h);
}
void winstd::win_handle::free_internal()
{
CloseHandle(m_h);
}
//////////////////////////////////////////////////////////////////////
// winstd::library
//////////////////////////////////////////////////////////////////////
@@ -128,3 +145,20 @@ winstd::user_impersonator::~user_impersonator()
if (m_cookie)
RevertToSelf();
}
//////////////////////////////////////////////////////////////////////
// winstd::vmemory
//////////////////////////////////////////////////////////////////////
winstd::vmemory::~vmemory()
{
if (m_h)
VirtualFreeEx(m_proc, m_h, 0, MEM_RELEASE);
}
void winstd::vmemory::free_internal()
{
VirtualFreeEx(m_proc, m_h, 0, MEM_RELEASE);
}