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.

700 lines
18 KiB

  1. #ifndef _WINS_
  2. #define _WINS_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*++
  7. Copyright (c) 1989 Microsoft Corporation
  8. Module Name:
  9. wins.h
  10. Abstract:
  11. This is the main header file for WINS.
  12. Author:
  13. Pradeep Bahl Dec-1992
  14. Revision History:
  15. --*/
  16. /*
  17. Includes
  18. */
  19. /*
  20. For now include all header files here since wins.h is included in every
  21. C file. In future, include only those headers whose stuff is being referenced
  22. */
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <nt.h>
  26. #include <ntrtl.h>
  27. #include <nturtl.h>
  28. #include <windows.h>
  29. #include <ntseapi.h>
  30. #include <rpc.h>
  31. #include "winsdbg.h"
  32. #include "winsevnt.h"
  33. #if 0
  34. #ifdef WINSDBG
  35. #include "winsthd.h"
  36. #endif
  37. #endif
  38. /*
  39. defines
  40. */
  41. #pragma warning (disable: 4005)
  42. #define LiGtr(a, b) ((a).QuadPart > (b).QuadPart)
  43. #define LiGeq(a, b) ((a).QuadPart >= (b).QuadPart)
  44. #define LiLtr(a, b) ((a).QuadPart < (b).QuadPart)
  45. #define LiLeq(a, b) ((a).QuadPart <= (b).QuadPart)
  46. #define LiGtrZero(a) ((a).QuadPart > 0)
  47. #define LiGeqZero(a) ((a).QuadPart >= 0)
  48. #define LiLtrZero(a) ((a).QuadPart < 0)
  49. #define LiLeqZero(a) ((a).QuadPart <= 0)
  50. #define LiNeqZero(a) ((a).QuadPart != 0)
  51. #define LiAdd(a,b) ((a).QuadPart + (b).QuadPart)
  52. #define LiSub(a,b) ((a).QuadPart - (b).QuadPart)
  53. #define LiXDiv(a,b) ((a).Quadpart/(b).QuadPart)
  54. #define LiEql(a,b) ((a).QuadPart == (b).QuadPart)
  55. #define LiEqlZero(a) ((a).QuadPart == 0)
  56. #define LiNeq(a,b) ((a).QuadPart != (b).QuadPart)
  57. #pragma warning (default: 4005)
  58. #if 0
  59. #define HIGH_WORD(a) (DWORD)Int64ShraMod32(a,32)
  60. #define LOW_WORD(a) (DWORD)(a & 0xffffffff)
  61. #define WINS_LI_TO_INT64_M(Li, b) b = Int64ShllMod32(Li.HighPart, 32) | Li.LowPart
  62. #endif
  63. //
  64. // Major and minor version numbers for WINS.
  65. //
  66. // Used in start assoc. req message.
  67. //
  68. #define WINS_MAJOR_VERS 2
  69. #if PRSCONN
  70. #define WINS_MINOR_VERS_NT5 5
  71. #define WINS_MINOR_VERS WINS_MINOR_VERS_NT5 //for NT 5
  72. #else
  73. #define WINS_MINOR_VERS 1
  74. #endif
  75. #if SUPPORT612WINS > 0
  76. #define WINS_BETA2_MAJOR_VERS_NO 2
  77. #define WINS_BETA1_MAJOR_VERS_NO 1
  78. #endif
  79. #define WINS_SERVER TEXT("Wins")
  80. #define WINS_SERVER_FULL_NAME TEXT("WINDOWS INTERNET NAME SERVICE")
  81. #define WINS_NAMED_PIPE TEXT("\\pipe\\WinsPipe")
  82. #define WINS_NAMED_PIPE_ASCII "\\pipe\\WinsPipe"
  83. /*
  84. The following macros are used to flag places in the code that need to be
  85. examined for enhancements (FUTURES), or verification of something to make
  86. the code better (CHECK) or for porting to another transport (NON_PORT)
  87. or performance improvement (PERF) or for alignment considerations (ALIGN)
  88. or for just FYI (NOTE)
  89. These macros provide a convenient mechanism to quickly determine all that
  90. needs to be enhanced, verified, or ported.
  91. */
  92. #ifdef FUTURES
  93. #define FUTURES(x) FUTURES: ## x
  94. #else
  95. #define FUTURES(x)
  96. #endif
  97. #ifdef CHECK
  98. #define CHECK(x) CHECK: ## x
  99. #else
  100. #define CHECK(x)
  101. #endif
  102. #ifdef NONPORT
  103. #define NONPORT(x) NON_PORT: ## x
  104. #else
  105. #define NONPORT(x)
  106. #endif
  107. #ifdef PERF
  108. #define PERF(x) PERF: ## x
  109. #else
  110. #define PERF(x)
  111. #endif
  112. #ifdef NOTE
  113. #define NOTE(x) NOTE: ## x
  114. #else
  115. #define NOTE(x)
  116. #endif
  117. //
  118. // NOTE NOTE NOTE:
  119. // The sequence of entering critical sections when more than one is
  120. // entered is given below
  121. //
  122. //
  123. // WinsCnfCnfCrtSec, NmsNmhNamRegCrtSec
  124. //
  125. // Entered in winsintf.c,winscnf.c,nmsscv.c, rplpull.c
  126. //
  127. //
  128. // Various critical sections and how they are entered
  129. //
  130. // ******************************
  131. // NmsNmhNamRegCrtSec
  132. //*******************************
  133. //
  134. // Entered by the main thread on a reconfig if vers. counter value is
  135. // specified in the registry. Enetered by nbt threads, nmschl thread
  136. //
  137. //
  138. // ******************************
  139. // NmsDbOwnAddTblCrtSec
  140. // ******************************
  141. //
  142. // Entered by Pull, Push, Rpc threads.
  143. //
  144. /*
  145. ALIGN - macro to flag places where alignment is very important
  146. */
  147. #ifdef ALIGN
  148. #define ALIGN(x) ALIGNMENT: ## x
  149. #else
  150. #define ALIGN(x)
  151. #endif
  152. /*
  153. EOS is not defined in windef.h.
  154. */
  155. #define EOS (TCHAR)0
  156. /*
  157. The opcodes in the first long word of a message sent on an association.
  158. When a message comes in on a TCP connection, the receiving COMSYS,
  159. checks the opcode in the first long word of the message ( lcation:
  160. bit 11 to bit 15) to determine if it is a message from an nbt node or
  161. a WINS server. NBT message formats use bit 11- bit 15 for the opcode and
  162. Req/Response bit. Since out of a posssible 32 opcode combintations, only
  163. 5 are used by NBT, WINS uses one so that the COMSYS receiving the first
  164. message on a connection can determine whether the connection was
  165. established by an NBT node or a WINS server.
  166. if we do not go with the above scheme, we would have had to compare the
  167. address of the node making the connection with all the addresses of the
  168. WINS partners that we were configured with to determine whether the
  169. connection came from a WINS partner or an NBT node. This search is not
  170. only expensive but also constraints a WINS to know of all its partners
  171. apriori.
  172. All messages sent by a WINS have WINS_IS_NOT_NBT opcode in the first byte.
  173. This is to enable the receiving COMSYS to look up the assoc. ctx block
  174. quickly without a search. This is because if the message is from a WINS
  175. and is not the first one, then it has the ptr to the local assoc. ctx (this
  176. was sent to that WINS in the start assoc. response message).
  177. */
  178. /*
  179. The value put in the first long word by rplmsgf functions
  180. */
  181. #define WINS_RPL_NOT_FIRST_MSG (0xF800)
  182. //
  183. // Defines to indicate to WinsMscTermThd whether a database session is
  184. // existent or not
  185. //
  186. #define WINS_DB_SESSION_EXISTS 0
  187. #define WINS_NO_DB_SESSION_EXISTS 1
  188. //
  189. // Max. size of a file name
  190. //
  191. #define WINS_MAX_FILENAME_SZ 255
  192. //
  193. // Max. size of a line
  194. //
  195. // Used in winsprs.c
  196. //
  197. #define WINS_MAX_LINE_SZ 80
  198. //
  199. // Swap bytes (used in NmsMsgfProcNbtReq) and in nmschl.c)
  200. //
  201. #define WINS_SWAP_BYTES_M(pFirstByte, pSecondByte) \
  202. { \
  203. BYTE SecondByte = *(pSecondByte); \
  204. *(pSecondByte) = *(pFirstByte); \
  205. *(pFirstByte) = (SecondByte); \
  206. }
  207. //
  208. // Max size of a non-scoped null name (along with NULL character)
  209. //
  210. #define WINS_MAX_NS_NETBIOS_NAME_LEN 17
  211. //
  212. // Max. size of a name in the name - address mapping table.
  213. //
  214. #define WINS_MAX_NAME_SZ 255
  215. FUTURES("Make this a value in the enumerator for Opcodes")
  216. /*
  217. The actual value put in bit 11-bit 14. Use 0xE (0xF is used for multihomed
  218. registration)
  219. */
  220. #define WINS_IS_NOT_NBT (0xF)
  221. /*
  222. defines for the different status values returned by the various
  223. functions withing WINS
  224. |
  225. | SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
  226. | Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
  227. | Warning=0x2:STATUS_SEVERITY_WARNING
  228. | Error=0x3:STATUS_SEVERITY_ERROR
  229. | )
  230. |
  231. | FacilityNames=(System=0x0
  232. | RpcRuntime=0x2:FACILITY_RPC_RUNTIME
  233. | RpcStubs=0x3:FACILITY_RPC_STUBS
  234. | Io=0x4:FACILITY_IO_ERROR_CODE
  235. | )
  236. |
  237. | Status codes are laid out as:
  238. |
  239. | //
  240. | // Values are 32 bit values layed out as follows:
  241. | //
  242. | // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  243. | // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  244. | // +---+-+-+-----------------------+-------------------------------+
  245. | // |Sev|C|R| Facility | Code |
  246. | // +---+-+-+-----------------------+-------------------------------+
  247. | //
  248. | // where
  249. | //
  250. | // Sev - is the severity code
  251. | //
  252. | // 00 - Success
  253. | // 01 - Informational
  254. | // 10 - Warning
  255. | // 11 - Error
  256. | //
  257. | // C - is the Customer code flag
  258. | //
  259. | // R - is a reserved bit
  260. | //
  261. | // Facility - is the facility code
  262. | //
  263. | // Code - is the facility's status code
  264. | //
  265. | //
  266. | // Define the facility codes
  267. | //
  268. |
  269. | MS will never set the C bit. This is reserved for
  270. | applications. If exceptions stay within the app, setting
  271. | the C bit means you will never get a collision.
  272. |
  273. */
  274. #define WINS_FIRST_NON_ERR_STATUS ((DWORD )0x00000000L)
  275. #define WINS_SUCCESS (WINS_FIRST_NON_ERR_STATUS + 0x0)
  276. #define WINS_NO_REQ (WINS_FIRST_NON_ERR_STATUS + 0x1)
  277. #define WINS_NO_SP_TIME (WINS_FIRST_NON_ERR_STATUS + 0x2)
  278. #define WINS_LAST_NON_ERR_STATUS (WINS_NO_SP_TIME)
  279. #define WINS_FIRST_ERR_STATUS ((DWORD )0xE0000000L)
  280. #define WINS_FAILURE (WINS_FIRST_ERR_STATUS + 0x1)
  281. #define WINS_FATAL_ERR (WINS_FIRST_ERR_STATUS + 0x2)
  282. #define WINS_BAD_STATE_ASSOC (WINS_FIRST_ERR_STATUS + 0x3)
  283. #define WINS_OUT_OF_MEM (WINS_FIRST_ERR_STATUS + 0x4)
  284. #define WINS_OUT_OF_HEAP (WINS_FIRST_ERR_STATUS + 0x5)
  285. #define WINS_BAD_PTR (WINS_FIRST_ERR_STATUS + 0x6)
  286. #define WINS_COULD_NOT_FREE_MEM (WINS_FIRST_ERR_STATUS + 0x7)
  287. #define WINS_COMM_FAIL (WINS_FIRST_ERR_STATUS + 0x8)
  288. #define WINS_ABNORMAL_TERM (WINS_FIRST_ERR_STATUS + 0x9)
  289. #define WINS_PKT_FORMAT_ERR (WINS_FIRST_ERR_STATUS + 0xA)
  290. #define WINS_HEAP_FREE_ERR (WINS_FIRST_ERR_STATUS + 0xB)
  291. #define WINS_HEAP_CREATE_ERR (WINS_FIRST_ERR_STATUS + 0xC)
  292. #define WINS_SIGNAL_TMM_ERR (WINS_FIRST_ERR_STATUS + 0xD)
  293. #define WINS_SIGNAL_CLIENT_ERR (WINS_FIRST_ERR_STATUS + 0xE)
  294. #define WINS_DB_INCONSISTENT (WINS_FIRST_ERR_STATUS + 0xF)
  295. #define WINS_OUT_OF_RSRCS (WINS_FIRST_ERR_STATUS + 0x10)
  296. #define WINS_INVALID_HDL (WINS_FIRST_ERR_STATUS + 0x11)
  297. #define WINS_CANT_OPEN_KEY (WINS_FIRST_ERR_STATUS + 0x12)
  298. #define WINS_CANT_CLOSE_KEY (WINS_FIRST_ERR_STATUS + 0x13)
  299. #define WINS_CANT_QUERY_KEY (WINS_FIRST_ERR_STATUS + 0x14)
  300. #define WINS_RPL_STATE_ERR (WINS_FIRST_ERR_STATUS + 0x15)
  301. #define WINS_RECORD_NOT_OWNED (WINS_FIRST_ERR_STATUS + 0x16)
  302. #define WINS_RECV_TIMED_OUT (WINS_FIRST_ERR_STATUS + 0x17)
  303. #define WINS_LOCK_ASSOC_ERR (WINS_FIRST_ERR_STATUS + 0x18)
  304. #define WINS_LOCK_DLG_ERR (WINS_FIRST_ERR_STATUS + 0x19)
  305. #define WINS_OWNER_LIMIT_REACHED (WINS_FIRST_ERR_STATUS + 0x20)
  306. #define WINS_NBT_ERR (WINS_FIRST_ERR_STATUS + 0x21)
  307. #define WINS_QUEUE_FULL (WINS_FIRST_ERR_STATUS + 0x22)
  308. #define WINS_BAD_RECORD (WINS_FIRST_ERR_STATUS + 0x23)
  309. #define WINS_LAST_ERR_STATUS (WINS_QUEUE_FULL)
  310. /*
  311. The various exceptions used within WINS
  312. */
  313. #define WINS_EXC_INIT WINS_SUCCESS
  314. #define WINS_EXC_FAILURE WINS_FAILURE
  315. #define WINS_EXC_FATAL_ERR WINS_FATAL_ERR
  316. #define WINS_EXC_BAD_STATE_ASSOC WINS_BAD_STATE_ASSOC
  317. #define WINS_EXC_OUT_OF_MEM WINS_OUT_OF_MEM
  318. /*
  319. Could not allocate heap memory
  320. */
  321. #define WINS_EXC_OUT_OF_HEAP WINS_OUT_OF_HEAP
  322. /*
  323. a bad pointer was passed Possibley to LocalFree
  324. Check WInsMscDealloc
  325. */
  326. #define WINS_EXC_BAD_PTR WINS_BAD_PTR
  327. /*
  328. Memory could not be freed through LocalFree
  329. Check WInsMscDealloc
  330. */
  331. #define WINS_EXC_COULD_NOT_FREE_MEM WINS_COULD_NOT_FREE_MEM
  332. #define WINS_EXC_COMM_FAIL WINS_COMM_FAIL
  333. /*
  334. The wait was terminated abnormally
  335. */
  336. #define WINS_EXC_ABNORMAL_TERM WINS_ABNORMAL_TERM
  337. /*
  338. The name packet received is not formatted properly
  339. */
  340. #define WINS_EXC_PKT_FORMAT_ERR WINS_PKT_FORMAT_ERR
  341. /*
  342. Heap memory could not be freed
  343. */
  344. #define WINS_EXC_HEAP_FREE_ERR WINS_HEAP_FREE_ERR
  345. /*
  346. Heap could not be created
  347. */
  348. #define WINS_EXC_HEAP_CREATE_ERR WINS_HEAP_CREATE_ERR
  349. /*
  350. Could not signal Tmm thread
  351. */
  352. #define WINS_EXC_SIGNAL_TMM_ERR WINS_SIGNAL_TMM_ERR
  353. /*
  354. TMM Could not signal Client thread
  355. */
  356. #define WINS_EXC_SIGNAL_CLIENT_ERR WINS_SIGNAL_CLIENT_ERR
  357. /*
  358. Database is inconsistent.
  359. */
  360. #define WINS_EXC_DB_INCONSISTENT WINS_DB_INCONSISTENT
  361. /*
  362. Out of resources (for example: a thread could not be created)
  363. */
  364. #define WINS_EXC_OUT_OF_RSRCS WINS_OUT_OF_RSRCS
  365. /*
  366. An invalid handle is being used
  367. */
  368. #define WINS_EXC_INVALID_HDL WINS_INVALID_HDL
  369. /*
  370. The registry key is there but could not be opened
  371. */
  372. #define WINS_EXC_CANT_OPEN_KEY WINS_CANT_OPEN_KEY
  373. /*
  374. The registry key could not be closed
  375. */
  376. #define WINS_EXC_CANT_CLOSE_KEY WINS_CANT_CLOSE_KEY
  377. /*
  378. The registry key was opened but could not be queried
  379. */
  380. #define WINS_EXC_CANT_QUERY_KEY WINS_CANT_QUERY_KEY
  381. /*
  382. WINS received a replica that does not have the correct state. For example,
  383. it may have received the replica of a special group (Internet) group that
  384. has all members timed out but the state is not TOMBSTONE
  385. Another example is when a replica with state RELEASED is received
  386. */
  387. #define WINS_EXC_RPL_STATE_ERR WINS_RPL_STATE_ERR
  388. /*
  389. WINS received an update version number notification (from another WINS)
  390. for a record that it does not own
  391. There can be two reasons why this happened
  392. 1) There is a bug in WINS (highly unlikely)
  393. 2) The system administrator just deleted the record that was replicated
  394. to the remote WINS resulting in the clash and consequent update
  395. notification.
  396. Check the event logger to confirm/reject the second reason
  397. */
  398. #define WINS_EXC_RECORD_NOT_OWNED WINS_RECORD_NOT_OWNED
  399. //
  400. // Could not lock an assoc block
  401. //
  402. #define WINS_EXC_LOCK_ASSOC_ERR WINS_LOCK_ASSOC_ERR
  403. //
  404. // Could not lock a dialogue block
  405. //
  406. #define WINS_EXC_LOCK_DLG_ERR WINS_LOCK_DLG_ERR
  407. //
  408. // NmsDbOwnAddTbl limit reached. All owners of the array are taken
  409. // by ACTIVE WINS owners
  410. //
  411. #define WINS_EXC_OWNER_LIMIT_REACHED WINS_OWNER_LIMIT_REACHED
  412. //
  413. // Some fatal error concerning NBT was encountered
  414. //
  415. #define WINS_EXC_NBT_ERR WINS_NBT_ERR
  416. // bad database record encountered.
  417. #define WINS_EXC_BAD_RECORD WINS_BAD_RECORD
  418. /*
  419. Macros
  420. */
  421. //
  422. // Control codes that can be used by the service controller (128-255)
  423. //
  424. #define WINS_MIN_SERVICE_CONTROL_CODE 128
  425. #define WINS_ABRUPT_TERM (WINS_MIN_SERVICE_CONTROL_CODE + 0)
  426. #define WINS_RAISE_EXC_M(x) RaiseException(x, 0, 0, NULL)
  427. #define WINS_HDL_EXC_M(MemPtrs) \
  428. { \
  429. WinsMscFreeMem(MemPtrs); \
  430. }
  431. #define WINS_HDL_EXC_N_EXIT_M(MemPtrs) \
  432. { \
  433. WinsMscFreeMem(MemPtrs); \
  434. ExitProcess(0); \
  435. }
  436. #define WINS_RERAISE_EXC_M() \
  437. { \
  438. DWORD ExcCode; \
  439. ExcCode = GetExceptionCode(); \
  440. WINS_RAISE_EXC_M(ExcCode); \
  441. }
  442. #define WINS_HDL_EXC_N_RERAISE_M(MemPtrs) \
  443. { \
  444. DWORD ExcCode; \
  445. WinsMscFreeMem(MemPtrs); \
  446. ExcCode = GetExceptionCode(); \
  447. WINS_RAISE_EXC_M(ExcCode); \
  448. }
  449. #if 0
  450. #define WINS_RPL_OPCODE_M(pTmp) \
  451. { \
  452. *pTmp = WINS_RPL_NOT_FIRST_MSG; \
  453. }
  454. #endif
  455. #define WINS_EXIT_IF_ERR_M(func, ExpectedStatus) \
  456. { \
  457. STATUS Status_mv ; \
  458. Status_mv = (func); \
  459. if (Status_mv != ExpectedStatus) \
  460. { \
  461. DBGPRINT0(ERR, "Major Error"); \
  462. ExitProcess(1); \
  463. } \
  464. }
  465. #define WINS_RET_IF_ERR_M(func, ExpectedStatus) \
  466. { \
  467. STATUS Status_mv ; \
  468. Status_mv = (func); \
  469. if (Status_mv != ExpectedStatus) \
  470. { \
  471. DBGPRINT0(ERR, "Error returned by called func."); \
  472. return(WINS_FAILURE); \
  473. } \
  474. }
  475. //
  476. // Vers. No. operations
  477. //
  478. #if 0
  479. #define WINS_ASSIGN_INT_TO_LI_M(Li, no) { \
  480. (Li).LowPart = (no); \
  481. (Li).HighPart = 0; \
  482. }
  483. #endif
  484. #define WINS_ASSIGN_INT_TO_LI_M(Li, no) (Li).QuadPart = (no)
  485. #define WINS_ASSIGN_INT_TO_VERS_NO_M(Li, no) WINS_ASSIGN_INT_TO_LI_M(Li, no)
  486. #define WINS_PUT_VERS_NO_IN_STREAM_M(pVersNo, pStr) \
  487. { \
  488. LPLONG _pTmpL = (LPLONG)(pStr); \
  489. COMM_HOST_TO_NET_L_M((pVersNo)->HighPart, *_pTmpL); \
  490. _pTmpL++; \
  491. COMM_HOST_TO_NET_L_M((pVersNo)->LowPart, *_pTmpL); \
  492. }
  493. #define WINS_GET_VERS_NO_FR_STREAM_M(pStr, pVersNo) \
  494. { \
  495. LPLONG _pTmpL = (LPLONG)(pStr); \
  496. COMM_NET_TO_HOST_L_M(*_pTmpL, (pVersNo)->HighPart); \
  497. _pTmpL++; \
  498. COMM_NET_TO_HOST_L_M(*_pTmpL, (pVersNo)->LowPart ); \
  499. }
  500. #define WINS_VERS_NO_SIZE sizeof(LARGE_INTEGER)
  501. /*
  502. externs
  503. */
  504. extern DWORD WinsTlsIndex; /*TLS index for Nbt threads to
  505. *store database info*/
  506. /*
  507. Typedefs
  508. */
  509. typedef DWORD STATUS; // status returned by all NBNS funcs
  510. /*
  511. * VERS_NO_T -- datatype of variable storing version number. The sizeof
  512. * of this datatype is used when adding version number column in the
  513. * name - address mapping table and when setting a value in this column.
  514. * So, if you change the datatype, make sure you make appropriate changes
  515. * in nmsdb.c (CreateTbl, InsertRow, etc)
  516. */
  517. typedef LARGE_INTEGER VERS_NO_T, *PVERS_NO_T; // version no.
  518. typedef LPBYTE MSG_T; //ptr to a message
  519. typedef LPBYTE *PMSG_T; //ptr to a message
  520. typedef DWORD MSG_LEN_T; //length of message
  521. typedef LPDWORD PMSG_LEN_T; //length of message
  522. typedef MSG_LEN_T MSG_LEN;
  523. typedef PMSG_LEN_T PMSG_LEN;
  524. typedef DWORD WINS_UID_T, *PWINS_UID_T;
  525. /*
  526. WINS_CLIENT_E -- specifies the different components and their parts
  527. inside the WINS server.
  528. */
  529. typedef enum _WINS_CLIENT_E {
  530. WINS_E_REPLICATOR = 0, /*replicator */
  531. WINS_E_RPLPULL, /*replicator - PULL*/
  532. WINS_E_RPLPUSH, /*replicator - PUSH*/
  533. WINS_E_NMS, /* Name Space Manager */
  534. WINS_E_NMSNMH, /* Name Space Manager - Name Handler */
  535. WINS_E_NMSCHL, /* Name Space Manager - Challenge Manager*/
  536. WINS_E_NMSSCV, /* Name Space Manager - Savenger */
  537. WINS_E_COMSYS, /* Communication Subsystem Manager*/
  538. WINS_E_WINSCNF, /* WINS - Configuration */
  539. WINS_E_WINSTMM, /* WINS - Timer Manager*/
  540. WINS_E_WINSRPC /* WINS - RPC thread*/
  541. } WINS_CLIENT_E, *PWINS_CLIENT_E;
  542. #define WINS_NO_OF_CLIENTS (WINS_E_WINSRPC + 1)
  543. /*
  544. WINS_MEM_T -- This structure is used in any function that allocates memory
  545. or has memory allocated for it by a called function and passed
  546. back via an OUT argument
  547. The ptrs to the memory blocks are linked together. The memory
  548. is freed in the exception handler.
  549. This mechanism of keeping track of memory in a structure and
  550. getting rid of it in the exception handler will alleviate memory
  551. leak problems
  552. */
  553. typedef struct _WINS_MEM_T {
  554. LPVOID pMem; //non-heap allocated memory
  555. LPVOID pMemHeap; //memory allocated from a heap
  556. } WINS_MEM_T, *PWINS_MEM_T;
  557. #ifdef __cplusplus
  558. }
  559. #endif
  560. #endif
  561.