diff options
Diffstat (limited to 'src/vm/corebindresult.cpp')
-rw-r--r-- | src/vm/corebindresult.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/vm/corebindresult.cpp b/src/vm/corebindresult.cpp new file mode 100644 index 0000000000..68803e24b9 --- /dev/null +++ b/src/vm/corebindresult.cpp @@ -0,0 +1,66 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// ============================================================ +// +// CoreBindResult.cpp +// + +// +// Implements the CoreBindResult class +// ============================================================ + + +#include "common.h" + +#include "../binder/inc/assembly.hpp" + +#ifndef FEATURE_FUSION +#ifndef DACCESS_COMPILE + +STDMETHODIMP CoreBindResult::QueryInterface(REFIID riid, + void **ppv) +{ + HRESULT hr = S_OK; + + if (ppv == NULL) + { + hr = E_POINTER; + } + else + { + if ( IsEqualIID(riid, IID_IUnknown) ) + { + AddRef(); + *ppv = static_cast<IUnknown *>(this); + } + else + { + *ppv = NULL; + hr = E_NOINTERFACE; + } + } + + return hr; +} + +STDMETHODIMP_(ULONG) CoreBindResult::AddRef() +{ + return InterlockedIncrement(&m_cRef); +} + +STDMETHODIMP_(ULONG) CoreBindResult::Release() +{ + ULONG ulRef = InterlockedDecrement(&m_cRef); + + if (ulRef == 0) + { + delete this; + } + + return ulRef; +} + + +#endif // DACCES_COMPILE +#endif // FEATURE_FUSION |