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.

1240 lines
44 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 2000.
  5. //
  6. // File: PARAMS.HXX
  7. //
  8. // Contents: Default content index parameters
  9. //
  10. // History: 25-Mar-92 BartoszM Created.
  11. // 04-Jan-94 DwightKr Added MAX_PERSIST_DEL_RECORDS
  12. // 19-Oct-98 SundarA Added IS_ENUM_ALLOWED
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <ciintf.h>
  17. const BOOL CI_GENERATE_RELEVANT_WORDS_DEFAULT = FALSE;
  18. const BOOL CI_FFILTER_FILES_WITH_UNKNOWN_EXTENSIONS_DEFAULT = TRUE;
  19. const BOOL CI_FILTER_CONTENTS_DEFAULT = TRUE;
  20. //
  21. // Maximum time spent creating a clustering.
  22. // Units: seconds
  23. // Note: this isn't currenly used anywhere.
  24. //
  25. const ULONG CI_CLUSTERINGTIME_DEFAULT = 500;
  26. const ULONG CI_CLUSTERINGTIME_MIN = 100;
  27. const ULONG CI_CLUSTERINGTIME_MAX = 10000;
  28. //
  29. // Minimum number of idle threads kept alive to process
  30. // incoming queries.
  31. //
  32. const ULONG CI_MIN_IDLE_QUERY_THREADS_DEFAULT = 1;
  33. const ULONG CI_MIN_IDLE_QUERY_THREADS_MIN = 0;
  34. const ULONG CI_MIN_IDLE_QUERY_THREADS_MAX = 1000;
  35. //
  36. // Maximum number of query threads. This caps the number of concurrently
  37. // processed asynchronous queries.
  38. //
  39. const ULONG CI_MAX_ACTIVE_QUERY_THREADS_DEFAULT = 2;
  40. const ULONG CI_MAX_ACTIVE_QUERY_THREADS_MIN = 1;
  41. const ULONG CI_MAX_ACTIVE_QUERY_THREADS_MAX = 1000;
  42. //
  43. // Minimum number of idle request threads kept alive to process
  44. // incoming query requests.
  45. //
  46. const ULONG CI_MIN_IDLE_REQUEST_THREADS_DEFAULT = 1;
  47. const ULONG CI_MIN_IDLE_REQUEST_THREADS_MIN = 0;
  48. const ULONG CI_MIN_IDLE_REQUEST_THREADS_MAX = 1000;
  49. //
  50. // Maximum number of request threads. This caps the number of concurrently
  51. // processed synchronous queries.
  52. //
  53. const ULONG CI_MAX_ACTIVE_REQUEST_THREADS_DEFAULT = 2;
  54. const ULONG CI_MAX_ACTIVE_REQUEST_THREADS_MIN = 1;
  55. const ULONG CI_MAX_ACTIVE_REQUEST_THREADS_MAX = 1000;
  56. //
  57. // Maximum number of simultaneous query/catalog request connections
  58. // (pipe instances).
  59. //
  60. const ULONG CI_MAX_SIMULTANEOUS_REQUESTS_DEFAULT = 100;
  61. const ULONG CI_MAX_SIMULTANEOUS_REQUESTS_MIN = 1;
  62. const ULONG CI_MAX_SIMULTANEOUS_REQUESTS_MAX = 20000;
  63. //
  64. // Maximum number of cached pipe instances
  65. //
  66. const ULONG CI_MAX_CACHED_PIPES_DEFAULT = 3;
  67. const ULONG CI_MAX_CACHED_PIPES_MIN = 0;
  68. const ULONG CI_MAX_CACHED_PIPES_MAX = 1000;
  69. //
  70. // Timeout (in milleseconds) for clients trying to obtain a pipe instance
  71. // when all available pipe instances are busy.
  72. //
  73. const ULONG CI_REQUEST_TIMEOUT_DEFAULT = 10000;
  74. const ULONG CI_REQUEST_TIMEOUT_MIN = 0;
  75. const ULONG CI_REQUEST_TIMEOUT_MAX = 1000000000;
  76. //
  77. // Minimum idle time a client can enjoy. After this expires, it can be
  78. // kicked out on the server's discretion to allow newer clients.
  79. // This is in seconds.
  80. //
  81. const ULONG CI_MIN_CLIENT_IDLE_TIME = 600; // 10 minutes. Is this a reasonable default?
  82. //
  83. // W3 Server Instance #
  84. //
  85. const ULONG CI_W3SVC_INSTANCE_DEFAULT = 1;
  86. const ULONG CI_W3SVC_INSTANCE_MIN = 1;
  87. const ULONG CI_W3SVC_INSTANCE_MAX = ~0;
  88. //
  89. // NNTP Server Instance #
  90. //
  91. const ULONG CI_NNTPSVC_INSTANCE_DEFAULT = 1;
  92. const ULONG CI_NNTPSVC_INSTANCE_MIN = 1;
  93. const ULONG CI_NNTPSVC_INSTANCE_MAX = ~0;
  94. //
  95. // IMAP Server Instance #
  96. //
  97. const ULONG CI_IMAPSVC_INSTANCE_DEFAULT = 1;
  98. const ULONG CI_IMAPSVC_INSTANCE_MIN = 1;
  99. const ULONG CI_IMAPSVC_INSTANCE_MAX = ~0;
  100. //
  101. // Whether to trim working set when idle
  102. //
  103. const BOOL CI_MINIMIZE_WORKINGSET_DEFAULT = 0;
  104. //
  105. // Maximum amount of time to execute a query in a single time-slice.
  106. // If more asynchronous queries are active than allowed query threads,
  107. // then a query is put back on the pending queue after this time interval.
  108. // Timeslicing is done only after a matching row is found, so the time
  109. // spent in a timeslice may overrun this and a considerable number of
  110. // rows may be examined in the time slice.
  111. //
  112. // Units: milliseconds of CPU time
  113. //
  114. const ULONG CI_MAX_QUERY_TIMESLICE_DEFAULT = 50;
  115. const ULONG CI_MAX_QUERY_TIMESLICE_MIN = 1;
  116. const ULONG CI_MAX_QUERY_TIMESLICE_MAX = 1000;
  117. //
  118. // Maximum execution time of a query. If a query takes more than this
  119. // amount of CPU time, processing of it will be stopped and an error
  120. // status indicated.
  121. // A special value of 0 means no timeout or timeout specified by the client
  122. //
  123. // Units: milliseconds of CPU time
  124. //
  125. const ULONG CI_MAX_QUERY_EXECUTION_TIME_DEFAULT = 10*1000;
  126. const ULONG CI_MAX_QUERY_EXECUTION_TIME_MIN = 0;
  127. const ULONG CI_MAX_QUERY_EXECUTION_TIME_MAX = ~0;
  128. //++++++++++++++++++++++++++++++++++++
  129. //+ Content index parameters +
  130. //++++++++++++++++++++++++++++++++++++
  131. //
  132. // Sleep time between merges. Content index wakes up this often to determine
  133. // if a merge is necessary. Usually an annealing merge, but may be a shadow
  134. // or master merge.
  135. //
  136. // Units: minutes
  137. //
  138. const ULONG CI_MAX_MERGE_INTERVAL_DEFAULT = 10;
  139. const ULONG CI_MAX_MERGE_INTERVAL_MIN = 1;
  140. const ULONG CI_MAX_MERGE_INTERVAL_MAX = 60;
  141. //
  142. // Priority class of the filter process. Priority within class is always
  143. // above normal.
  144. //
  145. const int CI_THREAD_CLASS_FILTER_DEFAULT = IDLE_PRIORITY_CLASS;
  146. const int CI_THREAD_CLASS_FILTER_MIN = NORMAL_PRIORITY_CLASS;
  147. const int CI_THREAD_CLASS_FILTER_MAX = HIGH_PRIORITY_CLASS;
  148. //
  149. // Maximum number of word lists that can exists at one time.
  150. //
  151. const ULONG CI_MAX_WORDLISTS_DEFAULT = 25;
  152. const ULONG CI_MAX_WORDLISTS_MIN = 10;
  153. const ULONG CI_MAX_WORDLISTS_MAX = 2000;
  154. //
  155. // Minimum combined size of wordlists which will force shadow merge.
  156. // Units: 4k pages.
  157. //
  158. const ULONG CI_MIN_SIZE_MERGE_WORDLISTS_DEFAULT = 256;
  159. const ULONG CI_MIN_SIZE_MERGE_WORDLISTS_MIN = 16;
  160. const ULONG CI_MIN_SIZE_MERGE_WORDLISTS_MAX = ~0;
  161. //
  162. // Minimum free memory for wordlist creation.
  163. // Units: MBytes
  164. //
  165. const ULONG CI_MIN_WORDLIST_MEMORY_DEFAULT = 5;
  166. const ULONG CI_MIN_WORDLIST_MEMORY_MIN = 1;
  167. const ULONG CI_MIN_WORDLIST_MEMORY_MAX = 100;
  168. //
  169. // Milliseconds after system boot until CI starts scanning/filtering
  170. // Units: Milliseconds
  171. //
  172. const ULONG CI_STARTUP_DELAY_DEFAULT = 1000 * 60 * 8; // 8 minutes
  173. const ULONG CI_STARTUP_DELAY_MIN = 0;
  174. const ULONG CI_STARTUP_DELAY_MAX = ~0;
  175. //
  176. // More than this amount of I/O results in a delay before
  177. // creating a word list.
  178. // Units: KB/Sec
  179. //
  180. const ULONG CI_MAX_WORDLIST_IO_MIN = 100;
  181. const ULONG CI_MAX_WORDLIST_IO_MAX = ~0;
  182. const ULONG CI_MAX_WORDLIST_IO_DEFAULT = 410; // ~ 2 Mb / 5 Seconds
  183. //
  184. // More than this amount of I/O results in a delay before creating a
  185. // word list. FSCI-specific, and only enabled if DiskPerf counters are
  186. // enabled.
  187. // Units: % Disk in use.
  188. //
  189. const ULONG CI_MAX_WORDLIST_IO_DISKPERF_MIN = 1; // 0% doesn't make any sense. We'd never run.
  190. const ULONG CI_MAX_WORDLIST_IO_DISKPERF_MAX = 100;
  191. const ULONG CI_MAX_WORDLIST_IO_DISKPERF_DEFAULT = 10;
  192. //
  193. // Interval at which resource limitations such as low memory and
  194. // heavy [user] I/O will be checked. This is the minimum unit of
  195. // time devoted to wordlist creation.
  196. // Units: Seconds
  197. //
  198. const ULONG CI_WORDLIST_RESOURCE_CHECK_INTERVAL_MIN = 5;
  199. const ULONG CI_WORDLIST_RESOURCE_CHECK_INTERVAL_MAX = ~0;
  200. const ULONG CI_WORDLIST_RESOURCE_CHECK_INTERVAL_DEFAULT = 60;
  201. //
  202. // Maximum fresh list entries--forces master merge
  203. // Each fresh entry takes up 8 bytes.
  204. //
  205. const ULONG CI_MAX_FRESHCOUNT_DEFAULT = 60000;
  206. const ULONG CI_MAX_FRESHCOUNT_MIN = 1000;
  207. const ULONG CI_MAX_FRESHCOUNT_MAX = ~0;
  208. //
  209. // Maximum number of delete entries in fresh list before a
  210. // delete merge is forced.
  211. //
  212. const ULONG CI_MAX_FRESH_DELETES_DEFAULT = 5000;
  213. const ULONG CI_MAX_FRESH_DELETES_MIN = 10;
  214. const ULONG CI_MAX_FRESH_DELETES_MAX = ~0;
  215. //
  216. // Maximum amount of data which can be gernated from a single file, based
  217. // on its size. This value is a multiplier. 8 means that a file can generate
  218. // up to 8 times it size in content index data.
  219. //
  220. const ULONG CI_MAX_FILESIZE_MULTIPLIER_DEFAULT = 8;
  221. const ULONG CI_MAX_FILESIZE_MULTIPLIER_MIN = 4;
  222. const ULONG CI_MAX_FILESIZE_MULTIPLIER_MAX = ~0;
  223. //
  224. // Time at which master merge will occur. This is stored as the number of
  225. // minutes after midnight.
  226. // Units: minutes
  227. //
  228. const ULONG CI_MASTER_MERGE_TIME_DEFAULT = 60;
  229. const ULONG CI_MASTER_MERGE_TIME_MIN = 0;
  230. const ULONG CI_MASTER_MERGE_TIME_MAX = 1439;
  231. //
  232. // Maximum number of indices considered acceptable in a well-tuned system.
  233. // When the number of indices climbs above this number and the system is
  234. // idle then an 'annealing' merge will take place to bring the total count
  235. // of indices under this number.
  236. //
  237. const ULONG CI_MAX_IDEAL_INDEXES_DEFAULT = 5;
  238. const ULONG CI_MAX_IDEAL_INDEXES_MIN = 2;
  239. const ULONG CI_MAX_IDEAL_INDEXES_MAX = 100;
  240. //
  241. // If average system idle time for the last merge check period is greater
  242. // than this value, then we may perform an annealing merge.
  243. // Units: Percentage of total CPU time.
  244. //
  245. const ULONG CI_MIN_MERGE_IDLE_TIME_DEFAULT = 90;
  246. const ULONG CI_MIN_MERGE_IDLE_TIME_MIN = 10;
  247. const ULONG CI_MIN_MERGE_IDLE_TIME_MAX = 100;
  248. //
  249. // Time interval between forced scans on network shares with no notifications.
  250. // Units: minutes
  251. //
  252. const ULONG CI_FORCED_NETPATH_SCAN_DEFAULT = 120;
  253. const ULONG CI_FORCED_NETPATH_SCAN_MIN = 10;
  254. const ULONG CI_FORCED_NETPATH_SCAN_MAX = 0x00FFFFFF;
  255. //
  256. // Maximum # of catalogs that can be opened at once.
  257. // Units: count of catalogs
  258. //
  259. const ULONG CI_MAX_CATALOGS_DEFAULT = 33; // enough to fit in 1 perfmon shared-memory page
  260. const ULONG CI_MAX_CATALOGS_MIN = 1;
  261. const ULONG CI_MAX_CATALOGS_MAX = 1000;
  262. //
  263. // Default value for _fIsEnumAllowed is TRUE
  264. //
  265. const BOOL CI_IS_ENUM_ALLOWED_DEFAULT = TRUE;
  266. //
  267. // Default value for _fIsReadOnly is FALSE
  268. //
  269. const BOOL CI_IS_READ_ONLY_DEFAULT = FALSE;
  270. //
  271. // Number of megabytes to leave on disk
  272. // If there is less than this amount of space on disk then fail attempts to
  273. // extend files.
  274. //
  275. const ULONG CI_MIN_DISK_SPACE_TO_LEAVE_DEFAULT = 20;
  276. const ULONG CI_MIN_DISK_SPACE_TO_LEAVE_MIN = 0;
  277. const ULONG CI_MIN_DISK_SPACE_TO_LEAVE_MAX = ~0;
  278. //++++++++++++++++++++++++++++++++++++++
  279. //+ IDQ ISAPI extension parameters +
  280. //++++++++++++++++++++++++++++++++++++++
  281. //
  282. // Maximum total number of rows to fetch for a single query.
  283. //
  284. const ULONG IS_MAX_ROWS_IN_RESULT_DEFAULT = 0;
  285. const ULONG IS_MAX_ROWS_IN_RESULT_MIN = 0;
  286. const ULONG IS_MAX_ROWS_IN_RESULT_MAX = 1000000;
  287. //
  288. // Only fetch and sort this number of rows in a single query.
  289. //
  290. const ULONG IS_FIRST_ROWS_IN_RESULT_DEFAULT = 0;
  291. const ULONG IS_FIRST_ROWS_IN_RESULT_MIN = 0;
  292. const ULONG IS_FIRST_ROWS_IN_RESULT_MAX = 1000000;
  293. //
  294. // Maximum number of cached queries.
  295. //
  296. const ULONG IS_MAX_ENTRIES_IN_CACHE_DEFAULT = 10;
  297. const ULONG IS_MAX_ENTRIES_IN_CACHE_MIN = 0;
  298. const ULONG IS_MAX_ENTRIES_IN_CACHE_MAX = 100;
  299. //
  300. // Time interval a query cache entry will remain live.
  301. // Units: Minutes
  302. //
  303. const ULONG IS_QUERY_CACHE_PURGE_INTERVAL_DEFAULT = 5;
  304. const ULONG IS_QUERY_CACHE_PURGE_INTERVAL_MIN = 1;
  305. const ULONG IS_QUERY_CACHE_PURGE_INTERVAL_MAX = 120;
  306. //
  307. // Default IS catalog directory
  308. extern const WCHAR * IS_DEFAULT_CATALOG_DIRECTORY;
  309. //
  310. // # of web query requests to queue at most when busy with
  311. // other queries
  312. // Units: Count
  313. //
  314. const ULONG IS_QUERY_REQUEST_QUEUE_SIZE_DEFAULT = 16;
  315. const ULONG IS_QUERY_REQUEST_QUEUE_SIZE_MIN = 0;
  316. const ULONG IS_QUERY_REQUEST_QUEUE_SIZE_MAX = 100000;
  317. //
  318. // # of threads per processor beyond which query requests are queued.
  319. // Units: Count of threads per processor
  320. //
  321. const ULONG IS_QUERY_REQUEST_THRESHOLD_FACTOR_DEFAULT = 3;
  322. const ULONG IS_QUERY_REQUEST_THRESHOLD_FACTOR_MIN = 1;
  323. const ULONG IS_QUERY_REQUEST_THRESHOLD_FACTOR_MAX = 100000;
  324. //
  325. // Date/Time formatting settings for IDQ
  326. // 0 -- user default locale (slow) (half of all time spent formatting date/time)
  327. // 1 -- system default locale (ok) (default)
  328. // 2 -- hard-coded formatting (fast)
  329. //
  330. const ULONG IS_QUERY_DATETIME_FORMATTING_DEFAULT = 1;
  331. const ULONG IS_QUERY_DATETIME_FORMATTING_MIN = 0;
  332. const ULONG IS_QUERY_DATETIME_FORMATTING_MAX = 2;
  333. //
  334. // Date/Time local/gmt settings for IDQ
  335. // 0 -- GMT (default)
  336. // 1 -- Local system time
  337. //
  338. const ULONG IS_QUERY_DATETIME_LOCAL_DEFAULT = 0;
  339. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  340. //+ Internal parameters (not exposed outside registry) +
  341. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  342. //
  343. // maximum number of updates passed by the catalog
  344. // update to content index in a single batch
  345. //
  346. const ULONG CI_MAX_UPDATES_DEFAULT = 100;
  347. const ULONG CI_MAX_UPDATES_MIN = 50;
  348. const ULONG CI_MAX_UPDATES_MAX = 200;
  349. //
  350. // Maximum size (in 4k pages) of wordlist at which new documents
  351. // can still be added to wordlist.
  352. //
  353. const ULONG CI_MAX_WORDLIST_SIZE_DEFAULT = 20;
  354. const ULONG CI_MAX_WORDLIST_SIZE_MIN = 10;
  355. const ULONG CI_MAX_WORDLIST_SIZE_MAX = 262144;
  356. //
  357. // Time to wait after low resource conditions before retrying operation.
  358. // Units: seconds
  359. //
  360. const ULONG CI_LOW_RESOURCE_SLEEP_DEFAULT = 180;
  361. const ULONG CI_LOW_RESOURCE_SLEEP_MIN = 5;
  362. const ULONG CI_LOW_RESOURCE_SLEEP_MAX = 1200; // 20 minutes
  363. //
  364. // Maximum memory load for wordlist creation
  365. // Units: percentage of total memory
  366. //
  367. const ULONG CI_MAX_WORDLIST_MEMORY_LOAD_DEFAULT = 95;
  368. const ULONG CI_MAX_WORDLIST_MEMORY_LOAD_MIN = 80;
  369. const ULONG CI_MAX_WORDLIST_MEMORY_LOAD_MAX = 95;
  370. //
  371. // Number of chunks allowed in the in-memory copy of the change list.
  372. // Units: chunks
  373. //
  374. const ULONG CI_MAX_QUEUE_CHUNKS_DEFAULT = 20;
  375. const ULONG CI_MAX_QUEUE_CHUNKS_MIN = 10;
  376. const ULONG CI_MAX_QUEUE_CHUNKS_MAX = 30;
  377. //
  378. // Number of kilobytes to process before checkpointing during master merge
  379. // Units: Kbytes
  380. //
  381. const ULONG CI_MASTER_MERGE_CHECKPOINT_INTERVAL_DEFAULT = 0x0800;
  382. const ULONG CI_MASTER_MERGE_CHECKPOINT_INTERVAL_MIN = 0x0100;
  383. const ULONG CI_MASTER_MERGE_CHECKPOINT_INTERVAL_MAX = 0x1000;
  384. //
  385. // Maximum number of indexes. Normally, a shadow merge will merge all
  386. // existing wordlists into a new shadow index. When the total number of
  387. // indexes climbs beyond this count, then existing shadow indexes will
  388. // participate in a shadow merge.
  389. //
  390. const ULONG CI_MAX_INDEXES_DEFAULT = 25;
  391. const ULONG CI_MAX_INDEXES_MIN = 10;
  392. const ULONG CI_MAX_INDEXES_MAX = 150;
  393. //
  394. // Memory buffer size used for CI filter to communicate between
  395. // server and kernel space.
  396. // Units: KBytes
  397. //
  398. const ULONG CI_FILTER_BUFFER_SIZE_DEFAULT = 128;
  399. const ULONG CI_FILTER_BUFFER_SIZE_MIN = 64;
  400. const ULONG CI_FILTER_BUFFER_SIZE_MAX = 1024;
  401. #if 0
  402. //
  403. // Time in minutes between polling the system for new OFS drives to start
  404. // filtering.
  405. // Units: minutes
  406. //
  407. const ULONG CI_CHANGE_NOTIFICATION_INTERVAL_DEFAULT = 15;
  408. const ULONG CI_CHANGE_NOTIFICATION_INTERVAL_MIN = 1;
  409. const ULONG CI_CHANGE_NOTIFICATION_INTERVAL_MAX = 20;
  410. #endif
  411. //
  412. // Number of attempts to filter a document.
  413. //
  414. //
  415. const ULONG CI_FILTER_RETRIES_DEFAULT = 4;
  416. const ULONG CI_FILTER_RETRIES_MIN = 1;
  417. const ULONG CI_FILTER_RETRIES_MAX = 10;
  418. //
  419. // Number of attempts to filter a document in secondary Q.
  420. //
  421. //
  422. const ULONG CI_SECQ_FILTER_RETRIES_DEFAULT = 10;
  423. const ULONG CI_SECQ_FILTER_RETRIES_MIN = 0;
  424. const ULONG CI_SECQ_FILTER_RETRIES_MAX = 32000; // long enough
  425. //
  426. // Interval between retries for filtering "open" documents.
  427. // Units: minutes
  428. //
  429. const ULONG CI_FILTER_RETRY_INTERVAL_DEFAULT = 5;
  430. const ULONG CI_FILTER_RETRY_INTERVAL_MIN = 1;
  431. const ULONG CI_FILTER_RETRY_INTERVAL_MAX = 240;
  432. //
  433. // Filtering delay in case there are very few documents to be filtered. This
  434. // will allow filtering more documents per call rather than 1 per call.
  435. // Units: seconds
  436. //
  437. const ULONG CI_FILTER_DELAY_INTERVAL_DEFAULT = 20;
  438. const ULONG CI_FILTER_DELAY_INTERVAL_MIN = 0;
  439. const ULONG CI_FILTER_DELAY_INTERVAL_MAX = 600;
  440. //
  441. // If the number of un-filtered documents is below this threshold, a filtering
  442. // delay will be introduced.
  443. //
  444. const ULONG CI_FILTER_REMAINING_THRESHOLD_DEFAULT = 32;
  445. const ULONG CI_FILTER_REMAINING_THRESHOLD_MIN = 0;
  446. const ULONG CI_FILTER_REMAINING_THRESHOLD_MAX = 320;
  447. //
  448. // If a filter has not been used in the below time, the daemon will ask if
  449. // it can unload its DLL.
  450. // Units: milliseconds
  451. //
  452. const ULONG CI_FILTER_IDLE_TIMEOUT_DEFAULT = 15 * 60 * 1000;
  453. const ULONG CI_FILTER_IDLE_TIMEOUT_MIN = 0;
  454. const ULONG CI_FILTER_IDLE_TIMEOUT_MAX = ~0;
  455. //
  456. // Min disk space available before a master merge is forced, thus freeing
  457. // up disk space.
  458. // Units: percentage of disk size
  459. //
  460. const ULONG CI_MIN_DISKFREE_FORCE_MERGE_DEFAULT = 15;
  461. const ULONG CI_MIN_DISKFREE_FORCE_MERGE_MIN = 5;
  462. const ULONG CI_MIN_DISKFREE_FORCE_MERGE_MAX = 25;
  463. //
  464. // Max disk free space consumed by shadow indexes before a master merge
  465. // is forced, thus freeing up a significant portion of shadow index
  466. // disk space.
  467. // Units: percentage of disk free space
  468. //
  469. const ULONG CI_MAX_SHADOW_FREE_FORCE_MERGE_DEFAULT = 20;
  470. const ULONG CI_MAX_SHADOW_FREE_FORCE_MERGE_MIN = 5;
  471. const ULONG CI_MAX_SHADOW_FREE_FORCE_MERGE_MAX = ~0;
  472. //
  473. // Max combined size of shadow indexes before a master merge is forced.
  474. // Units: percentage of disk space
  475. //
  476. const ULONG CI_MAX_SHADOW_INDEX_SIZE_DEFAULT = 15;
  477. const ULONG CI_MAX_SHADOW_INDEX_SIZE_MIN = 5;
  478. const ULONG CI_MAX_SHADOW_INDEX_SIZE_MAX = 25;
  479. //
  480. // Time to wait for a response from the CI daemon on a query status
  481. // call.
  482. // Units: minutes
  483. //
  484. const ULONG CI_DAEMON_RESPONSE_TIMEOUT_DEFAULT = 5;
  485. const ULONG CI_DAEMON_RESPONSE_TIMEOUT_MIN = 1;
  486. const ULONG CI_DAEMON_RESPONSE_TIMEOUT_MAX = 120;
  487. //
  488. // Maximum number of documents pending filtering before considering
  489. // CI out-of-date for property queries.
  490. // Units: documents
  491. //
  492. const ULONG CI_MAX_PENDING_DOCUMENTS_DEFAULT = 32;
  493. const ULONG CI_MAX_PENDING_DOCUMENTS_MIN = 1;
  494. const ULONG CI_MAX_PENDING_DOCUMENTS_MAX = 50000;
  495. //
  496. // Whether or not characterizations are generated and stored by default
  497. // in the ci, and the max size in wide characters if they are generated.
  498. //
  499. const ULONG CI_MAX_CHARACTERIZATION_DEFAULT = 160;
  500. const ULONG CI_MAX_CHARACTERIZATION_MIN = 0;
  501. const ULONG CI_MAX_CHARACTERIZATION_MAX = 500;
  502. //
  503. // Determines whether characterizations should be generated at all. (Default: TRUE)
  504. //
  505. const ULONG CI_GENERATE_CHARACTERIZATION_DEFAULT = 1;
  506. const ULONG CI_GENERATE_CHARACTERIZATION_MIN = 0;
  507. const ULONG CI_GENERATE_CHARACTERIZATION_MAX = 1;
  508. //
  509. // Size of the property store mapped large pages cache (in physical storage)
  510. // Units: pages
  511. //
  512. const ULONG CI_PROPERTY_STORE_MAPPED_CACHE_DEFAULT = 4;
  513. const ULONG CI_PROPERTY_STORE_MAPPED_CACHE_MIN = 0;
  514. const ULONG CI_PROPERTY_STORE_MAPPED_CACHE_MAX = ~0;
  515. //
  516. // The mode for backing off on scans
  517. // 0 -- no backing off -- the original behavior
  518. // 1 -- moderate backoff
  519. // 10 -- aggressive backoff
  520. // 11-20 -- reserved for special cases like battery power
  521. const ULONG CI_SCAN_BACKOFF_DEFAULT = 3;
  522. const ULONG CI_SCAN_BACKOFF_MIN = 0;
  523. const ULONG CI_SCAN_BACKOFF_MAX_RANGE = 10;
  524. const ULONG CI_SCAN_BACKOFF_MAX = 20;
  525. //
  526. // Number of OS pages to be backed up in the backup page
  527. // Min filesize is 128 KB and max is 2 GB
  528. //
  529. #if defined (_X86_)
  530. const ULONG CI_PROPERTY_STORE_BACKUP_SIZE_DEFAULT = 1024;
  531. const ULONG CI_PROPERTY_STORE_BACKUP_SIZE_MIN = 32;
  532. const ULONG CI_PROPERTY_STORE_BACKUP_SIZE_MAX = 500000;
  533. ;///////////////////// RISC ////////////////
  534. #else
  535. const ULONG CI_PROPERTY_STORE_BACKUP_SIZE_DEFAULT = 512;
  536. const ULONG CI_PROPERTY_STORE_BACKUP_SIZE_MIN = 16;
  537. const ULONG CI_PROPERTY_STORE_BACKUP_SIZE_MAX = 250000;
  538. #endif
  539. //
  540. // Maximum number of expanded restriction nodes in a single query
  541. //
  542. const ULONG CI_MAX_RESTRICTION_NODES_DEFAULT = 5000;
  543. const ULONG CI_MAX_RESTRICTION_NODES_MIN = 1;
  544. const ULONG CI_MAX_RESTRICTION_NODES_MAX = ~0;
  545. //
  546. // Whether CI should auto-alias (add fixups for net shares). (default TRUE)
  547. //
  548. const BOOL CI_IS_AUTO_ALIAS_DEFAULT = 1;
  549. //
  550. // Maximum refresh frequency for alias checks
  551. // Units: Minutes
  552. //
  553. const ULONG CI_MAX_AUTO_ALIAS_REFRESH_DEFAULT = 15;
  554. const ULONG CI_MAX_AUTO_ALIAS_REFRESH_MIN = 0;
  555. const ULONG CI_MAX_AUTO_ALIAS_REFRESH_MAX = 10080; // 1 week
  556. //
  557. // Force path fixups in query results, default is FALSE
  558. //
  559. const ULONG CI_FORCE_PATH_ALIAS_DEFAULT = 0;
  560. //
  561. // Whether CI should index w3 vroots (default TRUE)
  562. //
  563. const BOOL CI_IS_INDEXING_W3_ROOTS_DEFAULT = 1;
  564. //
  565. // Whether CI should index nntp vroots (default FALSE)
  566. //
  567. const ULONG CI_IS_INDEXING_NNTP_ROOTS_DEFAULT = 0;
  568. //
  569. // Whether CI should index imap vroots (default FALSE)
  570. //
  571. const ULONG CI_IS_INDEXING_IMAP_ROOTS_DEFAULT = 0;
  572. //
  573. // Wether to auto-mount catalogs on the roots of removable drives (TRUE)
  574. //
  575. const ULONG CI_AUTO_MOUNT_CATALOGS_DEFAULT = 1;
  576. //
  577. // Whether directories should be filtered and returned in queries by default
  578. //
  579. const ULONG CI_FILTER_DIRECTORIES_DEFAULT = 1;
  580. //
  581. // Whether files with unknown extensions should be filtered by default
  582. //
  583. const ULONG CI_FILTER_FILES_WITH_UNKNOWN_EXTENSIONS_DEFAULT = 1;
  584. //
  585. // Flags that control type of events that are logged.
  586. //
  587. const ULONG CI_EVTLOG_FLAGS_UNKNOWN_CLASS = 0x00000001;
  588. const ULONG CI_EVTLOG_FLAGS_FAILED_EMBEDDING = 0x00000002;
  589. const ULONG CI_EVTLOG_FLAGS_DEFAULT = 0x00000002;
  590. //
  591. // Usn log parameters
  592. //
  593. const CI_MAX_USN_LOG_SIZE_DEFAULT = 0x800000; // Max size of usn log in bytes
  594. const CI_USN_LOG_ALLOCATION_DELTA_DEFAULT = 0x100000; // Allocation/deallocation size in bytes
  595. //
  596. // Usn Log timeout. Wait until buffer is full or this many seconds since call.
  597. //
  598. const ULONG CI_USN_READ_TIMEOUT_DEFAULT = 1 * 60; // 1 minute
  599. const ULONG CI_USN_READ_TIMEOUT_MIN = 0;
  600. const ULONG CI_USN_READ_TIMEOUT_MAX = 12 * 60 * 60; // 12 hours
  601. //
  602. // Usn Log minimum read size. Wait until at least this many bytes in the log
  603. // before returning.
  604. //
  605. const ULONG CI_USN_READ_MIN_SIZE_DEFAULT = 4 * 1024;
  606. const ULONG CI_USN_READ_MIN_SIZE_MIN = 1;
  607. const ULONG CI_USN_READ_MIN_SIZE_MAX = 512 * 1024;
  608. //
  609. // Determines whether USN read should be delayed when machine is busy. Default: TRUE
  610. //
  611. const BOOL CI_DELAY_USN_READ_ON_LOW_RESOURCE_DEFAULT = TRUE;
  612. //
  613. // Files with last access times older than this don't have their last access times modified
  614. // by the filter daemon. This is parameterized becuase there is a cost, both in terms
  615. // of extra downlevel notifications and extra USN records when last access time is reset
  616. // by the daemon.
  617. // Units: Days
  618. //
  619. const ULONG CI_STOMP_LAST_ACCESS_DELAY_DEFAULT = 7;
  620. const ULONG CI_STOMP_LAST_ACCESS_DELAY_MIN = 0;
  621. const ULONG CI_STOMP_LAST_ACCESS_DELAY_MAX = 1000000000; // Don't overflow 64-bit FILETIME
  622. //
  623. // Minimim amount of battery life required to keep filtering running.
  624. // Units: Percent of battery life remaining. 0 --> Always run.
  625. //
  626. const ULONG CI_MIN_WORDLIST_BATTERY_DEFAULT = 100; // Never filter on batteries
  627. const ULONG CI_MIN_WORDLIST_BATTERY_MIN = 0;
  628. const ULONG CI_MIN_WORDLIST_BATTERY_MAX = 100;
  629. //
  630. // User idle time required to keep filtering running.
  631. // Units: seconds 0 --> Always run.
  632. //
  633. const ULONG CI_WORDLIST_USER_IDLE_DEFAULT = 120;
  634. const ULONG CI_WORDLIST_USER_IDLE_MIN = 0;
  635. const ULONG CI_WORDLIST_USER_IDLE_MAX = 1200;
  636. //
  637. // Maximum amount of pagefile space consumed by out-of-process filter daemon.
  638. // Allocations beyond this limit will fail.
  639. // Units: KB
  640. //
  641. const ULONG CI_MAX_DAEMON_VM_USE_DEFAULT = 40 * 1024; // Big, but shouldn't kill the machine
  642. const ULONG CI_MAX_DAEMON_VM_USE_MIN = 10 * 1024; // 10 Mb
  643. const ULONG CI_MAX_DAEMON_VM_USE_MAX = 0x3FFFFF; // Avoid overflow when converted to bytes
  644. //
  645. // Flags for miscellaneous use - internal only.
  646. //
  647. const ULONG CI_MISC_FLAGS_DONT_FILTER = 0x00000001;
  648. const ULONG CI_MISC_FLAGS_NO_QUERIES = 0x00000002;
  649. const ULONG CI_MISC_FLAGS_DEFAULT = 0x00000000;
  650. //
  651. // Maximum portion of a file with a well-known extenstion the text filter
  652. // will index. Default is 25 meg.
  653. //
  654. const ULONG CI_MAX_TEXT_FILTER_BYTES_DEFAULT = 1024 * 1024 * 25;
  655. const ULONG CI_MAX_TEXT_FILTER_BYTES_MIN = 1;
  656. const ULONG CI_MAX_TEXT_FILTER_BYTES_MAX = ~0;
  657. //
  658. // Flags for Content Index Use
  659. //
  660. //
  661. // Set this flag to turn off notifications on all remote roots.
  662. //
  663. const ULONG CI_FLAGS_NO_REMOTE_NOTIFY = 0x00000001;
  664. //
  665. // Set this flag to turn off notifications on all local roots.
  666. //
  667. const ULONG CI_FLAGS_NO_LOCAL_NOTIFY = 0x00000002;
  668. const ULONG CI_FLAGS_DEFAULT = 0x00000000;
  669. //+++++++++++++++++++++++++++++++++++++++++++++++++++++
  670. //+ Internal parameters (not even in registry) +
  671. //+++++++++++++++++++++++++++++++++++++++++++++++++++++
  672. //
  673. // Priority of the filter daemon and merge thread. Only class of
  674. // filter daemon is controlled via registry.
  675. //
  676. const int CI_THREAD_PRIORITY_FILTER_DEFAULT = THREAD_PRIORITY_ABOVE_NORMAL;
  677. const int CI_THREAD_PRIORITY_MERGE_DEFAULT = THREAD_BASE_PRIORITY_MIN;
  678. //
  679. // Maximum number of documents to be filtered at once and put
  680. // into a single wordlist. Cannot be > 16 given current
  681. // wordlist compression scheme.
  682. //
  683. const ULONG CI_MAX_DOCS_IN_WORDLIST = 16;
  684. //
  685. // Content index version. Increment both current_index_version and
  686. // fsci_version when a change is made that will affect all framework
  687. // client, but increment fsci_version only when changes are made to
  688. // data structures such as property store that are used only by the
  689. // File System client. Site Server Search also uses these, but they
  690. // are not always using the same versions as the fsci is.
  691. //
  692. // For example, FSCI moved to a two-level store in Dec '97 but Site
  693. // Server Search will remain with the older single level store for the
  694. // 3.0 release.
  695. //
  696. //
  697. // INDEX_VERSION HISTORY:
  698. //
  699. // Version Date Change
  700. // ------- -------- ----------------------------------------------------------
  701. // 1 Original
  702. // 10 06/11/97 USN Support
  703. // 11 07/01/97 Parent WorkId
  704. // 30 07/18/97 Property Store Backup
  705. // 31 08/06/97 64-bit file ids
  706. // 32 09/21/97 File id hash function change
  707. // 33 09/29/97 Scope checking fix
  708. // 34 12/16/97 Size/Performance changes
  709. // 35 01/26/98 Added signatures at beginning/end of index pages.
  710. // 36 02/26/98 Changed directory format to fit count in 1 byte
  711. // 37 04/14/98 Added SecondaryQ Retry Count for documents
  712. // 38 05/27/98 Added checksums to all recoverable stream records
  713. // 39 06/23/98 Changed the way variable records are written
  714. // 3A 08/11/98 Changed .dir files to support ro catalogs during MM
  715. // 3B 01/04/99 dlee Changed cicat.hsh and cicat.fid hash chaining
  716. //
  717. // FSCI_VERSION HISTORY:
  718. //
  719. // Version Date Change
  720. // ------- -------- ----------------------------------------------------------
  721. // 34 12/02/97 2 level property store
  722. // 35 12/16/97 Size/Performance changes
  723. // 36 12/30/97 Lean primary store
  724. // 37 01/08/98 Move file index to primary store
  725. // 38 02/02/98 Move attrib to primary store
  726. // 39 04/10/98 Track volume id for NTFS v5 volumes
  727. // 3A 05/27/98 Added checksums to all recoverable stream records
  728. // 3B 06/01/98 Changed the way variable records are written
  729. // 3C 08/11/98 Changed .dir files to support ro catalogs during MM
  730. // 3D 01/04/99 dlee Changed cicat.hsh and cicat.fid hash chaining
  731. //
  732. const ULONG CURRENT_INDEX_VERSION = 0x3B; // PLEASE CHANGE HISTORY ABOVE
  733. const ULONG CURRENT_FSCI_VERSION = 0x3D; // PLEASE CHANGE HISTORY ABOVE
  734. const ULONG CURRENT_VERSION_STAMP = (CURRENT_INDEX_VERSION << 16);
  735. const ULONG FSCI_VERSION_STAMP = (CURRENT_FSCI_VERSION << 16);
  736. //
  737. // 64K common page size for memory mapped streams
  738. //
  739. const ULONG COMMON_PAGE_SIZE = 0x10000L;
  740. // This is 4 Kb == 2^12
  741. const ULONG CI_PAGE_SIZE = 0x1000;
  742. const ULONG CI_PAGE_SHIFT = 12;
  743. //
  744. // Size of page in DWORDs. Missing two DWORDs for signatures.
  745. //
  746. const ULONG SMARTBUF_PAGE_SIZE_IN_DWORDS = CI_PAGE_SIZE / sizeof(DWORD) - 2;
  747. const ULONG SMARTBUF_PAGE_SIZE_IN_BITS = SMARTBUF_PAGE_SIZE_IN_DWORDS * 8 * sizeof(DWORD);
  748. // This is 64 b == 2^6
  749. //const ULONG CI_PAGE_SIZE = 64; // For testing
  750. //const ULONG CI_PAGE_SHIFT = 6; // For testing
  751. const ULONG PAGES_PER_COMMON_PAGE = (COMMON_PAGE_SIZE/CI_PAGE_SIZE);
  752. //
  753. // Maximum file size for which the contents will be filtered. Files
  754. // larger than this will have only their properities included in the CI.
  755. // Units: KBytes
  756. //
  757. const ULONG CI_MAX_FILESIZE_FILTERED_DEFAULT = 256;
  758. //
  759. // Use Cairo/Daytona for binding
  760. //
  761. const BOOL CI_USE_OLE_DEFAULT = TRUE;
  762. //
  763. // Default IP address for the default virtual server.
  764. //
  765. const CI_DEFAULT_IP_ADDRESS = ~0;
  766. //
  767. // Default is a catalog is active
  768. //
  769. const ULONG CI_CATALOG_INACTIVE_DEFAULT = 0;
  770. //+---------------------------------------------------------------------------
  771. //
  772. // Class: CCiRegVars
  773. //
  774. // Purpose: Registry variables used by CI
  775. //
  776. // Notes: Does not include registry params used by IDQ, Webhits or
  777. // other client-side only functionality.
  778. //
  779. // History 10-11-96 dlee Created from user+kernel params
  780. // 02-04-98 kitmanh Added _fIsReadOnly
  781. //
  782. //----------------------------------------------------------------------------
  783. class CCiRegVars
  784. {
  785. public:
  786. void SetDefault();
  787. ULONG _maxMergeInterval; // Sleep time between merges
  788. int _threadPriorityMerge; // Priority of merge thread
  789. ULONG _maxUpdates; // Max # of updates passed by catalog
  790. ULONG _maxWordlists; // Max # of word lists that can exist
  791. ULONG _minSizeMergeWordlist; // Min combined size of wordlists
  792. ULONG _maxWordlistSize; // Max size at which docs can be added
  793. ULONG _minWordlistMemory; // Min free mem for wordlist creation
  794. ULONG _maxWordlistIo; // User I/O has to be below this for wordlist creation
  795. ULONG _maxWordlistIoDiskPerf; // User I/O has to be below this for wordlist creation
  796. ULONG _minWordlistBattery; // Min remaining batter for wordlist creation
  797. ULONG _WordlistUserIdle; // User idle time for wordlist creation
  798. ULONG _ResourceCheckInterval; // Low memory / high I/O are checked at most this often.
  799. ULONG _maxFreshDeletes; // Max # of uncommitted deletes in fresh list
  800. ULONG _lowResourceSleep; // Time to wait after low resource condition
  801. ULONG _maxWordlistMemoryLoad; // Max mem load for wordlist creation
  802. ULONG _maxFreshCount; // Max fresh list entries before mmerge
  803. ULONG _maxQueueChunks; // # of chunks in in-memory change list
  804. ULONG _masterMergeCheckpointInterval; // # of bytes to process before Checkpointing
  805. ULONG _filterRetries; // # of attempts to filter a document
  806. ULONG _secQFilterRetries; // # of attempts to filter a document in Sec. Q
  807. ULONG _filterRetryInterval; // # of minutes between retrying an open doc
  808. ULONG _maxShadowIndexSize; // Max combined size of shadow indexes
  809. ULONG _minDiskFreeForceMerge; // Min disk free before a mmerge is forced
  810. ULONG _maxShadowFreeForceMerge; // Max space for shadow indexes (% free space)
  811. ULONG _maxIndexes; // Maximum number of indexes (persistent or wordlist)
  812. ULONG _maxIdealIndexes; // Maximum number of indexes in an 'ideal' system.
  813. ULONG _minMergeIdleTime; // Minumum idle time to perform annealing merge.
  814. ULONG _maxPendingDocuments; // Max pending docs for property queries
  815. ULONG _minIdleQueryThreads; // Min number of idle query threads to maintain
  816. ULONG _maxActiveQueryThreads; // Maximum number of query threads to allow
  817. ULONG _maxQueryTimeslice; // Query timeslice (if waiting queries)
  818. ULONG _maxQueryExecutionTime; // Maximum query execution time (if waiting queries)
  819. ULONG _evtLogFlags; // Flags for event log
  820. ULONG _miscCiFlags; // Miscellaneous CI Flags
  821. ULONG _ciCatalogFlags; // CI external flags
  822. ULONG _maxRestrictionNodes; // Maximum normalized restriction nodes
  823. ULONG _minIdleRequestThreads; // Min number of idle request threads to maintain
  824. ULONG _minClientIdleTime; // Minimum client idle time after which it can be disconnected.
  825. ULONG _maxActiveRequestThreads; // Maximum number of request threads to allow
  826. ULONG _maxSimultaneousRequests; // Maximum number of simultaneous client/server connections
  827. ULONG _maxCachedPipes; // Maximum number of cached pipe instances
  828. ULONG _requestTimeout; // Milliseconds after which clients timeout
  829. BOOL _fIsAutoAlias; // TRUE if fixups should be automatically added for net shares
  830. ULONG _maxAutoAliasRefresh; // Time between net share polls
  831. ULONG _W3SvcInstance; // W3SVC Instance ID
  832. ULONG _NNTPSvcInstance; // NNTP Instance ID
  833. ULONG _IMAPSvcInstance; // IMAP Instance ID
  834. BOOL _fIsIndexingW3Roots; // TRUE if should index w3 vroots
  835. BOOL _fIsIndexingNNTPRoots; // TRUE if should index nntp vroots
  836. BOOL _fIsIndexingIMAPRoots; // TRUE if should index imap vroots
  837. BOOL _fMinimizeWorkingSet; // if TRUE, minimize WS when idle
  838. BOOL _fIsReadOnly; // Catalogs are in read-only mode
  839. BOOL _fIsEnumAllowed; // Flag to perform enumeration
  840. BOOL _fForcePathAlias; // If TRUE, query result paths are fixed up
  841. ULONG _minDiskSpaceToLeave; // Number of megabytes to leave on disk
  842. BOOL _useOle; // Use OLE for filtering
  843. ULONG _filterBufferSize; // Buffer size for filtering
  844. BOOL _filterContents; // Should the daemon filter contents?
  845. ULONG _filterDelayInterval; // Number of seconds the filter should delay
  846. // in case there are few documents.
  847. ULONG _filterRemainingThreshold;
  848. // The number of unfiltered documents below
  849. // which a delay will be introduced.
  850. ULONG _maxFilesizeFiltered; // Maximum filesize filtered
  851. ULONG _masterMergeTime; // Time for queue master merge
  852. ULONG _maxFilesizeMultiplier; // Largest amount of data from single file
  853. int _threadPriorityFilter; // Priority of update/filter thread
  854. int _threadClassFilter; // Priority class of update/filter thread
  855. ULONG _daemonResponseTimeout; // Timeout waiting for response
  856. ULONG _maxCharacterization; // Max size in cwc of a characterization
  857. BOOL _fFilterDirectories; // Should queries return directories?
  858. BOOL _fFilterFilesWithUnknownExtensions; // Should files with unknown(to IFilter) extensions be filtered ?
  859. BOOL _fCatalogInactive; // TRUE if the catalog shouldn't be auto-loaded
  860. ULONG _maxPropertyStoreMappedCache; // # of mapped large pages cached in primary
  861. ULONG _maxPropertyStoreBackupSize; // # of backed up OS pages in primary
  862. ULONG _maxSecPropertyStoreMappedCache; // # of mapped large pages cached in secondary
  863. ULONG _maxSecPropertyStoreBackupSize; // # of backed up OS pages in secondary
  864. ULONG _forcedNetPathScanInterval; // Number of minutes for forced net path scans
  865. ULONG _maxUsnLogSize; // Max size of usn log in bytes
  866. ULONG _usnLogAllocationDelta; // Allocation/deallocation size in bytes
  867. ULONG _ulScanBackoff; // Mode for backing off on scans
  868. ULONG _ulStartupDelay; // Delay in MS after boot
  869. ULONG _ulUsnReadTimeout; // Max wait in MS for Usn log data
  870. ULONG _ulUsnReadMinSize; // Wait until timeout or this many bytes
  871. ULONG _fDelayUsnReadOnLowResource; // TRUE --> Don't read USN Journal during high i/o, low memory
  872. ULONG _maxDaemonVmUse; // Max amount of pagefile used by OOP daemon
  873. ULONG _ulStompLastAccessDelay; // Files accessed more recently than this delta are not reset
  874. };
  875. //+---------------------------------------------------------------------------
  876. //
  877. // Class: CCiRegParams
  878. //
  879. // Purpose: Registry variables used by CI
  880. //
  881. // History 10-11-96 dlee Created from user+kernel params
  882. // 02-04-98 kitmanh Added IsReadOnly()
  883. //
  884. //----------------------------------------------------------------------------
  885. class CRegAccess;
  886. class CCiRegParams : public CCiRegVars
  887. {
  888. public :
  889. CCiRegParams( const WCHAR * pwcName = 0 );
  890. void Refresh( ICiAdminParams * pICiAdminParams = 0,
  891. BOOL fUseDefaultsOnFailure = FALSE );
  892. const BOOL UseOle() { return _useOle; }
  893. const BOOL FilterContents() { return _filterContents; }
  894. const ULONG GetMasterMergeTime() { return _masterMergeTime; }
  895. const ULONG GetMaxFilesizeMultiplier() { return _maxFilesizeMultiplier; }
  896. const int GetThreadPriorityFilter() { return _threadPriorityFilter; }
  897. const int GetThreadClassFilter() { return _threadClassFilter; }
  898. const ULONG GetDaemonResponseTimeout() { return _daemonResponseTimeout; }
  899. const BOOL GetGenerateCharacterization() { return (0 != _maxCharacterization); }
  900. const ULONG GetMaxCharacterization() { return _maxCharacterization; }
  901. const BOOL IsAutoAlias() { return _fIsAutoAlias; }
  902. const ULONG MaxAutoAliasRefresh() { return _maxAutoAliasRefresh; }
  903. const BOOL IsIndexingW3Roots() { return _fIsIndexingW3Roots; }
  904. const BOOL IsIndexingIMAPRoots() { return _fIsIndexingIMAPRoots; }
  905. const BOOL IsIndexingNNTPRoots() { return _fIsIndexingNNTPRoots; }
  906. const BOOL IsReadOnly() { return _fIsReadOnly; }
  907. const BOOL IsEnumAllowed() { return _fIsEnumAllowed; }
  908. const BOOL FilterDirectories() { return _fFilterDirectories; }
  909. const BOOL FilterFilesWithUnknownExtensions() { return _fFilterFilesWithUnknownExtensions; }
  910. const ULONG GetPrimaryStoreMappedCache() { return _maxPropertyStoreMappedCache; }
  911. const ULONG GetSecondaryStoreMappedCache() { return _maxSecPropertyStoreMappedCache; }
  912. const ULONG GetMaxFilesizeFiltered() { return _maxFilesizeFiltered; }
  913. const ULONG GetPrimaryStoreBackupSize() { return _maxPropertyStoreBackupSize; }
  914. const ULONG GetSecondaryStoreBackupSize() { return _maxSecPropertyStoreBackupSize; }
  915. void SetPrimaryStoreMappedCache(ULONG ulVal) { _maxPropertyStoreMappedCache = ulVal; }
  916. void SetPrimaryStoreBackupSize(ULONG ulVal) { _maxPropertyStoreBackupSize = ulVal; }
  917. void SetSecondaryStoreMappedCache(ULONG ulVal) { _maxPropertyStoreMappedCache = ulVal; }
  918. void SetSecondaryStoreBackupSize(ULONG ulVal) { _maxSecPropertyStoreBackupSize = ulVal; }
  919. const BOOL GetCatalogInactive() { return _fCatalogInactive; }
  920. const BOOL GetForcePathAlias() const { return _fForcePathAlias; }
  921. const ULONG GetForcedNetPathScanInterval() { return _forcedNetPathScanInterval; }
  922. const ULONG GetFilterDelayInterval() { return _filterDelayInterval; }
  923. const ULONG GetFilterRemainingThreshold() { return _filterRemainingThreshold; }
  924. const ULONG GetMaxMergeInterval() { return _maxMergeInterval; }
  925. const int GetThreadPriorityMerge() { return _threadPriorityMerge; }
  926. const ULONG GetMaxUpdates() { return _maxUpdates; }
  927. const ULONG GetMaxWordlists() { return _maxWordlists; }
  928. const ULONG GetMinSizeMergeWordlist() { return _minSizeMergeWordlist; }
  929. const ULONG GetMaxWordlistSize() { return _maxWordlistSize; }
  930. const ULONG GetMinWordlistMemory() { return _minWordlistMemory; }
  931. const ULONG GetMaxWordlistIo() { return _maxWordlistIo; }
  932. const ULONG GetMaxWordlistIoDiskPerf() { return _maxWordlistIoDiskPerf; }
  933. const ULONG GetMinWordlistBattery() { return _minWordlistBattery; }
  934. const ULONG GetWordlistUserIdle() { return _WordlistUserIdle; }
  935. const ULONG GetResourceCheckInterval() { return _ResourceCheckInterval; }
  936. const ULONG GetMaxFreshDeletes() { return _maxFreshDeletes; }
  937. const ULONG GetLowResourceSleep() { return _lowResourceSleep; }
  938. const ULONG GetMaxWordlistMemoryLoad() { return _maxWordlistMemoryLoad; }
  939. const ULONG GetMaxFreshCount() { return _maxFreshCount; }
  940. const ULONG GetMaxQueueChunks() { return _maxQueueChunks; }
  941. const ULONG GetMasterMergeCheckpointInterval() { return _masterMergeCheckpointInterval; }
  942. const ULONG GetFilterBufferSize() { return _filterBufferSize; }
  943. const ULONG GetFilterRetries() { return _filterRetries; }
  944. const ULONG GetSecQFilterRetries() { return _secQFilterRetries; }
  945. const ULONG GetFilterRetryInterval() { return _filterRetryInterval; }
  946. const ULONG GetMaxShadowIndexSize() { return _maxShadowIndexSize; }
  947. const ULONG GetMinDiskFreeForceMerge() { return _minDiskFreeForceMerge; }
  948. const ULONG GetMaxShadowFreeForceMerge() { return _maxShadowFreeForceMerge; }
  949. const ULONG GetMaxIndexes() { return _maxIndexes; }
  950. const ULONG GetMaxIdealIndexes() { return _maxIdealIndexes; }
  951. const ULONG GetMinMergeIdleTime() { return _minMergeIdleTime; }
  952. const ULONG GetMaxPendingDocuments() { return _maxPendingDocuments; }
  953. const ULONG GetMinIdleQueryThreads() { return _minIdleQueryThreads; }
  954. const ULONG GetMaxActiveQueryThreads() { return _maxActiveQueryThreads; }
  955. const ULONG GetMaxQueryTimeslice() { return _maxQueryTimeslice; }
  956. const ULONG GetMaxQueryExecutionTime() { return _maxQueryExecutionTime; }
  957. const ULONG GetMinIdleRequestThreads() { return _minIdleRequestThreads; }
  958. const ULONG GetMinClientIdleTime() { return _minClientIdleTime; }
  959. const ULONG GetMaxActiveRequestThreads() { return _maxActiveRequestThreads; }
  960. const ULONG GetMaxSimultaneousRequests() { return _maxSimultaneousRequests; }
  961. const ULONG GetMaxCachedPipes() { return _maxCachedPipes; }
  962. const ULONG GetRequestTimeout() { return _requestTimeout; }
  963. const ULONG GetW3SvcInstance() { return _W3SvcInstance; }
  964. const ULONG GetNNTPSvcInstance() { return _NNTPSvcInstance; }
  965. const ULONG GetIMAPSvcInstance() { return _IMAPSvcInstance; }
  966. const BOOL GetMinimizeWorkingSet() { return _fMinimizeWorkingSet; }
  967. const ULONG GetEventLogFlags() { return _evtLogFlags; }
  968. const ULONG GetMiscCiFlags() { return _miscCiFlags; }
  969. const ULONG GetCiCatalogFlags() { return _ciCatalogFlags; }
  970. const ULONG GetMaxRestrictionNodes() { return _maxRestrictionNodes; }
  971. const ULONG GetMaxUsnLogSize() { return _maxUsnLogSize; }
  972. const ULONG GetUsnLogAllocationDelta() { return _usnLogAllocationDelta; }
  973. const ULONG GetScanBackoff() { return _ulScanBackoff; }
  974. const ULONG GetStartupDelay() { return _ulStartupDelay; }
  975. const ULONG GetUsnReadTimeout() { return _ulUsnReadTimeout; }
  976. const ULONG GetUsnReadMinSize() { return _ulUsnReadMinSize; }
  977. const BOOL DelayUsnReadOnLowResource() { return _fDelayUsnReadOnLowResource; }
  978. const ULONG GetMaxDaemonVmUse() { return _maxDaemonVmUse; }
  979. const ULONG GetStompLastAccessDelay() { return _ulStompLastAccessDelay; }
  980. const ULONG GetMinDiskSpaceToLeave() {return _minDiskSpaceToLeave; }
  981. private:
  982. void _ReadValues( CRegAccess & reg, CCiRegVars & vars );
  983. void _ReadAndOverrideValues( CRegAccess & reg );
  984. void _StoreCIValues ( CCiRegVars & vars, ICiAdminParams * pICiAdminParams );
  985. void _StoreNewValues( CCiRegVars & vars );
  986. void _OverrideForCatalog();
  987. static void _CheckNamedValues();
  988. CMutexSem _mutex; // Used to serialize access
  989. XArray<WCHAR> _xOverrideName;
  990. static const CI_ADMIN_PARAMS _aParamNames[CI_AP_MAX_VAL];
  991. };
  992. void BuildRegistryScopesKey( XArray<WCHAR> & xKey, WCHAR const *pwcName );
  993. void BuildRegistryPropertiesKey( XArray<WCHAR> & xKey, WCHAR const *pwcName );
  994. ULONG GetMaxCatalogs();