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.

217 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. ulnamesp.c
  5. Abstract:
  6. This module implements the namespace reservation and registration
  7. support.
  8. Author:
  9. Anish Desai (anishd) 13-May-2002
  10. Revision History:
  11. --*/
  12. //
  13. // Private declaration
  14. //
  15. //
  16. // Scheme and port binding entry
  17. //
  18. typedef struct _UL_PORT_SCHEME_PAIR {
  19. USHORT PortNumber;
  20. BOOLEAN Secure;
  21. LONG RefCount;
  22. } UL_PORT_SCHEME_PAIR, *PUL_PORT_SCHEME_PAIR;
  23. //
  24. // Scheme and port binding table
  25. //
  26. typedef struct _UL_PORT_SCHEME_TABLE {
  27. LONG UsedCount;
  28. LONG AllocatedCount;
  29. UL_PORT_SCHEME_PAIR Table[0];
  30. } UL_PORT_SCHEME_TABLE, *PUL_PORT_SCHEME_TABLE;
  31. //
  32. // Default table size (Make it a power of 2.)
  33. //
  34. #define UL_DEFAULT_PORT_SCHEME_TABLE_SIZE 2
  35. //
  36. // Private functions
  37. //
  38. BOOLEAN
  39. UlpFindPortNumberIndex(
  40. IN USHORT PortNumber,
  41. OUT PLONG pIndex
  42. );
  43. NTSTATUS
  44. UlpBindSchemeToPort(
  45. IN BOOLEAN Secure,
  46. IN USHORT PortNumber
  47. );
  48. NTSTATUS
  49. UlpUnbindSchemeFromPort(
  50. IN BOOLEAN Secure,
  51. IN USHORT PortNumber
  52. );
  53. NTSTATUS
  54. UlpQuerySchemeForPort(
  55. IN USHORT PortNumber,
  56. OUT PBOOLEAN Secure
  57. );
  58. NTSTATUS
  59. UlpUpdateReservationInRegistry(
  60. IN BOOLEAN Add,
  61. IN PHTTP_PARSED_URL pParsedUrl,
  62. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  63. IN ULONG SecurityDescriptorLength
  64. );
  65. NTSTATUS
  66. UlpLogGeneralInitFailure(
  67. IN NTSTATUS LogStatus
  68. );
  69. NTSTATUS
  70. UlpLogSpecificInitFailure(
  71. IN PKEY_VALUE_FULL_INFORMATION pFullInfo,
  72. IN NTSTATUS LogStatus
  73. );
  74. NTSTATUS
  75. UlpValidateUrlSdPair(
  76. IN PKEY_VALUE_FULL_INFORMATION pFullInfo,
  77. OUT PWSTR * ppSanitizedUrl,
  78. OUT PHTTP_PARSED_URL pParsedUrl
  79. );
  80. NTSTATUS
  81. UlpReadReservations(
  82. VOID
  83. );
  84. NTSTATUS
  85. UlpTreeAllocateNamespace(
  86. IN PHTTP_PARSED_URL pParsedUrl,
  87. IN HTTP_URL_OPERATOR_TYPE OperatorType,
  88. IN PACCESS_STATE AccessState,
  89. IN ACCESS_MASK DesiredAccess,
  90. IN KPROCESSOR_MODE RequestorMode,
  91. OUT PUL_CG_URL_TREE_ENTRY *ppEntry
  92. );
  93. NTSTATUS
  94. UlpTreeReserveNamespace(
  95. IN PHTTP_PARSED_URL pParsedUrl,
  96. IN PSECURITY_DESCRIPTOR pUrlSD,
  97. IN PACCESS_STATE AccessState,
  98. IN ACCESS_MASK DesiredAccess,
  99. IN KPROCESSOR_MODE RequestorMode
  100. );
  101. NTSTATUS
  102. UlpReserveUrlNamespace(
  103. IN PHTTP_PARSED_URL pParsedUrl,
  104. IN PSECURITY_DESCRIPTOR pUrlSD,
  105. IN PACCESS_STATE AccessState,
  106. IN ACCESS_MASK DesiredAccess,
  107. IN KPROCESSOR_MODE RequestorMode
  108. );
  109. PUL_DEFERRED_REMOVE_ITEM
  110. UlpAllocateDeferredRemoveItem(
  111. IN PHTTP_PARSED_URL pParsedUrl
  112. );
  113. NTSTATUS
  114. UlpTreeRegisterNamespace(
  115. IN PHTTP_PARSED_URL pParsedUrl,
  116. IN HTTP_URL_CONTEXT UrlContext,
  117. IN PUL_CONFIG_GROUP_OBJECT pConfigObject,
  118. IN PACCESS_STATE AccessState,
  119. IN ACCESS_MASK DesiredAccess,
  120. IN KPROCESSOR_MODE RequestorMode
  121. );
  122. NTSTATUS
  123. UlpRegisterUrlNamespace(
  124. IN PHTTP_PARSED_URL pParsedUrl,
  125. IN HTTP_URL_CONTEXT UrlContext,
  126. IN PUL_CONFIG_GROUP_OBJECT pConfigObject,
  127. IN PACCESS_STATE AccessState,
  128. IN ACCESS_MASK DesiredAccess,
  129. IN KPROCESSOR_MODE RequestorMode
  130. );
  131. NTSTATUS
  132. UlpPrepareSecurityDescriptor(
  133. IN PSECURITY_DESCRIPTOR pInSecurityDescriptor,
  134. IN KPROCESSOR_MODE RequestorMode,
  135. OUT PSECURITY_DESCRIPTOR * ppPreparedSecurityDescriptor,
  136. OUT PSECURITY_DESCRIPTOR * ppCapturedSecurityDescriptor,
  137. OUT PULONG pCapturedSecurityDescriptorLength
  138. );
  139. NTSTATUS
  140. UlpAddReservationEntry(
  141. IN PHTTP_PARSED_URL pParsedUrl,
  142. IN PSECURITY_DESCRIPTOR pUserSecurityDescriptor,
  143. IN ULONG SecurityDescriptorLength,
  144. IN PACCESS_STATE AccessState,
  145. IN ACCESS_MASK AccessMask,
  146. IN KPROCESSOR_MODE RequestorMode,
  147. IN BOOLEAN bPersist
  148. );
  149. NTSTATUS
  150. UlpDeleteReservationEntry(
  151. IN PHTTP_PARSED_URL pParsedUrl,
  152. IN PACCESS_STATE AccessState,
  153. IN ACCESS_MASK AccessMask,
  154. IN KPROCESSOR_MODE RequestorMode
  155. );
  156. NTSTATUS
  157. UlpNamespaceAccessCheck(
  158. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  159. IN PACCESS_STATE AccessState OPTIONAL,
  160. IN ACCESS_MASK DesiredAccess OPTIONAL,
  161. IN KPROCESSOR_MODE RequestorMode OPTIONAL,
  162. IN PCWSTR pObjectName OPTIONAL
  163. );
  164. //
  165. // Public functions
  166. //
  167. NTSTATUS
  168. UlInitializeNamespace(
  169. VOID
  170. );
  171. VOID
  172. UlTerminateNamespace(
  173. VOID
  174. );