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.

274 lines
6.8 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1991 - 1999
  3. Module Name:
  4. epmp.idl
  5. Abstract:
  6. This file specifies the interface to the endpoint mapper
  7. Author:
  8. Bharat Shah (barats) 2-11-92
  9. Revision History:
  10. barats 03-13-92 Changed to new spec.
  11. barats 05-10-92 Midl related bugbug removed
  12. mariogo 06-08-94 Changed to full pointers.
  13. mariogo 04-24-96 Added local interface for local runtime
  14. <-> rpcss calls.
  15. gopalp 06-03-97 Added code to cleanup stale EP Mapper entries.
  16. --*/
  17. #ifdef WIN
  18. #define __RPC_FAR __far
  19. #else
  20. #define __RPC_FAR
  21. #endif
  22. //
  23. // EPMP Interface.
  24. //
  25. [
  26. uuid(e1af8308-5d1f-11c9-91a4-08002b14a0fa), version(3.0),
  27. pointer_default(ptr)
  28. ]
  29. interface epmp
  30. {
  31. import "nbase.idl";
  32. import "wtypes.idl";
  33. //
  34. // Well known endpoint mapper constants
  35. //
  36. const unsigned32 ep_max_annotation_size = 64;
  37. const unsigned32 EP_S_CANT_PERFORM_OP = 0x16c9a0cd;
  38. const unsigned32 EP_S_NOT_REGISTERED = 0x16c9a0d6;
  39. //
  40. // User Defind Types
  41. //
  42. typedef unsigned long ulong;
  43. typedef unsigned32 error_status;
  44. typedef [context_handle] void * ept_lookup_handle_t;
  45. typedef [context_handle] void * ept_cleanup_handle_t;
  46. #define ep_max_annotation_size 64
  47. typedef struct _twr_t {
  48. [range(0, 2000)] unsigned32 tower_length;
  49. [size_is(tower_length)]
  50. byte tower_octet_string[];
  51. } twr_t, *twr_p_t;
  52. #ifdef _CLIENT_PASS_
  53. typedef [unique] twr_t *TWR_P_T;
  54. #else
  55. typedef [ptr] twr_t *TWR_P_T;
  56. #endif
  57. typedef struct {
  58. UUID object;
  59. twr_p_t tower;
  60. [string] char annotation[ep_max_annotation_size];
  61. } ept_entry_t;
  62. typedef [ptr] ept_entry_t * ept_entry_p_t;
  63. typedef struct _I_Tower {
  64. TWR_P_T Tower;
  65. } I_Tower;
  66. cpp_quote("//")
  67. cpp_quote("// The maximum size, in bytes, of incoming data for methods in the interface.")
  68. cpp_quote("//")
  69. cpp_quote("// The largest [in] size is for ept_insert if 500 ept_entry_t's are passed but")
  70. cpp_quote("// the funciton is depricated and will fail. Any legitimate call should fit into")
  71. cpp_quote("// several K and we will be generous.")
  72. cpp_quote("//")
  73. cpp_quote("#define epmp_MaxRpcSize (4*1024)")
  74. //
  75. // Interface Exported Methods
  76. //
  77. void
  78. ept_insert(
  79. [in] handle_t hEpMapper,
  80. [in, range(0,500)] unsigned32 num_ents,
  81. [in, size_is(num_ents)] ept_entry_t entries[],
  82. [in] unsigned long replace,
  83. [out] error_status *status
  84. );
  85. void
  86. ept_delete (
  87. [in] handle_t hEpMapper,
  88. [in, range(0,500)] unsigned32 num_ents,
  89. [in, size_is(num_ents)] ept_entry_t entries[],
  90. [out] error_status *status
  91. );
  92. void
  93. ept_lookup (
  94. [in] handle_t hEpMapper,
  95. [in] unsigned32 inquiry_type,
  96. [in, ptr] UUID * object,
  97. [in, ptr] RPC_IF_ID * Ifid,
  98. [in] unsigned32 vers_option,
  99. [in, out] ept_lookup_handle_t *entry_handle,
  100. [in, range(0, 500)] unsigned32 max_ents,
  101. [out] unsigned32 *num_ents,
  102. [out, length_is(*num_ents), size_is(max_ents)] ept_entry_t entries[],
  103. [out] error_status *status
  104. );
  105. void __RPC_FAR
  106. ept_map (
  107. [in] handle_t hEpMapper,
  108. [in, ptr] UUID * obj,
  109. [in, ptr] twr_p_t map_tower,
  110. [in, out] ept_lookup_handle_t *entry_handle,
  111. [in, range(0, 500)] unsigned32 max_towers,
  112. [out] unsigned32 *num_towers,
  113. [out,size_is(max_towers),length_is(*num_towers)] TWR_P_T *ITowers,
  114. [out] error_status *status
  115. );
  116. void
  117. ept_lookup_handle_free (
  118. [in] handle_t h,
  119. [in, out] ept_lookup_handle_t *entry_handle,
  120. [out] error_status *status
  121. );
  122. void
  123. ept_inq_object (
  124. [in] handle_t hEpMapper,
  125. [in] UUID *ept_object,
  126. [out] error_status *status
  127. );
  128. void
  129. ept_mgmt_delete (
  130. [in] handle_t hEpMapper,
  131. [in] boolean32 object_speced,
  132. [in, ptr] UUID * object,
  133. [in, ptr] twr_p_t tower,
  134. [out] error_status *status
  135. );
  136. void __RPC_FAR
  137. ept_map_auth (
  138. [in] handle_t hEpMapper,
  139. [in, ptr] UUID * obj,
  140. [in, ptr] twr_p_t map_tower,
  141. [in, unique] PISID pSID,
  142. [in, out] ept_lookup_handle_t *entry_handle,
  143. [in, range(0, 500)] unsigned32 max_towers,
  144. [out] unsigned32 *num_towers,
  145. [out,size_is(max_towers),length_is(*num_towers)] TWR_P_T *ITowers,
  146. [out] error_status *status
  147. );
  148. } // interface epmp
  149. //
  150. // LOCALEPMP Interface.
  151. //
  152. #if !defined(MAC) && !defined(MPPC)
  153. [
  154. uuid(0b0a6584-9e0f-11cf-a3cf-00805f68cb1b),
  155. version(1.1)
  156. ]
  157. interface localepmp
  158. {
  159. cpp_quote("//")
  160. cpp_quote("// The maximum size, in bytes, of incoming data for methods in the interface.")
  161. cpp_quote("//")
  162. cpp_quote("// The largest [in] size is for ept_insert_ex if 500 ept_entry_t's are passed.")
  163. cpp_quote("// This would require 500*(64+2000+...) > 500K bytes. We would not expect")
  164. cpp_quote("// a legitimate client to send this much. 200K will be enough for at least 100")
  165. cpp_quote("// towers.")
  166. cpp_quote("//")
  167. cpp_quote("#define localepmp_MaxRpcSize (200*1024)")
  168. typedef [context_handle] void *HPROCESS;
  169. //
  170. // Must be called to call the local endpoint mapper at all.
  171. //
  172. error_status_t
  173. OpenEndpointMapper([in] handle_t hServer,
  174. [out] HPROCESS *pProcessHandle);
  175. //
  176. // For machines on networks with port restrictions due to firewalls
  177. // we need to centrally (for a system) manage port allocation.
  178. //
  179. // Regardless of the general policy for the network, applications
  180. // either want a "standard" port which is not available from an
  181. // external network (system services usually) or want a "restricted"
  182. // port because their service needs to be avaiable to both internal
  183. // and external users.
  184. // The endpoint mapper manages ranges of both kinds of ports and
  185. // will return "restricted" (if fRestricted) or "standard" ports
  186. // as required by applications.
  187. // If *pPort is zero then any port maybe used.
  188. //
  189. typedef [v1_enum] enum {
  190. PORT_INTERNET = 1,
  191. PORT_INTRANET,
  192. PORT_DEFAULT
  193. } PORT_TYPE;
  194. error_status_t
  195. AllocateReservedIPPort(
  196. [in] HPROCESS hProcess,
  197. [in] PORT_TYPE DesiredPort,
  198. [out] long *pAllocationStatus,
  199. [out] unsigned short *pPort);
  200. void
  201. ept_insert_ex(
  202. [in] handle_t hEpMapper,
  203. [in, out] ept_cleanup_handle_t *hEpCleanup,
  204. [in, range(0, 500)] unsigned32 num_ents,
  205. [in, size_is(num_ents)] ept_entry_t entries[],
  206. [in] unsigned long replace,
  207. [out] error_status *status
  208. );
  209. void
  210. ept_delete_ex (
  211. [in] handle_t hEpMapper,
  212. [in, out] ept_cleanup_handle_t *hEpCleanup,
  213. [in, range(0, 500)] unsigned32 num_ents,
  214. [in, size_is(num_ents)] ept_entry_t entries[],
  215. [out] error_status *status
  216. );
  217. } // interface localepmp
  218. #endif // !MAC && !MPPC