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 //*****************************************************************************
7 // File: ShimDataTarget.cpp
9 //*****************************************************************************
20 // Standard impl of IUnknown::QueryInterface
21 HRESULT STDMETHODCALLTYPE ShimDataTarget::QueryInterface(
26 if (InterfaceId == IID_IUnknown)
28 *pInterface = static_cast<IUnknown *>(static_cast<ICorDebugDataTarget *>(this));
30 else if (InterfaceId == IID_ICorDebugDataTarget)
32 *pInterface = static_cast<ICorDebugDataTarget *>(this);
34 else if (InterfaceId == IID_ICorDebugMutableDataTarget)
36 *pInterface = static_cast<ICorDebugMutableDataTarget *>(this);
38 else if (InterfaceId == IID_ICorDebugDataTarget4)
40 *pInterface = static_cast<ICorDebugDataTarget4 *>(this);
52 // Standard impl of IUnknown::AddRef
53 ULONG STDMETHODCALLTYPE ShimDataTarget::AddRef()
55 LONG ref = InterlockedIncrement(&m_ref);
59 // Standard impl of IUnknown::Release
60 ULONG STDMETHODCALLTYPE ShimDataTarget::Release()
62 LONG ref = InterlockedDecrement(&m_ref);
70 //---------------------------------------------------------------------------------------
72 // Get the OS Process ID that this DataTarget is for.
75 // The OS PID of the process this data target is representing.
76 DWORD ShimDataTarget::GetPid()
81 //---------------------------------------------------------------------------------------
82 // Hook a custom function to handle ICorDebugMutableDataTarget::ContinueStatusChanged
85 // fpContinueStatusChanged - callback function to invoke.
86 // pUserData - user data to pass to callback
88 void ShimDataTarget::HookContinueStatusChanged(FPContinueStatusChanged fpContinueStatusChanged, void * pUserData)
90 m_fpContinueStatusChanged = fpContinueStatusChanged;
91 m_pContinueStatusChangedUserData = pUserData;