IDebugDataSpaces::ReadVirtual method

The ReadVirtual method reads memory from the target's virtual address space.

Syntax


HRESULT ReadVirtual(
  [in]            ULONG64 Offset,
  [out]           PVOID   Buffer,
  [in]            ULONG   BufferSize,
  [out, optional] PULONG  BytesRead
);

Parameters

Offset [in]

Specifies the location in the target's virtual address space to be read.

Buffer [out]

Specifies the buffer to read the memory into.

BufferSize [in]

Specifies the size in bytes of the buffer. This is also the number of bytes being requested.

BytesRead [out, optional]

Receives the number of bytes that were read. If it is set to NULL, this information is not returned.

Return value

Return codeDescription
S_OK

The method was successful. It is possible that BytesRead is less than BufferSize, but at least one byte of data was returned.

 

This method can also return error values. See Return Values for more details.

Remarks

This method fills the buffer with the contents of the memory in the target's virtual address space.

This method may reference a cache of memory data when retrieving data. If the data is volatile, such as memory-mapped hardware state, use ReadVirtualUncached instead.

When reading memory that contains pointers, these pointers are for the target's virtual address space and not the engine's. For example, if a data structure contained a string, a second call to this method may be needed to read the contents of the string.

Requirements

Target platform

Desktop

Header

Dbgeng.h (include Dbgeng.h)

See also

IDebugDataSpaces
IDebugDataSpaces2
IDebugDataSpaces3
IDebugDataSpaces4
WriteVirtual
ReadVirtualUncached

 

 

Send comments about this topic to Microsoft

Show: