RETURN m_rgpIPtr[index];
}
-BOOL ComCallWrapperTemplate::HasInvisibleParent()
-{
- LIMITED_METHOD_CONTRACT;
-
- return (m_flags & enum_InvisibleParent);
-}
-
// Determines whether the template is for a type that cannot be safely marshalled to
// an out of proc COM client
BOOL ComCallWrapperTemplate::IsSafeTypeForMarshalling()
}
*ppDefaultItf = m_pDefaultItf;
- return (DefaultInterfaceType)(m_flags & enum_DefaultInterfaceType);
+ return (DefaultInterfaceType)(m_flags & enum_DefaultInterfaceTypeMask);
}
//--------------------------------------------------------------------------
ComMethodTable* GetBasicComMT();
ULONG GetNumInterfaces();
SLOT* GetVTableSlot(ULONG index);
- BOOL HasInvisibleParent();
void CheckParentComVisibility(BOOL fForIDispatch);
BOOL CheckParentComVisibilityNoThrow(BOOL fForIDispatch);
IIDToInterfaceTemplateCache *GetOrCreateIIDToInterfaceTemplateCache();
+ BOOL HasInvisibleParent()
+ {
+ LIMITED_METHOD_CONTRACT;
+ return (m_flags & enum_InvisibleParent);
+ }
+
BOOL SupportsICustomQueryInterface()
{
LIMITED_METHOD_CONTRACT;
static ComCallWrapperTemplate *CreateTemplateForInterface(MethodTable *pItfMT);
private:
-
- enum ComCallWrapperTemplateFlags
- {
- // first 3 bits are interpreted as DefaultInterfaceType
- enum_DefaultInterfaceType = 0x7,
- enum_DefaultInterfaceTypeComputed = 0x10,
-
- enum_InvisibleParent = 0x20,
- enum_ImplementsICustomQueryInterface = 0x40,
- enum_SupportsIInspectable = 0x80,
- enum_SupportsIClassX = 0x100,
-
- enum_SupportsVariantInterface = 0x200, // this is a template for a class that implements an interface with variance
- enum_RepresentsVariantInterface = 0x400, // this is a template for an interface with variance
-
- enum_UseOleAutDispatchImpl = 0x800, // the class is decorated with IDispatchImplAttribute(CompatibleImpl)
-
- enum_ImplementsIMarshal = 0x1000, // the class implements a managed interface with Guid == IID_IMarshal
-
- enum_IsSafeTypeForMarshalling = 0x2000, // The class can be safely marshalled out of process via DCOM
- };
// Hide the constructor
ComCallWrapperTemplate();
MethodTable* m_pWinRTRuntimeClass;
ComMethodTable* m_pClassComMT;
ComMethodTable* m_pBasicComMT;
+
+ enum
+ {
+ // first 3 bits are interpreted as DefaultInterfaceType
+ enum_DefaultInterfaceTypeMask = 0x7,
+ enum_DefaultInterfaceTypeComputed = 0x10,
+
+ enum_InvisibleParent = 0x20,
+ enum_ImplementsICustomQueryInterface = 0x40,
+ enum_SupportsIInspectable = 0x80,
+ enum_SupportsIClassX = 0x100,
+
+ enum_SupportsVariantInterface = 0x200, // this is a template for a class that implements an interface with variance
+ enum_RepresentsVariantInterface = 0x400, // this is a template for an interface with variance
+
+ enum_UseOleAutDispatchImpl = 0x800, // the class is decorated with IDispatchImplAttribute(CompatibleImpl)
+
+ enum_ImplementsIMarshal = 0x1000, // the class implements a managed interface with Guid == IID_IMarshal
+
+ enum_IsSafeTypeForMarshalling = 0x2000, // The class can be safely marshalled out of process via DCOM
+ };
DWORD m_flags;
MethodDesc* m_pICustomQueryInterfaceGetInterfaceMD;
Volatile<IIDToInterfaceTemplateCache *> m_pIIDToInterfaceTemplateCache;
}
//---------------------------------------------------------------------------
-// This method determines if a type is visible from COM or not based on
+// This method determines if a type is visible from COM or not based on
// its visibility. This version of the method works with a type handle.
// This version will ignore a type's generic attributes.
//
// This API should *never* be called directly!!!
-BOOL SpecialIsGenericTypeVisibleFromCom(TypeHandle hndType)
+static BOOL SpecialIsGenericTypeVisibleFromCom(TypeHandle hndType)
{
CONTRACTL
{
NOTHROW;
GC_NOTRIGGER;
MODE_ANY;
- PRECONDITION(!hndType.IsNull());
+ PRECONDITION(!hndType.IsNull());
}
CONTRACTL_END;
-
+
DWORD dwFlags;
mdTypeDef tdEnclosingType;
HRESULT hr;
const BYTE * pVal;
ULONG cbVal;
- MethodTable * pMT = hndType.GetMethodTable();
- _ASSERTE(pMT);
+ MethodTable * pMT = hndType.GetMethodTable();
+ _ASSERTE(pMT);
mdTypeDef mdType = pMT->GetCl();
IMDInternalImport * pInternalImport = pMT->GetMDImport();
// If the type is an array, then it is not visible from COM.
if (pMT->IsArray())
return FALSE;
-
+
// Retrieve the flags for the current type.
tdEnclosingType = mdType;
if (FAILED(pInternalImport->GetTypeDefProps(tdEnclosingType, &dwFlags, 0)))
{
return FALSE;
}
-
+
// Handle nested types.
while (IsTdNestedPublic(dwFlags))
{
{
return FALSE;
}
-
+
// Retrieve the flags for the enclosing type.
if (FAILED(pInternalImport->GetTypeDefProps(tdEnclosingType, &dwFlags, 0)))
{
return FALSE;
}
}
-
+
// If the outermost type is not visible then the specified type is not visible.
if (!IsTdPublic(dwFlags))
return FALSE;
return TRUE;
}
-
//---------------------------------------------------------------------------
// This method determines if a type is visible from COM or not based on
// its visibility. This version of the method works with a type handle.
//---------------------------------------------------------------------------
// This method determines if a type is visible from COM or not based on
// its visibility. This version of the method works with a type handle.
-// This version will ignore a type's generic attributes.
-//
-// This API should *never* be called directly!!!
-BOOL SpecialIsGenericTypeVisibleFromCom(TypeHandle hndType);
-
-//---------------------------------------------------------------------------
-// This method determines if a type is visible from COM or not based on
-// its visibility. This version of the method works with a type handle.
BOOL IsTypeVisibleFromCom(TypeHandle hndType);
//---------------------------------------------------------------------------
// If we haven't found the IP or if we haven't looked yet (because we aren't
// being aggregated), now look on the managed object to see if it supports the interface.
if (pDestItf == NULL)
- {
pDestItf = ComCallWrapper::GetComIPFromCCW(pWrap, riid, NULL, GetComIPFromCCW::CheckVisibility);
- if (pDestItf == NULL)
- {
- }
- }
ErrExit:
// If we succeeded in obtaining the requested IP then return S_OK.