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.

69 lines
2.4 KiB

  1. //--------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation, 1997 - 2000
  3. //
  4. // ecblist.h
  5. //
  6. // Simple rountines to keep a list of the active ISAPI ECBs.
  7. //--------------------------------------------------------------------
  8. #ifndef _ECBLIST_H
  9. #define _ECBLIST_H
  10. //--------------------------------------------------------------------
  11. // ACTIVE_ECB_LIST is the list (hashed) of currently active
  12. // Extension Control Blocks. There is one ECB_ENTRY for each
  13. // currently active ECB the RpcProxy.dll is managing.
  14. //--------------------------------------------------------------------
  15. // HASH_SIZE should be a prime number.
  16. #define HASH_SIZE 991
  17. #define ECB_HASH(pointer) (((UINT_PTR)pointer)%HASH_SIZE)
  18. typedef struct _ECB_ENTRY
  19. {
  20. LIST_ENTRY ListEntry; // Linked list of hash collisions.
  21. LONG lRefCount; // Refcount for ECBs.
  22. DWORD dwTickCount; // For ECB age
  23. EXTENSION_CONTROL_BLOCK *pECB;
  24. } ECB_ENTRY;
  25. typedef struct _ACTIVE_ECB_LIST
  26. {
  27. RTL_CRITICAL_SECTION cs;
  28. DWORD dwNumEntries;
  29. LIST_ENTRY HashTable[HASH_SIZE]; // List heads for the hash.
  30. } ACTIVE_ECB_LIST;
  31. //--------------------------------------------------------------------
  32. //
  33. //--------------------------------------------------------------------
  34. extern ACTIVE_ECB_LIST *InitializeECBList();
  35. extern BOOL EmptyECBList( IN ACTIVE_ECB_LIST *pECBList );
  36. extern BOOL AddToECBList( IN ACTIVE_ECB_LIST *pECBList,
  37. IN EXTENSION_CONTROL_BLOCK *pECB );
  38. extern BOOL IncrementECBRefCount( IN ACTIVE_ECB_LIST *pECBList,
  39. IN EXTENSION_CONTROL_BLOCK *pECB );
  40. extern EXTENSION_CONTROL_BLOCK *DecrementECBRefCount(
  41. IN ACTIVE_ECB_LIST *pECBList,
  42. IN EXTENSION_CONTROL_BLOCK *pECB );
  43. extern EXTENSION_CONTROL_BLOCK *LookupInECBList(
  44. IN ACTIVE_ECB_LIST *pECBList,
  45. IN EXTENSION_CONTROL_BLOCK *pECB );
  46. extern EXTENSION_CONTROL_BLOCK *LookupRemoveFromECBList(
  47. IN ACTIVE_ECB_LIST *pECBList,
  48. IN EXTENSION_CONTROL_BLOCK *pECB );
  49. #ifdef DBG
  50. extern void CheckECBHashBalance( IN ACTIVE_ECB_LIST *pECBList );
  51. #endif
  52. #endif