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.

101 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1994-95 Microsoft Corporation
  3. Module Name:
  4. prdobj.h
  5. Abstract:
  6. Product object implementation.
  7. Author:
  8. Don Ryan (donryan) 11-Jan-1995
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. --*/
  13. #ifndef _PRDOBJ_H_
  14. #define _PRDOBJ_H_
  15. class CProduct : public CCmdTarget
  16. {
  17. DECLARE_DYNCREATE(CProduct)
  18. private:
  19. CCmdTarget* m_pParent;
  20. CObArray m_licenseArray;
  21. CObArray m_statisticArray;
  22. CObArray m_serverstatisticArray;
  23. BOOL m_bLicensesRefreshed;
  24. BOOL m_bStatisticsRefreshed;
  25. BOOL m_bServerStatisticsRefreshed;
  26. public:
  27. CString m_strName;
  28. long m_lInUse;
  29. long m_lLimit;
  30. long m_lConcurrent;
  31. long m_lHighMark;
  32. CLicenses* m_pLicenses;
  33. CStatistics* m_pStatistics;
  34. CServerStatistics* m_pServerStatistics;
  35. public:
  36. CProduct(
  37. CCmdTarget* pParent = NULL,
  38. LPCTSTR pName = NULL,
  39. long lPurchased = 0L,
  40. long lInUse = 0L,
  41. long lConcurrent = 0L,
  42. long lHighMark = 0L
  43. );
  44. virtual ~CProduct();
  45. BOOL RefreshLicenses();
  46. BOOL RefreshStatistics();
  47. BOOL RefreshServerStatistics();
  48. void ResetLicenses();
  49. void ResetStatistics();
  50. void ResetServerStatistics();
  51. //{{AFX_VIRTUAL(CProduct)
  52. public:
  53. virtual void OnFinalRelease();
  54. //}}AFX_VIRTUAL
  55. //{{AFX_DISPATCH(CProduct)
  56. afx_msg LPDISPATCH GetApplication();
  57. afx_msg LPDISPATCH GetParent();
  58. afx_msg long GetInUse();
  59. afx_msg BSTR GetName();
  60. afx_msg long GetPerSeatLimit();
  61. afx_msg long GetPerServerLimit();
  62. afx_msg long GetPerServerReached();
  63. afx_msg LPDISPATCH GetLicenses(const VARIANT FAR& index);
  64. afx_msg LPDISPATCH GetStatistics(const VARIANT FAR& index);
  65. afx_msg LPDISPATCH GetServerStatistics(const VARIANT FAR& index);
  66. //}}AFX_DISPATCH
  67. DECLARE_DISPATCH_MAP()
  68. protected:
  69. //{{AFX_MSG(CProduct)
  70. // NOTE - the ClassWizard will add and remove member functions here.
  71. //}}AFX_MSG
  72. DECLARE_MESSAGE_MAP()
  73. };
  74. #define IsProductInViolation(prd) ((prd)->m_lLimit < (prd)->m_lInUse)
  75. #define IsProductAtLimit(prd) (((prd)->m_lLimit == (prd)->m_lInUse) && (prd)->m_lLimit)
  76. #define CalcProductBitmap(prd) (IsProductInViolation(prd) ? BMPI_VIOLATION : (IsProductAtLimit(prd) ? BMPI_WARNING_AT_LIMIT : BMPI_PRODUCT))
  77. #endif // _PRDOBJ_H_