Skip to content

Commit

Permalink
Add guard to COMException::GetMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyaoyuan committed Jun 8, 2022
1 parent f2d6c65 commit f130e28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/coreclr/inc/ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,9 @@ class COMException : public HRException

// Virtual overrides
IErrorInfo *GetErrorInfo();
#ifdef FEATURE_COMINTEROP
void GetMessage(SString &result);
#endif

protected:
virtual Exception *CloneHelper()
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/utilcode/comex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include "holder.h"
#include "corerror.h"

#ifdef FEATURE_COMINTEROP

// ---------------------------------------------------------------------------
// COMException class. Implements exception API for standard COM-based error info
// ---------------------------------------------------------------------------
Expand All @@ -37,6 +35,8 @@ IErrorInfo *COMException::GetErrorInfo()
return pErrorInfo;
}

#ifdef FEATURE_COMINTEROP

void COMException::GetMessage(SString &string)
{
STATIC_CONTRACT_THROWS;
Expand Down

0 comments on commit f130e28

Please sign in to comment.