VirtualQueryEx function kernel32

Win32Result<int> VirtualQueryEx(
  1. HANDLE hProcess,
  2. Pointer<NativeType>? lpAddress,
  3. Pointer<MEMORY_BASIC_INFORMATION> lpBuffer,
  4. int dwLength,
)

Retrieves information about a range of pages within the virtual address space of a specified process.

To learn more, see learn.microsoft.com/windows/win32/api/memoryapi/nf-memoryapi-virtualqueryex.

Implementation

Win32Result<int> VirtualQueryEx(
  HANDLE hProcess,
  Pointer? lpAddress,
  Pointer<MEMORY_BASIC_INFORMATION> lpBuffer,
  int dwLength,
) {
  final result_ = VirtualQueryEx_Wrapper(
    hProcess,
    lpAddress ?? nullptr,
    lpBuffer,
    dwLength,
  );
  return .new(value: result_.value.i64, error: result_.error);
}