This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here
Reads a sequence of bytes, starting at a given location.
HRESULT ReadAt( IDebugMemoryContext2* pStartContext, DWORD dwCount, BYTE* rgbMemory, DWORD* pdwRead, DWORD* pdwUnreadable );
int ReadAt( IDebugMemoryContext2 pStartContext, uint dwCount, byte rgbMemory, out uint pdwRead, ref uint pdwUnreadable );
[in] The IDebugMemoryContext2 object that specifies where to start reading bytes.
[in] The number of bytes to read. Also specifies the length of the
[in, out] Array filled in with the bytes actually read.
[out] Returns the number of contiguous bytes actually read.
[in, out] Returns the number of unreadable bytes. May be a null value if the client is uninterested in the number of unreadable bytes.
If successful, returns S_OK; otherwise, returns an error code.
If 100 bytes are requested and the first 50 are readable, the next 20 are unreadable, and the remaining 30 are readable, this method returns:
pdwRead = 50
pdwUnreadable = 20
In this case, because
*pdwRead + *pdwUnreadable < dwCount, the caller must make an additional call to read the remaining 30 bytes of the original 100 requested and the IDebugMemoryContext2 object passed in the
pStartContext parameter must be advanced by 70.