1 | // Licensed to the .NET Foundation under one or more agreements. |
2 | // The .NET Foundation licenses this file to you under the MIT license. |
3 | // See the LICENSE file in the project root for more information. |
4 | |
5 | class DataTarget : public ICLRDataTarget, ICorDebugDataTarget4 |
6 | { |
7 | private: |
8 | LONG m_ref; // Reference count. |
9 | |
10 | public: |
11 | DataTarget(void); |
12 | virtual ~DataTarget() {} |
13 | |
14 | // IUnknown. |
15 | STDMETHOD(QueryInterface)( |
16 | THIS_ |
17 | ___in REFIID InterfaceId, |
18 | ___out PVOID* Interface |
19 | ); |
20 | STDMETHOD_(ULONG, AddRef)( |
21 | THIS |
22 | ); |
23 | STDMETHOD_(ULONG, Release)( |
24 | THIS |
25 | ); |
26 | |
27 | // |
28 | // ICLRDataTarget. |
29 | // |
30 | |
31 | virtual HRESULT STDMETHODCALLTYPE GetMachineType( |
32 | /* [out] */ ULONG32 *machine); |
33 | |
34 | virtual HRESULT STDMETHODCALLTYPE GetPointerSize( |
35 | /* [out] */ ULONG32 *size); |
36 | |
37 | virtual HRESULT STDMETHODCALLTYPE GetImageBase( |
38 | /* [string][in] */ LPCWSTR name, |
39 | /* [out] */ CLRDATA_ADDRESS *base); |
40 | |
41 | virtual HRESULT STDMETHODCALLTYPE ReadVirtual( |
42 | /* [in] */ CLRDATA_ADDRESS address, |
43 | /* [length_is][size_is][out] */ PBYTE buffer, |
44 | /* [in] */ ULONG32 request, |
45 | /* [optional][out] */ ULONG32 *done); |
46 | |
47 | virtual HRESULT STDMETHODCALLTYPE WriteVirtual( |
48 | /* [in] */ CLRDATA_ADDRESS address, |
49 | /* [size_is][in] */ PBYTE buffer, |
50 | /* [in] */ ULONG32 request, |
51 | /* [optional][out] */ ULONG32 *done); |
52 | |
53 | virtual HRESULT STDMETHODCALLTYPE GetTLSValue( |
54 | /* [in] */ ULONG32 threadID, |
55 | /* [in] */ ULONG32 index, |
56 | /* [out] */ CLRDATA_ADDRESS* value); |
57 | |
58 | virtual HRESULT STDMETHODCALLTYPE SetTLSValue( |
59 | /* [in] */ ULONG32 threadID, |
60 | /* [in] */ ULONG32 index, |
61 | /* [in] */ CLRDATA_ADDRESS value); |
62 | |
63 | virtual HRESULT STDMETHODCALLTYPE GetCurrentThreadID( |
64 | /* [out] */ ULONG32* threadID); |
65 | |
66 | virtual HRESULT STDMETHODCALLTYPE GetThreadContext( |
67 | /* [in] */ ULONG32 threadID, |
68 | /* [in] */ ULONG32 contextFlags, |
69 | /* [in] */ ULONG32 contextSize, |
70 | /* [out, size_is(contextSize)] */ PBYTE context); |
71 | |
72 | virtual HRESULT STDMETHODCALLTYPE SetThreadContext( |
73 | /* [in] */ ULONG32 threadID, |
74 | /* [in] */ ULONG32 contextSize, |
75 | /* [in, size_is(contextSize)] */ PBYTE context); |
76 | |
77 | virtual HRESULT STDMETHODCALLTYPE Request( |
78 | /* [in] */ ULONG32 reqCode, |
79 | /* [in] */ ULONG32 inBufferSize, |
80 | /* [size_is][in] */ BYTE *inBuffer, |
81 | /* [in] */ ULONG32 outBufferSize, |
82 | /* [size_is][out] */ BYTE *outBuffer); |
83 | |
84 | // ICorDebugDataTarget4 |
85 | |
86 | virtual HRESULT STDMETHODCALLTYPE VirtualUnwind( |
87 | /* [in] */ DWORD threadId, |
88 | /* [in] */ ULONG32 contextSize, |
89 | /* [in, out, size_is(contextSize)] */ PBYTE context); |
90 | }; |