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.

81 lines
2.1 KiB

  1. #include "priv.h"
  2. #include <iiscnfg.h>
  3. #include "wrapmb.h"
  4. #include "Sink.h"
  5. #include "eddir.h"
  6. #include "shellext.h"
  7. //--------------------------------------------------------------------
  8. CImpIMSAdminBaseSink::CImpIMSAdminBaseSink():
  9. m_pPageWeb(NULL)
  10. {
  11. m_dwRefCount=1;
  12. }
  13. //--------------------------------------------------------------------
  14. CImpIMSAdminBaseSink::~CImpIMSAdminBaseSink()
  15. {
  16. }
  17. //--------------------------------------------------------------------
  18. HRESULT
  19. CImpIMSAdminBaseSink::QueryInterface(REFIID riid, void **ppObject)
  20. {
  21. if (riid==IID_IUnknown || riid==IID_IMSAdminBaseSink)
  22. {
  23. *ppObject = (IMSAdminBaseSink*) this;
  24. }
  25. else
  26. {
  27. return E_NOINTERFACE;
  28. }
  29. AddRef();
  30. return NO_ERROR;
  31. }
  32. //--------------------------------------------------------------------
  33. ULONG
  34. CImpIMSAdminBaseSink::AddRef()
  35. {
  36. DWORD dwRefCount;
  37. dwRefCount = InterlockedIncrement((long *)&m_dwRefCount);
  38. return dwRefCount;
  39. }
  40. //--------------------------------------------------------------------
  41. ULONG
  42. CImpIMSAdminBaseSink::Release()
  43. {
  44. DWORD dwRefCount;
  45. dwRefCount = InterlockedDecrement((long *)&m_dwRefCount);
  46. if (dwRefCount == 0)
  47. {
  48. delete this;
  49. }
  50. return dwRefCount;
  51. }
  52. //--------------------------------------------------------------------
  53. HRESULT STDMETHODCALLTYPE
  54. CImpIMSAdminBaseSink::SinkNotify(
  55. /* [in] */ DWORD dwMDNumElements,
  56. /* [size_is][in] */ MD_CHANGE_OBJECT __RPC_FAR pcoChangeList[ ])
  57. {
  58. // we are not actually allowed to make any metadata calls here, so we need to notfy the
  59. // appropriate view that it has work to do the next time there is time.
  60. // however, we can let the views decide if they want this...
  61. if ( m_pPageWeb )
  62. m_pPageWeb->SinkNotify( dwMDNumElements, pcoChangeList );
  63. return (0);
  64. }
  65. //--------------------------------------------------------------------
  66. HRESULT STDMETHODCALLTYPE
  67. CImpIMSAdminBaseSink::ShutdownNotify(void)
  68. {
  69. if ( m_pPageWeb )
  70. PostMessage( m_pPageWeb->m_hwnd, WM_SHUTDOWN_NOTIFY, 0, 0 );
  71. return (0);
  72. }