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.

202 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. globals.cxx
  5. Abstract:
  6. IIS MetaBase global variables
  7. Author:
  8. Michael W. Thomas 31-May-96
  9. Revision History:
  10. --*/
  11. #include "precomp.hxx"
  12. //
  13. // Access to global data structures is synchronized by
  14. // acquiring g_LockMasterResource with read or write
  15. // permission.
  16. //
  17. CMDCOMSrvFactory *g_pFactory = NULL;
  18. ULONG g_dwRefCount = 0;
  19. CMDBaseObject *g_pboMasterRoot;
  20. CReaderWriterLock3 g_LockMasterResource;
  21. TS_RESOURCE *g_rSinkResource;
  22. CMDHandle *g_phHandleHead;
  23. METADATA_HANDLE g_mhHandleIdentifier;
  24. DWORD g_dwSystemChangeNumber = 0;
  25. DWORD g_dwSchemaChangeNumber = 1;
  26. DWORD g_dwLastSchemaChangeNumber = 1;
  27. DWORD g_dwMajorVersionNumber = MD_MAJOR_VERSION_NUMBER;
  28. DWORD g_dwMinorVersionNumber = MD_MINOR_VERSION_NUMBER;
  29. HANDLE g_phEventHandles[EVENT_ARRAY_LENGTH];
  30. HANDLE g_hReadSaveSemaphore;
  31. DWORD g_dwInitialized = 0;
  32. HRESULT g_hresInitWarning = ERROR_SUCCESS;
  33. CMDBaseData **g_ppbdDataHashTable;
  34. DWORD g_dwWriteNumber;
  35. DWORD g_dwLastSaveChangeNumber;
  36. BOOL g_bSaveDisallowed;
  37. DWORD g_dwEnableEditWhileRunning = 0;
  38. ULONG g_ulHistoryMajorVersionNumber;
  39. DWORD g_dwEnableHistory;
  40. DWORD g_dwMaxHistoryFiles;
  41. DWORD g_dwMaxErrorFiles;
  42. FILETIME g_XMLSchemaFileTimeStamp;
  43. FILETIME g_BINSchemaFileTimeStamp;
  44. //
  45. // The following globals are used by edit while running to determine if the
  46. // file change notification received was due to a programmatic save
  47. // (SaveAllData), or due to a user edit. They are all protected by the
  48. // g_csEditWhileRunning critical section:
  49. //
  50. CRITICAL_SECTION g_csEditWhileRunning;
  51. FILETIME g_EWRProcessedMetabaseTimeStamp;
  52. FILETIME g_MostRecentMetabaseFileLastWriteTimeStamp;
  53. ULONG g_ulMostRecentMetabaseVersion;
  54. BOOL g_bSavingMetabaseFileToDisk;
  55. //
  56. // Data Buffer
  57. // Access to these is synchronized via
  58. // g_csDataBufferCritSec
  59. //
  60. PBUFFER_CONTAINER g_pbcDataFreeBufHead;
  61. PBUFFER_CONTAINER g_pbcDataUsedBufHead;
  62. PVOID *g_ppvDataBufferBlock;
  63. PBUFFER_CONTAINER g_pbcDataContainerBlock;
  64. HANDLE g_hDataBufferSemaphore;
  65. BOOL g_fDataBufferCritSecInitialized;
  66. CRITICAL_SECTION g_csDataBufferCritSec;
  67. //
  68. // Data File
  69. //
  70. STR *g_strRealFileName;
  71. STR *g_strSchemaFileName;
  72. STR *g_strTempFileName;
  73. STR *g_strBackupFileName;
  74. STR *g_pstrBackupFilePath;
  75. PSID g_psidSystem;
  76. PSID g_psidAdmin;
  77. PACL g_paclDiscretionary;
  78. PSECURITY_DESCRIPTOR g_psdStorage;
  79. //
  80. // GlobalISTHelper class
  81. //
  82. CWriterGlobalHelper* g_pGlobalISTHelper;
  83. //
  84. // Unicode versions of strings & their lengths.
  85. // Initialized in : InitializeUnicodeGlobalDataFileValues
  86. // Set in : SetUnicodeGlobalDataFileValues
  87. // UnInitialized in: UnInitializeUnicodeGlobalDataFileValues
  88. //
  89. LPWSTR g_wszTempFileName;
  90. LPWSTR g_wszRealFileName;
  91. LPWSTR g_wszBackupFileName;
  92. LPWSTR g_wszSchemaFileName;
  93. LPWSTR g_wszRealFileNameWithoutPath;
  94. LPWSTR g_wszMetabaseDir;
  95. LPWSTR g_wszRealFileNameWithoutPathWithoutExtension;
  96. LPWSTR g_wszRealFileNameExtension;
  97. LPWSTR g_wszSchemaFileNameWithoutPath;
  98. LPWSTR g_wszSchemaFileNameWithoutPathWithoutExtension;
  99. LPWSTR g_wszSchemaFileNameExtension;
  100. LPWSTR g_wszHistoryFileDir;
  101. LPWSTR g_wszHistoryFileSearchString;
  102. LPWSTR g_wszErrorFileSearchString;
  103. LPWSTR g_wszSchemaExtensionFile;
  104. ULONG g_cchTempFileName;
  105. ULONG g_cchRealFileName;
  106. ULONG g_cchBackupFileName;
  107. ULONG g_cchSchemaFileName;
  108. ULONG g_cchRealFileNameWithoutPath;
  109. ULONG g_cchMetabaseDir;
  110. ULONG g_cchRealFileNameWithoutPathWithoutExtension;
  111. ULONG g_cchRealFileNameExtension;
  112. ULONG g_cchSchemaFileNameWithoutPath;
  113. ULONG g_cchSchemaFileNameWithoutPathWithoutExtension;
  114. ULONG g_cchSchemaFileNameExtension;
  115. ULONG g_cchHistoryFileDir;
  116. ULONG g_cchHistoryFileSearchString;
  117. ULONG g_cchErrorFileSearchString;
  118. ULONG g_cchSchemaExtensionFile;
  119. //
  120. // This is the array that holds the handle to the metabase schema and data
  121. // files. These files are locked when edit while running is disabled and
  122. // this array holds these handles. It is protected by the read/save semaphore.
  123. //
  124. HANDLE g_ahMetabaseFile[cMetabaseFileTypes];
  125. //
  126. // ListenerController is the object that controls edit while running
  127. //
  128. CListenerController* g_pListenerController = NULL;
  129. //
  130. // Global event logging object
  131. //
  132. ICatalogErrorLogger2* g_pEventLog = NULL;
  133. //
  134. // Debugging stuff
  135. //
  136. DECLARE_DEBUG_PRINTS_OBJECT();
  137. DWORD g_dwProcessAttached = 0;
  138. DWORD g_dwCMDBaseObjectNextUniqueDataSetNumber = 1;