Hello,
I'm implementing and testing myself native api but I got some problems with NtFreeVirtualMemory.
NtFreeVirtualMemory(Process.GetCurrentProcess().Handle, ptr, 0, 0x00008000); //doesn't work from ntdll
VirtualFree(ptr , (uint)0, 0x00008000); // from kernel32
I don't know why NtFreeVirtualMemory returns always access violation whereas VirtualFree works and frees the memory (I've inspected with ProcessHacker)
Any idea ?