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.

69 lines
2.2 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Rule.h
  4. //
  5. ///////////////////////////////////////////////////////////////////////////////
  6. // Bring in only once
  7. #pragma once
  8. #include "oerules.h"
  9. class COERule : public IOERule, IPersistStream
  10. {
  11. private:
  12. enum
  13. {
  14. RULE_STATE_UNINIT = 0x00000000,
  15. RULE_STATE_INIT = 0x00000001,
  16. RULE_STATE_LOADED = 0x00000002,
  17. RULE_STATE_DIRTY = 0x00000004,
  18. RULE_STATE_DISABLED = 0x00000008,
  19. RULE_STATE_INVALID = 0x00000010
  20. };
  21. enum {RULE_VERSION = 0x00050000};
  22. private:
  23. LONG m_cRef;
  24. DWORD m_dwState;
  25. LPSTR m_pszName;
  26. IOECriteria * m_pICrit;
  27. IOEActions * m_pIAct;
  28. DWORD m_dwVersion;
  29. public:
  30. // Constructor/destructor
  31. COERule();
  32. ~COERule();
  33. // IUnknown members
  34. STDMETHODIMP QueryInterface(REFIID riid, void ** ppvObject);
  35. STDMETHODIMP_(ULONG) AddRef(void);
  36. STDMETHODIMP_(ULONG) Release(void);
  37. // IRule members
  38. STDMETHODIMP Reset(void);
  39. STDMETHODIMP GetState(DWORD * pdwState);
  40. STDMETHODIMP Validate(DWORD dwFlags);
  41. STDMETHODIMP GetProp(RULE_PROP prop, DWORD dwFlags, PROPVARIANT * pvarResult);
  42. STDMETHODIMP SetProp(RULE_PROP prop, DWORD dwFlags, PROPVARIANT * pvarValue);
  43. STDMETHODIMP Evaluate(LPCSTR pszAcct, MESSAGEINFO * pMsgInfo, IMessageFolder * pFolder,
  44. IMimePropertySet * pIMPropSet, IMimeMessage * pIMMsg, ULONG cbMsgSize,
  45. ACT_ITEM ** ppActions, ULONG * pcActions);
  46. STDMETHODIMP LoadReg(LPCSTR szRegPath);
  47. STDMETHODIMP SaveReg(LPCSTR szRegPath, BOOL fClearDirty);
  48. STDMETHODIMP Clone(IOERule ** ppIRule);
  49. // IPersistStream members
  50. STDMETHODIMP GetClassID(CLSID * pclsid);
  51. STDMETHODIMP IsDirty(void);
  52. STDMETHODIMP Load(IStream * pStm);
  53. STDMETHODIMP Save(IStream * pStm, BOOL fClearDirty);
  54. STDMETHODIMP GetSizeMax(ULARGE_INTEGER * pcbSize) { return E_NOTIMPL; }
  55. };
  56. HRESULT HrCreateRule(IOERule ** ppIRule);