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.

148 lines
3.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: sinklist.hxx
  7. //
  8. // Contents: Linked list class
  9. //
  10. // Classes: CSinkList
  11. // CConnectionPoint
  12. //
  13. // Functions:
  14. //
  15. // History: 24-Dec-95 SusiA Created
  16. //
  17. //----------------------------------------------------------------------------
  18. #ifndef __SINKLIST_HXX__
  19. #define __SINKLIST_HXX__
  20. #include "intfy.h"
  21. //+---------------------------------------------------------------------------
  22. //
  23. // Class: CSinkList
  24. //
  25. // Purpose: Generic linked list class for use by async docfiles
  26. //
  27. // Interface:
  28. //
  29. // History: 24-Dec-95 SusiA Created
  30. //
  31. // Notes:
  32. //
  33. //----------------------------------------------------------------------------
  34. class CSinkList
  35. {
  36. public:
  37. inline CSinkList();
  38. inline CSinkList *GetNext(void);
  39. inline void SetNext(CSinkList *psl);
  40. inline DWORD GetCookie(void);
  41. inline void SetCookie(DWORD dwCookie);
  42. inline IProgressNotify *GetProgressNotify(void);
  43. inline void SetProgressNotify(IProgressNotify *ppn);
  44. private:
  45. IProgressNotify *_ppn;
  46. DWORD _dwCookie;
  47. CSinkList *_pslNext;
  48. };
  49. inline CSinkList::CSinkList()
  50. {
  51. _ppn = NULL;
  52. _dwCookie = 0;
  53. _pslNext = NULL;
  54. }
  55. inline CSinkList * CSinkList::GetNext(void)
  56. {
  57. return _pslNext;
  58. }
  59. inline void CSinkList::SetNext(CSinkList *psl)
  60. {
  61. _pslNext = psl;
  62. }
  63. inline DWORD CSinkList::GetCookie(void)
  64. {
  65. return _dwCookie;
  66. }
  67. inline void CSinkList::SetCookie(DWORD dwCookie)
  68. {
  69. _dwCookie = dwCookie;
  70. }
  71. inline IProgressNotify *CSinkList::GetProgressNotify(void)
  72. {
  73. return _ppn;
  74. }
  75. inline void CSinkList::SetProgressNotify(IProgressNotify *ppn)
  76. {
  77. _ppn = ppn;
  78. }
  79. //+---------------------------------------------------------------------------
  80. //
  81. // Class: CConnectionPoint
  82. //
  83. // Purpose:
  84. //
  85. // Interface:
  86. //
  87. // History: 28-Dec-95 SusiA Created
  88. //
  89. // Notes:
  90. //
  91. //----------------------------------------------------------------------------
  92. class CConnectionPoint: public IConnectionPoint
  93. {
  94. public:
  95. CConnectionPoint();
  96. void Init(IConnectionPointContainer *pCPC);
  97. //From IUnknown
  98. STDMETHOD(QueryInterface)(REFIID iid, void **ppvObj);
  99. STDMETHOD_(ULONG,AddRef)(void);
  100. STDMETHOD_(ULONG,Release)(void);
  101. //From IConnectionPoint
  102. STDMETHOD(GetConnectionInterface)(IID *pIID);
  103. STDMETHOD(GetConnectionPointContainer)
  104. (IConnectionPointContainer ** ppCPC);
  105. STDMETHOD(Advise)(IUnknown *pUnkSink, DWORD *pdwCookie);
  106. STDMETHOD(Unadvise)(DWORD dwCookie);
  107. STDMETHOD(EnumConnections)(IEnumConnections **ppEnum);
  108. inline CSinkList *GetHead(void);
  109. private:
  110. DWORD _dwCookie;
  111. LONG _cReferences;
  112. CSinkList *_pSinkHead;
  113. IConnectionPointContainer *_pCPC;
  114. };
  115. inline CSinkList * CConnectionPoint::GetHead(void)
  116. {
  117. return _pSinkHead;
  118. }
  119. #endif // #ifndef __SINKLIST_HXX__