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.

137 lines
3.0 KiB

  1. #ifndef _WINSTHD_
  2. #define _WINSTHD_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*++
  7. Copyright (c) 1989 Microsoft Corporation
  8. Module Name:
  9. winsthd.h
  10. Abstract:
  11. Author:
  12. Pradeep Bahl 18-Nov-1992
  13. Revision History:
  14. --*/
  15. #include "wins.h"
  16. #include "esent.h"
  17. /*
  18. WINS_MAX_THD - Maximum number of threads in the WINS Server
  19. Main thd + Thd pool # + Name Challenger (1) + Replicator (3) +
  20. COMSYS (2) + Timer Manager (1)
  21. */
  22. #if REG_N_QUERY_SEP > 0
  23. #define WINSTHD_MIN_NO_NBT_THDS 2
  24. #define WINSTHD_DEF_NO_NBT_THDS 2
  25. #else
  26. #define WINSTHD_MIN_NO_NBT_THDS 1
  27. #define WINSTHD_DEF_NO_NBT_THDS 1
  28. #endif
  29. #define WINSTHD_MAX_NO_NBT_THDS 20
  30. #define WINSTHD_NO_RPL_THDS 2
  31. #define WINSTHD_NO_COMM_THDS 2
  32. #define WINSTHD_NO_TMM_THDS 1
  33. #define WINSTHD_NO_CHL_THDS 1
  34. #define WINSTHD_NO_SCV_THDS 1
  35. /*
  36. Indices of the various Replicator threads in the RplThds array of
  37. WinsThdPool var.
  38. */
  39. #define WINSTHD_RPL_PULL_INDEX 0
  40. #define WINSTHD_RPL_PUSH_INDEX 1
  41. /*
  42. WINSTHD_TLS_T -- Structure in the thread local storage of a thread
  43. */
  44. typedef struct _WINSTHD_TLS_T {
  45. #ifdef WINSDBG
  46. BYTE ThdName[30]; //just for testing
  47. WINS_CLIENT_E Client_e; //client
  48. #endif
  49. JET_SESID SesId; //session id
  50. JET_DBID DbId; //database id
  51. JET_TABLEID NamAddTblId; //name-address table id
  52. JET_TABLEID OwnAddTblId; //Owner - address table id
  53. BOOL fNamAddTblOpen; //indicates whether the name-add tbl
  54. //was opened by this thread
  55. BOOL fOwnAddTblOpen; //indicates whether the owner-add tbl
  56. //was opened by this thread
  57. HANDLE HeapHdl;
  58. } WINSTHD_TLS_T, *PWINSTHD_TLS_T;
  59. /*
  60. WINSTHD_TYP_E -- Enumerates the different types of threads in the WINS server
  61. */
  62. typedef enum _WINSTHD_TYP_E {
  63. WINSTHD_E_TCP = 0, //COMSYS TCP listener thread
  64. WINSTHD_E_UDP, //COMSYS UDP listener thread
  65. WINSTHD_E_NBT_REQ, //NMS NBT REQ Thread
  66. WINSTHD_E_RPL_REQ, //Replicator PULL Thread
  67. WINSTHD_E_RPL_RSP //Replicator PUSH Thread
  68. } WINSTHD_TYP_E, *PWINSTHD_TYP_E;
  69. /*
  70. WINSTHD_INFO_T -- Info. pertaining to a thread
  71. */
  72. typedef struct _WINSTHD_INFO_T {
  73. BOOL fTaken; /*indicates whether entry is empty*/
  74. DWORD ThdId; /*thread id */
  75. HANDLE ThdHdl; /*handle to the thread*/
  76. WINSTHD_TYP_E ThdTyp_e; /*Type of thread */
  77. } WINSTHD_INFO_T, *PWINSTHD_INFO_T;
  78. /*
  79. WINSTHD_POOL_T - The thread pool for the WINS server
  80. */
  81. typedef struct _WINSTHD_POOL_T {
  82. DWORD ThdCount;
  83. WINSTHD_INFO_T CommThds[WINSTHD_NO_COMM_THDS];/*comm thds (TCP and
  84. *UDP listener)
  85. */
  86. WINSTHD_INFO_T RplThds[WINSTHD_NO_RPL_THDS]; //replication threads
  87. WINSTHD_INFO_T ChlThd[WINSTHD_NO_CHL_THDS]; //Challenge threads
  88. WINSTHD_INFO_T TimerThds[WINSTHD_NO_TMM_THDS];//Timer thread
  89. WINSTHD_INFO_T ScvThds[WINSTHD_NO_SCV_THDS];
  90. WINSTHD_INFO_T NbtReqThds[WINSTHD_MAX_NO_NBT_THDS]; //nbt threads
  91. } WINSTHD_POOL_T, *PWINSTHD_POOL_T;
  92. /*
  93. Externals
  94. */
  95. extern WINSTHD_POOL_T WinsThdPool;
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif //_WINSTHD_
  100.