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.

986 lines
54 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1998.
  5. //
  6. // File: params.cxx
  7. //
  8. // Contents: CCiRegParams class
  9. //
  10. // History: 29-Jul-94 DwightKr Created
  11. // 14-Api-96 DwightKr Added default Isapi catalog directory
  12. // 11-Oct-96 dlee collapsed kernel+user, added override
  13. //
  14. //--------------------------------------------------------------------------
  15. #include <pch.cxx>
  16. #pragma hdrstop
  17. #include <ciregkey.hxx>
  18. #include <regacc.hxx>
  19. #include <ciintf.h>
  20. #include <cifrmcom.hxx>
  21. const WCHAR * IS_DEFAULT_CATALOG_DIRECTORY = L"C:\\";
  22. //+-------------------------------------------------------------------------
  23. //
  24. // Member: CCiRegParams::CCiRegParams, public
  25. //
  26. // Synopsis: Constructor for registry param object
  27. //
  28. // Arguments: [pwcName] - 0 or name of the catalog from the registry
  29. //
  30. // History: 12-Oct-96 dlee Created
  31. //
  32. //--------------------------------------------------------------------------
  33. CCiRegParams::CCiRegParams( const WCHAR * pwcName )
  34. {
  35. _CheckNamedValues();
  36. SetDefault();
  37. // If a name isn't passed, then the catalog wasn't listed in the registry
  38. // to begin with, so we can't override the registry params.
  39. if ( 0 != pwcName )
  40. {
  41. _xOverrideName.Init( wcslen( pwcName ) + 1 );
  42. RtlCopyMemory( _xOverrideName.Get(),
  43. pwcName,
  44. _xOverrideName.SizeOf() );
  45. }
  46. Refresh( );
  47. } //CCiRegParams
  48. //+-------------------------------------------------------------------------
  49. //
  50. // Member: CCiRegParams::_OverrideForCatalog, private
  51. //
  52. // Synopsis: Overrides registry parameters with those for a given catalog
  53. //
  54. // History: 12-Oct-96 dlee Created
  55. //
  56. //--------------------------------------------------------------------------
  57. void CCiRegParams::_OverrideForCatalog()
  58. {
  59. // override values under ContentIndex with those for this catalog
  60. if ( 0 != _xOverrideName.Get() )
  61. {
  62. unsigned cwcNeeded = wcslen( wcsRegJustCatalogsSubKey );
  63. cwcNeeded += 2; // "\\" + null termination
  64. cwcNeeded += wcslen( _xOverrideName.Get() );
  65. XArray<WCHAR> xKey( cwcNeeded );
  66. wcscpy( xKey.Get(), wcsRegJustCatalogsSubKey );
  67. wcscat( xKey.Get(), L"\\" );
  68. wcscat( xKey.Get(), _xOverrideName.Get() );
  69. ciDebugOut(( DEB_ITRACE, "overriding for catalog key '%ws'\n",
  70. xKey.Get() ));
  71. CRegAccess reg( RTL_REGISTRY_CONTROL, xKey.Get() );
  72. ciDebugOut(( DEB_ITRACE, "before: generate 0x%x, index w3 0x%x\n",
  73. _maxCharacterization, _fIsIndexingW3Roots ));
  74. _ReadAndOverrideValues( reg );
  75. ciDebugOut(( DEB_ITRACE, "after: generate 0x%x, index w3 0x%x\n",
  76. _maxCharacterization, _fIsIndexingW3Roots ));
  77. }
  78. } //_OverrideForCatalog
  79. //+-------------------------------------------------------------------------
  80. //
  81. // Member: CCiRegVars::SetDefault, public
  82. //
  83. // Synopsis: Sets default values for registry params
  84. //
  85. // History: 12-Oct-96 dlee Added header
  86. // 04-Feb-98 kitmanh Added entry for _fIsReadOnly
  87. //
  88. //--------------------------------------------------------------------------
  89. void CCiRegVars::SetDefault()
  90. {
  91. _useOle = TRUE;
  92. _filterContents = FALSE;
  93. _filterDelayInterval = CI_FILTER_DELAY_INTERVAL_DEFAULT;
  94. _filterRemainingThreshold = CI_FILTER_REMAINING_THRESHOLD_DEFAULT;
  95. _maxFilesizeFiltered = CI_MAX_FILESIZE_FILTERED_DEFAULT;
  96. _masterMergeTime = CI_MASTER_MERGE_TIME_DEFAULT;
  97. _maxFilesizeMultiplier = CI_MAX_FILESIZE_MULTIPLIER_DEFAULT;
  98. _threadPriorityFilter = CI_THREAD_PRIORITY_FILTER_DEFAULT;
  99. _threadClassFilter = CI_THREAD_CLASS_FILTER_DEFAULT;
  100. _daemonResponseTimeout = CI_DAEMON_RESPONSE_TIMEOUT_DEFAULT;
  101. _maxCharacterization = CI_MAX_CHARACTERIZATION_DEFAULT;
  102. _fIsAutoAlias = CI_IS_AUTO_ALIAS_DEFAULT;
  103. _maxAutoAliasRefresh = CI_MAX_AUTO_ALIAS_REFRESH_DEFAULT;
  104. _fIsIndexingW3Roots = CI_IS_INDEXING_W3_ROOTS_DEFAULT;
  105. _fIsIndexingNNTPRoots = CI_IS_INDEXING_NNTP_ROOTS_DEFAULT;
  106. _fIsIndexingIMAPRoots = CI_IS_INDEXING_IMAP_ROOTS_DEFAULT;
  107. _fIsReadOnly = CI_IS_READ_ONLY_DEFAULT; //default is "not" READ_ONLY
  108. _fIsEnumAllowed = CI_IS_ENUM_ALLOWED_DEFAULT ;
  109. _fFilterDirectories = CI_FILTER_DIRECTORIES_DEFAULT;
  110. _fFilterFilesWithUnknownExtensions = CI_FILTER_FILES_WITH_UNKNOWN_EXTENSIONS_DEFAULT;
  111. _fCatalogInactive = CI_CATALOG_INACTIVE_DEFAULT;
  112. _fForcePathAlias = CI_FORCE_PATH_ALIAS_DEFAULT;
  113. _maxPropertyStoreMappedCache = CI_PROPERTY_STORE_MAPPED_CACHE_DEFAULT;
  114. _maxPropertyStoreBackupSize = CI_PROPERTY_STORE_BACKUP_SIZE_DEFAULT;
  115. _maxSecPropertyStoreMappedCache = CI_PROPERTY_STORE_MAPPED_CACHE_DEFAULT;
  116. _maxSecPropertyStoreBackupSize = CI_PROPERTY_STORE_BACKUP_SIZE_DEFAULT;
  117. _forcedNetPathScanInterval = CI_FORCED_NETPATH_SCAN_DEFAULT;
  118. _maxMergeInterval = CI_MAX_MERGE_INTERVAL_DEFAULT;
  119. _threadPriorityMerge = CI_THREAD_PRIORITY_MERGE_DEFAULT;
  120. _maxUpdates = CI_MAX_UPDATES_DEFAULT;
  121. _maxWordlists = CI_MAX_WORDLISTS_DEFAULT;
  122. _minSizeMergeWordlist = CI_MIN_SIZE_MERGE_WORDLISTS_DEFAULT;
  123. _maxWordlistSize = CI_MAX_WORDLIST_SIZE_DEFAULT;
  124. _minWordlistMemory = CI_MIN_WORDLIST_MEMORY_DEFAULT;
  125. _maxWordlistIo = CI_MAX_WORDLIST_IO_DEFAULT;
  126. _maxWordlistIoDiskPerf = CI_MAX_WORDLIST_IO_DISKPERF_DEFAULT;
  127. _minWordlistBattery = CI_MIN_WORDLIST_BATTERY_DEFAULT;
  128. _ResourceCheckInterval = CI_WORDLIST_RESOURCE_CHECK_INTERVAL_DEFAULT;
  129. _maxFreshDeletes = CI_MAX_FRESH_DELETES_DEFAULT;
  130. _lowResourceSleep = CI_LOW_RESOURCE_SLEEP_DEFAULT;
  131. _maxWordlistMemoryLoad = CI_MAX_WORDLIST_MEMORY_LOAD_DEFAULT;
  132. _maxFreshCount = CI_MAX_FRESHCOUNT_DEFAULT;
  133. _maxQueueChunks = CI_MAX_QUEUE_CHUNKS_DEFAULT;
  134. _masterMergeCheckpointInterval = CI_MASTER_MERGE_CHECKPOINT_INTERVAL_DEFAULT;
  135. _filterBufferSize = CI_FILTER_BUFFER_SIZE_DEFAULT;
  136. _filterRetries = CI_FILTER_RETRIES_DEFAULT;
  137. _filterRetryInterval = CI_FILTER_RETRY_INTERVAL_DEFAULT;
  138. _maxShadowIndexSize = CI_MAX_SHADOW_INDEX_SIZE_DEFAULT;
  139. _minDiskFreeForceMerge = CI_MIN_DISKFREE_FORCE_MERGE_DEFAULT;
  140. _maxShadowFreeForceMerge = CI_MAX_SHADOW_FREE_FORCE_MERGE_DEFAULT;
  141. _maxIndexes = CI_MAX_INDEXES_DEFAULT;
  142. _maxIdealIndexes = CI_MAX_IDEAL_INDEXES_DEFAULT;
  143. _minMergeIdleTime = CI_MIN_MERGE_IDLE_TIME_DEFAULT;
  144. _maxPendingDocuments = CI_MAX_PENDING_DOCUMENTS_DEFAULT;
  145. _minIdleQueryThreads = CI_MIN_IDLE_QUERY_THREADS_DEFAULT;
  146. _maxActiveQueryThreads = CI_MAX_ACTIVE_QUERY_THREADS_DEFAULT;
  147. _maxQueryTimeslice = CI_MAX_QUERY_TIMESLICE_DEFAULT;
  148. _maxQueryExecutionTime = CI_MAX_QUERY_EXECUTION_TIME_DEFAULT;
  149. _maxRestrictionNodes = CI_MAX_RESTRICTION_NODES_DEFAULT;
  150. _minIdleRequestThreads = CI_MIN_IDLE_REQUEST_THREADS_DEFAULT;
  151. _minClientIdleTime = CI_MIN_CLIENT_IDLE_TIME;
  152. _maxActiveRequestThreads = CI_MAX_ACTIVE_REQUEST_THREADS_DEFAULT;
  153. _maxSimultaneousRequests = CI_MAX_SIMULTANEOUS_REQUESTS_DEFAULT;
  154. _maxCachedPipes = CI_MAX_CACHED_PIPES_DEFAULT;
  155. _requestTimeout = CI_REQUEST_TIMEOUT_DEFAULT;
  156. _W3SvcInstance = CI_W3SVC_INSTANCE_DEFAULT;
  157. _NNTPSvcInstance = CI_NNTPSVC_INSTANCE_DEFAULT;
  158. _IMAPSvcInstance = CI_IMAPSVC_INSTANCE_DEFAULT;
  159. _fMinimizeWorkingSet = CI_MINIMIZE_WORKINGSET_DEFAULT;
  160. _evtLogFlags = CI_EVTLOG_FLAGS_DEFAULT;
  161. _miscCiFlags = CI_MISC_FLAGS_DEFAULT;
  162. _ciCatalogFlags = CI_FLAGS_DEFAULT;
  163. _maxUsnLogSize = CI_MAX_USN_LOG_SIZE_DEFAULT;
  164. _usnLogAllocationDelta = CI_USN_LOG_ALLOCATION_DELTA_DEFAULT;
  165. _ulScanBackoff = CI_SCAN_BACKOFF_DEFAULT;
  166. _ulStartupDelay = CI_STARTUP_DELAY_DEFAULT;
  167. _ulUsnReadTimeout = CI_USN_READ_TIMEOUT_DEFAULT;
  168. _ulUsnReadMinSize = CI_USN_READ_MIN_SIZE_DEFAULT;
  169. _fDelayUsnReadOnLowResource = CI_DELAY_USN_READ_ON_LOW_RESOURCE_DEFAULT;
  170. _maxDaemonVmUse = CI_MAX_DAEMON_VM_USE_DEFAULT;
  171. _secQFilterRetries = CI_SECQ_FILTER_RETRIES_DEFAULT;
  172. _ulStompLastAccessDelay = CI_STOMP_LAST_ACCESS_DELAY_DEFAULT;
  173. _WordlistUserIdle = CI_WORDLIST_USER_IDLE_DEFAULT;
  174. _minDiskSpaceToLeave = CI_MIN_DISK_SPACE_TO_LEAVE_DEFAULT;
  175. } //SetDefault
  176. //+-------------------------------------------------------------------------
  177. //
  178. // Member: CCiRegParams::_ReadAndOverrideValues, private
  179. //
  180. // Synopsis: Attempts to read values, with the default being the current
  181. // value.
  182. //
  183. // History: 12-Oct-96 dlee created
  184. // 04-Feb-98 kitmanh added entry for _fIsReadOnly
  185. //
  186. //--------------------------------------------------------------------------
  187. void CCiRegParams::_ReadAndOverrideValues( CRegAccess & reg )
  188. {
  189. CCiRegVars newVals;
  190. newVals._useOle = reg.Read(wcsUseOle, _useOle );
  191. newVals._filterContents = reg.Read(wcsFilterContents, _filterContents );
  192. newVals._filterDelayInterval = reg.Read(wcsFilterDelayInterval, _filterDelayInterval );
  193. newVals._filterRemainingThreshold = reg.Read(wcsFilterRemainingThreshold, _filterRemainingThreshold );
  194. newVals._maxFilesizeFiltered = reg.Read(wcsMaxFilesizeFiltered, (ULONG) _maxFilesizeFiltered);
  195. newVals._masterMergeTime = reg.Read(wcsMasterMergeTime, _masterMergeTime );
  196. newVals._maxFilesizeMultiplier = reg.Read(wcsMaxFilesizeMultiplier, _maxFilesizeMultiplier );
  197. newVals._threadClassFilter = reg.Read(wcsThreadClassFilter, _threadClassFilter );
  198. newVals._threadPriorityFilter = reg.Read(wcsThreadPriorityFilter, _threadPriorityFilter );
  199. newVals._daemonResponseTimeout = reg.Read(wcsDaemonResponseTimeout, _daemonResponseTimeout );
  200. newVals._maxCharacterization = reg.Read(wcsMaxCharacterization, _maxCharacterization );
  201. //
  202. // Allow old behavior.
  203. //
  204. ULONG ulgenerateCharacterization = reg.Read(wcsGenerateCharacterization, GetGenerateCharacterization() ? 1 : 0 );
  205. if ( 0 == ulgenerateCharacterization )
  206. newVals._maxCharacterization = 0;
  207. newVals._fIsAutoAlias = reg.Read(wcsIsAutoAlias, _fIsAutoAlias );
  208. newVals._maxAutoAliasRefresh = reg.Read(wcsMaxAutoAliasRefresh, _maxAutoAliasRefresh );
  209. newVals._fIsIndexingW3Roots = reg.Read(wcsIsIndexingW3Roots, _fIsIndexingW3Roots );
  210. newVals._fIsIndexingNNTPRoots = reg.Read(wcsIsIndexingNNTPRoots, _fIsIndexingNNTPRoots );
  211. newVals._fIsIndexingIMAPRoots = reg.Read(wcsIsIndexingIMAPRoots, _fIsIndexingIMAPRoots );
  212. newVals._fIsReadOnly = reg.Read(wcsIsReadOnly, _fIsReadOnly );
  213. newVals._fIsEnumAllowed = reg.Read(wcsIsEnumAllowed, _fIsEnumAllowed);
  214. newVals._fFilterDirectories = reg.Read(wcsFilterDirectories, _fFilterDirectories );
  215. newVals._fFilterFilesWithUnknownExtensions = reg.Read(wcsFilterFilesWithUnknownExtensions, _fFilterFilesWithUnknownExtensions );
  216. newVals._fCatalogInactive = reg.Read(wcsCatalogInactive, _fCatalogInactive );
  217. newVals._fForcePathAlias = reg.Read(wcsForcePathAlias, _fForcePathAlias );
  218. newVals._maxPropertyStoreMappedCache = reg.Read(wcsPrimaryStoreMappedCache, _maxPropertyStoreMappedCache );
  219. newVals._maxPropertyStoreBackupSize = reg.Read(wcsPrimaryStoreBackupSize, _maxPropertyStoreBackupSize);
  220. newVals._maxSecPropertyStoreMappedCache= reg.Read(wcsSecondaryStoreMappedCache, _maxSecPropertyStoreMappedCache );
  221. newVals._maxSecPropertyStoreBackupSize = reg.Read(wcsSecondaryStoreBackupSize, _maxSecPropertyStoreBackupSize);
  222. newVals._forcedNetPathScanInterval = reg.Read(wcsForcedNetPathScanInterval, _forcedNetPathScanInterval );
  223. newVals._maxMergeInterval = reg.Read(wcsMaxMergeInterval, _maxMergeInterval );
  224. newVals._threadPriorityMerge = reg.Read(wcsThreadPriorityMerge, _threadPriorityMerge );
  225. newVals._maxUpdates = reg.Read(wcsMaxUpdates, _maxUpdates );
  226. newVals._maxWordlists = reg.Read(wcsMaxWordLists, _maxWordlists );
  227. newVals._minSizeMergeWordlist = reg.Read(wcsMinSizeMergeWordlists, _minSizeMergeWordlist );
  228. newVals._maxWordlistSize = reg.Read(wcsMaxWordlistSize, _maxWordlistSize );
  229. newVals._minWordlistMemory = reg.Read(wcsMinWordlistMemory, _minWordlistMemory );
  230. newVals._maxWordlistIo = reg.Read(wcsMaxWordlistIo, _maxWordlistIo );
  231. newVals._maxWordlistIoDiskPerf = reg.Read(wcsMaxWordlistIoDiskPerf, _maxWordlistIoDiskPerf );
  232. newVals._minWordlistBattery = reg.Read(wcsMinWordlistBattery, _minWordlistBattery );
  233. newVals._ResourceCheckInterval = reg.Read(wcsResourceCheckInterval, _ResourceCheckInterval );
  234. newVals._maxFreshDeletes = reg.Read(wcsMaxFreshDeletes, _maxFreshDeletes );
  235. newVals._lowResourceSleep = reg.Read(wcsLowResourceSleep, _lowResourceSleep );
  236. newVals._maxWordlistMemoryLoad = reg.Read(wcsMaxWordlistMemoryLoad, _maxWordlistMemoryLoad );
  237. newVals._maxFreshCount = reg.Read(wcsMaxFreshCount, _maxFreshCount );
  238. newVals._maxQueueChunks = reg.Read(wcsMaxQueueChunks, _maxQueueChunks );
  239. newVals._masterMergeCheckpointInterval = reg.Read(wcsMasterMergeCheckpointInterval, _masterMergeCheckpointInterval );
  240. newVals._filterBufferSize = reg.Read(wcsFilterBufferSize, _filterBufferSize );
  241. newVals._filterRetries = reg.Read(wcsFilterRetries, _filterRetries );
  242. newVals._filterRetryInterval = reg.Read(wcsFilterRetryInterval, _filterRetryInterval );
  243. newVals._maxShadowIndexSize = reg.Read(wcsMaxShadowIndexSize, _maxShadowIndexSize );
  244. newVals._minDiskFreeForceMerge = reg.Read(wcsMinDiskFreeForceMerge, _minDiskFreeForceMerge );
  245. newVals._maxShadowFreeForceMerge = reg.Read(wcsMaxShadowFreeForceMerge, _maxShadowFreeForceMerge );
  246. newVals._maxIndexes = reg.Read(wcsMaxIndexes, _maxIndexes );
  247. newVals._maxIdealIndexes = reg.Read(wcsMaxIdealIndexes, _maxIdealIndexes );
  248. newVals._minMergeIdleTime = reg.Read(wcsMinMergeIdleTime, _minMergeIdleTime );
  249. newVals._maxPendingDocuments = reg.Read(wcsMaxPendingDocuments, _maxPendingDocuments );
  250. newVals._minIdleQueryThreads = reg.Read(wcsMinIdleQueryThreads, _minIdleQueryThreads );
  251. newVals._maxActiveQueryThreads = reg.Read(wcsMaxActiveQueryThreads, _maxActiveQueryThreads );
  252. newVals._maxQueryTimeslice = reg.Read(wcsMaxQueryTimeslice, _maxQueryTimeslice );
  253. newVals._maxQueryExecutionTime = reg.Read(wcsMaxQueryExecutionTime, _maxQueryExecutionTime );
  254. newVals._minIdleRequestThreads = reg.Read(wcsMinIdleRequestThreads, _minIdleRequestThreads );
  255. newVals._minClientIdleTime = reg.Read(wcsMinClientIdleTime, _minClientIdleTime );
  256. newVals._maxActiveRequestThreads = reg.Read(wcsMaxActiveRequestThreads, _maxActiveRequestThreads );
  257. newVals._maxSimultaneousRequests = reg.Read(wcsMaxSimultaneousRequests, _maxSimultaneousRequests );
  258. newVals._maxCachedPipes = reg.Read(wcsMaxCachedPipes, _maxCachedPipes );
  259. newVals._WordlistUserIdle = reg.Read(wcsWordlistUserIdle, _WordlistUserIdle );
  260. newVals._requestTimeout = reg.Read(wcsRequestTimeout, _requestTimeout );
  261. newVals._W3SvcInstance = reg.Read(wcsW3SvcInstance, _W3SvcInstance );
  262. newVals._NNTPSvcInstance = reg.Read(wcsNNTPSvcInstance, _NNTPSvcInstance );
  263. newVals._IMAPSvcInstance = reg.Read(wcsIMAPSvcInstance, _IMAPSvcInstance );
  264. newVals._fMinimizeWorkingSet = reg.Read(wcsMinimizeWorkingSet, _fMinimizeWorkingSet );
  265. newVals._evtLogFlags = reg.Read(wcsEventLogFlags, _evtLogFlags );
  266. newVals._miscCiFlags = reg.Read(wcsMiscFlags, _miscCiFlags );
  267. newVals._ciCatalogFlags = reg.Read(wcsCiCatalogFlags, _ciCatalogFlags );
  268. newVals._maxRestrictionNodes = reg.Read(wcsMaxRestrictionNodes, _maxRestrictionNodes );
  269. newVals._maxUsnLogSize = reg.Read( wcsMaxUsnLogSize, _maxUsnLogSize );
  270. newVals._usnLogAllocationDelta = reg.Read( wcsUsnLogAllocationDelta, _usnLogAllocationDelta );
  271. newVals._ulScanBackoff = reg.Read( wcsScanBackoff, _ulScanBackoff );
  272. newVals._ulStartupDelay = reg.Read( wcsStartupDelay, _ulStartupDelay );
  273. newVals._ulUsnReadTimeout = reg.Read( wcsUsnReadTimeout, _ulUsnReadTimeout );
  274. newVals._ulUsnReadMinSize = reg.Read( wcsUsnReadMinSize, _ulUsnReadMinSize );
  275. newVals._fDelayUsnReadOnLowResource = reg.Read( wcsDelayUsnReadOnLowResource, _fDelayUsnReadOnLowResource );
  276. newVals._maxDaemonVmUse = reg.Read( wcsMaxDaemonVmUse, _maxDaemonVmUse );
  277. newVals._secQFilterRetries = reg.Read(wcsSecQFilterRetries, _secQFilterRetries );
  278. newVals._ulStompLastAccessDelay = reg.Read(wcsStompLastAccessDelay, _ulStompLastAccessDelay );
  279. newVals._minDiskSpaceToLeave = reg.Read( wcsMinDiskSpaceToLeave, _minDiskSpaceToLeave );
  280. _StoreNewValues( newVals );
  281. } //_ReadAndOverrideValues
  282. //+-------------------------------------------------------------------------
  283. //
  284. // Member: CCiRegParams::_ReadValues, private
  285. //
  286. // Synopsis: Reads values for variables
  287. //
  288. // History: 12-Oct-96 dlee Added header
  289. // 04-Feb-98 kitmanh Added entry for _fIsReadOnly
  290. //
  291. //--------------------------------------------------------------------------
  292. void CCiRegParams::_ReadValues(
  293. CRegAccess & reg,
  294. CCiRegVars & vars )
  295. {
  296. vars._useOle = reg.Read(wcsUseOle, (ULONG) FALSE);
  297. vars._filterContents = reg.Read(wcsFilterContents, (ULONG) TRUE );
  298. vars._filterDelayInterval = reg.Read(wcsFilterDelayInterval, CI_FILTER_DELAY_INTERVAL_DEFAULT);
  299. vars._filterRemainingThreshold = reg.Read(wcsFilterRemainingThreshold, CI_FILTER_REMAINING_THRESHOLD_DEFAULT);
  300. vars._maxFilesizeFiltered = reg.Read(wcsMaxFilesizeFiltered, CI_MAX_FILESIZE_FILTERED_DEFAULT );
  301. vars._masterMergeTime = reg.Read(wcsMasterMergeTime, CI_MASTER_MERGE_TIME_DEFAULT);
  302. vars._maxFilesizeMultiplier = reg.Read(wcsMaxFilesizeMultiplier, CI_MAX_FILESIZE_MULTIPLIER_DEFAULT);
  303. vars._threadClassFilter = reg.Read(wcsThreadClassFilter, CI_THREAD_CLASS_FILTER_DEFAULT);
  304. vars._threadPriorityFilter = reg.Read(wcsThreadPriorityFilter, CI_THREAD_PRIORITY_FILTER_DEFAULT);
  305. vars._daemonResponseTimeout = reg.Read(wcsDaemonResponseTimeout, CI_DAEMON_RESPONSE_TIMEOUT_DEFAULT );
  306. vars._maxCharacterization = reg.Read(wcsMaxCharacterization, CI_MAX_CHARACTERIZATION_DEFAULT );
  307. //
  308. // Allow old behavior.
  309. //
  310. ULONG ulgenerateCharacterization = reg.Read(wcsGenerateCharacterization, 1 );
  311. if ( 0 == ulgenerateCharacterization )
  312. vars._maxCharacterization = 0;
  313. vars._fIsAutoAlias = reg.Read(wcsIsAutoAlias, CI_IS_AUTO_ALIAS_DEFAULT );
  314. vars._maxAutoAliasRefresh = reg.Read(wcsMaxAutoAliasRefresh, CI_MAX_AUTO_ALIAS_REFRESH_DEFAULT );
  315. vars._fIsIndexingW3Roots = reg.Read(wcsIsIndexingW3Roots, CI_IS_INDEXING_W3_ROOTS_DEFAULT );
  316. vars._fIsIndexingNNTPRoots = reg.Read(wcsIsIndexingNNTPRoots, CI_IS_INDEXING_NNTP_ROOTS_DEFAULT );
  317. vars._fIsIndexingIMAPRoots = reg.Read(wcsIsIndexingIMAPRoots, CI_IS_INDEXING_IMAP_ROOTS_DEFAULT );
  318. vars._fIsReadOnly = reg.Read(wcsIsReadOnly, (DWORD)CI_IS_READ_ONLY_DEFAULT );
  319. vars._fIsEnumAllowed = reg.Read(wcsIsEnumAllowed, (ULONG)CI_IS_ENUM_ALLOWED_DEFAULT);
  320. vars._fFilterDirectories = reg.Read(wcsFilterDirectories, CI_FILTER_DIRECTORIES_DEFAULT);
  321. vars._fFilterFilesWithUnknownExtensions = reg.Read(wcsFilterFilesWithUnknownExtensions, CI_FILTER_FILES_WITH_UNKNOWN_EXTENSIONS_DEFAULT );
  322. vars._fCatalogInactive = reg.Read(wcsCatalogInactive, CI_CATALOG_INACTIVE_DEFAULT );
  323. vars._fForcePathAlias = reg.Read(wcsForcePathAlias, CI_FORCE_PATH_ALIAS_DEFAULT );
  324. vars._maxPropertyStoreMappedCache = reg.Read(wcsPrimaryStoreMappedCache, CI_PROPERTY_STORE_MAPPED_CACHE_DEFAULT);
  325. vars._maxPropertyStoreBackupSize = reg.Read(wcsPrimaryStoreBackupSize, CI_PROPERTY_STORE_BACKUP_SIZE_DEFAULT);
  326. vars._maxSecPropertyStoreMappedCache= reg.Read(wcsSecondaryStoreMappedCache, CI_PROPERTY_STORE_MAPPED_CACHE_DEFAULT);
  327. vars._maxSecPropertyStoreBackupSize = reg.Read(wcsSecondaryStoreBackupSize, CI_PROPERTY_STORE_BACKUP_SIZE_DEFAULT);
  328. vars._forcedNetPathScanInterval = reg.Read(wcsForcedNetPathScanInterval, CI_FORCED_NETPATH_SCAN_DEFAULT );
  329. vars._maxMergeInterval = reg.Read(wcsMaxMergeInterval, CI_MAX_MERGE_INTERVAL_DEFAULT);
  330. vars._threadPriorityMerge = reg.Read(wcsThreadPriorityMerge, CI_THREAD_PRIORITY_MERGE_DEFAULT);
  331. vars._maxUpdates = reg.Read(wcsMaxUpdates, CI_MAX_UPDATES_DEFAULT);
  332. vars._maxWordlists = reg.Read(wcsMaxWordLists, CI_MAX_WORDLISTS_DEFAULT);
  333. vars._minSizeMergeWordlist = reg.Read(wcsMinSizeMergeWordlists, CI_MIN_SIZE_MERGE_WORDLISTS_DEFAULT);
  334. vars._maxWordlistSize = reg.Read(wcsMaxWordlistSize, CI_MAX_WORDLIST_SIZE_DEFAULT);
  335. vars._minWordlistMemory = reg.Read(wcsMinWordlistMemory, CI_MIN_WORDLIST_MEMORY_DEFAULT);
  336. vars._maxWordlistIo = reg.Read(wcsMaxWordlistIo, CI_MAX_WORDLIST_IO_DEFAULT );
  337. vars._maxWordlistIoDiskPerf = reg.Read(wcsMaxWordlistIoDiskPerf, CI_MAX_WORDLIST_IO_DISKPERF_DEFAULT );
  338. vars._minWordlistBattery = reg.Read(wcsMinWordlistBattery, CI_MIN_WORDLIST_BATTERY_DEFAULT );
  339. vars._ResourceCheckInterval = reg.Read(wcsResourceCheckInterval, CI_WORDLIST_RESOURCE_CHECK_INTERVAL_DEFAULT );
  340. vars._maxFreshDeletes = reg.Read(wcsMaxFreshDeletes, CI_MAX_FRESH_DELETES_DEFAULT );
  341. vars._lowResourceSleep = reg.Read(wcsLowResourceSleep, CI_LOW_RESOURCE_SLEEP_DEFAULT);
  342. vars._maxWordlistMemoryLoad = reg.Read(wcsMaxWordlistMemoryLoad, CI_MAX_WORDLIST_MEMORY_LOAD_DEFAULT);
  343. vars._maxFreshCount = reg.Read(wcsMaxFreshCount, CI_MAX_FRESHCOUNT_DEFAULT);
  344. vars._maxQueueChunks = reg.Read(wcsMaxQueueChunks, CI_MAX_QUEUE_CHUNKS_DEFAULT);
  345. vars._masterMergeCheckpointInterval = reg.Read(wcsMasterMergeCheckpointInterval, CI_MASTER_MERGE_CHECKPOINT_INTERVAL_DEFAULT);
  346. vars._filterBufferSize = reg.Read(wcsFilterBufferSize, CI_FILTER_BUFFER_SIZE_DEFAULT);
  347. vars._filterRetries = reg.Read(wcsFilterRetries, CI_FILTER_RETRIES_DEFAULT);
  348. vars._filterRetryInterval = reg.Read(wcsFilterRetryInterval, CI_FILTER_RETRY_INTERVAL_DEFAULT);
  349. vars._maxShadowIndexSize = reg.Read(wcsMaxShadowIndexSize, CI_MAX_SHADOW_INDEX_SIZE_DEFAULT);
  350. vars._minDiskFreeForceMerge = reg.Read(wcsMinDiskFreeForceMerge, CI_MIN_DISKFREE_FORCE_MERGE_DEFAULT);
  351. vars._maxShadowFreeForceMerge = reg.Read(wcsMaxShadowFreeForceMerge, CI_MAX_SHADOW_FREE_FORCE_MERGE_DEFAULT);
  352. vars._maxIndexes = reg.Read(wcsMaxIndexes, CI_MAX_INDEXES_DEFAULT);
  353. vars._maxIdealIndexes = reg.Read(wcsMaxIdealIndexes, CI_MAX_IDEAL_INDEXES_DEFAULT);
  354. vars._minMergeIdleTime = reg.Read(wcsMinMergeIdleTime, CI_MIN_MERGE_IDLE_TIME_DEFAULT);
  355. vars._maxPendingDocuments = reg.Read(wcsMaxPendingDocuments, CI_MAX_PENDING_DOCUMENTS_DEFAULT);
  356. vars._minIdleQueryThreads = reg.Read(wcsMinIdleQueryThreads, CI_MIN_IDLE_QUERY_THREADS_DEFAULT);
  357. vars._maxActiveQueryThreads = reg.Read(wcsMaxActiveQueryThreads, CI_MAX_ACTIVE_QUERY_THREADS_DEFAULT);
  358. vars._maxQueryTimeslice = reg.Read(wcsMaxQueryTimeslice, CI_MAX_QUERY_TIMESLICE_DEFAULT);
  359. vars._maxQueryExecutionTime = reg.Read(wcsMaxQueryExecutionTime, CI_MAX_QUERY_EXECUTION_TIME_DEFAULT);
  360. vars._minIdleRequestThreads = reg.Read(wcsMinIdleRequestThreads, CI_MIN_IDLE_REQUEST_THREADS_DEFAULT);
  361. vars._maxActiveRequestThreads = reg.Read(wcsMaxActiveRequestThreads, CI_MAX_ACTIVE_REQUEST_THREADS_DEFAULT);
  362. vars._maxSimultaneousRequests = reg.Read(wcsMaxSimultaneousRequests, CI_MAX_SIMULTANEOUS_REQUESTS_DEFAULT);
  363. vars._maxCachedPipes = reg.Read(wcsMaxCachedPipes, CI_MAX_CACHED_PIPES_DEFAULT);
  364. vars._requestTimeout = reg.Read(wcsRequestTimeout, CI_REQUEST_TIMEOUT_DEFAULT);
  365. vars._W3SvcInstance = reg.Read(wcsW3SvcInstance, CI_W3SVC_INSTANCE_DEFAULT );
  366. vars._NNTPSvcInstance = reg.Read(wcsNNTPSvcInstance, CI_NNTPSVC_INSTANCE_DEFAULT );
  367. vars._IMAPSvcInstance = reg.Read(wcsIMAPSvcInstance, CI_IMAPSVC_INSTANCE_DEFAULT );
  368. vars._fMinimizeWorkingSet = reg.Read(wcsMinimizeWorkingSet, (DWORD)CI_MINIMIZE_WORKINGSET_DEFAULT );
  369. vars._evtLogFlags = reg.Read(wcsEventLogFlags, CI_EVTLOG_FLAGS_DEFAULT);
  370. vars._miscCiFlags = reg.Read(wcsMiscFlags, CI_MISC_FLAGS_DEFAULT);
  371. vars._ciCatalogFlags = reg.Read(wcsCiCatalogFlags, CI_FLAGS_DEFAULT);
  372. vars._maxUsnLogSize = reg.Read( wcsMaxUsnLogSize, CI_MAX_USN_LOG_SIZE_DEFAULT );
  373. vars._usnLogAllocationDelta = reg.Read( wcsUsnLogAllocationDelta, CI_USN_LOG_ALLOCATION_DELTA_DEFAULT );
  374. vars._ulScanBackoff = reg.Read( wcsScanBackoff, CI_SCAN_BACKOFF_DEFAULT );
  375. vars._ulStartupDelay = reg.Read( wcsStartupDelay, CI_STARTUP_DELAY_DEFAULT );
  376. vars._ulUsnReadTimeout = reg.Read( wcsUsnReadTimeout, CI_USN_READ_TIMEOUT_DEFAULT );
  377. vars._ulUsnReadMinSize = reg.Read( wcsUsnReadMinSize, CI_USN_READ_MIN_SIZE_DEFAULT );
  378. vars._fDelayUsnReadOnLowResource = reg.Read( wcsDelayUsnReadOnLowResource, CI_DELAY_USN_READ_ON_LOW_RESOURCE_DEFAULT );
  379. vars._maxDaemonVmUse = reg.Read( wcsMaxDaemonVmUse, CI_MAX_DAEMON_VM_USE_DEFAULT );
  380. vars._secQFilterRetries = reg.Read(wcsSecQFilterRetries, CI_SECQ_FILTER_RETRIES_DEFAULT);
  381. vars._maxRestrictionNodes = reg.Read(wcsMaxRestrictionNodes, CI_MAX_RESTRICTION_NODES_DEFAULT );
  382. vars._ulStompLastAccessDelay = reg.Read(wcsStompLastAccessDelay, CI_STOMP_LAST_ACCESS_DELAY_DEFAULT );
  383. vars._WordlistUserIdle = reg.Read(wcsWordlistUserIdle, CI_WORDLIST_USER_IDLE_DEFAULT );
  384. vars._minDiskSpaceToLeave = reg.Read( wcsMinDiskSpaceToLeave, CI_MIN_DISK_SPACE_TO_LEAVE_DEFAULT );
  385. #if DBG == 1 || CIDBG == 1
  386. ULONG ulLevel = reg.Read( wcsWin4AssertLevel, 0xFFFFFFFF );
  387. if (ulLevel != 0xFFFFFFFF )
  388. SetWin4AssertLevel( ulLevel );
  389. #endif // DBG == 1 || CIDBG == 1
  390. } //_ReadValues
  391. //+-------------------------------------------------------------------------
  392. //
  393. // Member: CCiRegParams::_StoreCIValues, private
  394. //
  395. // Synopsis: Packs all CI parameters in an array of CStorageVariants,
  396. // and sets CI by invoking ICiAdminParams::SetValues()
  397. //
  398. // History: 1-24-97 mohamedn created
  399. //
  400. // Notes:
  401. //
  402. //--------------------------------------------------------------------------
  403. void CCiRegParams::_StoreCIValues(CCiRegVars & vars, ICiAdminParams * pICiAdminParams )
  404. {
  405. if ( pICiAdminParams )
  406. {
  407. CStorageVariant aParamVals[CI_AP_MAX_VAL];
  408. aParamVals[CI_AP_MERGE_INTERVAL] = vars._maxMergeInterval;
  409. aParamVals[CI_AP_MAX_UPDATES] = vars._maxUpdates;
  410. aParamVals[CI_AP_MAX_WORDLISTS] = vars._maxWordlists;
  411. aParamVals[CI_AP_MIN_SIZE_MERGE_WORDLISTS] = vars._minSizeMergeWordlist;
  412. aParamVals[CI_AP_MAX_WORDLIST_SIZE] = vars._maxWordlistSize;
  413. aParamVals[CI_AP_MIN_WORDLIST_MEMORY] = vars._minWordlistMemory;
  414. aParamVals[CI_AP_LOW_RESOURCE_SLEEP] = vars._lowResourceSleep;
  415. aParamVals[CI_AP_MAX_WORDLIST_MEMORY_LOAD] = vars._maxWordlistMemoryLoad;
  416. aParamVals[CI_AP_MAX_WORDLIST_IO] = vars._maxWordlistIo;
  417. aParamVals[CI_AP_WORDLIST_RESOURCE_CHECK_INTERVAL] = vars._ResourceCheckInterval;
  418. aParamVals[CI_AP_STARTUP_DELAY] = vars._ulStartupDelay;
  419. // Note: we don't really use this -- it's just for Olympus.
  420. // It's always TRUE for CI (even though if the size is 0 they
  421. // won't be generated.
  422. aParamVals[CI_AP_GENERATE_CHARACTERIZATION] = CI_GENERATE_CHARACTERIZATION_DEFAULT;
  423. aParamVals[CI_AP_MAX_FRESH_COUNT] = vars._maxFreshCount;
  424. aParamVals[CI_AP_MAX_SHADOW_INDEX_SIZE] = vars._maxShadowIndexSize;
  425. aParamVals[CI_AP_MIN_DISK_FREE_FORCE_MERGE] = vars._minDiskFreeForceMerge;
  426. aParamVals[CI_AP_MAX_SHADOW_FREE_FORCE_MERGE] = vars._maxShadowFreeForceMerge;
  427. aParamVals[CI_AP_MAX_INDEXES] = vars._maxIndexes;
  428. aParamVals[CI_AP_MAX_IDEAL_INDEXES] = vars._maxIdealIndexes;
  429. aParamVals[CI_AP_MIN_MERGE_IDLE_TIME] = vars._minMergeIdleTime;
  430. aParamVals[CI_AP_MAX_PENDING_DOCUMENTS] = vars._maxPendingDocuments;
  431. aParamVals[CI_AP_MASTER_MERGE_TIME] = vars._masterMergeTime;
  432. aParamVals[CI_AP_MAX_QUEUE_CHUNKS] = vars._maxQueueChunks;
  433. aParamVals[CI_AP_MASTER_MERGE_CHECKPOINT_INTERVAL] = vars._masterMergeCheckpointInterval;
  434. aParamVals[CI_AP_FILTER_BUFFER_SIZE] = vars._filterBufferSize;
  435. aParamVals[CI_AP_FILTER_RETRIES] = vars._filterRetries;
  436. aParamVals[CI_AP_FILTER_RETRY_INTERVAL] = vars._filterRetryInterval;
  437. aParamVals[CI_AP_MIN_IDLE_QUERY_THREADS] = vars._minIdleQueryThreads;
  438. aParamVals[CI_AP_MAX_ACTIVE_QUERY_THREADS] = vars._maxActiveQueryThreads;
  439. aParamVals[CI_AP_MAX_QUERY_TIMESLICE] = vars._maxQueryTimeslice;
  440. aParamVals[CI_AP_MAX_QUERY_EXECUTION_TIME] = vars._maxQueryExecutionTime;
  441. aParamVals[CI_AP_MAX_RESTRICTION_NODES] = vars._maxRestrictionNodes;
  442. aParamVals[CI_AP_CLUSTERINGTIME] = (ULONG)0; // not supported yet.
  443. aParamVals[CI_AP_MAX_FILESIZE_MULTIPLIER] = vars._maxFilesizeMultiplier;
  444. aParamVals[CI_AP_DAEMON_RESPONSE_TIMEOUT] = vars._daemonResponseTimeout;
  445. aParamVals[CI_AP_FILTER_DELAY_INTERVAL] = vars._filterDelayInterval;
  446. aParamVals[CI_AP_FILTER_REMAINING_THRESHOLD] = vars._filterRemainingThreshold;
  447. aParamVals[CI_AP_MAX_CHARACTERIZATION] = vars._maxCharacterization;
  448. aParamVals[CI_AP_MIN_WORDLIST_BATTERY] = vars._minWordlistBattery;
  449. aParamVals[CI_AP_THREAD_PRIORITY_MERGE] = (ULONG)vars._threadPriorityMerge;
  450. aParamVals[CI_AP_THREAD_PRIORITY_FILTER] = (ULONG)vars._threadPriorityFilter;
  451. aParamVals[CI_AP_THREAD_CLASS_FILTER] = (ULONG)vars._threadClassFilter;
  452. aParamVals[CI_AP_EVTLOG_FLAGS] = vars._evtLogFlags;
  453. aParamVals[CI_AP_MISC_FLAGS] = vars._miscCiFlags;
  454. aParamVals[CI_AP_GENERATE_RELEVANT_WORDS] = (ULONG)0; // not supported yet.
  455. aParamVals[CI_AP_FFILTER_FILES_WITH_UNKNOWN_EXTENSIONS] = (ULONG)vars._fFilterFilesWithUnknownExtensions;
  456. aParamVals[CI_AP_FILTER_DIRECTORIES] = (ULONG)vars._fFilterDirectories;
  457. aParamVals[CI_AP_FILTER_CONTENTS] = (ULONG)vars._filterContents;
  458. aParamVals[CI_AP_MAX_FILESIZE_FILTERED] = (ULONG)vars._maxFilesizeFiltered;
  459. aParamVals[CI_AP_MAX_FRESH_DELETES] = vars._maxFreshDeletes;
  460. aParamVals[CI_AP_MIN_CLIENT_IDLE_TIME] = vars._minClientIdleTime;
  461. aParamVals[CI_AP_MAX_DAEMON_VM_USE] = vars._maxDaemonVmUse;
  462. aParamVals[CI_AP_SECQ_FILTER_RETRIES] = vars._secQFilterRetries;
  463. aParamVals[CI_AP_WORDLIST_USER_IDLE] = vars._WordlistUserIdle;
  464. aParamVals[CI_AP_IS_ENUM_ALLOWED] = (ULONG)vars._fIsEnumAllowed;
  465. aParamVals[CI_AP_MIN_DISK_SPACE_TO_LEAVE] = vars._minDiskSpaceToLeave;
  466. aParamVals[CI_AP_MAX_DWORD_VAL] = (ULONG)0; // place holder to mark end of values that fit in DWORD.
  467. #if CIDBG == 1
  468. for ( int i = 0; i < CI_AP_MAX_VAL; i++ )
  469. Win4Assert( VT_EMPTY != aParamVals[i].Type() );
  470. #endif // CIDBG == 1
  471. // both aParamVal and _aParamNames arrays have the same size - CI_AP_MAX_VAL in this case.
  472. SCODE sc = pICiAdminParams->SetValues( CI_AP_MAX_VAL , aParamVals, _aParamNames );
  473. if (sc != S_OK)
  474. {
  475. ciDebugOut(( DEB_ERROR,"pICiAdminParams->SetValues() failed: %x",sc));
  476. }
  477. }
  478. } //_StoreCIValues
  479. //+-------------------------------------------------------------------------
  480. //
  481. // Member: CCiRegVars::_StoreNewValues, private
  482. //
  483. // Synopsis: Transfers range-checked values
  484. //
  485. // History: 12-Oct-96 dlee Added header
  486. // 04-Feb-98 kitmanh Added entry for _fIsReadOnly
  487. //
  488. //--------------------------------------------------------------------------
  489. void CCiRegParams::_StoreNewValues(CCiRegVars & vars )
  490. {
  491. InterlockedExchange( (long *) &_useOle, vars._useOle != 0 );
  492. InterlockedExchange( (long *) &_filterContents, vars._filterContents != 0 );
  493. InterlockedExchange( (long *) &_filterDelayInterval, Range( vars._filterDelayInterval, CI_FILTER_DELAY_INTERVAL_MIN, CI_FILTER_DELAY_INTERVAL_MAX ) );
  494. InterlockedExchange( (long *) &_filterRemainingThreshold, Range( vars._filterRemainingThreshold, CI_FILTER_REMAINING_THRESHOLD_MIN, CI_FILTER_REMAINING_THRESHOLD_MAX ) );
  495. InterlockedExchange( (long *) &_maxFilesizeFiltered, vars._maxFilesizeFiltered );
  496. InterlockedExchange( (long *) &_masterMergeTime, Range( vars._masterMergeTime, CI_MASTER_MERGE_TIME_MIN, CI_MASTER_MERGE_TIME_MAX ) );
  497. InterlockedExchange( (long *) &_maxFilesizeMultiplier, Range( vars._maxFilesizeMultiplier, CI_MAX_FILESIZE_MULTIPLIER_MIN, CI_MAX_FILESIZE_MULTIPLIER_MAX ) );
  498. InterlockedExchange( (long *) &_threadClassFilter, Range( vars._threadClassFilter, CI_THREAD_CLASS_FILTER_MIN, CI_THREAD_CLASS_FILTER_MAX ) );
  499. InterlockedExchange( (long *) &_threadPriorityFilter, Range( vars._threadPriorityFilter, THREAD_BASE_PRIORITY_MIN, THREAD_BASE_PRIORITY_MAX ) );
  500. InterlockedExchange( (long *) &_daemonResponseTimeout, Range( vars._daemonResponseTimeout, CI_DAEMON_RESPONSE_TIMEOUT_MIN, CI_DAEMON_RESPONSE_TIMEOUT_MAX ) );
  501. InterlockedExchange( (long *) &_maxCharacterization, Range( vars._maxCharacterization, CI_MAX_CHARACTERIZATION_MIN, CI_MAX_CHARACTERIZATION_MAX ) );
  502. InterlockedExchange( (long *) &_fIsAutoAlias, vars._fIsAutoAlias != 0 );
  503. InterlockedExchange( (long *) &_maxAutoAliasRefresh, Range( vars._maxAutoAliasRefresh, CI_MAX_AUTO_ALIAS_REFRESH_MIN, CI_MAX_AUTO_ALIAS_REFRESH_MAX ) );
  504. InterlockedExchange( (long *) &_fIsIndexingW3Roots, vars._fIsIndexingW3Roots != 0 );
  505. InterlockedExchange( (long *) &_fIsIndexingNNTPRoots, vars._fIsIndexingNNTPRoots != 0 );
  506. InterlockedExchange( (long *) &_fIsIndexingIMAPRoots, vars._fIsIndexingIMAPRoots != 0 );
  507. InterlockedExchange( (long *) &_fIsReadOnly, vars._fIsReadOnly != 0 );
  508. InterlockedExchange( (long *) &_fIsEnumAllowed, vars._fIsEnumAllowed != 0 );
  509. InterlockedExchange( (long *) &_fFilterDirectories, vars._fFilterDirectories != 0 );
  510. InterlockedExchange( (long *) &_fFilterFilesWithUnknownExtensions, vars._fFilterFilesWithUnknownExtensions != 0 );
  511. InterlockedExchange( (long *) &_fCatalogInactive, vars._fCatalogInactive != 0 );
  512. InterlockedExchange( (long *) &_fForcePathAlias, vars._fForcePathAlias != 0 );
  513. InterlockedExchange( (long *) &_maxPropertyStoreMappedCache, Range( vars._maxPropertyStoreMappedCache, CI_PROPERTY_STORE_MAPPED_CACHE_MIN, CI_PROPERTY_STORE_MAPPED_CACHE_MAX ) );
  514. InterlockedExchange( (long *) &_maxPropertyStoreBackupSize, Range( vars._maxPropertyStoreBackupSize, CI_PROPERTY_STORE_BACKUP_SIZE_MIN, CI_PROPERTY_STORE_BACKUP_SIZE_MAX ) );
  515. InterlockedExchange( (long *) &_maxSecPropertyStoreMappedCache, Range( vars._maxSecPropertyStoreMappedCache, CI_PROPERTY_STORE_MAPPED_CACHE_MIN, CI_PROPERTY_STORE_MAPPED_CACHE_MAX ) );
  516. InterlockedExchange( (long *) &_maxSecPropertyStoreBackupSize, Range( vars._maxSecPropertyStoreBackupSize, CI_PROPERTY_STORE_BACKUP_SIZE_MIN, CI_PROPERTY_STORE_BACKUP_SIZE_MAX ) );
  517. InterlockedExchange( (long *) &_forcedNetPathScanInterval, Range( vars._forcedNetPathScanInterval, CI_FORCED_NETPATH_SCAN_MIN, CI_FORCED_NETPATH_SCAN_MAX ) );
  518. InterlockedExchange( (long *) &_maxMergeInterval, Range( vars._maxMergeInterval, CI_MAX_MERGE_INTERVAL_MIN, CI_MAX_MERGE_INTERVAL_MAX ) );
  519. InterlockedExchange( (long *) &_threadPriorityMerge, Range( vars._threadPriorityMerge, THREAD_BASE_PRIORITY_MIN, THREAD_BASE_PRIORITY_MAX ) );
  520. InterlockedExchange( (long *) &_maxUpdates, Range( vars._maxUpdates, CI_MAX_UPDATES_MIN, CI_MAX_UPDATES_MAX ) );
  521. InterlockedExchange( (long *) &_maxWordlists, Range( vars._maxWordlists, CI_MAX_WORDLISTS_MIN, CI_MAX_WORDLISTS_MAX ) );
  522. InterlockedExchange( (long *) &_minSizeMergeWordlist, Range( vars._minSizeMergeWordlist, CI_MIN_SIZE_MERGE_WORDLISTS_MIN, CI_MIN_SIZE_MERGE_WORDLISTS_MAX ) );
  523. InterlockedExchange( (long *) &_maxWordlistSize, Range( vars._maxWordlistSize, CI_MAX_WORDLIST_SIZE_MIN, CI_MAX_WORDLIST_SIZE_MAX ) );
  524. InterlockedExchange( (long *) &_minWordlistMemory, Range( vars._minWordlistMemory, CI_MIN_WORDLIST_MEMORY_MIN, CI_MIN_WORDLIST_MEMORY_MAX ) );
  525. InterlockedExchange( (long *) &_maxWordlistIo, Range( vars._maxWordlistIo, CI_MAX_WORDLIST_IO_MIN, CI_MAX_WORDLIST_IO_MAX ) );
  526. InterlockedExchange( (long *) &_maxWordlistIoDiskPerf, Range( vars._maxWordlistIoDiskPerf, CI_MAX_WORDLIST_IO_DISKPERF_MIN, CI_MAX_WORDLIST_IO_DISKPERF_MAX ) );
  527. InterlockedExchange( (long *) &_minWordlistBattery, Range( vars._minWordlistBattery, CI_MIN_WORDLIST_BATTERY_MIN, CI_MIN_WORDLIST_BATTERY_MAX ) );
  528. InterlockedExchange( (long *) &_ResourceCheckInterval, Range( vars._ResourceCheckInterval, CI_WORDLIST_RESOURCE_CHECK_INTERVAL_MIN, CI_WORDLIST_RESOURCE_CHECK_INTERVAL_MAX ) );
  529. InterlockedExchange( (long *) &_maxFreshDeletes, Range( vars._maxFreshDeletes, CI_MAX_FRESH_DELETES_MIN, CI_MAX_FRESH_DELETES_MAX ) );
  530. InterlockedExchange( (long *) &_lowResourceSleep, Range( vars._lowResourceSleep, CI_LOW_RESOURCE_SLEEP_MIN, CI_LOW_RESOURCE_SLEEP_MAX ) );
  531. InterlockedExchange( (long *) &_maxWordlistMemoryLoad, Range( vars._maxWordlistMemoryLoad, CI_MAX_WORDLIST_MEMORY_LOAD_MIN, CI_MAX_WORDLIST_MEMORY_LOAD_MAX ) );
  532. InterlockedExchange( (long *) &_maxFreshCount, Range( vars._maxFreshCount, CI_MAX_FRESHCOUNT_MIN, CI_MAX_FRESHCOUNT_MAX ) );
  533. InterlockedExchange( (long *) &_maxQueueChunks, Range( vars._maxQueueChunks, CI_MAX_QUEUE_CHUNKS_MIN, CI_MAX_QUEUE_CHUNKS_MAX ) );
  534. InterlockedExchange( (long *) &_masterMergeCheckpointInterval,
  535. Range( vars._masterMergeCheckpointInterval, CI_MASTER_MERGE_CHECKPOINT_INTERVAL_MIN, CI_MASTER_MERGE_CHECKPOINT_INTERVAL_MAX ) );
  536. InterlockedExchange( (long *) &_filterBufferSize, Range( vars._filterBufferSize, CI_FILTER_BUFFER_SIZE_MIN, CI_FILTER_BUFFER_SIZE_MAX ) );
  537. InterlockedExchange( (long *) &_filterRetries, Range( vars._filterRetries, CI_FILTER_RETRIES_MIN, CI_FILTER_RETRIES_MAX ) );
  538. InterlockedExchange( (long *) &_filterRetryInterval, Range( vars._filterRetryInterval, CI_FILTER_RETRY_INTERVAL_MIN, CI_FILTER_RETRY_INTERVAL_MAX ) );
  539. InterlockedExchange( (long *) &_maxShadowIndexSize, Range( vars._maxShadowIndexSize, CI_MAX_SHADOW_INDEX_SIZE_MIN, CI_MAX_SHADOW_INDEX_SIZE_MAX ) );
  540. InterlockedExchange( (long *) &_minDiskFreeForceMerge, Range( vars._minDiskFreeForceMerge, CI_MIN_DISKFREE_FORCE_MERGE_MIN, CI_MIN_DISKFREE_FORCE_MERGE_MAX ) );
  541. InterlockedExchange( (long *) &_maxShadowFreeForceMerge, Range( vars._maxShadowFreeForceMerge, CI_MAX_SHADOW_FREE_FORCE_MERGE_MIN, CI_MAX_SHADOW_FREE_FORCE_MERGE_MAX ) );
  542. InterlockedExchange( (long *) &_maxIndexes, Range( vars._maxIndexes, CI_MAX_INDEXES_MIN, CI_MAX_INDEXES_MAX ) );
  543. InterlockedExchange( (long *) &_maxIdealIndexes, Range( vars._maxIdealIndexes, CI_MAX_IDEAL_INDEXES_MIN, CI_MAX_IDEAL_INDEXES_MAX ) );
  544. InterlockedExchange( (long *) &_minMergeIdleTime, Range( vars._minMergeIdleTime, CI_MIN_MERGE_IDLE_TIME_MIN, CI_MIN_MERGE_IDLE_TIME_MAX ) );
  545. InterlockedExchange( (long *) &_maxPendingDocuments, Range( vars._maxPendingDocuments, CI_MAX_PENDING_DOCUMENTS_MIN, CI_MAX_PENDING_DOCUMENTS_MAX ) );
  546. InterlockedExchange( (long *) &_minIdleQueryThreads, Range( vars._minIdleQueryThreads, CI_MIN_IDLE_QUERY_THREADS_MIN, CI_MIN_IDLE_QUERY_THREADS_MAX ) );
  547. InterlockedExchange( (long *) &_maxActiveQueryThreads, Range( vars._maxActiveQueryThreads, CI_MAX_ACTIVE_QUERY_THREADS_MIN, CI_MAX_ACTIVE_QUERY_THREADS_MAX ) );
  548. InterlockedExchange( (long *) &_maxQueryTimeslice, Range( vars._maxQueryTimeslice, CI_MAX_QUERY_TIMESLICE_MIN, CI_MAX_QUERY_TIMESLICE_MAX ) );
  549. InterlockedExchange( (long *) &_maxQueryExecutionTime, Range( vars._maxQueryExecutionTime, CI_MAX_QUERY_EXECUTION_TIME_MIN, CI_MAX_QUERY_EXECUTION_TIME_MAX ) );
  550. InterlockedExchange( (long *) &_maxRestrictionNodes, Range( vars._maxRestrictionNodes, CI_MAX_RESTRICTION_NODES_MIN, CI_MAX_RESTRICTION_NODES_MAX ) );
  551. InterlockedExchange( (long *) &_minIdleRequestThreads, Range( vars._minIdleRequestThreads, CI_MIN_IDLE_REQUEST_THREADS_MIN, CI_MIN_IDLE_REQUEST_THREADS_MAX ) );
  552. InterlockedExchange( (long *) &_minClientIdleTime, Range( vars._minClientIdleTime, CI_MIN_CLIENT_IDLE_TIME, CI_MIN_CLIENT_IDLE_TIME ) );
  553. InterlockedExchange( (long *) &_maxActiveRequestThreads, Range( vars._maxActiveRequestThreads, CI_MAX_ACTIVE_REQUEST_THREADS_MIN, CI_MAX_ACTIVE_REQUEST_THREADS_MAX ) );
  554. InterlockedExchange( (long *) &_maxSimultaneousRequests, Range( vars._maxSimultaneousRequests, CI_MAX_SIMULTANEOUS_REQUESTS_MIN, CI_MAX_SIMULTANEOUS_REQUESTS_MAX ) );
  555. InterlockedExchange( (long *) &_maxCachedPipes, Range( vars._maxCachedPipes, CI_MAX_CACHED_PIPES_MIN, CI_MAX_CACHED_PIPES_MAX ) );
  556. InterlockedExchange( (long *) &_requestTimeout, Range( vars._requestTimeout, CI_REQUEST_TIMEOUT_MIN, CI_REQUEST_TIMEOUT_MAX ) );
  557. InterlockedExchange( (long *) &_W3SvcInstance, Range( vars._W3SvcInstance, CI_W3SVC_INSTANCE_MIN, CI_W3SVC_INSTANCE_MAX ) );
  558. InterlockedExchange( (long *) &_NNTPSvcInstance, Range( vars._NNTPSvcInstance, CI_NNTPSVC_INSTANCE_MIN, CI_NNTPSVC_INSTANCE_MAX ) );
  559. InterlockedExchange( (long *) &_IMAPSvcInstance, Range( vars._IMAPSvcInstance, CI_IMAPSVC_INSTANCE_MIN, CI_IMAPSVC_INSTANCE_MAX ) );
  560. InterlockedExchange( (long *) &_ulScanBackoff, Range( vars._ulScanBackoff, CI_SCAN_BACKOFF_MIN, CI_SCAN_BACKOFF_MAX ) );
  561. InterlockedExchange( (long *) &_ulStartupDelay, Range( vars._ulStartupDelay, CI_STARTUP_DELAY_MIN, CI_STARTUP_DELAY_MAX ) );
  562. InterlockedExchange( (long *) &_ulUsnReadTimeout, Range( vars._ulUsnReadTimeout, CI_USN_READ_TIMEOUT_MIN, CI_USN_READ_TIMEOUT_MAX ) );
  563. InterlockedExchange( (long *) &_ulUsnReadMinSize, Range( vars._ulUsnReadMinSize, CI_USN_READ_MIN_SIZE_MIN, CI_USN_READ_MIN_SIZE_MAX ) );
  564. InterlockedExchange( (long *) &_fDelayUsnReadOnLowResource, vars._fDelayUsnReadOnLowResource != 0 );
  565. InterlockedExchange( (long *) &_maxDaemonVmUse, Range( vars._maxDaemonVmUse, CI_MAX_DAEMON_VM_USE_MIN, CI_MAX_DAEMON_VM_USE_MAX ) );
  566. InterlockedExchange( (long *) &_secQFilterRetries, Range( vars._secQFilterRetries, CI_SECQ_FILTER_RETRIES_MIN, CI_SECQ_FILTER_RETRIES_MAX ) );
  567. InterlockedExchange( (long *) &_fMinimizeWorkingSet, vars._fMinimizeWorkingSet );
  568. InterlockedExchange( (long *) &_WordlistUserIdle, Range( vars._WordlistUserIdle, CI_WORDLIST_USER_IDLE_MIN, CI_WORDLIST_USER_IDLE_MAX ) );
  569. InterlockedExchange( (long *) &_evtLogFlags, vars._evtLogFlags );
  570. InterlockedExchange( (long *) &_miscCiFlags, vars._miscCiFlags );
  571. InterlockedExchange( (long *) &_ciCatalogFlags, vars._ciCatalogFlags );
  572. InterlockedExchange( (long *) &_maxUsnLogSize, vars._maxUsnLogSize );
  573. InterlockedExchange( (long *) &_usnLogAllocationDelta, vars._usnLogAllocationDelta );
  574. InterlockedExchange( (long *) &_ulStompLastAccessDelay, Range( vars._ulStompLastAccessDelay, CI_STOMP_LAST_ACCESS_DELAY_MIN, CI_STOMP_LAST_ACCESS_DELAY_MAX ) );
  575. InterlockedExchange( (long *) &_minDiskSpaceToLeave, Range( vars._minDiskSpaceToLeave, CI_MIN_DISK_SPACE_TO_LEAVE_MIN, CI_MIN_DISK_SPACE_TO_LEAVE_MAX ) );
  576. } //_StoreNewValues
  577. //+-------------------------------------------------------------------------
  578. //
  579. // Member: CCiRegParams::Refresh, public
  580. //
  581. // Synopsis: Reads the values from the registry
  582. //
  583. // History: 12-Oct-96 dlee Added header, reorganized
  584. //
  585. //--------------------------------------------------------------------------
  586. void CCiRegParams::Refresh(
  587. ICiAdminParams * pICiAdminParams,
  588. BOOL fUseDefaultsOnFailure )
  589. {
  590. // Grab the lock so no other writers try to update at the same time
  591. CCiRegVars newVals;
  592. CLock lock( _mutex );
  593. TRY
  594. {
  595. // Query the registry.
  596. CRegAccess regAdmin( RTL_REGISTRY_CONTROL, wcsRegAdmin );
  597. _ReadValues( regAdmin, newVals );
  598. _StoreNewValues( newVals );
  599. // if there is a catalog override, use it
  600. _OverrideForCatalog();
  601. _StoreCIValues( *this, pICiAdminParams );
  602. }
  603. CATCH (CException, e)
  604. {
  605. // Only store defaults when told to do so -- the params
  606. // are still in good shape at this point and are more
  607. // accurate than the default settings.
  608. if ( fUseDefaultsOnFailure )
  609. {
  610. newVals.SetDefault();
  611. _StoreNewValues( newVals );
  612. _StoreCIValues ( newVals, pICiAdminParams );
  613. }
  614. }
  615. END_CATCH
  616. } //Refresh
  617. //+-------------------------------------------------------------------------
  618. //
  619. // Function: BuildRegistryScopesKey
  620. //
  621. // Synopsis: Builds a registry key for scopes for a given catalog. This
  622. // is needed in a couple of places.
  623. //
  624. // Arguments: [xKey] -- Returns the registry key
  625. // [pwcName] -- Name of the catalog for which key is built
  626. //
  627. // History: 4-Nov-96 dlee created
  628. //
  629. //--------------------------------------------------------------------------
  630. void BuildRegistryScopesKey(
  631. XArray<WCHAR> & xKey,
  632. WCHAR const * pwcName )
  633. {
  634. unsigned cwc = wcslen( L"\\Registry\\Machine\\" );
  635. cwc += wcslen( wcsRegCatalogsSubKey );
  636. cwc += 3;
  637. cwc += wcslen( pwcName );
  638. cwc += wcslen( wcsCatalogScopes );
  639. xKey.Init( cwc );
  640. wcscpy( xKey.Get(), L"\\Registry\\Machine\\" );
  641. wcscat( xKey.Get(), wcsRegCatalogsSubKey );
  642. wcscat( xKey.Get(), L"\\" );
  643. wcscat( xKey.Get(), pwcName );
  644. wcscat( xKey.Get(), L"\\" );
  645. wcscat( xKey.Get(), wcsCatalogScopes );
  646. } //BuildRegistryScopesKey
  647. //+-------------------------------------------------------------------------
  648. //
  649. // Function: BuildRegistryPropertiesKey
  650. //
  651. // Synopsis: Builds a registry key for properties for a given catalog.
  652. //
  653. // Arguments: [xKey] -- Returns the registry key
  654. // [pwcName] -- Name of the catalog for which key is built
  655. //
  656. // History: 11-Nov-97 KyleP Stole from BuildRegistryScopesKey
  657. //
  658. //--------------------------------------------------------------------------
  659. void BuildRegistryPropertiesKey( XArray<WCHAR> & xKey,
  660. WCHAR const * pwcName )
  661. {
  662. unsigned cwc = wcslen( L"\\Registry\\Machine\\" );
  663. cwc += wcslen( wcsRegCatalogsSubKey );
  664. cwc += 3;
  665. cwc += wcslen( pwcName );
  666. cwc += wcslen( wcsCatalogProperties );
  667. xKey.Init( cwc );
  668. wcscpy( xKey.Get(), L"\\Registry\\Machine\\" );
  669. wcscat( xKey.Get(), wcsRegCatalogsSubKey );
  670. wcscat( xKey.Get(), L"\\" );
  671. wcscat( xKey.Get(), pwcName );
  672. wcscat( xKey.Get(), L"\\" );
  673. wcscat( xKey.Get(), wcsCatalogProperties );
  674. } //BuildRegistryPropertiesKey
  675. //+---------------------------------------------------------------------------
  676. //
  677. // Member: CCiRegParams::CheckNamedValues
  678. //
  679. // Synopsis: Asserts that each of the named values matches
  680. // the assumption about it's definition in ciintf.idl
  681. //
  682. // Notes: if any of the assertions here pop up,
  683. //
  684. // History: 1-30-97 mohamedn created
  685. //
  686. //----------------------------------------------------------------------------
  687. void CCiRegParams::_CheckNamedValues()
  688. {
  689. Win4Assert ( 0 == CI_AP_MERGE_INTERVAL );
  690. Win4Assert ( 1 == CI_AP_MAX_UPDATES);
  691. Win4Assert ( 2 == CI_AP_MAX_WORDLISTS);
  692. Win4Assert ( 3 == CI_AP_MIN_SIZE_MERGE_WORDLISTS);
  693. Win4Assert ( 4 == CI_AP_MAX_WORDLIST_SIZE);
  694. Win4Assert ( 5 == CI_AP_MIN_WORDLIST_MEMORY);
  695. Win4Assert ( 6 == CI_AP_LOW_RESOURCE_SLEEP);
  696. Win4Assert ( 7 == CI_AP_MAX_WORDLIST_MEMORY_LOAD);
  697. Win4Assert ( 8 == CI_AP_MAX_FRESH_COUNT);
  698. Win4Assert ( 9 == CI_AP_MAX_SHADOW_INDEX_SIZE);
  699. Win4Assert ( 10 == CI_AP_MIN_DISK_FREE_FORCE_MERGE);
  700. Win4Assert ( 11 == CI_AP_MAX_SHADOW_FREE_FORCE_MERGE);
  701. Win4Assert ( 12 == CI_AP_MAX_INDEXES);
  702. Win4Assert ( 13 == CI_AP_MAX_IDEAL_INDEXES);
  703. Win4Assert ( 14 == CI_AP_MIN_MERGE_IDLE_TIME);
  704. Win4Assert ( 15 == CI_AP_MAX_PENDING_DOCUMENTS);
  705. Win4Assert ( 16 == CI_AP_MASTER_MERGE_TIME);
  706. Win4Assert ( 17 == CI_AP_MAX_QUEUE_CHUNKS);
  707. Win4Assert ( 18 == CI_AP_MASTER_MERGE_CHECKPOINT_INTERVAL);
  708. Win4Assert ( 19 == CI_AP_FILTER_BUFFER_SIZE);
  709. Win4Assert ( 20 == CI_AP_FILTER_RETRIES);
  710. Win4Assert ( 21 == CI_AP_FILTER_RETRY_INTERVAL);
  711. Win4Assert ( 22 == CI_AP_MIN_IDLE_QUERY_THREADS);
  712. Win4Assert ( 23 == CI_AP_MAX_ACTIVE_QUERY_THREADS);
  713. Win4Assert ( 24 == CI_AP_MAX_QUERY_TIMESLICE);
  714. Win4Assert ( 25 == CI_AP_MAX_QUERY_EXECUTION_TIME);
  715. Win4Assert ( 26 == CI_AP_MAX_RESTRICTION_NODES);
  716. Win4Assert ( 27 == CI_AP_CLUSTERINGTIME);
  717. Win4Assert ( 28 == CI_AP_MAX_FILESIZE_MULTIPLIER);
  718. Win4Assert ( 29 == CI_AP_DAEMON_RESPONSE_TIMEOUT);
  719. Win4Assert ( 30 == CI_AP_FILTER_DELAY_INTERVAL);
  720. Win4Assert ( 31 == CI_AP_FILTER_REMAINING_THRESHOLD);
  721. Win4Assert ( 32 == CI_AP_MAX_CHARACTERIZATION);
  722. Win4Assert ( 33 == CI_AP_MAX_FRESH_DELETES );
  723. Win4Assert ( 34 == CI_AP_MAX_WORDLIST_IO );
  724. Win4Assert ( 35 == CI_AP_WORDLIST_RESOURCE_CHECK_INTERVAL );
  725. Win4Assert ( 36 == CI_AP_STARTUP_DELAY );
  726. Win4Assert ( 37 == CI_AP_GENERATE_CHARACTERIZATION );
  727. Win4Assert ( 38 == CI_AP_MIN_WORDLIST_BATTERY );
  728. Win4Assert ( 39 == CI_AP_THREAD_PRIORITY_MERGE);
  729. Win4Assert ( 40 == CI_AP_THREAD_PRIORITY_FILTER);
  730. Win4Assert ( 41 == CI_AP_THREAD_CLASS_FILTER);
  731. Win4Assert ( 42 == CI_AP_EVTLOG_FLAGS);
  732. Win4Assert ( 43 == CI_AP_MISC_FLAGS);
  733. Win4Assert ( 44 == CI_AP_GENERATE_RELEVANT_WORDS);
  734. Win4Assert ( 45 == CI_AP_FFILTER_FILES_WITH_UNKNOWN_EXTENSIONS);
  735. Win4Assert ( 46 == CI_AP_FILTER_DIRECTORIES);
  736. Win4Assert ( 47 == CI_AP_FILTER_CONTENTS);
  737. Win4Assert ( 48 == CI_AP_MAX_FILESIZE_FILTERED);
  738. Win4Assert ( 49 == CI_AP_MIN_CLIENT_IDLE_TIME);
  739. Win4Assert ( 50 == CI_AP_MAX_DAEMON_VM_USE);
  740. Win4Assert ( 51 == CI_AP_SECQ_FILTER_RETRIES);
  741. Win4Assert ( 52 == CI_AP_WORDLIST_USER_IDLE);
  742. Win4Assert ( 53 == CI_AP_IS_ENUM_ALLOWED);
  743. Win4Assert ( 54 == CI_AP_MIN_DISK_SPACE_TO_LEAVE);
  744. //
  745. // Place holder to mark end of values that fit in DWORD,
  746. //
  747. Win4Assert ( 55 == CI_AP_MAX_DWORD_VAL);
  748. // CI_AP_MAX_VAL // mark end of params.
  749. }
  750. // ---------------------------------------------------------------------------
  751. // Array of enumerated/named Ci admin. parameters, used to index
  752. // into the array of parameters to set/get parameter values.
  753. // ---------------------------------------------------------------------------
  754. const CI_ADMIN_PARAMS CCiRegParams::_aParamNames[ CI_AP_MAX_VAL ] =
  755. {
  756. CI_AP_MERGE_INTERVAL,
  757. CI_AP_MAX_UPDATES,
  758. CI_AP_MAX_WORDLISTS,
  759. CI_AP_MIN_SIZE_MERGE_WORDLISTS,
  760. CI_AP_MAX_WORDLIST_SIZE,
  761. CI_AP_MIN_WORDLIST_MEMORY,
  762. CI_AP_LOW_RESOURCE_SLEEP,
  763. CI_AP_MAX_WORDLIST_MEMORY_LOAD,
  764. CI_AP_MAX_FRESH_COUNT,
  765. CI_AP_MAX_SHADOW_INDEX_SIZE,
  766. CI_AP_MIN_DISK_FREE_FORCE_MERGE,
  767. CI_AP_MAX_SHADOW_FREE_FORCE_MERGE,
  768. CI_AP_MAX_INDEXES,
  769. CI_AP_MAX_IDEAL_INDEXES,
  770. CI_AP_MIN_MERGE_IDLE_TIME,
  771. CI_AP_MAX_PENDING_DOCUMENTS,
  772. CI_AP_MASTER_MERGE_TIME,
  773. CI_AP_MAX_QUEUE_CHUNKS,
  774. CI_AP_MASTER_MERGE_CHECKPOINT_INTERVAL,
  775. CI_AP_FILTER_BUFFER_SIZE,
  776. CI_AP_FILTER_RETRIES,
  777. CI_AP_FILTER_RETRY_INTERVAL,
  778. CI_AP_MIN_IDLE_QUERY_THREADS,
  779. CI_AP_MAX_ACTIVE_QUERY_THREADS,
  780. CI_AP_MAX_QUERY_TIMESLICE,
  781. CI_AP_MAX_QUERY_EXECUTION_TIME,
  782. CI_AP_MAX_RESTRICTION_NODES,
  783. CI_AP_CLUSTERINGTIME,
  784. CI_AP_MAX_FILESIZE_MULTIPLIER,
  785. CI_AP_DAEMON_RESPONSE_TIMEOUT,
  786. CI_AP_FILTER_DELAY_INTERVAL,
  787. CI_AP_FILTER_REMAINING_THRESHOLD,
  788. CI_AP_MAX_CHARACTERIZATION,
  789. CI_AP_MAX_FRESH_DELETES,
  790. CI_AP_MAX_WORDLIST_IO,
  791. CI_AP_WORDLIST_RESOURCE_CHECK_INTERVAL,
  792. CI_AP_STARTUP_DELAY,
  793. CI_AP_GENERATE_CHARACTERIZATION,
  794. CI_AP_MIN_WORDLIST_BATTERY,
  795. CI_AP_THREAD_PRIORITY_MERGE,
  796. CI_AP_THREAD_PRIORITY_FILTER,
  797. CI_AP_THREAD_CLASS_FILTER,
  798. CI_AP_EVTLOG_FLAGS,
  799. CI_AP_MISC_FLAGS,
  800. CI_AP_GENERATE_RELEVANT_WORDS,
  801. CI_AP_FFILTER_FILES_WITH_UNKNOWN_EXTENSIONS,
  802. CI_AP_FILTER_DIRECTORIES,
  803. CI_AP_FILTER_CONTENTS,
  804. CI_AP_MAX_FILESIZE_FILTERED,
  805. CI_AP_MIN_CLIENT_IDLE_TIME,
  806. CI_AP_MAX_DAEMON_VM_USE,
  807. CI_AP_SECQ_FILTER_RETRIES,
  808. CI_AP_WORDLIST_USER_IDLE,
  809. CI_AP_IS_ENUM_ALLOWED,
  810. CI_AP_MIN_DISK_SPACE_TO_LEAVE,
  811. //
  812. // Place holder to mark end of values that fit in DWORD,
  813. //
  814. CI_AP_MAX_DWORD_VAL,
  815. // CI_AP_MAX_VAL // mark end of params.
  816. };
  817. //+---------------------------------------------------------------------------
  818. //
  819. // Function: GetMaxCatalogs
  820. //
  821. // Synopsis: Retrieves the global max count of catalogs
  822. //
  823. // History: May-5-99 dlee created
  824. //
  825. //----------------------------------------------------------------------------
  826. ULONG GetMaxCatalogs()
  827. {
  828. //
  829. // Make sure we only read this value once. Force a restart of the
  830. // service to read it again.
  831. //
  832. static ULONG cMaxCatalogs = 0xffffffff;
  833. if ( 0xffffffff == cMaxCatalogs )
  834. {
  835. CRegAccess reg( RTL_REGISTRY_CONTROL, wcsRegAdmin );
  836. DWORD cCat = reg.Read( wcsMaxCatalogs, CI_MAX_CATALOGS_DEFAULT);
  837. cMaxCatalogs = Range( cCat, CI_MAX_CATALOGS_MIN, CI_MAX_CATALOGS_MAX );
  838. }
  839. return cMaxCatalogs;
  840. } //GetMaxCatalogs