-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
datatargetreader.h
57 lines (46 loc) · 1.64 KB
/
datatargetreader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef _MD_DATA_TARGET_READER_
#define _MD_DATA_TARGET_READER_
#include "cor.h"
#include "cordebug.h"
class DataTargetReader;
class TargetObject
{
public:
virtual HRESULT ReadFrom(DataTargetReader & reader) = 0;
};
class DataTargetReader
{
public:
DataTargetReader(CORDB_ADDRESS remoteAddressCursor, ICorDebugDataTarget* pDataTarget, DWORD targetDefines, DWORD mdStructuresVersion);
DataTargetReader(const DataTargetReader & otherReader);
DataTargetReader & operator=(const DataTargetReader & rhs);
~DataTargetReader();
HRESULT Read(TargetObject* pTargetObjectValue);
HRESULT ReadPointer(TargetObject* pTargetObjectValue);
HRESULT ReadPointer(CORDB_ADDRESS* pPointerValue);
HRESULT SkipPointer();
HRESULT Read8(BYTE* pByteValue);
HRESULT Skip8();
HRESULT Read32(ULONG32* pUlong32Value);
HRESULT Skip32();
HRESULT Read64(ULONG64* pUlong64Value);
HRESULT Skip64();
HRESULT ReadBytes(BYTE* pBuffer, DWORD cbBuffer);
HRESULT SkipBytes(DWORD cbBuffer);
void Align(DWORD alignmentBytes);
void AlignBase();
DataTargetReader CreateReaderAt(CORDB_ADDRESS remoteAddressCursor);
DWORD GetMDStructuresVersion();
BOOL IsDefined(DWORD define);
private:
HRESULT GetRemotePointerSize(ULONG32* pPointerSize);
ICorDebugDataTarget* m_pDataTarget;
ULONG32 m_remotePointerSize;
CORDB_ADDRESS m_remoteAddressCursor;
ULONG32 m_currentStructureAlign;
DWORD m_targetDefines;
DWORD m_mdStructuresVersion;
};
#endif // _MD_DATA_TARGET_READER_