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.

307 lines
6.9 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. //
  33. // Well known endpoint mapper constants
  34. //
  35. const unsigned32 ep_max_annotation_size = 64;
  36. const unsigned32 EP_S_SUCCESS = 0x00000000;
  37. const unsigned32 EP_S_CANT_PERFORM_OP = 0x16c9a0cd;
  38. const unsigned32 EP_S_DATABASE_INVALID = 0x16c9a0cf;
  39. const unsigned32 EP_S_CANT_CREATE = 0x16c9a0d0;
  40. const unsigned32 EP_S_CANT_ACCESS = 0x16c9a0d1;
  41. const unsigned32 EP_S_BAD_ENTRY = 0x16c9a0d3;
  42. const unsigned32 EP_S_UPDATA_FAILED = 0x16c9a0d4;
  43. const unsigned32 EP_S_NOT_REGISTERED = 0x16c9a0d6;
  44. const unsigned32 EP_S_SERVER_UNAVAILABLE = 0x16c9a0d7;
  45. //
  46. // User Defind Types
  47. //
  48. typedef unsigned long ulong;
  49. typedef unsigned32 error_status;
  50. typedef [context_handle] void * ept_lookup_handle_t;
  51. typedef [context_handle] void * ept_cleanup_handle_t;
  52. #define ep_max_annotation_size 64
  53. typedef struct _twr_t {
  54. unsigned32 tower_length;
  55. [size_is(tower_length)]
  56. byte tower_octet_string[];
  57. } twr_t, *twr_p_t;
  58. #ifdef _CLIENT_PASS_
  59. typedef [unique] twr_t *TWR_P_T;
  60. #else
  61. typedef [ptr] twr_t *TWR_P_T;
  62. #endif
  63. typedef struct {
  64. UUID object;
  65. twr_p_t tower;
  66. [string] char annotation[ep_max_annotation_size];
  67. } ept_entry_t;
  68. typedef [ptr] ept_entry_t * ept_entry_p_t;
  69. typedef struct _I_Tower {
  70. TWR_P_T Tower;
  71. } I_Tower;
  72. //
  73. // Interface Exported Methods
  74. //
  75. void
  76. ept_insert(
  77. [in] handle_t hEpMapper,
  78. [in] unsigned32 num_ents,
  79. [in, size_is(num_ents)] ept_entry_t entries[],
  80. [in] unsigned long replace,
  81. [out] error_status *status
  82. );
  83. void
  84. ept_delete (
  85. [in] handle_t hEpMapper,
  86. [in] unsigned32 num_ents,
  87. [in, size_is(num_ents)] ept_entry_t entries[],
  88. [out] error_status *status
  89. );
  90. void
  91. ept_lookup (
  92. [in] handle_t hEpMapper,
  93. [in] unsigned32 inquiry_type,
  94. [in, ptr] UUID * object,
  95. [in, ptr] RPC_IF_ID * Ifid,
  96. [in] unsigned32 vers_option,
  97. [in, out] ept_lookup_handle_t *entry_handle,
  98. [in] unsigned32 max_ents,
  99. [out] unsigned32 *num_ents,
  100. [out, length_is(*num_ents), size_is(max_ents)] ept_entry_t entries[],
  101. [out] error_status *status
  102. );
  103. #ifdef _CLIENT_PASS_
  104. void __RPC_FAR
  105. ept_map (
  106. [in] handle_t hEpMapper,
  107. [in, ptr] UUID * obj,
  108. [in, ptr] twr_p_t map_tower,
  109. [in, out] ept_lookup_handle_t *entry_handle,
  110. [in] unsigned32 max_towers,
  111. [out] unsigned32 *num_towers,
  112. [out,size_is(max_towers),length_is(*num_towers)] TWR_P_T *ITowers,
  113. [out] error_status *status
  114. );
  115. #elif _SERVER_PASS_
  116. void __RPC_FAR
  117. ept_map (
  118. [in] handle_t hEpMapper,
  119. [in, ptr] UUID * obj,
  120. [in, ptr] twr_p_t map_tower,
  121. [in, out] ept_lookup_handle_t *entry_handle,
  122. [in] unsigned32 max_towers,
  123. [out] unsigned32 *num_towers,
  124. [out,size_is(max_towers),length_is(*num_towers)] TWR_P_T *ITowers,
  125. [out] error_status *status
  126. );
  127. #else
  128. #error must define either _CLIENT_PASS_ or _SERVER_PASS_ (for Win95 and NT 3.1 compatibility)
  129. #endif
  130. void
  131. ept_lookup_handle_free (
  132. [in] handle_t h,
  133. [in, out] ept_lookup_handle_t *entry_handle,
  134. [out] error_status *status
  135. );
  136. void
  137. ept_inq_object (
  138. [in] handle_t hEpMapper,
  139. [in] UUID *ept_object,
  140. [out] error_status *status
  141. );
  142. void
  143. ept_mgmt_delete (
  144. [in] handle_t hEpMapper,
  145. [in] boolean32 object_speced,
  146. [in, ptr] UUID * object,
  147. [in, ptr] twr_p_t tower,
  148. [out] error_status *status
  149. );
  150. } // interface epmp
  151. //
  152. // LOCALEPMP Interface.
  153. //
  154. #if !defined(MAC) && !defined(MPPC)
  155. [
  156. uuid(0b0a6584-9e0f-11cf-a3cf-00805f68cb1b),
  157. version(1.1)
  158. ]
  159. interface localepmp
  160. {
  161. typedef [context_handle] void *HPROCESS;
  162. //
  163. // Must be called to call the local endpoint mapper at all.
  164. //
  165. error_status_t
  166. OpenEndpointMapper([in] handle_t hServer,
  167. [out] HPROCESS *pProcessHandle);
  168. //
  169. // For machines on networks with port restrictions due to firewalls
  170. // we need to centrally (for a system) manage port allocation.
  171. //
  172. // Regardless of the general policy for the network, applications
  173. // either want a "standard" port which is not available from an
  174. // external network (system services usually) or want a "restricted"
  175. // port because their service needs to be avaiable to both internal
  176. // and external users.
  177. // The endpoint mapper manages ranges of both kinds of ports and
  178. // will return "restricted" (if fRestricted) or "standard" ports
  179. // as required by applications.
  180. // If *pPort is zero then any port maybe used.
  181. //
  182. typedef [v1_enum] enum {
  183. PORT_INTERNET = 1,
  184. PORT_INTRANET,
  185. PORT_DEFAULT
  186. } PORT_TYPE;
  187. error_status_t
  188. AllocateReservedIPPort(
  189. [in] HPROCESS hProcess,
  190. [in] PORT_TYPE DesiredPort,
  191. [out] long *pAllocationStatus,
  192. [out] unsigned short *pPort);
  193. void
  194. ept_insert_ex(
  195. [in] handle_t hEpMapper,
  196. [in, out] ept_cleanup_handle_t *hEpCleanup,
  197. [in] unsigned32 num_ents,
  198. [in, size_is(num_ents)] ept_entry_t entries[],
  199. [in] unsigned long replace,
  200. [out] error_status *status
  201. );
  202. void
  203. ept_delete_ex (
  204. [in] handle_t hEpMapper,
  205. [in, out] ept_cleanup_handle_t *hEpCleanup,
  206. [in] unsigned32 num_ents,
  207. [in, size_is(num_ents)] ept_entry_t entries[],
  208. [out] error_status *status
  209. );
  210. #if 0
  211. //
  212. // We only allocate local processes to register and delete
  213. // bindings from the endpoint mapper. The remote version
  214. // always fails with access denided.
  215. //
  216. // The context handle parameter is used to allow the endpoint
  217. // mapper to cleanup entries in the endpoint mapper database
  218. // when a process dies.
  219. //
  220. void
  221. ept_insert(
  222. [in] handle_t hServer,
  223. [in] HPROCESS hProcess,
  224. [in] unsigned32 num_ents,
  225. [in, size_is(num_ents)] ept_entry_t entries[],
  226. [in] unsigned long replace,
  227. [out] error_status *status
  228. );
  229. void
  230. ept_delete (
  231. [in] handle_t hServer,
  232. [in] HPROCESS hProcess,
  233. [in] unsigned32 num_ents,
  234. [in, size_is(num_ents)] ept_entry_t entries[],
  235. [out] error_status *status
  236. );
  237. #endif
  238. } // interface localepmp
  239. #endif // !MAC && !MPPC