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.

112 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1995-1996 Microsoft Corporation
  3. Module Name :
  4. auxctrs.h
  5. Abstract:
  6. This module defines the auxiliary counters for Internet Common Services.
  7. Author:
  8. Murali R. Krishnan ( MuraliK ) 02-Apr-1996
  9. Environment:
  10. Windows NT - User Mode
  11. Project:
  12. Internet Services Common DLL
  13. Revision History:
  14. --*/
  15. # ifndef _IIS_CACHE_COUNTERS_HXX_
  16. # define _IIS_CACHE_COUNTERS_HXX_
  17. /************************************************************
  18. * Include Headers
  19. ************************************************************/
  20. /************************************************************
  21. * Symbolic Definitions
  22. ************************************************************/
  23. /*++
  24. Counters belong to two categories
  25. 1. Active Counter - one that counts up and down
  26. It is expected that this counter consists of the current
  27. active items and hence this should not be wildly high, unless
  28. there are large # of counted objects.
  29. 2. Cumulative Counters - counts values up and up
  30. This count value is used to measure the # of times event(s)
  31. related to this counter occurred.
  32. Naming Conventions:
  33. prefixes used are: Aac & Cac
  34. Aac - Active Auxiliary Counter
  35. Cac - Cumulative Auxiliary Counter
  36. Ac - Auxiliar Counter
  37. --*/
  38. typedef enum { // Ac - stands for Aux Counters.
  39. AacOpenURIFiles = 0,
  40. CacOpenURI,
  41. CacCloseURI,
  42. AacIISCacheMaxCounters // sentinel counter
  43. } ENUM_IIS_CACHE_COUNTER;
  44. #ifdef IIS_AUX_COUNTERS
  45. # define NUM_AUX_COUNTERS (AacIISCacheMaxCounters)
  46. extern LONG g_IISCacheAuxCounters[];
  47. # define VAR_AUX_COUNTER (g_IISCacheAuxCounters)
  48. //
  49. // Macros for operating on these counters
  50. //
  51. # define AcIncrement( acCounter) \
  52. (((acCounter) < NUM_AUX_COUNTERS) ? \
  53. InterlockedIncrement( (VAR_AUX_COUNTER) + (acCounter)) : \
  54. 0)
  55. # define AcDecrement( acCounter) \
  56. (((acCounter) < NUM_AUX_COUNTERS) ? \
  57. InterlockedDecrement( (VAR_AUX_COUNTER) + (acCounter)) : \
  58. 0)
  59. # define AcCounter( acCounter) \
  60. (((acCounter) < NUM_AUX_COUNTERS) ? (VAR_AUX_COUNTER)[acCounter] : 0)
  61. # else // IIS_AUX_COUNTERS
  62. # define NUM_AUX_COUNTERS (0)
  63. # define VAR_AUX_COUNTER /* nothing */
  64. # define AcIncrement( acCounter) (0) /* do nothing */
  65. # define AcDecrement( acCounter) (0) /* do nothing */
  66. # define AcCounter( acCounter) (0) /* do nothing */
  67. #endif // IIS_AUX_COUNTERS
  68. # endif // _IIS_CACHE_COUNTERS_HXX_
  69. /************************ End of File ***********************/