Example #1
0
 public void Dispose()
 {
     foreach (var kvp in _allocations)
     {
         Native.VirtualFreeEx(_handle, kvp.Key, kvp.Value, MemoryFreeType.MEM_DECOMMIT);
     }
 }
Example #2
0
 public void Dispose()
 {
     foreach (var kvp in _allocations)
     {
         if (IsDriver)
         {
             KernelMemorySharp.MemoryDriver.FreeProcessMem((UInt64)kvp.Key);
         }
         else
         {
             Native.VirtualFreeEx(_handle, kvp.Key, kvp.Value, MemoryFreeType.MEM_DECOMMIT);
         }
     }
 }