mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
7bd28e4357
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2304 21ef857c-d57f-4fe0-8362-d861dc6d29cd
26 lines
640 B
C#
26 lines
640 B
C#
using System;
|
|
using ProcessHacker.Native.Api;
|
|
using ProcessHacker.Native.Objects;
|
|
|
|
namespace ProcessHacker.Native
|
|
{
|
|
public class VirtualMemoryAlloc : MemoryAlloc
|
|
{
|
|
public VirtualMemoryAlloc(int size)
|
|
{
|
|
this.Memory = ProcessHandle.Current.AllocateMemory(size, MemoryProtection.ReadWrite);
|
|
this.Size = size;
|
|
}
|
|
|
|
protected override void Free()
|
|
{
|
|
ProcessHandle.Current.FreeMemory(this, this.Size);
|
|
}
|
|
|
|
public override void Resize(int newSize)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
}
|
|
}
|