diff options
| author | gdk <gab.dark.100@gmail.com> | 2019-10-13 03:02:07 -0300 |
|---|---|---|
| committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
| commit | 1876b346fea647e8284a66bb6d62c38801035cff (patch) | |
| tree | 6eeff094298cda84d1613dc5ec0691e51d7b35f1 /ARMeilleure/Memory/MemoryManagementWindows.cs | |
| parent | f617fb542a0e3d36012d77a4b5acbde7b08902f2 (diff) | |
Initial work
Diffstat (limited to 'ARMeilleure/Memory/MemoryManagementWindows.cs')
| -rw-r--r-- | ARMeilleure/Memory/MemoryManagementWindows.cs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/ARMeilleure/Memory/MemoryManagementWindows.cs b/ARMeilleure/Memory/MemoryManagementWindows.cs index c1a84c95..ae64b5c6 100644 --- a/ARMeilleure/Memory/MemoryManagementWindows.cs +++ b/ARMeilleure/Memory/MemoryManagementWindows.cs @@ -36,12 +36,6 @@ namespace ARMeilleure.Memory WriteCombineModifierflag = 0x400 } - private enum WriteWatchFlags : uint - { - None = 0, - Reset = 1 - } - [DllImport("kernel32.dll")] private static extern IntPtr VirtualAlloc( IntPtr lpAddress, @@ -62,15 +56,6 @@ namespace ARMeilleure.Memory IntPtr dwSize, AllocationType dwFreeType); - [DllImport("kernel32.dll")] - private static extern int GetWriteWatch( - WriteWatchFlags dwFlags, - IntPtr lpBaseAddress, - IntPtr dwRegionSize, - IntPtr[] lpAddresses, - ref ulong lpdwCount, - out uint lpdwGranularity); - public static IntPtr Allocate(IntPtr size) { const AllocationType flags = @@ -130,27 +115,5 @@ namespace ARMeilleure.Memory { return VirtualFree(address, IntPtr.Zero, AllocationType.Release); } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool GetModifiedPages( - IntPtr address, - IntPtr size, - IntPtr[] addresses, - out ulong count) - { - ulong pagesCount = (ulong)addresses.Length; - - int result = GetWriteWatch( - WriteWatchFlags.Reset, - address, - size, - addresses, - ref pagesCount, - out uint granularity); - - count = pagesCount; - - return result == 0; - } } }
\ No newline at end of file |
