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.

60 lines
1.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: lht.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 2-05-97 RichardW Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __LHT_HXX__
  18. #define __LHT_HXX__
  19. #define HANDLE_TABLE_SIZE 16
  20. #define HANDLE_TABLE_MASK (HANDLE_TABLE_SIZE - 1)
  21. #define HANDLE_SPLIT_THRESHOLD (HANDLE_TABLE_SIZE * 2)
  22. typedef struct _LHT_HANDLE_LIST {
  23. LIST_ENTRY List ;
  24. ULONG Length ;
  25. ULONG Flags ;
  26. } LHT_HANDLE_LIST, * PLHT_HANDLE_LIST ;
  27. #define LHT_SUB_TABLE (SHT_MAX_FLAG << 1)
  28. #define LHT_TAG 'XTHL'
  29. typedef struct _LARGE_HANDLE_TABLE {
  30. ULONG Tag ;
  31. ULONG Flags ;
  32. ULONG Depth ;
  33. struct _LARGE_HANDLE_TABLE * Parent ;
  34. ULONG IndexOfParent ;
  35. ULONG Count ;
  36. PHP_ENUM_CALLBACK_FN DeleteCallback ;
  37. CRITICAL_SECTION Lock ;
  38. SMALL_HANDLE_TABLE Lists[ HANDLE_TABLE_SIZE ];
  39. } LARGE_HANDLE_TABLE, * PLARGE_HANDLE_TABLE ;
  40. #define LHT_NO_SERIALIZE HANDLE_PACKAGE_NO_SERIALIZE // Serialization at client end
  41. #define LHT_DELETE_CALLBACK HANDLE_PACKAGE_CALLBACK_ON_DELETE // Callback on delete
  42. #define LHT_REQUIRE_UNIQUE HANDLE_PACKAGE_REQUIRE_UNIQUE
  43. #define LHT_BASE_FLAG (HANDLE_PACKAGE_MAX_FLAG)
  44. #define LHT_CHILD (LHT_BASE_FLAG) // This is a child
  45. #define LHT_LIMIT_DEPTH (LHT_BASE_FLAG << 1)// Limit depth
  46. #define LHT_DELETE_PENDING (LHT_BASE_FLAG << 2)// Delete pending, no adds/dels
  47. #define LHT_NO_FREE (LHT_BASE_FLAG << 3)// Don't free on delete
  48. #endif // __LHT_HXX__