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.

742 lines
24 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. net\routing\ipx\sap\serverdb.h
  5. Abstract:
  6. This is a header file for SAP Server Table management API
  7. Author:
  8. Vadim Eydelman 05-15-1995
  9. Revision History:
  10. --*/
  11. #ifndef _SAP_SERVERDB_
  12. #define _SAP_SERVERDB_
  13. #define SDB_NAME_HASH_SIZE 257
  14. // Max number of unsorted servers
  15. extern ULONG SDBMaxUnsortedServers;
  16. // Interval with which to update the sorted list
  17. extern ULONG SDBSortLatency;
  18. // Size of heap reserved for the database
  19. extern ULONG SDBMaxHeapSize;
  20. #define SDB_SERVER_NODE_SIGNATURE 'NS'
  21. #define SDB_ENUMERATOR_NODE_SIGNATURE 'NE'
  22. #define VALIDATE_NODE(node) \
  23. ASSERTMSG ("Server database corrupted ", \
  24. IsEnumerator(node) \
  25. ? (((PENUMERATOR_NODE)(node))->EN_Signature==SDB_ENUMERATOR_NODE_SIGNATURE)\
  26. : (node->SN_Signature==SDB_SERVER_NODE_SIGNATURE)\
  27. )
  28. #define VALIDATE_SERVER_NODE(node) \
  29. ASSERTMSG ("Server database corrupted ", \
  30. node->SN_Signature==SDB_SERVER_NODE_SIGNATURE)
  31. #define VALIDATE_ENUMERATOR_NODE(node) \
  32. ASSERTMSG ("Server database corrupted ", \
  33. ((PENUMERATOR_NODE)(node))->EN_Signature==SDB_ENUMERATOR_NODE_SIGNATURE)
  34. // Max entries to keep for each server (this limit does not include
  35. // entries that must be kept for correct iplementation of split-horizon
  36. // algorithm on looped networks)
  37. #define SDB_MAX_NODES_PER_SERVER 1
  38. // Max time in msec we allow enumerators to keep the list locked
  39. #define SDB_MAX_LOCK_HOLDING_TIME 1000
  40. #define SDB_INVALID_OBJECT_ID 0xFFFFFFFF
  41. #define SDB_OBJECT_ID_MASK 0x0FFFFFFF
  42. // Object IDs are subdivided onto 4 zones in the order of ULONG numbers
  43. // When assigning new IDs we make sure that zone in front of the one
  44. // from which new IDs get assigned is not used by invalidating object
  45. // IDs that belong to that zone
  46. #define SDB_OBJECT_ID_ZONE_MASK 0x0C000000
  47. #define SDB_OBJECT_ID_ZONE_UNIT 0x04000000
  48. #define IsSameObjectIDZone(id1,id2) \
  49. ((id1&SDB_OBJECT_ID_ZONE_MASK)==(id2&SDB_OBJECT_ID_ZONE_MASK))
  50. // Server entry links that can be used for enumeration/searching
  51. #define SDB_HASH_TABLE_LINK 0
  52. // Entry can only be in one of the sorted lists (temporary
  53. // or permanent), so we'll use the same link for both
  54. #define SDB_SORTED_LIST_LINK 1
  55. #define SDB_CHANGE_QUEUE_LINK 2
  56. #define SDB_INTF_LIST_LINK 3
  57. #define SDB_TYPE_LIST_LINK 4
  58. #define SDB_NUM_OF_LINKS 5
  59. #define SDB_ENUMERATOR_FLAG 0x00000001
  60. #define SDB_MAIN_NODE_FLAG 0x00000002
  61. #define SDB_SORTED_NODE_FLAG 0x00000004
  62. #define SDB_DISABLED_NODE_FLAG 0x00000008
  63. #define SDB_DONT_RESPOND_NODE_FLAG 0x00000010
  64. #define SDB_ENUMERATION_NODE SDB_ENUMERATOR_FLAG
  65. #define SDB_SERVER_NODE 0
  66. #define IsEnumerator(node) ((node)->N_NodeFlags&SDB_ENUMERATOR_FLAG)
  67. #define IsMainNode(node) ((node)->N_NodeFlags&SDB_MAIN_NODE_FLAG)
  68. #define IsSortedNode(node) ((node)->N_NodeFlags&SDB_SORTED_NODE_FLAG)
  69. #define IsDisabledNode(node) ((node)->N_NodeFlags&SDB_DISABLED_NODE_FLAG)
  70. #define IsNoResponseNode(node) ((node)->N_NodeFlags&SDB_DONT_RESPOND_NODE_FLAG)
  71. #define SetMainNode(node) (node)->N_NodeFlags |= SDB_MAIN_NODE_FLAG
  72. #define SetSortedNode(node) (node)->N_NodeFlags |= SDB_SORTED_NODE_FLAG
  73. #define SetDisabledNode(node) (node)->N_NodeFlags |= SDB_DISABLED_NODE_FLAG
  74. #define SetNoResponseNode(node) ((node)->N_NodeFlags |= SDB_DONT_RESPOND_NODE_FLAG)
  75. #define ResetMainNode(node) (node)->N_NodeFlags &= ~SDB_MAIN_NODE_FLAG
  76. #define ResetSortedNode(node) (node)->N_NodeFlags &= ~SDB_SORTED_NODE_FLAG
  77. #define ResetDisabledNode(node) (node)->N_NodeFlags &= ~SDB_DISABLED_NODE_FLAG
  78. #define ResetNoResponseNode(node) ((node)->N_NodeFlags &= ~SDB_DONT_RESPOND_NODE_FLAG)
  79. // Each hash list carries number to be used for generation of Object ID
  80. typedef struct _SDB_HASH_LIST {
  81. PROTECTED_LIST HL_List; // List itself
  82. ULONG HL_ObjectID; // Last used object ID
  83. } SDB_HASH_LIST, *PSDB_HASH_LIST;
  84. // Both regular server entries and nodes used for enumeration have same
  85. // header
  86. #define NODE_HEADER \
  87. INT N_NodeFlags; \
  88. LIST_ENTRY N_Links[SDB_NUM_OF_LINKS]
  89. // Node of the service table
  90. typedef struct _SERVER_NODE {
  91. NODE_HEADER;
  92. LIST_ENTRY SN_ServerLink; // Head of/link in the list of entries
  93. // with same name and type (this list
  94. // is ordered by hop count)
  95. LIST_ENTRY SN_TimerLink; // Link in timer queue
  96. ULONG SN_ObjectID; // Unique ID
  97. PSDB_HASH_LIST SN_HashList; // Which hash list we belong to
  98. ULONG SN_ExpirationTime; // Time when this node should be
  99. // aged out
  100. ULONG SN_InterfaceIndex;
  101. DWORD SN_Protocol;
  102. UCHAR SN_AdvertisingNode[6];
  103. USHORT SN_Signature; // SN
  104. IPX_SERVER_ENTRY_P SN_Server;
  105. } SERVER_NODE, *PSERVER_NODE;
  106. #define SN_Type SN_Server.Type
  107. #define SN_Name SN_Server.Name
  108. #define SN_HopCount SN_Server.HopCount
  109. #define SN_Net SN_Server.Network
  110. #define SN_Node SN_Server.Node
  111. #define SN_Socket SN_Server.Node
  112. // Node used for enumerations
  113. typedef struct _ENUMERATOR_NODE {
  114. NODE_HEADER;
  115. INT EN_LinkIdx; // Index of the list we use
  116. PPROTECTED_LIST EN_ListLock; // Pointer to lock of that list
  117. PLIST_ENTRY EN_ListHead; // Head of the list we are
  118. // enumerating through
  119. INT EN_Flags; // Enumeration flags
  120. ULONG EN_InterfaceIndex;// InterfaceIndex to be enumerated
  121. // (INVALID_INTERFACE_INDEX
  122. // - all interfaces)
  123. ULONG EN_Protocol; // Protocol to be enumerated
  124. // (0xFFFFFFFF - all protocols)
  125. USHORT EN_Signature; // 'EN'
  126. USHORT EN_Type; // Type of servers to be enumerated
  127. // (0xFFFF - all types)
  128. UCHAR EN_Name[48]; // Name of servers to be enumerated
  129. // ("\0" - all names)
  130. } ENUMERATOR_NODE, *PENUMERATOR_NODE;
  131. // Node of type list
  132. typedef struct _TYPE_NODE {
  133. LIST_ENTRY TN_Link; // Link in type list
  134. LIST_ENTRY TN_Head; // Head of server list
  135. // attached to this node
  136. USHORT TN_Type; // Type of servers in the
  137. // attached list
  138. } TYPE_NODE, *PTYPE_NODE;
  139. // Node of interface list
  140. typedef struct _INTF_NODE {
  141. LIST_ENTRY IN_Link; // Link in interface list
  142. LIST_ENTRY IN_Head; // Head of server list
  143. // attached to this node
  144. ULONG IN_InterfaceIndex; // InterfaceIndex of
  145. // servers in the attached list
  146. } INTF_NODE, *PINTF_NODE;
  147. // Data cobined in server table
  148. typedef struct _SERVER_TABLE {
  149. HGLOBAL ST_Heap; // Heap from which to allocate
  150. // server nodes
  151. HANDLE ST_UpdateTimer; // Update timer (signalled when
  152. // sorted list needs to be
  153. // updated
  154. HANDLE ST_ExpirationTimer; // Expiration timer (signalled
  155. // when expiration queue
  156. // requires processing
  157. LONG ST_UpdatePending; //
  158. ULONG ST_ServerCnt; // Total number of services
  159. ULONG ST_StaticServerCnt; // Total number of static services
  160. HANDLE ST_LastEnumerator;
  161. // ULONG ST_ChangeEnumCnt; // Number of enumerators
  162. // in the changed services queue
  163. // (nodes marked for deletion are
  164. // retainted in this queue until
  165. // all enumerators have seen it)
  166. ULONG ST_TMPListCnt; // Number of entries in temporary
  167. // sorted list
  168. ULONG ST_DeletedListCnt; //
  169. PROTECTED_LIST ST_ExpirationQueue; // Timer queue in expiration order
  170. PROTECTED_LIST ST_ChangedSvrsQueue;// Queue of changed services (most
  171. // recently changed first order)
  172. PROTECTED_LIST ST_TypeList; // Type list
  173. PROTECTED_LIST ST_IntfList; // Interface list
  174. PROTECTED_LIST ST_SortedListPRM; // Permanent type.name.intf.prot
  175. // sorted list
  176. PROTECTED_LIST ST_SortedListTMP; // Temporary type.name.intf.prot
  177. // sorted list
  178. PROTECTED_LIST ST_DeletedList; // List of entries to be deleted
  179. // from the table
  180. SDB_HASH_LIST ST_HashLists[SDB_NAME_HASH_SIZE]; // Hash lists
  181. // (entries are in type.name.intf.prot order)
  182. SYNC_OBJECT_POOL ST_SyncPool; // Pool of synchronization objects
  183. } SERVER_TABLE, *PSERVER_TABLE;
  184. extern SERVER_TABLE ServerTable;
  185. #define AcquireServerTableList(list,wait) \
  186. AcquireProtectedList(&ServerTable.ST_SyncPool,list,wait)
  187. #define ReleaseServerTableList(list) \
  188. ReleaseProtectedList(&ServerTable.ST_SyncPool,list)
  189. /*++
  190. *******************************************************************
  191. C r e a t e S e r v e r T a b l e
  192. Routine Description:
  193. Allocates resources for server table management
  194. Arguments:
  195. UpdateObject - this object will be signalled when 'slow'
  196. sorted list of servers needs to be updated
  197. (UpdateSortedList should be called)
  198. TimerObject - this object will be signalled when server expiration
  199. queue requires processing (ProcessExpirationQueue should
  200. be called)
  201. Return Value:
  202. NO_ERROR - resources were allocated successfully
  203. other - reason of failure (windows error code)
  204. *******************************************************************
  205. --*/
  206. DWORD
  207. CreateServerTable (
  208. HANDLE *UpdateObject,
  209. HANDLE *TimerObject
  210. );
  211. /*++
  212. *******************************************************************
  213. D e l e t e S e r v e r T a b l e
  214. Routine Description:
  215. Dispose of server table and associated resources
  216. Arguments:
  217. Return Value:
  218. NO_ERROR - resources were disposed of successfully
  219. other - reason of failure (windows error code)
  220. *******************************************************************
  221. --*/
  222. void
  223. DeleteServerTable (
  224. );
  225. /*++
  226. *******************************************************************
  227. U p d a t e S e r v e r
  228. Routine Description:
  229. Update server in the table (If entry for server does not exist and
  230. hop count parameter is less than 16, it is added to the table, if entry
  231. for the server exists and hop count parameter is 16, server is marked
  232. for deletion, otherwise server info is updated).
  233. Sorted list of servers is not updated immediately
  234. if new server is added or deleted
  235. Arguments:
  236. Server - server parameters (as it comes from IPX packet)
  237. InterfaceIndex - interface through which knowledge of server was obtained
  238. Protocol - protocol used to obtain server info
  239. TimeToLive - time in sec before server is aged out (INFINITE for no aging)
  240. AdvertisingNode - node that from which this server info was received
  241. NewServer - set to TRUE if server was not in the table
  242. Return Value:
  243. NO_ERROR - server was added/updated ok
  244. other - reason of failure (windows error code)
  245. *******************************************************************
  246. --*/
  247. DWORD
  248. UpdateServer (
  249. IN PIPX_SERVER_ENTRY_P Server,
  250. IN ULONG InterfaceIndex,
  251. IN DWORD Protocol,
  252. IN ULONG TimeToLive,
  253. IN PUCHAR AdvertisingNode,
  254. IN INT Flags,
  255. OUT BOOL *NewServer OPTIONAL
  256. );
  257. /*++
  258. *******************************************************************
  259. U p d a t e S o r t e d L i s t
  260. Routine Description:
  261. Schedules work item to update sorted list.
  262. Should be called whenever UpdateObject is signalled
  263. Arguments:
  264. None
  265. Return Value:
  266. None
  267. *******************************************************************
  268. --*/
  269. VOID
  270. UpdateSortedList (
  271. void
  272. );
  273. /*++
  274. *******************************************************************
  275. P r o c e s s E x p i r a t i o n Q u e u e
  276. Routine Description:
  277. Deletes expired servers from the table and set timer object to
  278. be signalled when next item in expiration queue is due
  279. Arguments:
  280. None
  281. Return Value:
  282. None
  283. *******************************************************************
  284. --*/
  285. VOID
  286. ProcessExpirationQueue (
  287. void
  288. );
  289. /*++
  290. *******************************************************************
  291. Q u e r y S e r v e r
  292. Routine Description:
  293. Checks if server with given type and name exists in the table
  294. Returns TRUE if it does and fills out requested server info
  295. with data of the best entry for the server
  296. Arguments:
  297. Type - server type
  298. Name - server name
  299. Server - buffer in which to put server info
  300. InterfaceIndex - buffer in which to put server interface index
  301. Protocol - buffer in which to put server protocol
  302. ObjectID - buffer in which to put server object id (number that uniquely
  303. identifies server (the whole set of entries, not just the best
  304. one) in the table; it is valid for very long but FINITE period
  305. of time)
  306. Return Value:
  307. TRUE - server was found
  308. FALSE - server was not found or operation failed (call GetLastError()
  309. to find out the reason for failure if any)
  310. *******************************************************************
  311. --*/
  312. BOOL
  313. QueryServer (
  314. IN USHORT Type,
  315. IN PUCHAR Name,
  316. OUT PIPX_SERVER_ENTRY_P Server OPTIONAL,
  317. OUT PULONG InterfaceIndex OPTIONAL,
  318. OUT PULONG Protocol OPTIONAL,
  319. OUT PULONG ObjectID OPTIONAL
  320. );
  321. /*++
  322. *******************************************************************
  323. G e t S e r v e r F r o m I D
  324. Routine Description:
  325. Returns info for server with specified ID
  326. Arguments:
  327. ObjectID - server object id (number that uniquely
  328. identifies server in the table, it is valid for very long
  329. but FINITE amount of time)
  330. Server - buffer in which to put server info
  331. InterfaceIndex - buffer in which to put server interface index
  332. Protocol - buffer in which to put server protocol
  333. Return Value:
  334. TRUE - server was found
  335. FALSE - server was not found or operation failed (call GetLastError()
  336. to find out the reason for failure if any)
  337. *******************************************************************
  338. --*/
  339. BOOL
  340. GetServerFromID (
  341. IN ULONG ObjectID,
  342. OUT PIPX_SERVER_ENTRY_P Server OPTIONAL,
  343. OUT PULONG InterfaceIndex OPTIONAL,
  344. OUT PULONG Protocol OPTIONAL
  345. );
  346. /*++
  347. *******************************************************************
  348. G e t N e x t S e r v e r F r o m I D
  349. Routine Description:
  350. Find and return service that follows server with specified ID
  351. in the type.name order.
  352. Arguments:
  353. ObjectID - on input: id of server form which to start the search
  354. on output: id of returned server
  355. Type - if not 0xFFFF, search should be limited to only servers
  356. of specified type
  357. Server, Protocol, InterfaceIndex - buffer to put returned server info in
  358. Return Value:
  359. TRUE - server was found
  360. FALSE - search failed
  361. *******************************************************************
  362. --*/
  363. BOOL
  364. GetNextServerFromID (
  365. IN OUT PULONG ObjectID,
  366. IN USHORT Type,
  367. OUT PIPX_SERVER_ENTRY_P Server,
  368. OUT PULONG InterfaceIndex OPTIONAL,
  369. OUT PULONG Protocol OPTIONAL
  370. );
  371. /*++
  372. *******************************************************************
  373. C r e a t e L i s t E n u m e r a t o r
  374. Routine Description:
  375. Creates enumerator node that allows scanning through the server
  376. table lists
  377. Arguments:
  378. ListIdx - index of list through which to scan (currently supported lists
  379. are: hash lists, interface lists, type lists,
  380. changed servers queue
  381. Type - limits enumeration to servers of specific type and
  382. indentifies a particular type list if index is SDB_TYPE_LIST_IDX
  383. (use 0xFFFF to return all server and/or to go through all
  384. type lists)
  385. Name - limits enumeration to servers with certain name if present
  386. InterfaceIndex - limits enumeration to servers of specific interface and
  387. indentifies a particular interface list if index
  388. is SDB_INTF_LIST_IDX (use INVALID_INTERFACE_INDEX to return all
  389. server and/or to go through all interface lists)
  390. Protocol - limits enumeration to servers of certain protocol (0xFFFFFFFF
  391. - all protocols)
  392. Flags - identifies additional conditions on entries enumerated:
  393. SDB_MAIN_NODE_FLAG - only best servers
  394. SDB_DISABLED_NODE_FLAG - include disabled servers
  395. Return Value:
  396. Handle that represents the enumeration node
  397. NULL if specified list does not exist or operation failed
  398. (call GetLastError () for the reason of failure if any)
  399. *******************************************************************
  400. --*/
  401. HANDLE
  402. CreateListEnumerator (
  403. IN INT ListIdx,
  404. IN USHORT Type,
  405. IN PUCHAR Name OPTIONAL,
  406. IN ULONG InterfaceIndex,
  407. IN ULONG Protocol,
  408. IN INT Flags
  409. );
  410. /*++
  411. *******************************************************************
  412. E n u m e r a t i o n C a l l b a c k P r o c
  413. Routine Description:
  414. Provided as a parameter to EnumerateServers call.
  415. Gets call with all entries in the enumerated list.
  416. If there is more than one entry for the server, the callback
  417. will get them in the order of decreasing hop count (the best entry
  418. will show up last)
  419. Arguments:
  420. CBParam - parameter specified in call to EnumerateServers,
  421. Server, InterfaceIndex, Protocol, AdvertisingNode - server data
  422. Flags - flags associated with the node
  423. Return Value:
  424. TRUE - stop enumeration
  425. FALSE - continue
  426. *******************************************************************
  427. --*/
  428. typedef
  429. BOOL
  430. (* EnumerateServersCallBack) (
  431. IN LPVOID CBParam,
  432. IN OUT PIPX_SERVER_ENTRY_P Server,
  433. IN ULONG InterfaceIndex,
  434. IN ULONG Protocol,
  435. IN PUCHAR AdvertisingNode,
  436. IN INT Flags
  437. );
  438. /*++
  439. *******************************************************************
  440. D e l e t e A l l S e r v e r s C B
  441. Routine Description:
  442. Callback proc for EnumerateServers that deletes all server
  443. entries with which it is called
  444. Arguments:
  445. CBParam - enumeration handle that identifies enumeration
  446. Server - pointer to server data inside server node from which node
  447. itself is computed
  448. Return Value:
  449. FALSE - deletion succeded, continue
  450. TRUE - failure to lock SDB list, stop enumeration and return FALSE
  451. to client (error code is set in this routine)
  452. *******************************************************************
  453. --*/
  454. BOOL
  455. DeleteAllServersCB (
  456. IN LPVOID CBParam,
  457. IN OUT PIPX_SERVER_ENTRY_P Server,
  458. IN ULONG InterfaceIndex,
  459. IN ULONG Protocol,
  460. IN PUCHAR AdvertisingNode,
  461. IN INT Flags
  462. );
  463. BOOL
  464. DeleteNonLocalServersCB (
  465. IN LPVOID CBParam,
  466. IN PIPX_SERVER_ENTRY_P Server,
  467. IN ULONG InterfaceIndex,
  468. IN ULONG Protocol,
  469. IN PUCHAR AdvertisingNode,
  470. IN INT Flags
  471. );
  472. /*++
  473. *******************************************************************
  474. G e t O n e C B
  475. Routine Description:
  476. Callback proc for EnumerateServers.
  477. Copies the first entry with which it is called and stops enumeration
  478. by returning TRUE
  479. Arguments:
  480. CBParam - pointer to buffer to which to copy service info
  481. Server, InterfaceIndex, Protocol, AdvertisingNode - service data
  482. MainEntry - ignored
  483. Return Value:
  484. TRUE
  485. *******************************************************************
  486. --*/
  487. BOOL
  488. GetOneCB (
  489. IN LPVOID CBParam,
  490. IN OUT PIPX_SERVER_ENTRY_P Server,
  491. IN ULONG InterfaceIndex,
  492. IN ULONG Protocol,
  493. IN PUCHAR AdvertisingNode,
  494. IN INT Flags
  495. );
  496. /*++
  497. *******************************************************************
  498. C o n v e r t T o S t a t i c C B
  499. Routine Description:
  500. Callback proc for EnumerateServers that converts all server
  501. entries with which it is called to static (changes protocol field to
  502. static)
  503. Arguments:
  504. CBParam - enumeration handle that identifies enumeration
  505. Server - pointer to server data inside server node from which node
  506. itself is computed
  507. Return Value:
  508. FALSE
  509. *******************************************************************
  510. --*/
  511. BOOL
  512. ConvertToStaticCB (
  513. IN LPVOID CBParam,
  514. IN PIPX_SERVER_ENTRY_P Server,
  515. IN ULONG InterfaceIndex,
  516. IN ULONG Protocol,
  517. IN PUCHAR AdvertisingNode,
  518. IN INT Flags
  519. );
  520. BOOL
  521. EnableAllServersCB (
  522. IN LPVOID CBParam,
  523. IN PIPX_SERVER_ENTRY_P Server,
  524. IN ULONG InterfaceIndex,
  525. IN ULONG Protocol,
  526. IN PUCHAR AdvertisingNode,
  527. IN INT Flags
  528. );
  529. BOOL
  530. DisableAllServersCB (
  531. IN LPVOID CBParam,
  532. IN PIPX_SERVER_ENTRY_P Server,
  533. IN ULONG InterfaceIndex,
  534. IN ULONG Protocol,
  535. IN PUCHAR AdvertisingNode,
  536. IN INT Flags
  537. );
  538. /*++
  539. *******************************************************************
  540. E n u m e r a t e S e r v e r s
  541. Routine Description:
  542. Calls callback routine consequtively for servers in the enumerated
  543. list until told to stop by the callback or end of list is reached
  544. Arguments:
  545. Enumerator - handle obtained from CreateListEnumerator
  546. CallBackProc - function to call for each server in the list
  547. CBParam - extra parameter to pass to callback function
  548. Return Value:
  549. TRUE - if stopped by the callback
  550. FALSE - if end of list is reached or operation failed (call GetLastError ()
  551. to find out the reason of failure)
  552. *******************************************************************
  553. --*/
  554. BOOLEAN
  555. EnumerateServers (
  556. IN HANDLE Enumerator, // Existing enumerator
  557. IN EnumerateServersCallBack CallBackProc,// Callback proc
  558. IN LPVOID CBParam // Parameter to pass to callback
  559. );
  560. /*++
  561. *******************************************************************
  562. D e l e t e L i s t E n u m e r a t o r
  563. Routine Description:
  564. Releases resources associated with list enumerator (this includes
  565. server entries that are queued to change queue before being deleted)
  566. Arguments:
  567. Enumerator - handle obtained from CreateListEnumerator
  568. Return Value:
  569. None
  570. *******************************************************************
  571. --*/
  572. void
  573. DeleteListEnumerator (
  574. IN HANDLE Enumerator
  575. );
  576. /*++
  577. *******************************************************************
  578. G e t F i r s t S e r v e r
  579. Routine Description:
  580. Find and return first service in the order specified by the ordering method.
  581. Search is limited only to certain types of services as specified by the
  582. exclusion flags end corresponding fields in Server parameter.
  583. Returns IPX_ERROR_NO_MORE_ITEMS if there are no services in the
  584. table that meet specified criteria.
  585. Arguments:
  586. OrderingMethod - which ordering to consider in determining what is
  587. the first server
  588. ExclusionFlags - flags to limit search to certain servers according
  589. to specified criteria
  590. Server - On input: criteria for exclusion flags
  591. On output: first service entry in the specified order
  592. Return Value:
  593. NO_ERROR - server was found that meets specified criteria
  594. IPX_ERROR_NO_MORE_ITEMS - no server exist with specified criteria
  595. other - operation failed (windows error code)
  596. *******************************************************************
  597. --*/
  598. DWORD
  599. GetFirstServer (
  600. IN DWORD OrderingMethod,
  601. IN DWORD ExclusionFlags,
  602. IN OUT PIPX_SERVER_ENTRY_P Server,
  603. IN OUT ULONG *InterfaceInex,
  604. IN OUT ULONG *Protocol
  605. );
  606. /*++
  607. *******************************************************************
  608. G e t N e x t S e r v e r
  609. Routine Description:
  610. Find and return next service in the order specified by the ordering method.
  611. Search starts from specified service and is limited only to certain types
  612. of services as specified by the exclusion flags and corresponding fields
  613. in Server parameter.
  614. Arguments:
  615. OrderingMethod - which ordering to consider in determining what is
  616. the first server
  617. ExclusionFlags - flags to limit search to certain servers according
  618. to fields of Server
  619. Server - On input server entry from which to compute the next
  620. On output: first service entry in the specified order
  621. Return Value:
  622. NO_ERROR - server was found that meets specified criteria
  623. IPX_ERROR_NO_MORE_ITEMS - no server exist with specified criteria
  624. other - operation failed (windows error code)
  625. *******************************************************************
  626. --*/
  627. DWORD
  628. GetNextServer (
  629. IN DWORD OrderingMethod,
  630. IN DWORD ExclusionFlags,
  631. IN OUT PIPX_SERVER_ENTRY_P Server,
  632. IN OUT ULONG *InterfaceInex,
  633. IN OUT ULONG *Protocol
  634. );
  635. #endif