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.

451 lines
13 KiB

  1. #ifndef _WINSCNF_
  2. #define _WINSCNF_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*++
  7. Copyright (c) 1989 Microsoft Corporation
  8. Module Name:
  9. nmscnf.c
  10. Abstract:
  11. This is the header file to be included for calling functions defined
  12. in nmscnf.c file.
  13. Functions:
  14. Portability:
  15. This header is portable.
  16. Author:
  17. Pradeep Bahl (PradeepB) Jan-1993
  18. Revision History:
  19. Modification Date Person Description of Modification
  20. ------------------ ------- ---------------------------
  21. --*/
  22. /*
  23. includes
  24. */
  25. #include "wins.h"
  26. #include "rpl.h"
  27. #include "winscnst.h"
  28. #if MCAST > 0
  29. #include "rnraddrs.h"
  30. #endif
  31. /*
  32. defines
  33. */
  34. /*
  35. macros
  36. */
  37. /*
  38. * externs
  39. */
  40. struct _WINSCNF_CNF_T; //forward declaration
  41. extern DWORD WinsCnfCnfMagicNo;
  42. extern struct _WINSCNF_CNF_T WinsCnf;
  43. extern BOOL fWinsCnfRplEnabled; //replication is enabled/disabled
  44. extern BOOL fWinsCnfScvEnabled; //scavenging is enabled/disabled
  45. extern BOOL fWinsCnfReadNextTimeVersNo; //set if vers. no. to use next time
  46. //is read in
  47. FUTURES("use #ifdef PERF around the following three perf. mon. vars")
  48. extern BOOL fWinsCnfPerfMonEnabled; //Perf Mon is enabled/disabled
  49. extern BOOL fWinsCnfHighResPerfCntr; //indicates whether the hardware
  50. //supports a high resolution
  51. //perf. counter
  52. extern LARGE_INTEGER LiWinsCnfPerfCntrFreq; //Performance Counter's Frequency
  53. extern CRITICAL_SECTION WinsCnfCnfCrtSec;
  54. extern TCHAR WinsCnfDb[WINS_MAX_FILENAME_SZ]; //db file to hold tables
  55. extern TCHAR WinsCnfStaticDataFile[WINS_MAX_FILENAME_SZ]; //file containing
  56. //static data used
  57. //to initialize WINS
  58. extern BOOL WinsCnfRegUpdThdExists;
  59. extern HANDLE WinsCnfNbtHandle;
  60. extern PTCHAR pWinsCnfNbtPath;
  61. extern BOOL fWinsCnfInitStatePaused;
  62. extern BOOL sfNoLimitChk; //to override the limit checks
  63. //
  64. // magic number of the Wins Cnf structure used at process invocation. This
  65. // WinsCnf structure is a global structure. When there is a reconfiguration
  66. // of WINS, we allocate a new WinsCnf structure and copy its contents to
  67. // the global WinsCnf structure. The magic number in the global WinsCnf is
  68. // incremented.
  69. //
  70. #define WINSCNF_INITIAL_CNF_MAGIC_NO 0
  71. #define WINSCNF_FILE_INFO_SZ sizeof(WINSCNF_DATAFILE_INFO_T)
  72. #define WINSCNF_SPEC_GRP_MASK_SZ 32
  73. /*
  74. typedef definitions
  75. */
  76. //
  77. // Action to take regarding whether the MemberPrec field of NMSDB_ADD_STATE_T
  78. // table should be set. Used in RplFindOwnerId (called by Pull Thread).
  79. //
  80. typedef enum _WINSCNF_INITP_ACTION_E {
  81. WINSCNF_E_INITP = 0,
  82. WINSCNF_E_INITP_IF_NON_EXISTENT,
  83. WINSCNF_E_IGNORE_PREC
  84. } WINSCNF_INITP_ACTION_E, *PWINSCNF_INITP_ACTION_E;
  85. //
  86. // This structure holds information about the file (name and type as
  87. // found in the registry (REG_SZ, REG_EXPAND_SZ) to be used for static
  88. // initialization of WINS
  89. //
  90. typedef struct _WINSCNF_DATAFILE_INFO_T{
  91. TCHAR FileNm[WINS_MAX_FILENAME_SZ];
  92. DWORD StrType;
  93. } WINSCNF_DATAFILE_INFO_T, *PWINSCNF_DATAFILE_INFO_T;
  94. //
  95. // used to index the array of handles specified to WinsMscWaitUntilSignaled
  96. // in nms.c
  97. //
  98. typedef enum _WINSCNF_HDL_SIGNALED_E {
  99. WINSCNF_E_TERM_HDL = 0,
  100. WINSCNF_E_WINS_HDL,
  101. WINSCNF_E_PARAMETERS_HDL,
  102. WINSCNF_E_PARTNERS_HDL,
  103. WINSCNF_E_NO_OF_HDLS_TO_MONITOR
  104. } WINSCNF_HDL_SIGNALED_E, *PWINSCNF_HDL_SIGNALED_E;
  105. //
  106. // The various keys in the WINS configuration (in registry)
  107. //
  108. //
  109. // Don't modify the following enum without looking at TypOfMon[] in winscnf.c
  110. // first
  111. //
  112. typedef enum _WINSCNF_KEY_E {
  113. WINSCNF_E_WINS_KEY = 0,
  114. WINSCNF_E_PARAMETERS_KEY,
  115. WINSCNF_E_SPEC_GRP_MASKS_KEY,
  116. WINSCNF_E_DATAFILES_KEY,
  117. WINSCNF_E_PARTNERS_KEY,
  118. WINSCNF_E_PULL_KEY,
  119. WINSCNF_E_PUSH_KEY,
  120. WINSCNF_E_ALL_KEYS
  121. } WINSCNF_KEY_E, *PWINSCNF_KEY_E;
  122. //
  123. // The states of a WINS
  124. //
  125. typedef enum _WINSCNF_STATE_E {
  126. WINSCNF_E_INITING = 0,
  127. WINSCNF_E_STEADY_STATE, //not used currently
  128. WINSCNF_E_STEADY_STATE_INITING, //not used currently
  129. WINSCNF_E_RUNNING,
  130. WINSCNF_E_INIT_TIME_PAUSE, //paused at initialization time as directed
  131. //via registry
  132. WINSCNF_E_PAUSED,
  133. WINSCNF_E_TERMINATING
  134. } WINSCNF_STATE_E, *PWINSCNF_STATE_E;
  135. //
  136. // Stores the special groups
  137. //
  138. typedef struct _WINSCNF_SPEC_GRP_MASKS_T {
  139. DWORD NoOfSpecGrpMasks;
  140. LPSTR pSpecGrpMasks;
  141. } WINSCNF_SPEC_GRP_MASKS_T, *PWINSCNF_SPEC_GRP_MASKS_T;
  142. typedef struct _WINSCNF_CC_T {
  143. DWORD TimeInt;
  144. BOOL fSpTime;
  145. DWORD SpTimeInt;
  146. DWORD MaxRecsAAT;
  147. BOOL fUseRplPnrs;
  148. } WINSCNF_CC_T, *PWINSCNF_CC_T;
  149. //
  150. // Stores the 1B names cache used in R_WinsGetBrowserNames
  151. //
  152. typedef struct _DOM_CACHE_T {
  153. DWORD NoOfUsers;
  154. HANDLE EvtHdl;
  155. DWORD EntriesRead;
  156. DWORD SzOfBlock;
  157. LPVOID pInfo;
  158. BOOL bRefresh;
  159. } DOM_CACHE_T;
  160. //
  161. // WINSCNF_CNF_T --
  162. // Holds all the configuration information about the WINS
  163. //
  164. typedef struct _WINSCNF_CNF_T {
  165. DWORD MagicNo; //Id.
  166. DWORD LogDetailedEvts; //log detailed events
  167. DWORD NoOfProcessors; // No of processors on the WINS machine
  168. DWORD NoOfDbBuffers; //No of buffers to specify to Jet
  169. WINSCNF_SPEC_GRP_MASKS_T SpecGrpMasks;
  170. WINSCNF_STATE_E State_e; //State
  171. DWORD RefreshInterval; //Refresh time interval
  172. DWORD TombstoneInterval; //Tombstone time interval
  173. DWORD TombstoneTimeout; //Tombstone timeout
  174. DWORD VerifyInterval; //Verify time interval
  175. DWORD ScvChunk; //# of records to handle at one
  176. //time by the scavenger thread
  177. DWORD MaxNoOfRetries; //Max # of retries for challenges
  178. DWORD RetryInterval; //Retry time interval
  179. LPBYTE pWinsDb; //db file name
  180. DWORD NoOfDataFiles; //no of files to use for static init
  181. PWINSCNF_DATAFILE_INFO_T pStaticDataFile;
  182. BOOL fStaticInit; //Do static initialization of WINS
  183. HANDLE WinsKChgEvtHdl; /*event to specify to
  184. *RegNotifyChangeKeyValue
  185. */
  186. HANDLE ParametersKChgEvtHdl; /*event to specify to
  187. *RegNotifyChangeKeyValue
  188. */
  189. HANDLE PartnersKChgEvtHdl; /*event to specify to
  190. *RegNotifyChangeKeyValue
  191. */
  192. HANDLE CnfChgEvtHdl; //Manual reset event to signal on
  193. //to notify other threads of config
  194. //change
  195. HANDLE LogHdl; /*
  196. * Handle to the WINS event log
  197. * Used by ReportEvent
  198. */
  199. DWORD WinsPriorityClass; //Priority class of the process
  200. DWORD MaxNoOfWrkThds; //Max. no. of worker thds.
  201. int ScvThdPriorityLvl;
  202. DWORD MaxRplTimeInterval; //max. rpl time interval
  203. BOOL fRplOnlyWCnfPnrs; //Rpl only with Pull/Push Pnrs
  204. BOOL fAdd1Bto1CQueries; //1B name should prepend responses to queries for 1C names
  205. #if MCAST > 0
  206. BOOL fUseSelfFndPnrs; //Rpl with Pnrs found by self
  207. DWORD McastTtl; // TTL for Mcast packets
  208. DWORD McastIntvl; // Time interval for mcast packets
  209. #endif
  210. BOOL fLoggingOn; //Turn on logging flag
  211. LPBYTE pLogFilePath; //Path to log file
  212. LPBYTE pBackupDirPath; //Path to backup directory
  213. BOOL fDoBackupOnTerm; //To turn on backup on termination
  214. BOOL fPStatic; //Set it TRUE to make static
  215. //records p-static
  216. BOOL fPersonaGrata; // TRUE/FALSE if pPersonaList is persona grata/non-grata
  217. DWORD NoOfPersona; // number of personas in the pPersonas
  218. PCOMM_ADD_T pPersonaList; // list of Personas
  219. DWORD RplType; //Rpl types (defined in winscnf.h)
  220. BOOL fNoRplOnErr; //stop rpl on error
  221. #if PRSCONN
  222. BOOL fPrsConn; //Prs Conn
  223. #endif
  224. WINSCNF_CC_T CC; //Consistency Chk
  225. BOOL fDoSpoofing;
  226. BOOL fRandomize1CList; // whether or not to randomize 1C list
  227. // list members.
  228. struct _PULL_T {
  229. DWORD MaxNoOfRetries; //no of retries to do in case
  230. //of comm. failure
  231. DWORD NoOfPushPnrs; //No of Push Pnrs
  232. PRPL_CONFIG_REC_T pPullCnfRecs; //ptr. to buff holding
  233. //cnf records for PULL
  234. //thd
  235. DWORD InitTimeRpl; // indicates whether
  236. // Replication
  237. //should be done at invocation
  238. DWORD RplType; //replication type
  239. #if PRSCONN
  240. BOOL fPrsConn;
  241. #endif
  242. } PullInfo;
  243. struct _PUSH_T {
  244. BOOL fAddChgTrigger; //trigger repl. on address chg
  245. //of entry owned by us
  246. DWORD NoOfPullPnrs; //No of Pull Pnrs
  247. DWORD NoPushRecsWValUpdCnt;
  248. PRPL_CONFIG_REC_T pPushCnfRecs; //ptr to buffer holding
  249. //cnf records for PUSH
  250. //thd
  251. DWORD InitTimePush; //indicates whether Push
  252. // notifications should
  253. //be sent at invocation
  254. BOOL PropNetUpdNtf; //set to TRUE if we want
  255. //net triggers to be
  256. //propagated
  257. DWORD RplType; //replication type
  258. #if PRSCONN
  259. BOOL fPrsConn;
  260. #endif
  261. } PushInfo;
  262. } WINSCNF_CNF_T, *PWINSCNF_CNF_T;
  263. /*
  264. function declarations
  265. */
  266. #if USENETBT > 0
  267. extern
  268. STATUS
  269. WinsCnfReadNbtDeviceName(
  270. VOID
  271. );
  272. #endif
  273. extern
  274. STATUS
  275. WinsCnfInitConfig(
  276. VOID
  277. );
  278. extern
  279. VOID
  280. WinsCnfSetLastUpdCnt(
  281. PWINSCNF_CNF_T pWinsCnf
  282. );
  283. extern
  284. VOID
  285. WinsCnfReadRegInfo(
  286. PWINSCNF_CNF_T pWinsCnf
  287. );
  288. extern
  289. VOID
  290. WinsCnfCopyWinsCnf(
  291. WINS_CLIENT_E Client_e,
  292. PWINSCNF_CNF_T pSrc
  293. );
  294. extern
  295. LPVOID
  296. WinsCnfGetNextRplCnfRec(
  297. PRPL_CONFIG_REC_T pCnfRec,
  298. RPL_REC_TRAVERSAL_E RecTrv_e
  299. );
  300. extern
  301. VOID
  302. WinsCnfAskToBeNotified(
  303. WINSCNF_KEY_E Key_e
  304. );
  305. extern
  306. VOID
  307. WinsCnfDeallocCnfMem(
  308. PWINSCNF_CNF_T pWinsCnf
  309. );
  310. extern
  311. VOID
  312. WinsCnfReadWinsInfo(
  313. PWINSCNF_CNF_T pWinsCnf
  314. );
  315. extern
  316. VOID
  317. WinsCnfReadPartnerInfo(
  318. PWINSCNF_CNF_T pWinsCnf
  319. );
  320. extern
  321. VOID
  322. WinsCnfOpenSubKeys(
  323. VOID
  324. );
  325. extern
  326. VOID
  327. WinsCnfCloseKeys(
  328. VOID
  329. );
  330. extern
  331. VOID
  332. WinsCnfCloseSubKeys(
  333. VOID
  334. );
  335. extern
  336. STATUS
  337. WinsCnfGetNamesOfDataFiles(
  338. IN PWINSCNF_CNF_T pWinsCnf
  339. );
  340. extern
  341. DWORD
  342. WinsCnfWriteReg(
  343. LPVOID pTmp
  344. );
  345. extern
  346. STATUS
  347. WinsCnfInitLog(
  348. VOID
  349. );
  350. #if MCAST > 0
  351. extern
  352. STATUS
  353. WinsCnfAddPnr(
  354. RPL_RR_TYPE_E PnrType_e,
  355. LPBYTE pPnrAdd
  356. );
  357. extern
  358. STATUS
  359. WinsCnfDelPnr(
  360. RPL_RR_TYPE_E PnrType_e,
  361. LPBYTE pPnrAdd
  362. );
  363. #endif
  364. #ifdef DBGSVC
  365. extern
  366. VOID
  367. WinsCnfReadWinsDbgFlagValue(
  368. VOID
  369. );
  370. #endif
  371. #ifdef __cplusplus
  372. }
  373. #endif
  374. #endif //_WINSCNF_