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.

76 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1989-2001 Microsoft Corporation
  3. Module Name:
  4. hash.h
  5. Abstract:
  6. Abstract Data Type: Hash
  7. Author:
  8. Jiandong Ruan
  9. Revision History:
  10. --*/
  11. typedef struct SMB_HASH_TABLE *PSMB_HASH_TABLE;
  12. typedef PVOID (*PSMB_HASH_GET_KEY)(PLIST_ENTRY entry); // return the key stored in the entry
  13. typedef DWORD (*PSMB_HASH)(PVOID key);
  14. typedef VOID (*PSMB_HASH_DEL)(PLIST_ENTRY entry);
  15. typedef VOID (*PSMB_HASH_ADD)(PLIST_ENTRY entry); // OnAdd
  16. typedef LONG (*PSMB_HASH_REFERENCE)(PLIST_ENTRY entry);
  17. typedef LONG (*PSMB_HASH_DEREFERENCE)(PLIST_ENTRY entry);
  18. typedef int (*PSMB_HASH_CMP)(PLIST_ENTRY a, PVOID key);
  19. PSMB_HASH_TABLE
  20. SmbCreateHashTable(
  21. DWORD NumberOfBuckets,
  22. PSMB_HASH HashFunc,
  23. PSMB_HASH_GET_KEY GetKeyFunc,
  24. PSMB_HASH_CMP CmpFunc,
  25. PSMB_HASH_ADD AddFunc, // optional
  26. PSMB_HASH_DEL DelFunc, // optional
  27. PSMB_HASH_REFERENCE RefFunc, // optional
  28. PSMB_HASH_DEREFERENCE DerefFunc // optional
  29. );
  30. VOID
  31. SmbDestroyHashTable(
  32. PSMB_HASH_TABLE HashTbl
  33. );
  34. PLIST_ENTRY
  35. SmbLookupHashTable(
  36. PSMB_HASH_TABLE HashTbl,
  37. PVOID Key
  38. );
  39. PLIST_ENTRY
  40. SmbLookupHashTableAndReference(
  41. PSMB_HASH_TABLE HashTbl,
  42. PVOID Key
  43. );
  44. PLIST_ENTRY
  45. SmbAddToHashTable(
  46. PSMB_HASH_TABLE HashTbl,
  47. PLIST_ENTRY Entry
  48. );
  49. PLIST_ENTRY
  50. SmbRemoveFromHashTable(
  51. PSMB_HASH_TABLE HashTbl,
  52. PVOID Key
  53. );