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.

77 lines
2.1 KiB

  1. //////////////////////////////////////////////////////////////////////
  2. #ifndef __SESSMGREVNT_H__
  3. #define __SESSMGREVNT_H__
  4. //#include <atlbase.h>
  5. //#include "IMSession.h"
  6. class CIMSession;
  7. class CSessionMgrEvent : public IDispatch
  8. {
  9. public:
  10. CSessionMgrEvent(CIMSession*);
  11. ~CSessionMgrEvent();
  12. // IUnknown methods
  13. public:
  14. STDMETHOD_(ULONG, AddRef) ()
  15. {
  16. InterlockedIncrement((long*)&m_dwRefCount);
  17. return m_dwRefCount;
  18. }
  19. STDMETHOD_(ULONG, Release) ()
  20. {
  21. if ( InterlockedDecrement((long*)&m_dwRefCount) == 0 )
  22. {
  23. delete this;
  24. return 0;
  25. }
  26. else
  27. return m_dwRefCount;
  28. } ;
  29. STDMETHOD (QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  30. // IDispatch methods
  31. STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) ;
  32. STDMETHOD(GetTypeInfo)(
  33. THIS_
  34. UINT itinfo,
  35. LCID lcid,
  36. ITypeInfo FAR* FAR* pptinfo) ;
  37. STDMETHOD(GetIDsOfNames)(
  38. THIS_
  39. REFIID riid,
  40. OLECHAR FAR* FAR* rgszNames,
  41. UINT cNames,
  42. LCID lcid,
  43. DISPID FAR* rgdispid) ;
  44. STDMETHOD(Invoke)(
  45. THIS_
  46. DISPID dispidMember,
  47. REFIID riid,
  48. LCID lcid,
  49. WORD wFlags,
  50. DISPPARAMS FAR* pdispparams,
  51. VARIANT FAR* pvarResult,
  52. EXCEPINFO FAR* pexcepinfo,
  53. UINT FAR* puArgErr);
  54. public:
  55. HRESULT Advise(IConnectionPoint*);
  56. void OnAppShutDown();
  57. HRESULT Unadvise();
  58. private:
  59. ULONG m_dwRefCount;
  60. CIMSession *m_pIMSession;
  61. IConnectionPoint* m_pCP;
  62. DWORD m_dwCookie;
  63. IID m_iid;
  64. };
  65. #endif