Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

191 lines
5.1 KiB

  1. // MarshalableTI.h : Declaration of the CMarshalableTI
  2. #ifndef __MARSHALABLETI_H_
  3. #define __MARSHALABLETI_H_
  4. #include "MarshalableTI.h"
  5. #include "mslablti.h"
  6. #include "resource.h" // main symbols
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CMarshalableTI
  9. class ATL_NO_VTABLE CMarshalableTI :
  10. public CComObjectRootEx<CComSingleThreadModel>,
  11. public CComCoClass<CMarshalableTI, &CLSID_MarshalableTI>,
  12. public IMarshalableTI,
  13. public IMarshal,
  14. public ITypeInfo
  15. {
  16. private:
  17. CComTypeInfoHolder m_TIHolder;
  18. GUID m_guid;
  19. GUID m_libid;
  20. LCID m_lcid;
  21. bool m_bCreated;
  22. public:
  23. DECLARE_REGISTRY_RESOURCEID(IDR_MSLABLTI)
  24. DECLARE_NOT_AGGREGATABLE(CMarshalableTI)
  25. DECLARE_PROTECT_FINAL_CONSTRUCT()
  26. BEGIN_COM_MAP(CMarshalableTI)
  27. COM_INTERFACE_ENTRY(IMarshalableTI)
  28. COM_INTERFACE_ENTRY(IMarshal)
  29. COM_INTERFACE_ENTRY(ITypeInfo)
  30. END_COM_MAP()
  31. HRESULT FinalConstruct();
  32. /////////////////////////////////////////////////////////////////////////////////
  33. // IMarshalableTI methods
  34. STDMETHOD(Create)(/*[in]*/ REFIID clsid,
  35. /*[in]*/ REFIID iidLib,
  36. /*[in]*/ LCID lcid,
  37. /*[in]*/ WORD dwMajorVer,
  38. /*[in]*/ WORD dwMinorVer);
  39. /////////////////////////////////////////////////////////////////////////////////
  40. // IMarshal methods
  41. STDMETHOD(GetUnmarshalClass)(
  42. /* [in] */ REFIID riid,
  43. /* [unique][in] */ void *pv,
  44. /* [in] */ DWORD dwDestContext,
  45. /* [unique][in] */ void *pvDestContext,
  46. /* [in] */ DWORD mshlflags,
  47. /* [out] */ CLSID *pCid);
  48. STDMETHOD(GetMarshalSizeMax)(
  49. /* [in] */ REFIID riid,
  50. /* [unique][in] */ void *pv,
  51. /* [in] */ DWORD dwDestContext,
  52. /* [unique][in] */ void *pvDestContext,
  53. /* [in] */ DWORD mshlflags,
  54. /* [out] */ DWORD *pSize);
  55. STDMETHOD(MarshalInterface)(
  56. /* [unique][in] */ IStream *pStm,
  57. /* [in] */ REFIID riid,
  58. /* [unique][in] */ void *pv,
  59. /* [in] */ DWORD dwDestContext,
  60. /* [unique][in] */ void *pvDestContext,
  61. /* [in] */ DWORD mshlflags);
  62. STDMETHOD(UnmarshalInterface)(
  63. /* [unique][in] */ IStream *pStm,
  64. /* [in] */ REFIID riid,
  65. /* [out] */ void **ppv);
  66. STDMETHOD(ReleaseMarshalData)(
  67. /* [unique][in] */ IStream *pStm);
  68. STDMETHOD(DisconnectObject)(
  69. /* [in] */ DWORD dwReserved);
  70. /////////////////////////////////////////////////////////////////////////////////
  71. // ITypeInfo methods
  72. STDMETHOD(GetTypeAttr)(
  73. TYPEATTR ** ppTypeAttr);
  74. STDMETHOD(GetTypeComp)(
  75. ITypeComp ** ppTComp);
  76. STDMETHOD(GetFuncDesc)(
  77. UINT index,
  78. FUNCDESC ** ppFuncDesc);
  79. STDMETHOD(GetVarDesc)(
  80. UINT index,
  81. VARDESC ** ppVarDesc);
  82. STDMETHOD(GetNames)(
  83. MEMBERID memid,
  84. BSTR * rgBstrNames,
  85. UINT cMaxNames,
  86. UINT * pcNames);
  87. STDMETHOD(GetRefTypeOfImplType)(
  88. UINT index,
  89. HREFTYPE * pRefType);
  90. STDMETHOD(GetImplTypeFlags)(
  91. UINT index,
  92. INT * pImplTypeFlags);
  93. STDMETHOD(GetIDsOfNames)(
  94. LPOLESTR * rgszNames,
  95. UINT cNames,
  96. MEMBERID * pMemId);
  97. STDMETHOD(Invoke)(
  98. PVOID pvInstance,
  99. MEMBERID memid,
  100. WORD wFlags,
  101. DISPPARAMS * pDispParams,
  102. VARIANT * pVarResult,
  103. EXCEPINFO * pExcepInfo,
  104. UINT * puArgErr);
  105. STDMETHOD(GetDocumentation)(
  106. MEMBERID memid,
  107. BSTR * pBstrName,
  108. BSTR * pBstrDocString,
  109. DWORD * pdwHelpContext,
  110. BSTR * pBstrHelpFile);
  111. STDMETHOD(GetDllEntry)(
  112. MEMBERID memid,
  113. INVOKEKIND invKind,
  114. BSTR * pBstrDllName,
  115. BSTR * pBstrName,
  116. WORD * pwOrdinal);
  117. STDMETHOD(GetRefTypeInfo)(
  118. HREFTYPE hRefType,
  119. ITypeInfo ** ppTInfo);
  120. STDMETHOD(AddressOfMember)(
  121. MEMBERID memid,
  122. INVOKEKIND invKind,
  123. PVOID * ppv);
  124. STDMETHOD(CreateInstance)(
  125. IUnknown * pUnkOuter,
  126. REFIID riid,
  127. PVOID * ppvObj);
  128. STDMETHOD(GetMops)(
  129. MEMBERID memid,
  130. BSTR * pBstrMops);
  131. STDMETHOD(GetContainingTypeLib)(
  132. ITypeLib ** ppTLib,
  133. UINT * pIndex);
  134. STDMETHOD_(void, ReleaseTypeAttr)(
  135. TYPEATTR * pTypeAttr);
  136. STDMETHOD_(void, ReleaseFuncDesc)(
  137. FUNCDESC * pFuncDesc);
  138. STDMETHOD_(void, ReleaseVarDesc)(
  139. VARDESC * pVarDesc);
  140. private:
  141. HRESULT _GetClassInfo(ITypeInfo** ppTI);
  142. };
  143. #endif //__MARSHALABLETI_H_