public static NT.MEMORY_BASIC_INFORMATION VirtualQuery(this Process process, ulong memoryPointer) { var structSize = (uint)Marshal.SizeOf(typeof(NT.MEMORY_BASIC_INFORMATION)); NT.VirtualQueryEx(process.Handle, memoryPointer, out NT.MEMORY_BASIC_INFORMATION mem, structSize); return(mem); }