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.

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