From 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Wed, 23 Nov 2016 19:09:09 +0900 Subject: Imported Upstream version 1.1.0 --- src/vm/clrprivbinderloadfile.h | 148 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 src/vm/clrprivbinderloadfile.h (limited to 'src/vm/clrprivbinderloadfile.h') diff --git a/src/vm/clrprivbinderloadfile.h b/src/vm/clrprivbinderloadfile.h new file mode 100644 index 0000000000..02c4053ff4 --- /dev/null +++ b/src/vm/clrprivbinderloadfile.h @@ -0,0 +1,148 @@ +// 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. + + + +#pragma once + +#include "holder.h" +#include "internalunknownimpl.h" +#include "clrprivbinding.h" +#include "clrprivruntimebinders.h" +#include "clrprivbinderfusion.h" +#include "clrprivbinderutil.h" + +class PEAssembly; + +//===================================================================================================================== +class CLRPrivBinderLoadFile : + public IUnknownCommon +{ + +public: + //============================================================================================= + // ICLRPrivBinder methods + + //--------------------------------------------------------------------------------------------- + STDMETHOD(BindAssemblyByName)( + IAssemblyName * pAssemblyName, + ICLRPrivAssembly ** ppAssembly); + + //--------------------------------------------------------------------------------------------- + STDMETHOD(VerifyBind)( + IAssemblyName *pAssemblyName, + ICLRPrivAssembly *pAssembly, + ICLRPrivAssemblyInfo *pAssemblyInfo); + + //--------------------------------------------------------------------------------------------- + STDMETHOD(GetBinderFlags)( + DWORD *pBinderFlags) + { + LIMITED_METHOD_CONTRACT; + *pBinderFlags = BINDER_NONE; + return S_OK; + } + + //--------------------------------------------------------------------------------------------- + STDMETHOD(GetBinderID)( + UINT_PTR *pBinderId); + + //--------------------------------------------------------------------------------------------- + // FindAssemblyBySpec is not supported by this binder. + STDMETHOD(FindAssemblyBySpec)( + LPVOID pvAppDomain, + LPVOID pvAssemblySpec, + HRESULT * pResult, + ICLRPrivAssembly ** ppAssembly) + { STATIC_CONTRACT_WRAPPER; return E_FAIL; } + + //============================================================================================= + // Class methods + //--------------------------------------------------------------------------------------------- + STDMETHOD(BindAssemblyExplicit)( + PEImage* pImage, + IAssemblyName **ppAssemblyName, + ICLRPrivAssembly ** ppAssembly); + + //--------------------------------------------------------------------------------------------- + static + CLRPrivBinderLoadFile * GetOrCreateBinder(); + + //--------------------------------------------------------------------------------------------- + ~CLRPrivBinderLoadFile(); + +private: + //--------------------------------------------------------------------------------------------- + CLRPrivBinderLoadFile(); + + //--------------------------------------------------------------------------------------------- + ReleaseHolder m_pFrameworkBinder; + + //--------------------------------------------------------------------------------------------- + static CLRPrivBinderLoadFile * s_pSingleton; +}; + +class CLRPrivAssemblyLoadFile : + public IUnknownCommon +{ +protected: + ReleaseHolder m_pBinder; + ReleaseHolder m_pFrameworkBinder; + ReleaseHolder m_pPathResource; + +public: + //--------------------------------------------------------------------------------------------- + CLRPrivAssemblyLoadFile( + CLRPrivBinderLoadFile* pBinder, + CLRPrivBinderFusion* pFrameworkBinder, + CLRPrivBinderUtil::CLRPrivResourcePathImpl* pPathResource); + + //============================================================================================= + // ICLRPrivAssembly methods + + //--------------------------------------------------------------------------------------------- + STDMETHOD(BindAssemblyByName)( + IAssemblyName * pAssemblyName, + ICLRPrivAssembly ** ppAssembly); + + //--------------------------------------------------------------------------------------------- + STDMETHOD(VerifyBind)( + IAssemblyName *pAssemblyName, + ICLRPrivAssembly *pAssembly, + ICLRPrivAssemblyInfo *pAssemblyInfo); + + //--------------------------------------------------------------------------------------------- + STDMETHOD(GetBinderFlags)( + DWORD *pBinderFlags) + { + LIMITED_METHOD_CONTRACT; + return m_pBinder->GetBinderFlags(pBinderFlags); + } + + //--------------------------------------------------------------------------------------------- + STDMETHOD(GetBinderID)( + UINT_PTR *pBinderId); + + //--------------------------------------------------------------------------------------------- + STDMETHOD(IsShareable)( + BOOL * pbIsShareable); + + //--------------------------------------------------------------------------------------------- + STDMETHOD(GetAvailableImageTypes)( + LPDWORD pdwImageTypes); + + //--------------------------------------------------------------------------------------------- + STDMETHOD(GetImageResource)( + DWORD dwImageType, + DWORD *pdwImageType, + ICLRPrivResource ** ppIResource); + + //--------------------------------------------------------------------------------------------- + STDMETHOD(FindAssemblyBySpec)( + LPVOID pvAppDomain, + LPVOID pvAssemblySpec, + HRESULT * pResult, + ICLRPrivAssembly ** ppAssembly) + { STATIC_CONTRACT_WRAPPER; return m_pBinder->FindAssemblyBySpec(pvAppDomain, pvAssemblySpec, pResult, ppAssembly); } +}; -- cgit v1.2.3