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.

81 lines
3.1 KiB

  1. //=============================================================================
  2. //
  3. // Copyright (c) 1996-1999, Microsoft Corporation, All rights reserved
  4. //
  5. // STDCONS.H
  6. //
  7. // This file defines the class for permanent event consumer.
  8. //
  9. // Classes defined:
  10. //
  11. // CPermanentConsumer
  12. //
  13. // History:
  14. //
  15. // 11/27/96 a-levn Compiles.
  16. //
  17. //=============================================================================
  18. #ifndef __PERM_EVENT_CONSUMER__H_
  19. #define __PERM_EVENT_CONSUMER__H_
  20. #include "binding.h"
  21. #include "consprov.h"
  22. #include "fastall.h"
  23. class CPermanentConsumer : public CEventConsumer
  24. {
  25. protected:
  26. IWbemUnboundObjectSink* m_pCachedSink;
  27. DWORD m_dwLastDelivery;
  28. IWbemClassObject* m_pLogicalConsumer;
  29. static long mstatic_lMaxQueueSizeHandle;
  30. static long mstatic_lSidHandle;
  31. static bool mstatic_bHandlesInitialized;
  32. static HRESULT InitializeHandles( _IWmiObject* pObject);
  33. protected:
  34. HRESULT RetrieveProviderRecord(
  35. RELEASE_ME CConsumerProviderRecord** ppRecord,
  36. RELEASE_ME IWbemClassObject** ppLogicalConsumer = NULL);
  37. HRESULT RetrieveSink(RELEASE_ME IWbemUnboundObjectSink** ppSink,
  38. RELEASE_ME IWbemClassObject** ppLogicalConsumer);
  39. HRESULT ObtainSink(RELEASE_ME IWbemUnboundObjectSink** ppSink,
  40. RELEASE_ME IWbemClassObject** ppLogicalConsumer);
  41. HRESULT ClearCache();
  42. HRESULT Indicate(IWbemUnboundObjectSink* pSink,
  43. IWbemClassObject* pLogicalConsumer,
  44. long lNumEvents, IWbemEvent** apEvents,
  45. BOOL bSecure);
  46. HRESULT ConstructErrorEvent(LPCWSTR wszEventClass,
  47. IWbemEvent* pEvent, IWbemEvent** ppErrorEvent);
  48. HRESULT ReportConsumerFailure(IWbemEvent* pEvent, HRESULT hresError,
  49. _IWmiObject* pErrorObj);
  50. HRESULT ReportQosFailure(IWbemEvent* pEvent, HRESULT hresError);
  51. HRESULT ReportConsumerFailure(long lNumEvents,
  52. IWbemEvent** apEvents, HRESULT hresError);
  53. HRESULT Redeliver(long lNumEvents, IWbemEvent** apEvents, BOOL bSecure);
  54. void FireSinkUnloadedEvent();
  55. public:
  56. CPermanentConsumer(CEssNamespace* pNamespace);
  57. HRESULT Initialize(READ_ONLY IWbemClassObject* pActualConsumer);
  58. virtual ~CPermanentConsumer();
  59. BOOL UnloadIfUnusedFor(CWbemInterval Interval);
  60. BOOL IsFullyUnloaded();
  61. BOOL IsPermanent() const {return TRUE;}
  62. HRESULT ResetProviderRecord(LPCWSTR wszProvider);
  63. static SYSFREE_ME BSTR ComputeKeyFromObj(CEssNamespace* pNamespace,
  64. IWbemClassObject* pConsumerObj);
  65. virtual HRESULT ActuallyDeliver(long lNumEvents, IWbemEvent** apEvents,
  66. BOOL bSecure, CEventContext* pContext);
  67. HRESULT ReportQueueOverflow(IWbemEvent* pEvent, DWORD dwQueueSize);
  68. HRESULT Validate(IWbemClassObject* pLogicalConsumer);
  69. };
  70. #endif