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.

55 lines
1.5 KiB

  1. //+------------------------------------------------------------
  2. //
  3. // Copyright (C) 1999, Microsoft Corporation
  4. //
  5. // File: catperf.h
  6. //
  7. // Contents: Categorizer perf counter block
  8. //
  9. // Classes:
  10. //
  11. // Functions:
  12. //
  13. // History:
  14. // jstamerj 1999/02/23 17:55:10: Created.
  15. //
  16. //-------------------------------------------------------------
  17. #ifndef __CATPERF_H__
  18. #define __CATPERF_H__
  19. //
  20. // One global perf structure for the LDAP stuff
  21. //
  22. extern CATLDAPPERFBLOCK g_LDAPPerfBlock;
  23. //
  24. // Handy macros
  25. //
  26. #define INCREMENT_BLOCK_COUNTER_AMOUNT(PBlock, CounterName, Amount) \
  27. InterlockedExchangeAdd((PLONG) (& ((PBlock)->CounterName)), (Amount))
  28. #define INCREMENT_BLOCK_COUNTER(PBlock, CounterName) \
  29. InterlockedIncrement((PLONG) (& ((PBlock)->CounterName)))
  30. #define INCREMENT_COUNTER_AMOUNT(CounterName, Amount) \
  31. INCREMENT_BLOCK_COUNTER_AMOUNT(GetPerfBlock(), CounterName, Amount)
  32. #define INCREMENT_COUNTER(CounterName) \
  33. INCREMENT_BLOCK_COUNTER(GetPerfBlock(), CounterName)
  34. #define DECREMENT_BLOCK_COUNTER(PBlock, CounterName) \
  35. InterlockedDecrement((PLONG) (& ((PBlock)->CounterName)))
  36. #define DECREMENT_COUNTER(CounterName) \
  37. DECREMENT_BLOCK_COUNTER(GetPerfBlock(), CounterName)
  38. #define INCREMENT_LDAP_COUNTER(CounterName) \
  39. INCREMENT_BLOCK_COUNTER(&g_LDAPPerfBlock, CounterName)
  40. #define DECREMENT_LDAP_COUNTER(CounterName) \
  41. DECREMENT_BLOCK_COUNTER(&g_LDAPPerfBlock, CounterName)
  42. #endif //__CATPERF_H__