mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
* Move src/coreclr/src/Directory.Build.targets to src/coreclr Merge src/coreclr/src/CMakeLists.txt into src/coreclr/CMakeLists.txt * Mechanical move of src/coreclr/src to src/coreclr * Scripts adjustments to reflect the changed paths
51 lines
1.3 KiB
C++
51 lines
1.3 KiB
C++
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// ---------------------------------------------------------------------------
|
|
// COMEx.cpp
|
|
//
|
|
|
|
//
|
|
// ---------------------------------------------------------------------------
|
|
|
|
#include "stdafx.h"
|
|
#include "string.h"
|
|
#include "ex.h"
|
|
#include "holder.h"
|
|
#include "corerror.h"
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// COMException class. Implements exception API for standard COM-based error info
|
|
// ---------------------------------------------------------------------------
|
|
|
|
COMException::~COMException()
|
|
{
|
|
WRAPPER_NO_CONTRACT;
|
|
|
|
if (m_pErrorInfo != NULL)
|
|
m_pErrorInfo->Release();
|
|
}
|
|
|
|
IErrorInfo *COMException::GetErrorInfo()
|
|
{
|
|
LIMITED_METHOD_CONTRACT;
|
|
|
|
IErrorInfo *pErrorInfo = m_pErrorInfo;
|
|
if (pErrorInfo != NULL)
|
|
pErrorInfo->AddRef();
|
|
return pErrorInfo;
|
|
}
|
|
|
|
void COMException::GetMessage(SString &string)
|
|
{
|
|
STATIC_CONTRACT_THROWS;
|
|
STATIC_CONTRACT_GC_NOTRIGGER;
|
|
|
|
if (m_pErrorInfo != NULL)
|
|
{
|
|
BSTRHolder message(NULL);
|
|
if (SUCCEEDED(m_pErrorInfo->GetDescription(&message)))
|
|
string.Set(message, SysStringLen(message));
|
|
}
|
|
}
|
|
|