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.

273 lines
6.2 KiB

  1. #ifndef _NMSNMH_
  2. #define _NMSNMH_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*++
  7. Copyright (c) 1989 Microsoft Corporation
  8. Module Name:
  9. nmsnmh.h
  10. Abstract:
  11. Functions:
  12. Portability:
  13. This header is portable.
  14. Author:
  15. Pradeep Bahl (PradeepB) Jan-1993
  16. Revision History:
  17. Modification Date Person Description of Modification
  18. ------------------ ------- ---------------------------
  19. --*/
  20. /*
  21. includes
  22. */
  23. #include "wins.h"
  24. #include "nmsdb.h"
  25. #include "comm.h"
  26. #include "nmsmsgf.h"
  27. #include "nms.h"
  28. /*
  29. defines
  30. */
  31. extern BOOL NmsNmhRegThdExists;
  32. /*
  33. macros
  34. */
  35. #define NMSNMH_VERS_NO_EQ_ZERO_M(VersNo) ((VersNo).QuadPart == 0)
  36. #define NMSNMH_INC_VERS_NO_M(VersNoToInc, TgtVersNo) { \
  37. (TgtVersNo).QuadPart = LiAdd((VersNoToInc), NmsNmhIncNo); \
  38. }
  39. #define NMSNMH_DEC_VERS_NO_M(VersNoToDec, TgtVersNo) { \
  40. (TgtVersNo).QuadPart = LiSub((VersNoToDec), NmsNmhIncNo); \
  41. }
  42. #define NMSNMH_INC_VERS_COUNTER_M2(VersNoToInc, TgtVersNo) { \
  43. if (LiGtr((VersNoToInc), NmsHighWaterMarkVersNo)) \
  44. { \
  45. DWORD ThdId;\
  46. HANDLE ThdHdl;\
  47. if(!WinsCnfRegUpdThdExists) { \
  48. WinsCnfRegUpdThdExists = TRUE; \
  49. ThdHdl = WinsMscCreateThd(WinsCnfWriteReg, NULL, &ThdId); \
  50. CloseHandle(ThdHdl); \
  51. } \
  52. } \
  53. NMSNMH_INC_VERS_NO_M((VersNoToInc), (TgtVersNo)); \
  54. }
  55. #define NMSNMH_INC_VERS_COUNTER_M(VersNoToInc, TgtVersNo) \
  56. NMSNMH_INC_VERS_COUNTER_M2(VersNoToInc, TgtVersNo)
  57. #ifdef WINSDBG
  58. #if 0
  59. #define NMSNMH_UPD_UPD_CTRS_M(pRowInfo) { \
  60. IF_DBG(UPD_CNTRS) \
  61. { \
  62. PWINSTHD_TLS_T _pTls; \
  63. _pTls = TlsGetValue(WinsTlsIndex); /*GET_TLS_M(_pTls); */\
  64. switch(_pTls->Client_e) \
  65. { \
  66. case(WINS_E_RPLPULL): NMSDB_ENTRY_UNIQUE_M(pRowInfo->EntTyp) ? NmsRplUpd++ : NmsRplGUpd++; break; \
  67. case(WINS_E_NMSNMH): NMSDB_ENTRY_UNIQUE_M(pRowInfo->EntTyp) ? NmsNmhUpd++ : NmsNmhGUpd++; break; \
  68. case(WINS_E_NMSCHL): NMSDB_ENTRY_UNIQUE_M(pRowInfo->EntTyp) ? NmsChlUpd++ : NmsChlGUpd++; break;\
  69. case(WINS_E_NMSSCV): NMSDB_ENTRY_UNIQUE_M(pRowInfo->EntTyp) ? NmsScvUpd++ : NmsScvGUpd++; break; \
  70. case(WINS_E_WINSRPC): NMSDB_ENTRY_UNIQUE_M(pRowInfo->EntTyp) ? NmsRpcUpd++ : NmsRpcGUpd++; break; \
  71. default: NMSDB_ENTRY_UNIQUE_M(pRowInfo->EntTyp) ? NmsOthUpd++ : NmsOthGUpd++; break; \
  72. } \
  73. } \
  74. }
  75. #endif
  76. #define NMSNMH_UPD_UPD_CTRS_M(fIndexUpd, fUpd, pRowInfo) { \
  77. IF_DBG(UPD_CNTRS) \
  78. { \
  79. PWINSTHD_TLS_T _pTls; \
  80. _pTls = TlsGetValue(WinsTlsIndex); /*GET_TLS_M(_pTls); */\
  81. NmsUpdCtrs[_pTls->Client_e][fUpd][pRowInfo->EntTyp][pRowInfo->EntryState_e][fIndexUpd]++; \
  82. } \
  83. }
  84. #else
  85. #define NMSNMH_UPD_UPD_CTRS_M(fIndexUpd, fUpd, pRowInfo)
  86. #endif
  87. /*
  88. externs
  89. */
  90. /*
  91. NmsNmhMyMaxVersNo -- Stores highest version no. for
  92. entries owned by the local WINS
  93. in its local db
  94. */
  95. extern VERS_NO_T NmsNmhMyMaxVersNo;
  96. extern VERS_NO_T NmsNmhIncNo;
  97. /*
  98. NmsNmhNamRegCrtSect -- Variable for the critical section entered
  99. when name registrations or refreshes need to be done
  100. */
  101. extern CRITICAL_SECTION NmsNmhNamRegCrtSec;
  102. /*
  103. typedef definitions
  104. */
  105. /*
  106. NMSNMH_QUERY_RSP_T -- this contains the addresses found in a
  107. group entry. -- not being used currently
  108. */
  109. typedef struct _NMSNMH_QUERY_RSP_T {
  110. BOOL fGrp; //is it rsp. for a group
  111. WORD NoOfAdd; //no of addresses in the group
  112. COMM_ADD_T NodeAdd[NMSDB_MAX_MEMS_IN_GRP]; //addresses
  113. } NMSNMH_QUERY_RSP_T, *PNMSNMH_QUERY_RSP_T;
  114. /*
  115. function prototypes
  116. */
  117. extern
  118. STATUS
  119. NmsNmhNamRegInd(
  120. IN PCOMM_HDL_T pDlgHdl,
  121. IN LPBYTE pName,
  122. IN DWORD NameLen,
  123. IN PCOMM_ADD_T pNodeAdd,
  124. IN BYTE NodeTyp, //change to take Flag byte
  125. IN MSG_T pMsg,
  126. IN MSG_LEN_T MsgLen,
  127. IN DWORD QuesNamSecLen,
  128. IN BOOL fRefresh,
  129. IN BOOL fStatic,
  130. IN BOOL fAdmin
  131. );
  132. extern
  133. STATUS
  134. NmsNmhNamRegGrp(
  135. IN PCOMM_HDL_T pDlgHdl,
  136. IN PBYTE pName,
  137. IN DWORD NameLen,
  138. IN PNMSMSGF_CNT_ADD_T pCntAdd,
  139. IN BYTE NodeTyp,
  140. IN MSG_T pMsg,
  141. IN MSG_LEN_T MsgLen,
  142. IN DWORD QuesNamSecLen,
  143. IN DWORD TypeOfRec,
  144. IN BOOL fRefresh,
  145. IN BOOL fStatic,
  146. IN BOOL fAdmin
  147. );
  148. extern
  149. STATUS
  150. NmsNmhNamRel(
  151. IN PCOMM_HDL_T pDlgHdl,
  152. IN LPBYTE pName,
  153. IN DWORD NameLen,
  154. IN PCOMM_ADD_T pNodeAdd,
  155. IN BOOL fGrp,
  156. IN MSG_T pMsg,
  157. IN MSG_LEN_T MsgLen,
  158. IN DWORD QuesNamSecLen,
  159. IN BOOL fAdmin
  160. );
  161. extern
  162. STATUS
  163. NmsNmhNamQuery(
  164. IN PCOMM_HDL_T pDlgHdl, //dlg handle
  165. IN LPBYTE pName, //Name to release
  166. IN DWORD NameLen, //length of name to release
  167. IN MSG_T pMsg, //message received
  168. IN MSG_LEN_T MsgLen, //length of message
  169. IN DWORD QuesNamSecLen, //length of ques. name sec in msg
  170. IN BOOL fAdmin,
  171. OUT PNMSDB_STAT_INFO_T pStatInfo
  172. );
  173. extern
  174. VOID
  175. NmsNmhSndNamRegRsp(
  176. PCOMM_HDL_T pDlgHdl,
  177. PNMSMSGF_RSP_INFO_T pRspInfo
  178. );
  179. extern
  180. STATUS
  181. NmsNmhReplRegInd(
  182. IN LPBYTE pName,
  183. IN DWORD NameLen,
  184. IN PCOMM_ADD_T pNodeAdd,
  185. IN DWORD Flag, //change to take Flag byte
  186. IN DWORD OwnerId,
  187. IN VERS_NO_T VersNo,
  188. IN PCOMM_ADD_T pOwnerWinsAdd
  189. );
  190. extern
  191. STATUS
  192. NmsNmhReplGrpMems(
  193. IN LPBYTE pName,
  194. IN DWORD NameLen,
  195. IN BYTE EntTyp,
  196. IN PNMSDB_NODE_ADDS_T pGrpMem,
  197. IN DWORD Flag, //change to take Flag byte
  198. IN DWORD OwnerId,
  199. IN VERS_NO_T VersNo,
  200. IN PCOMM_ADD_T pOwnerWinsAdd
  201. );
  202. extern
  203. VOID
  204. NmsNmhUpdVersNo(
  205. IN LPBYTE pName,
  206. IN DWORD NameLen,
  207. //IN BYTE NodeTyp,
  208. //IN BOOL fBrowserName,
  209. //IN BOOL fStatic,
  210. //IN PCOMM_ADD_T pNodeAdd,
  211. OUT LPBYTE pRcode,
  212. IN PCOMM_ADD_T pWinsAdd
  213. );
  214. #ifdef __cplusplus
  215. }
  216. #endif
  217. #endif //_NMSNMH_
  218.