ICorDebugProcess::ReadMemory 方法ICorDebugProcess::ReadMemory Method

读取此进程的指定内存区域。Reads a specified area of memory for this process.


HRESULT ReadMemory(  
    [in]  CORDB_ADDRESS address,
    [in]  DWORD size,  
    [out, size_is(size), length_is(size)] BYTE buffer[],  
    [out] SIZE_T *read);  


中一个 CORDB_ADDRESS 值,该值指定要读取的内存的基址。[in] A CORDB_ADDRESS value that specifies the base address of the memory to be read.

中要从内存中读取的字节数。[in] The number of bytes to be read from memory.

弄接收内存内容的缓冲区。[out] A buffer that receives the contents of the memory.

弄一个指针,指向到指定缓冲区中传输的字节数。[out] A pointer to the number of bytes transferred into the specified buffer.


ReadMemory 方法主要用于互操作调试,用于检查调试对象的非托管部分所使用的内存区域。The ReadMemory method is primarily intended to be used by interop debugging to inspect memory regions that are being used by the unmanaged portion of the debuggee. 此方法还可用于读取 Microsoft 中间语言(MSIL)代码和本机 JIT 编译代码。This method can also be used to read Microsoft intermediate language (MSIL) code and native JIT-compiled code.

将从参数中返回的数据删除所有托管断点 bufferAny managed breakpoints will be removed from the data that is returned in the buffer parameter. 不会对ICorDebugProcess2:: SetUnmanagedBreakpoint设置的本机断点进行任何调整。No adjustments will be made for native breakpoints set by ICorDebugProcess2::SetUnmanagedBreakpoint.

不会执行进程内存缓存。No caching of process memory is performed.


平台: 请参阅系统要求Platforms: See System Requirements.

标头:CorDebug.idl、CorDebug.hHeader: CorDebug.idl, CorDebug.h

库: CorGuids.libLibrary: CorGuids.lib

.NET Framework 版本:自 1.0 之后可用Available since 1.0.NET Framework Versions: 自 1.0 之后可用Available since 1.0