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.

395 lines
9.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. srvconfg.c
  5. Abstract:
  6. This module defines global configuration data for the LAN Manager
  7. server. The variables referenced herein, because they are part of
  8. the driver image, are not pageable.
  9. All variables defined here are initialized, but not with real values.
  10. The initializers are present to get the variables into the Data
  11. section and out of the BSS section. The real initialization occurs
  12. when the server is started.
  13. Author:
  14. Chuck Lenzmeier (chuckl) 31-Dec-1989
  15. Revision History:
  16. --*/
  17. #include "precomp.h"
  18. #include "srvconfg.tmh"
  19. #pragma hdrstop
  20. //
  21. // Product type and server size.
  22. //
  23. BOOLEAN SrvProductTypeServer = FALSE;
  24. ULONG SrvServerSize = 2;
  25. //
  26. // Server "heuristics", enabling various capabilities.
  27. //
  28. BOOLEAN SrvEnableOplocks = 0;
  29. BOOLEAN SrvEnableFcbOpens = 0;
  30. BOOLEAN SrvEnableSoftCompatibility = 0;
  31. BOOLEAN SrvEnableRawMode = 0;
  32. //
  33. // Receive buffer size, receive work item count, and receive IRP stack
  34. // size.
  35. //
  36. CLONG SrvReceiveBufferLength = 0;
  37. CLONG SrvReceiveBufferSize = 0;
  38. CLONG SrvInitialReceiveWorkItemCount = 0;
  39. CLONG SrvMaxReceiveWorkItemCount = 0;
  40. CLONG SrvInitialRawModeWorkItemCount = 0;
  41. CLONG SrvMaxRawModeWorkItemCount = 0;
  42. CCHAR SrvReceiveIrpStackSize = 0;
  43. CLONG SrvReceiveIrpSize = 0;
  44. CLONG SrvReceiveMdlSize = 0;
  45. CLONG SrvMaxMdlSize = 0;
  46. //
  47. // Minimum negotiated buffer size we'll allow from a client
  48. //
  49. CLONG SrvMinClientBufferSize;
  50. //
  51. // Minimum and maximum number of free connections for an endpoint.
  52. //
  53. ULONG SrvFreeConnectionMinimum = 0;
  54. ULONG SrvFreeConnectionMaximum = 0;
  55. //
  56. // Maximum raw mode buffer size.
  57. //
  58. CLONG SrvMaxRawModeBufferLength = 0;
  59. //
  60. // Cache-related parameters.
  61. //
  62. CLONG SrvMaxCopyReadLength = 0;
  63. CLONG SrvMaxCopyWriteLength = 0;
  64. //
  65. // Initial table sizes.
  66. //
  67. USHORT SrvInitialSessionTableSize = 0;
  68. USHORT SrvMaxSessionTableSize = 0;
  69. USHORT SrvInitialTreeTableSize = 0;
  70. USHORT SrvMaxTreeTableSize = 0;
  71. USHORT SrvInitialFileTableSize = 0;
  72. USHORT SrvMaxFileTableSize = 0;
  73. USHORT SrvInitialSearchTableSize = 0;
  74. USHORT SrvMaxSearchTableSize = 0;
  75. USHORT SrvInitialCommDeviceTableSize = 0;
  76. USHORT SrvMaxCommDeviceTableSize = 0;
  77. //
  78. // Core search timeouts. There are four timeout values: two for core
  79. // searches that have completed, two for core searches that have had
  80. // STATUS_NO_MORE_FILES returned to the client. For each of these cases,
  81. // there is a maximum timeout, which is used by the scavanger thread
  82. // and is the longest possible time the search block can be around, and
  83. // a minimum timeout, which is the minimum amount of time the search
  84. // block will be kept around. The minimum timeout is used when the search
  85. // table is full and cannot be expanded.
  86. //
  87. LARGE_INTEGER SrvSearchMaxTimeout = {0};
  88. //
  89. // Should we remove duplicate searches?
  90. //
  91. BOOLEAN SrvRemoveDuplicateSearches = TRUE;
  92. //
  93. // restrict null session access ?
  94. //
  95. BOOLEAN SrvRestrictNullSessionAccess = TRUE;
  96. //
  97. // This flag is needed to enable old (snowball) clients to connect to the
  98. // server over direct hosted ipx. It is enabled by default even though
  99. // Snowball ipx clients don't do pipes correctly, because disabling it
  100. // breaks browsing.
  101. //
  102. // *** We actually don't expect anybody to use this parameter now that
  103. // it defaults to enabled, but due to the nearness of the Daytona
  104. // release, we are just changing the default instead of removing
  105. // the parameter.
  106. //
  107. BOOLEAN SrvEnableWfW311DirectIpx = TRUE;
  108. //
  109. // The maximum number of threads allowed on each work queue. The
  110. // server tries to minimize the number of threads -- this value is
  111. // just to keep the threads from getting out of control.
  112. //
  113. // Since the blocking work queue is not per-processor, the max thread
  114. // count for the blocking work queue is the following value times the
  115. // number of processors in the system.
  116. //
  117. ULONG SrvMaxThreadsPerQueue = 0;
  118. //
  119. // Load balancing variables
  120. //
  121. ULONG SrvPreferredAffinity = 0;
  122. ULONG SrvOtherQueueAffinity = 0;
  123. ULONG SrvBalanceCount = 0;
  124. LARGE_INTEGER SrvQueueCalc = {0};
  125. //
  126. // Scavenger thread idle wait time.
  127. //
  128. LARGE_INTEGER SrvScavengerTimeout = {0};
  129. ULONG SrvScavengerTimeoutInSeconds = 0;
  130. //
  131. // Various information variables for the server.
  132. //
  133. USHORT SrvMaxMpxCount = 0;
  134. CLONG SrvMaxNumberVcs = 0;
  135. //
  136. // Enforced minimum number of receive work items for the free queue
  137. // at all times.
  138. //
  139. CLONG SrvMinReceiveQueueLength = 0;
  140. //
  141. // Enforced minimum number of receive work items on the free queue
  142. // before the server may initiate a blocking operation.
  143. //
  144. CLONG SrvMinFreeWorkItemsBlockingIo = 0;
  145. //
  146. // Enforced maximum number of RFCBs held on the internal free lists, per processor
  147. //
  148. CLONG SrvMaxFreeRfcbs = 0;
  149. //
  150. // Enforced maximum number of RFCBs held on the internal free lists, per processor
  151. //
  152. CLONG SrvMaxFreeMfcbs = 0;
  153. //
  154. // Enforced maximum size of a saved pool chunk per processor
  155. //
  156. CLONG SrvMaxPagedPoolChunkSize = 0;
  157. //
  158. // Enforced maximum size of a saved non paged pool chunk per processor
  159. //
  160. CLONG SrvMaxNonPagedPoolChunkSize = 0;
  161. //
  162. // The number of elements in the directory name cache per connection
  163. //
  164. CLONG SrvMaxCachedDirectory;
  165. //
  166. // Size of the shared memory section used for communication between the
  167. // server and XACTSRV.
  168. //
  169. LARGE_INTEGER SrvXsSectionSize = {0};
  170. //
  171. // The time sessions may be idle before they are automatically
  172. // disconnected. The scavenger thread does the disconnecting.
  173. //
  174. LARGE_INTEGER SrvAutodisconnectTimeout = {0};
  175. ULONG SrvIpxAutodisconnectTimeout = {0};
  176. //
  177. // The time a connection structure can hang around without any sessions
  178. //
  179. ULONG SrvConnectionNoSessionsTimeout = {0};
  180. //
  181. // The maximum number of users the server will permit.
  182. //
  183. ULONG SrvMaxUsers = 0;
  184. //
  185. // Priority of server worker and blocking threads.
  186. //
  187. KPRIORITY SrvThreadPriority = 0;
  188. //
  189. // The time to wait before timing out a wait for oplock break.
  190. //
  191. LARGE_INTEGER SrvWaitForOplockBreakTime = {0};
  192. //
  193. // The time to wait before timing out a an oplock break request.
  194. //
  195. LARGE_INTEGER SrvWaitForOplockBreakRequestTime = {0};
  196. //
  197. // This BOOLEAN determines whether files with oplocks that have had
  198. // an oplock break outstanding for longer than SrvWaitForOplockBreakTime
  199. // should be closed or if the subsequest opens should fail.
  200. //
  201. // !!! it is currently ignored, defaulting to FALSE.
  202. BOOLEAN SrvEnableOplockForceClose = 0;
  203. //
  204. // Overall limits on server memory usage.
  205. //
  206. ULONG SrvMaxPagedPoolUsage = 0;
  207. ULONG SrvMaxNonPagedPoolUsage = 0;
  208. //
  209. // This BOOLEAN indicates whether the forced logoff code in the scavenger
  210. // thread should actually disconnect a user that remains on beyond
  211. // his logon hours, or just send messages coaxing them to log off.
  212. //
  213. BOOLEAN SrvEnableForcedLogoff = 0;
  214. //
  215. // The delay and throughput thresholds used to determine if a link
  216. // is unreliable. The delay is in 100ns. The Throughput is in bytes/s
  217. // SrvLinkInfoValidTime is the time within which the link info is still
  218. // considered valid.
  219. //
  220. LARGE_INTEGER SrvMaxLinkDelay = {0};
  221. LARGE_INTEGER SrvMinLinkThroughput = {0};
  222. LARGE_INTEGER SrvLinkInfoValidTime = {0};
  223. LONG SrvScavengerUpdateQosCount = 0;
  224. //
  225. // Used to determine how long a work context block can stay idle
  226. // before being freed.
  227. //
  228. ULONG SrvWorkItemMaxIdleTime = 0;
  229. LARGE_INTEGER SrvAlertSchedule = {0}; // Interval at which we do alert checks
  230. ULONG SrvAlertMinutes = 0; // As above, in minutes
  231. ULONG SrvFreeDiskSpaceThreshold = 0; // The disk free space threshold to raise an alert
  232. ULONG SrvFreeDiskSpaceCeiling = 250;// The minimum disk free space to log an event
  233. ULONG SrvDiskConfiguration = 0; // A bit mask of available disks
  234. //
  235. // List of pipes and shares that can be opened by the NULL session.
  236. //
  237. PWSTR *SrvNullSessionPipes = NULL;
  238. PWSTR *SrvNullSessionShares = NULL;
  239. #if SRVNTVERCHK
  240. //
  241. // List of domain names that we disallow
  242. //
  243. PWSTR *SrvInvalidDomainNames = NULL;
  244. #endif
  245. //
  246. // List of pipes that shouldn't be remapped, even in the clusters case
  247. //
  248. PWSTR *SrvNoRemapPipeNames = NULL;
  249. //
  250. // List of error codes that we do not log to the error log
  251. //
  252. NTSTATUS SrvErrorLogIgnore[ SRVMAXERRLOGIGNORE+1 ];
  253. //
  254. // List of pipes that require a license
  255. //
  256. PWSTR *SrvPipesNeedLicense = NULL;
  257. //
  258. // Delay and number of retries for opens returning sharing violation
  259. //
  260. ULONG SrvSharingViolationRetryCount = 0;
  261. LARGE_INTEGER SrvSharingViolationDelay = {0};
  262. //
  263. // Delay for lock requests returning lock violation
  264. //
  265. ULONG SrvLockViolationDelay = 0;
  266. LARGE_INTEGER SrvLockViolationDelayRelative = {0};
  267. ULONG SrvLockViolationOffset = 0;
  268. //
  269. // Upper limit for searches.
  270. //
  271. ULONG SrvMaxOpenSearches = 0;
  272. //
  273. // length to switchover to mdl read
  274. //
  275. ULONG SrvMdlReadSwitchover = 0;
  276. ULONG SrvMpxMdlReadSwitchover = 0;
  277. //
  278. // maximum length of buffers to copy before taking the whole receive buffer.
  279. // currently this is enabled only for WRITE_MPX on direct host IPX.
  280. //
  281. ULONG SrvMaxCopyLength;
  282. //
  283. // Number of open files that can be cached after close.
  284. //
  285. ULONG SrvCachedOpenLimit = 0;
  286. //
  287. // Globally unique id identifying server
  288. //
  289. GUID ServerGuid;