VirtualQuery function kernel32

Win32Result<int> VirtualQuery(
  1. Pointer<NativeType>? lpAddress,
  2. Pointer<MEMORY_BASIC_INFORMATION> lpBuffer,
  3. int dwLength
)

Retrieves information about a range of pages in the virtual address space of the calling process.

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

Implementation

Win32Result<int> VirtualQuery(
  Pointer? lpAddress,
  Pointer<MEMORY_BASIC_INFORMATION> lpBuffer,
  int dwLength,
) {
  resolveGetLastError();
  final result_ = _VirtualQuery(lpAddress ?? nullptr, lpBuffer, dwLength);
  return .new(value: result_, error: GetLastError());
}