Source code of Windows XP (NT5)
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.

131 lines
3.3 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // File: cmarshal.hxx
  4. //
  5. // Contents: This file contins the DLL entry points
  6. // LibMain
  7. // DllGetClassObject (Bindings key func)
  8. // DllCanUnloadNow
  9. // CCMarshalCF (class factory)
  10. // History: 30-Mar-92 SarahJ Created
  11. //
  12. //---------------------------------------------------------------------
  13. #ifndef __CMARSHAL_H__
  14. #define __CMARSHAL_H__
  15. //+-------------------------------------------------------------------
  16. //
  17. // Class: CCMarshalCF
  18. //
  19. // Synopsis: Class Factory for CCMarshal
  20. //
  21. // Methods: IUnknown - QueryInterface, AddRef, Release
  22. // IClassFactory - CreateInstance
  23. //
  24. // History: 21-Mar-92 SarahJ Created
  25. //
  26. //--------------------------------------------------------------------
  27. class FAR CCMarshalCF: public IClassFactory
  28. {
  29. public:
  30. // Constructor/Destructor
  31. CCMarshalCF();
  32. ~CCMarshalCF();
  33. // IUnknown
  34. STDMETHODIMP QueryInterface(REFIID iid, void FAR * FAR * ppv);
  35. STDMETHODIMP_(ULONG) AddRef(void);
  36. STDMETHODIMP_(ULONG) Release(void);
  37. // IClassFactory
  38. STDMETHODIMP CreateInstance(IUnknown FAR* pUnkOuter,
  39. REFIID iidInterface,
  40. void FAR* FAR* ppv);
  41. STDMETHODIMP LockServer(BOOL fLock);
  42. private:
  43. ULONG ref_count;;
  44. };
  45. class CMarshalBase : public IMarshal
  46. {
  47. public:
  48. CMarshalBase();
  49. ~CMarshalBase();
  50. // IMarshal
  51. STDMETHOD(GetUnmarshalClass) (THIS_ REFIID riid, LPVOID pv,
  52. DWORD dwDestContext, LPVOID pvDestContext,
  53. DWORD mshlflags, LPCLSID pCid);
  54. STDMETHOD(GetMarshalSizeMax) (THIS_ REFIID riid, LPVOID pv,
  55. DWORD dwDestContext, LPVOID pvDestContext,
  56. DWORD mshlflags, LPDWORD pSize);
  57. STDMETHOD(MarshalInterface) (THIS_ IStream * pStm, REFIID riid,
  58. LPVOID pv, DWORD dwDestContext, LPVOID pvDestContext,
  59. DWORD mshlflags);
  60. STDMETHOD(UnmarshalInterface)(THIS_ IStream * pStm, REFIID riid,
  61. LPVOID * ppv);
  62. STDMETHOD(ReleaseMarshalData)(THIS_ IStream * pStm);
  63. STDMETHOD(DisconnectObject) (THIS_ DWORD dwReserved);
  64. ITest *proxy;
  65. private:
  66. IMarshal *marshaller;
  67. };
  68. //+-------------------------------------------------------------------
  69. //
  70. // Class: CCMarshal
  71. //
  72. // Synopsis: Test class CCMarshal
  73. //
  74. // Methods:
  75. //
  76. // History: 21-Mar-92 SarahJ Created
  77. //
  78. //--------------------------------------------------------------------
  79. class FAR CCMarshal: public ITest, public CMarshalBase
  80. {
  81. public:
  82. // Constructor/Destructor
  83. CCMarshal();
  84. ~CCMarshal();
  85. // IUnknown
  86. STDMETHODIMP QueryInterface(REFIID iid, void FAR * FAR * ppv);
  87. STDMETHODIMP_(ULONG) AddRef(void);
  88. STDMETHODIMP_(ULONG) Release(void);
  89. // ITest
  90. STDMETHOD_(DWORD, die) ( ITest *, ULONG, ULONG, ULONG );
  91. STDMETHOD (die_cpp) ( ULONG );
  92. STDMETHOD (die_nt) ( ULONG );
  93. STDMETHOD_(DWORD, DoTest) ( ITest *, ITest * );
  94. STDMETHOD_(BOOL, hello) ( );
  95. STDMETHOD (interrupt) ( ITest *, BOOL );
  96. STDMETHOD (recurse) ( ITest *, ULONG );
  97. STDMETHOD (recurse_interrupt)( ITest *, ULONG );
  98. STDMETHOD (sick) ( ULONG );
  99. STDMETHOD (sleep) ( ULONG );
  100. private:
  101. ULONG ref_count;
  102. };
  103. #endif
  104.