Source code of Windows XP (NT5)
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.

91 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name :
  4. stats.hxx
  5. Abstract:
  6. Declares a class consisting of server statistics information.
  7. ( Multiple servers can make use of the same statistics
  8. information by creating distinct server statistics object)
  9. Author:
  10. Murali R. Krishnan ( MuraliK ) 04-Nov-1994
  11. Project:
  12. Web Server DLL
  13. Revision History:
  14. Sophia Chung ( SophiaC ) 20-Nov-1996
  15. --*/
  16. # ifndef _STATS_HXX_
  17. # define _STATS_HXX_
  18. /************************************************************
  19. * Include Headers
  20. ************************************************************/
  21. /************************************************************
  22. * Type Definitions
  23. ************************************************************/
  24. class SMTP_SERVER_INSTANCE;
  25. //
  26. // Make statistics a little easier.
  27. //
  28. #define INCREMENT_COUNTER(name, SmtpStats) \
  29. InterlockedIncrement((LPLONG)&(SmtpStats->name))
  30. #define DECREMENT_COUNTER(name, SmtpStats) \
  31. InterlockedDecrement((LPLONG)&(SmtpStats->name))
  32. class SMTP_SERVER_STATISTICS {
  33. private:
  34. SMTP_STATISTICS_0 m_SmtpStats;
  35. CRITICAL_SECTION m_csStatsLock; // to synchronize access among threads
  36. SMTP_SERVER_INSTANCE *m_pInstance;
  37. public:
  38. VOID LockStatistics( VOID) { EnterCriticalSection( &m_csStatsLock); }
  39. VOID UnlockStatistics( VOID) { LeaveCriticalSection( &m_csStatsLock); }
  40. SMTP_SERVER_STATISTICS(SMTP_SERVER_INSTANCE * pInstance);
  41. ~SMTP_SERVER_STATISTICS( VOID)
  42. { DeleteCriticalSection( &m_csStatsLock); };
  43. VOID ClearStatistics( VOID);
  44. LPSMTP_STATISTICS_0 QueryStatsMember( VOID)
  45. { return &m_SmtpStats; }
  46. //
  47. // copies statistics for RPC querying.
  48. //
  49. DWORD CopyToStatsBuffer( LPSMTP_STATISTICS_0 lpStat );
  50. }; // SMTP_SERVER_STATISTICS
  51. typedef SMTP_SERVER_STATISTICS FAR * LPSMTP_SERVER_STATISTICS;
  52. # endif // _STATS_HXX_
  53. /************************ End of File ***********************/