This documentation is archived and is not being maintained.


This interface represents bytes of memory.

IDebugMemoryBytes2 : IUnknown

The debug engine (DE) implements this interface to represent bytes in memory.

IDebugProgram2::GetMemoryBytes returns this interface to provide access to system memory. IDebugProperty2::GetMemoryBytes and IDebugReference2::GetMemoryBytes return this interface to provide access to an object's bytes.

The following table shows the methods of IDebugMemoryBytes2.

Method Description


Reads a sequence of bytes, starting at a given location.


Writes dwCount bytes, starting at pStartContext.


Gets the size, in bytes, of the memory represented by this interface.

For properties, an IDebugProperty2 interface representing an array provides an IDebugMemoryBytes2 interface to access the values in that array.

Visual Studio's Memory View calls IDebugProgram2::GetMemoryBytes to retrieve an IDebugMemoryBytes2 interface for accessing system memory. The address to be accessed is obtained by parsing the expression entered as an address into the Memory View and then evaluating the parsed expression using IDebugExpression2::EvaluateSync to get an IDebugProperty2 interface. A call to IDebugProperty2::GetMemoryContext returns the IDebugMemoryContext2 that describes the memory address. This memory context is then passed to IDebugMemoryBytes2::ReadAt and IDebugMemoryBytes2::WriteAt.

Header: msdbg.h

Namespace: Microsoft.VisualStudio.Debugger.Interop

Assembly: Microsoft.VisualStudio.Debugger.Interop.dll