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.

77 lines
1.2 KiB

  1. /*++
  2. Copyright(c) 1995 Microsoft Corporation
  3. MODULE NAME
  4. table.h
  5. ABSTRACT
  6. Header file for generic hash table routines.
  7. AUTHOR
  8. Anthony Discolo (adiscolo) 28-Jul-1995
  9. REVISION HISTORY
  10. --*/
  11. //
  12. // Number of hash table buckets.
  13. //
  14. #define NBUCKETS 13
  15. //
  16. // Generic hash table structure.
  17. //
  18. typedef struct _HASH_TABLE {
  19. LIST_ENTRY ListEntry[NBUCKETS];
  20. KSPIN_LOCK SpinLock;
  21. } HASH_TABLE, *PHASH_TABLE;
  22. //
  23. // Hash table enumerator procedure.
  24. // Returns TRUE to continue enumeration,
  25. // FALSE to terminate enumeration.
  26. //
  27. typedef BOOLEAN (*PHASH_TABLE_ENUM_PROC)(PVOID, PACD_ADDR, ULONG);
  28. PHASH_TABLE
  29. NewTable();
  30. VOID
  31. ClearTable(
  32. IN PHASH_TABLE pTable
  33. );
  34. VOID
  35. FreeTable(
  36. IN PHASH_TABLE pTable
  37. );
  38. VOID
  39. EnumTable(
  40. IN PHASH_TABLE pTable,
  41. IN PHASH_TABLE_ENUM_PROC pProc,
  42. IN PVOID pArg
  43. );
  44. BOOLEAN
  45. GetTableEntry(
  46. IN PHASH_TABLE pTable,
  47. IN PACD_ADDR pszKey,
  48. OUT PULONG pulData
  49. );
  50. BOOLEAN
  51. PutTableEntry(
  52. IN PHASH_TABLE pTable,
  53. IN PACD_ADDR pszKey,
  54. IN ULONG ulData
  55. );
  56. BOOLEAN
  57. DeleteTableEntry(
  58. IN PHASH_TABLE pTable,
  59. IN PACD_ADDR pszKey
  60. );
  61.