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// api.cpp
6//
7
8//
9//*****************************************************************************
10
11#include "stdafx.h"
12#include "remotemdinternalrwsource.h"
13
14HRESULT CreateRemoteMDInternalRWSource(TADDR mdInternalRWRemoteAddress, ICorDebugDataTarget* pDataTarget, DWORD defines, DWORD dataStructureVersion, IMDCustomDataSource** ppDataSource)
15{
16 HRESULT hr = S_OK;
17 RemoteMDInternalRWSource* pSource = new (nothrow) RemoteMDInternalRWSource();
18 if (pSource == NULL)
19 return E_OUTOFMEMORY;
20
21 hr = pSource->InitFromTarget(mdInternalRWRemoteAddress, pDataTarget, defines, dataStructureVersion);
22 if (SUCCEEDED(hr))
23 {
24 hr = pSource->QueryInterface(IID_IMDCustomDataSource, (void**)ppDataSource);
25 }
26 if (FAILED(hr))
27 {
28 delete pSource;
29 }
30 return hr;
31}
32