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.

58 lines
1.6 KiB

  1. #ifndef _NOTFSINK_HXX_
  2. #define _NOTFSINK_HXX_
  3. #include <notftn.h>
  4. class CNotfSink : public INotificationSink , public IDebugRegister
  5. {
  6. public:
  7. // IUnknown methods
  8. STDMETHODIMP QueryInterface(REFIID iid, void **ppvObj);
  9. STDMETHODIMP_(ULONG) AddRef(void);
  10. STDMETHODIMP_(ULONG) Release(void);
  11. STDMETHODIMP OnNotification(
  12. // the notification object itself
  13. LPNOTIFICATION pNotification,
  14. // the cookie of the object the notification is targeted too
  15. //PNOTIFICATIONCOOKIE pRunningNotfCookie,
  16. // flags how it was delivered and how it should
  17. // be processed
  18. //NOTIFICATIONFLAGS grfNotification,
  19. // the report sink if - can be NULL
  20. LPNOTIFICATIONREPORT pNotfctnReport,
  21. DWORD dwReserved
  22. );
  23. STDMETHODIMP GetFacilities (LPCWSTR *ppwzNames, DWORD *pcNames, DWORD dwReserved);
  24. STDMETHODIMP Register ( LPCWSTR pwzName, IDebugOut *pDbgOut, DWORD dwFlags, DWORD dwReserved);
  25. // internal methods
  26. BOOL IsApartmentThread()
  27. {
  28. EProtAssert((_ThreadId != 0));
  29. return (_ThreadId == GetCurrentThreadId());
  30. }
  31. public:
  32. CNotfSink(LPCWSTR pwzName ) : _CRefs(1)
  33. {
  34. _pwzName= pwzName;
  35. _ThreadId = GetCurrentThreadId();
  36. }
  37. ~CNotfSink()
  38. {
  39. }
  40. private:
  41. CRefCount _CRefs; // the total refcount of this object
  42. DWORD _ThreadId;
  43. LPCWSTR _pwzName;
  44. //PNOTIFICATION _pNotification;
  45. };
  46. #endif //_NOTFSINK_HXX_