win_handle, process and vmemory helper classes introduced
This commit is contained in:
34
src/Win.cpp
34
src/Win.cpp
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user