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.

155 lines
3.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: handle.hxx
  7. //
  8. // Contents: Handle Package interface
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 2-03-97 RichardW Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __HANDLE_HXX__
  18. #define __HANDLE_HXX__
  19. typedef
  20. VOID (WINAPI HP_ENUM_CALLBACK_FN)(
  21. PSecHandle Handle,
  22. PVOID Context,
  23. ULONG RefCount
  24. );
  25. typedef HP_ENUM_CALLBACK_FN * PHP_ENUM_CALLBACK_FN;
  26. typedef struct _SEC_HANDLE_ENTRY {
  27. LIST_ENTRY List ;
  28. SecHandle Handle ;
  29. PVOID Context ;
  30. ULONG HandleCount ;
  31. ULONG RefCount ;
  32. ULONG HandleIssuedCount ; // same as HandleCount, but doesn't go down.
  33. ULONG Flags ;
  34. } SEC_HANDLE_ENTRY, * PSEC_HANDLE_ENTRY ;
  35. #define SEC_HANDLE_FLAG_LOCKED 0x00000001
  36. #define SEC_HANDLE_FLAG_DELETE_PENDING 0x00000002
  37. #define SEC_HANDLE_FLAG_NO_CALLBACK 0x00000004
  38. typedef
  39. BOOL (WINAPI HP_INITIALIZE_FN)(
  40. VOID
  41. );
  42. typedef
  43. PVOID (WINAPI HP_CREATE_FN)(
  44. IN ULONG Flags,
  45. IN PVOID HandleTable OPTIONAL,
  46. IN PHP_ENUM_CALLBACK_FN Callback OPTIONAL
  47. );
  48. #define HANDLE_PACKAGE_NO_SERIALIZE 0x00000001
  49. #define HANDLE_PACKAGE_CALLBACK_ON_DELETE 0x00000002
  50. #define HANDLE_PACKAGE_REQUIRE_UNIQUE 0x00000004
  51. #define HANDLE_PACKAGE_MAX_FLAG 0x00000004
  52. #define HANDLE_PACKAGE_GENERAL_FLAGS 0x00000007
  53. typedef
  54. BOOL (WINAPI HP_DELETE_FN)(
  55. PVOID HandleTable,
  56. PHP_ENUM_CALLBACK_FN Callback
  57. );
  58. typedef
  59. BOOL (WINAPI HP_ADD_HANDLE_FN)(
  60. PVOID HandleTable,
  61. PSecHandle Handle,
  62. PVOID Context,
  63. ULONG Flags
  64. );
  65. typedef
  66. BOOL (WINAPI HP_DELETE_HANDLE_FN)(
  67. PVOID HandleTable,
  68. PSecHandle Handle,
  69. ULONG Options
  70. );
  71. #define DELHANDLE_FORCE 0x00000001
  72. #define DELHANDLE_NO_CALLBACK 0x00000002
  73. typedef
  74. BOOL (WINAPI HP_VALIDATE_HANDLE_FN)(
  75. PVOID HandleTable,
  76. PSecHandle Handle,
  77. BOOL Deref
  78. );
  79. typedef
  80. PVOID (WINAPI HP_REF_HANDLE_FN)(
  81. PVOID HandleTable,
  82. PSecHandle Handle
  83. );
  84. typedef
  85. VOID (WINAPI HP_DEREF_HANDLE_KEY_FN)(
  86. PVOID HandleTable,
  87. PVOID HandleKey
  88. );
  89. typedef
  90. PVOID (WINAPI HP_GET_HANDLE_CONTEXT_FN)(
  91. PVOID HandleTable,
  92. PSecHandle Handle
  93. );
  94. typedef
  95. BOOL (WINAPI HP_RELEASE_CONTEXT_FN)(
  96. PVOID HandleTable,
  97. PSecHandle Handle
  98. );
  99. typedef HP_INITIALIZE_FN * PHP_INITIALIZE_FN;
  100. typedef HP_CREATE_FN * PHP_CREATE_FN ;
  101. typedef HP_DELETE_FN * PHP_DELETE_FN ;
  102. typedef HP_ADD_HANDLE_FN * PHP_ADD_HANDLE_FN ;
  103. typedef HP_DELETE_HANDLE_FN * PHP_DELETE_HANDLE_FN ;
  104. typedef HP_VALIDATE_HANDLE_FN * PHP_VALIDATE_HANDLE_FN ;
  105. typedef HP_REF_HANDLE_FN * PHP_REF_HANDLE_FN ;
  106. typedef HP_DEREF_HANDLE_KEY_FN * PHP_DEREF_HANDLE_KEY_FN ;
  107. typedef HP_GET_HANDLE_CONTEXT_FN * PHP_GET_HANDLE_CONTEXT_FN ;
  108. typedef HP_RELEASE_CONTEXT_FN * PHP_RELEASE_CONTEXT_FN ;
  109. typedef struct _HANDLE_PACKAGE {
  110. ULONG TableSize ;
  111. PHP_INITIALIZE_FN Initialize ;
  112. PHP_CREATE_FN Create ;
  113. PHP_DELETE_FN Delete ;
  114. PHP_ADD_HANDLE_FN AddHandle ;
  115. PHP_DELETE_HANDLE_FN DeleteHandle ;
  116. PHP_VALIDATE_HANDLE_FN ValidateHandle ;
  117. PHP_REF_HANDLE_FN RefHandle ;
  118. PHP_DEREF_HANDLE_KEY_FN DerefHandleKey ;
  119. PHP_GET_HANDLE_CONTEXT_FN GetHandleContext ;
  120. PHP_RELEASE_CONTEXT_FN ReleaseContext ;
  121. } HANDLE_PACKAGE, * PHANDLE_PACKAGE ;
  122. PVOID
  123. LhtConvertSmallToLarge(
  124. PVOID Small
  125. );
  126. extern HANDLE_PACKAGE LargeHandlePackage ;
  127. extern HANDLE_PACKAGE SmallHandlePackage ;
  128. #endif // __HANDLE_HXX__