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.

102 lines
3.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 2002.
  5. //
  6. // File: IDQREG.HXX
  7. //
  8. // Contents: Default registry parameters for idq.dll
  9. //
  10. // History: 22 Oct 97 AlanW Created from params.hxx
  11. //
  12. //----------------------------------------------------------------------------
  13. #pragma once
  14. const ULONG IS_DATETIME_FORMATTING_USER_LCID = 0;
  15. const ULONG IS_DATETIME_FORMATTING_SYSTEM_LCID = 1;
  16. const ULONG IS_DATETIME_FORMATTING_FAST_LCID = 2;
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Class: CIdqRegVars
  20. //
  21. // Purpose: Registry variables used by IDQ.dll
  22. //
  23. // History 10-11-96 dlee Created from user+kernel params
  24. //
  25. //----------------------------------------------------------------------------
  26. class CIdqRegVars
  27. {
  28. public:
  29. void SetDefault();
  30. ULONG _maxISRowsInResultSet; // max rows in result for ISAPI exten.
  31. ULONG _maxISQueryCache; // max size of query cache for ISAPI exten.
  32. ULONG _ISFirstRowsInResultSet;
  33. ULONG _ISCachePurgeInterval; // query cache purge interval for ISAPI ext.
  34. ULONG _ISRequestQueueSize; // query queue for web requests w for ISAPI ext.
  35. ULONG _ISRequestThresholdFactor; // thread factor for # processors for
  36. // queueing requests
  37. ULONG _ISDateTimeFormatting; // mode for formatting date/time
  38. ULONG _ISDateTimeLocal; // 0 for GMT, 1 for local system time
  39. // Note: Not really an IDQ param, but used with ISRequestThresholdFactor to
  40. // compute the max # of threads in idq.dll.
  41. ULONG _maxActiveQueryThreads; // Maximum number of query threads to allow
  42. WCHAR _awcISDefaultCatalog[_MAX_PATH]; // default IS catalog dir
  43. };
  44. //+---------------------------------------------------------------------------
  45. //
  46. // Class: CIdqRegParams
  47. //
  48. // Purpose: Registry variables used by CI
  49. //
  50. // History 10-11-96 dlee Created from user+kernel params
  51. //
  52. //----------------------------------------------------------------------------
  53. class CRegAccess;
  54. class CIdqRegParams : public CIdqRegVars
  55. {
  56. public :
  57. CIdqRegParams( );
  58. void Refresh( BOOL fUseDefaultsOnFailure = FALSE );
  59. const ULONG GetMaxISRowsInResultSet() { return _maxISRowsInResultSet; }
  60. const ULONG GetMaxISQueryCache() { return _maxISQueryCache; }
  61. const ULONG GetISFirstRowsInResultSet() { return _ISFirstRowsInResultSet; }
  62. const ULONG GetISCachePurgeInterval() { return _ISCachePurgeInterval; }
  63. const ULONG GetISRequestQueueSize() { return _ISRequestQueueSize; }
  64. const ULONG GetISRequestThresholdFactor() { return _ISRequestThresholdFactor; }
  65. const ULONG GetMaxActiveQueryThreads() { return _maxActiveQueryThreads; }
  66. const ULONG GetDateTimeFormatting() { return _ISDateTimeFormatting; }
  67. const BOOL GetDateTimeLocal() { return 0 != _ISDateTimeLocal; }
  68. const ULONG GetISDefaultCatalog( WCHAR *pwc, ULONG cwc )
  69. {
  70. CLock lock( _mutex );
  71. // copy the whole string under lock
  72. ULONG cwcBuf = wcslen( _awcISDefaultCatalog );
  73. if ( cwc > cwcBuf )
  74. wcscpy( pwc, _awcISDefaultCatalog );
  75. return cwcBuf;
  76. }
  77. private:
  78. void _ReadValues( CRegAccess & reg, CIdqRegVars & vars );
  79. void _StoreNewValues( CIdqRegVars & vars );
  80. CMutexSem _mutex; // Used to serialize access
  81. };