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.

107 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. expinfo.h
  5. Abstract:
  6. Defines the CExpirationPolicy class that maintains all properties about an
  7. expiration policy.
  8. Author:
  9. Magnus Hedlund (MagnusH) --
  10. Revision History:
  11. --*/
  12. #ifndef _EXPINFO_INCLUDED_
  13. #define _EXPINFO_INCLUDED_
  14. // Dependencies:
  15. #include "cmultisz.h"
  16. typedef struct _NNTP_EXPIRE_INFO NNTP_EXPIRE_INFO, * LPNNTP_EXPIRE_INFO;
  17. //
  18. // Changed flags:
  19. //
  20. #define CHNG_EXPIRE_SIZE 0x00000001
  21. #define CHNG_EXPIRE_TIME 0x00000002
  22. #define CHNG_EXPIRE_NEWSGROUPS 0x00000004
  23. #define CHNG_EXPIRE_ID 0x00000008
  24. #define CHNG_EXPIRE_POLICY_NAME 0x00000010
  25. /////////////////////////////////////////////////////////////////////////////
  26. // Defaults:
  27. #define DEFAULT_EXPIRE_SIZE ( 500 ) // 500 megabytes
  28. #define DEFAULT_EXPIRE_TIME ( 24 * 7 ) // One week
  29. #define DEFAULT_EXPIRE_NEWSGROUPS ( _T ("\0") ) // Empty list
  30. #define DEFAULT_EXPIRE_POLICY_NAME ( _T ("") ) // No name
  31. DWORD GetExpireId ( const LPWSTR wszKey );
  32. BOOL IsKeyValidExpire ( const LPWSTR wszKey );
  33. //$-------------------------------------------------------------------
  34. //
  35. // Class:
  36. //
  37. // CExpirationPolicy
  38. //
  39. // Description:
  40. //
  41. // Maintains properties about a expire & communicates with the metabase.
  42. //
  43. // Interface:
  44. //
  45. //
  46. //
  47. //--------------------------------------------------------------------
  48. class CExpirationPolicy
  49. {
  50. public:
  51. CExpirationPolicy ( );
  52. ~CExpirationPolicy ( );
  53. void Destroy ();
  54. const CExpirationPolicy & operator= ( const CExpirationPolicy & Expire );
  55. inline const CExpirationPolicy & operator= ( const NNTP_EXPIRE_INFO & Expire ) {
  56. FromExpireInfo ( &Expire );
  57. return *this;
  58. }
  59. BOOL CheckValid ();
  60. HRESULT ToExpireInfo ( LPNNTP_EXPIRE_INFO pExpireInfo );
  61. void FromExpireInfo ( const NNTP_EXPIRE_INFO * pExpireInfo );
  62. HRESULT Add ( LPCWSTR strServer, DWORD dwInstance);
  63. HRESULT Set ( LPCWSTR strServer, DWORD dwInstance);
  64. // HRESULT Get ( LPCWSTR strServer, DWORD dwInstance);
  65. HRESULT Remove ( LPCWSTR strServer, DWORD dwInstance);
  66. // expire Properties:
  67. public:
  68. DWORD m_dwExpireId;
  69. CComBSTR m_strPolicyName;
  70. DWORD m_dwSize;
  71. DWORD m_dwTime;
  72. CMultiSz m_mszNewsgroups;
  73. private:
  74. // Don't call the copy constructor:
  75. CExpirationPolicy ( const CExpirationPolicy & );
  76. };
  77. #endif // _EXPINFO_INCLUDED_