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.

83 lines
2.4 KiB

  1. //******************************************************************************
  2. //
  3. // Copyright (c) 1999-2000, Microsoft Corporation, All rights reserved
  4. //
  5. //*****************************************************************************
  6. #ifndef __DELIVREC_H__
  7. #define __DELIVREC_H__
  8. #include <wmimsg.h>
  9. #include <wbemcli.h>
  10. #include <arrtempl.h>
  11. #include <comutl.h>
  12. #include <winntsec.h>
  13. #include <callsec.h>
  14. #include <unk.h>
  15. #include "evsink.h"
  16. class CQueueingEventSink;
  17. class CEssNamespace;
  18. /*************************************************************************
  19. CDeliveryRecord
  20. **************************************************************************/
  21. class CDeliveryRecord : public CUnk // for ref counting
  22. {
  23. private:
  24. DWORD m_dwSize;
  25. CRefedPointerArray<IWbemClassObject> m_Events;
  26. CWbemPtr<IWbemCallSecurity> m_pCallSec;
  27. CEssNamespace * m_pNamespace;
  28. //
  29. // later we'll have a consumer id here.
  30. //
  31. HRESULT AdjustTotalSize( IWbemClassObject* pObj );
  32. void* GetInterface( REFIID ) { return NULL; }
  33. public:
  34. CDeliveryRecord() : m_dwSize(0), m_pNamespace( NULL ) { }
  35. virtual ~CDeliveryRecord();
  36. void AddToCache( CEssNamespace * pNamespace, DWORD dwTotalSize, DWORD * pdwSleep );
  37. IWbemClassObject** GetEvents() { return m_Events.GetArrayPtr(); }
  38. IWbemCallSecurity* GetCallSecurity() { return m_pCallSec; }
  39. ULONG GetNumEvents() { return m_Events.GetSize(); }
  40. ULONG GetTotalBytes() { return m_dwSize; }
  41. void Clear() { m_Events.RemoveAll(); m_dwSize = 0; }
  42. HRESULT Initialize( IWbemClassObject** apEvents,
  43. ULONG cEvents,
  44. IWbemCallSecurity* pCallSec = NULL );
  45. virtual HRESULT PreDeliverAction( ITransaction* ppTxn ) = 0;
  46. virtual HRESULT PostDeliverAction( ITransaction* pTxn, HRESULT hres ) = 0;
  47. };
  48. /*************************************************************************
  49. CExpressDeliveryRecord
  50. **************************************************************************/
  51. class CExpressDeliveryRecord : public CDeliveryRecord
  52. {
  53. static CReuseMemoryManager mstatic_Manager;
  54. public:
  55. HRESULT PreDeliverAction( ITransaction* ppTxn );
  56. HRESULT PostDeliverAction( ITransaction* pTxn, HRESULT hres );
  57. void* operator new(size_t nSize);
  58. void operator delete(void* p);
  59. };
  60. #endif // __DELIVREC_H__