2OOO, 3 December
NTSYSAPI NTSTATUS NTAPI
NtFreeVirtualMemory(
IN HANDLE ProcessHandle, IN PVOID *BaseAddress, IN OUT PULONG RegionSize, IN ULONG FreeType );
If you put pointer to NULL value as RegionSize, system will free all region, and put size of it in result.
Can be one of the values: MEM_DECOMMIT, or MEM_RELEASE.