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 | |
6 | #ifndef __CORECLR_BINDER_COMMON_H__ |
7 | #define __CORECLR_BINDER_COMMON_H__ |
8 | |
9 | #include "clrprivbinding.h" |
10 | #include "internalunknownimpl.h" |
11 | #include "applicationcontext.hpp" |
12 | |
13 | |
14 | namespace BINDER_SPACE |
15 | { |
16 | class AssemblyIdentityUTF8; |
17 | }; |
18 | |
19 | class CLRPrivBinderCoreCLR; |
20 | |
21 | // General purpose AssemblyBinder helper class |
22 | class CCoreCLRBinderHelper |
23 | { |
24 | public: |
25 | static HRESULT Init(); |
26 | |
27 | static HRESULT DefaultBinderSetupContext(DWORD dwAppDomainId, |
28 | CLRPrivBinderCoreCLR **ppTPABinder); |
29 | |
30 | // ABHI-TODO: The call indicates that this can come from a case where |
31 | // pDomain->GetFusionContext() is null, hence this is static function |
32 | // which handles a null binder. See if this actually happens |
33 | static HRESULT GetAssemblyIdentity(LPCSTR szTextualIdentity, |
34 | BINDER_SPACE::ApplicationContext *pApplicationContext, |
35 | NewHolder<BINDER_SPACE::AssemblyIdentityUTF8> &assemblyIdentityHolder); |
36 | |
37 | //============================================================================= |
38 | // Class functions that provides binding services beyond the ICLRPrivInterface |
39 | //----------------------------------------------------------------------------- |
40 | static HRESULT BindToSystem(ICLRPrivAssembly **ppSystemAssembly, bool fBindToNativeImage); |
41 | |
42 | static HRESULT BindToSystemSatellite(SString &systemPath, |
43 | SString &sSimpleName, |
44 | SString &sCultureName, |
45 | ICLRPrivAssembly **ppSystemAssembly); |
46 | |
47 | static HRESULT GetAssemblyFromImage(PEImage *pPEImage, |
48 | PEImage *pNativePEImage, |
49 | ICLRPrivAssembly **ppAssembly); |
50 | |
51 | static HRESULT GetAssembly(/* in */ SString &assemblyPath, |
52 | /* in */ BOOL fInspectionOnly, |
53 | /* in */ BOOL fIsInGAC, |
54 | /* in */ BOOL fExplicitBindToNativeImage, |
55 | /* out */ BINDER_SPACE::Assembly **ppAssembly); |
56 | }; |
57 | |
58 | #endif // __CORECLR_BINDER_COMMON_H__ |
59 | |