ICorProfilerInfo7:: ReadInMemorySymbolsICorProfilerInfo7::ReadInMemorySymbols

[在 .NET Framework 4.6.1 及更新版本中支援][Supported in the .NET Framework 4.6.1 and later versions]

從記憶體中的符號資料流程讀取位元組。Reads bytes from an in-memory symbol stream.


HRESULT ReadInMemorySymbols(  
        [in] ModuleID moduleId,  
        [in] DWORD symbolsReadOffset,  
        [out] BYTE* pSymbolBytes,  
        [in] DWORD countSymbolBytes,  
        [out] DWORD* pCountSymbolBytesRead  


在包含記憶體中資料流程之模組的識別碼。[in] The identifier of the module containing the in-memory stream.

在記憶體內資料流程中要開始讀取位元組的位移。[in] The offset within the in-memory stream at which to start reading bytes.

擴展要將資料複製到其中的緩衝區指標。[out] A pointer to the buffer to which the data will be copied. 緩衝區應該有 countSymbolBytes 可用的空間。The buffer should have countSymbolBytes of space available.

在要複製的位元組數目。[in] The number of bytes to copy.

擴展當方法傳回時,會包含所讀取的實際位元組數目。[out] When the method returns, contains the actual number of bytes read.

傳回值Return Value

S_OK如果讀取了非零的位元組數目,則為。S_OK, if a non-zero number of bytes were read.

CORPROF_E_MODULE_IS_DYNAMIC如果模組是使用建立的,則為 System.Reflection.EmitCORPROF_E_MODULE_IS_DYNAMIC, if the module was created using System.Reflection.Emit.


ReadInMemorySymbols方法會嘗試 countSymbolBytessymbolsReadOffset 記憶體內資料流程內的位移開始讀取資料。The ReadInMemorySymbols method attempts to read countSymbolBytes of data starting at offset symbolsReadOffset within the in-memory stream. 資料會複製到 pSymbolBytes ,且預期會有 countSymbolBytes 可用的空間。The data is copied to pSymbolBytes, which is expected to have countSymbolBytes of space available. pCountSymbolsBytesRead 包含讀取的實際位元組數目, countSymbolBytes 如果到達資料流程末端,則可能小於。pCountSymbolsBytesRead contains the actual number of bytes read, which may be less than countSymbolBytes if the end of the stream is reached.


目前的執行不支援反映。發出。The current implementation does not support Reflection.Emit. 如果模組是使用反映來建立,則方法會傳回 CORPROF_E_MODULE_IS_DYNAMICIf the module was created by using Reflection.Emit, the method returns CORPROF_E_MODULE_IS_DYNAMIC.


平台: 請參閱 系統需求Platforms: See System Requirements.

標頭: CorProf.idl、CorProf.hHeader: CorProf.idl, CorProf.h

程式庫: CorGuids.libLibrary: CorGuids.lib

.NET Framework 版本:自 4.6.1 起可用Available since 4.6.1.NET Framework Versions: 自 4.6.1 起可用Available since 4.6.1

另請參閱See also