Files
mirror-processhacker/trunk/ProcessHacker.Native/Memory/PhysicalPagesMapping.cs
T
wj32 ab0938e89e * added PhysicalPages
* some refactoring in Windows

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1416 21ef857c-d57f-4fe0-8362-d861dc6d29cd
2009-06-14 02:07:56 +00:00

24 lines
651 B
C#

using System;
using ProcessHacker.Native.Api;
namespace ProcessHacker.Native.Memory
{
public class PhysicalPagesMapping : MemoryAlloc
{
private PhysicalPages _physicalPages;
internal PhysicalPagesMapping(PhysicalPages physicalPages, IntPtr address, MemoryProtection protection)
{
_physicalPages = physicalPages;
_physicalPages.Reference();
_physicalPages.Map(address, protection, false);
}
protected override void Free()
{
_physicalPages.Map(this, 0, true);
_physicalPages.Dereference();
}
}
}