Exemplo n.º 1
0
 // SafeHandle abstract member
 protected override bool ReleaseHandle()
 {
     if (!Disposed)
     {
         Disposed = true;
         GC.SuppressFinalize(this);
         VirtualMemoryManager.VirtualFreeEx(ProcessHandle,
                                            AllocatedPointer, MemorySize);
     }
     return(true);
 }
Exemplo n.º 2
0
 public VirtualMemoryPtr(int memorySize) :
     base(IntPtr.Zero, true)
 {
     ProcessHandle =
         VirtualMemoryManager.GetCurrentProcessHandle();
     MemorySize       = (IntPtr)memorySize;
     AllocatedPointer =
         VirtualMemoryManager.AllocExecutionBlock(
             memorySize, ProcessHandle);
     Disposed = false;
 }