public void Dispose() { foreach (var kvp in _allocations) { Native.VirtualFreeEx(_handle, kvp.Key, kvp.Value, MemoryFreeType.MEM_DECOMMIT); } }
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); } } }