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.

277 lines
6.2 KiB

  1. // Class to perform tha analisys
  2. // Copyright (c) 2001 Microsoft Corporation
  3. // Jun 2001 lucios
  4. #ifndef ANALYSIS_HPP
  5. #define ANALYSIS_HPP
  6. #include "AnalysisResults.hpp"
  7. #include "dspecup.hpp"
  8. #include "constants.hpp"
  9. class CSVDSReader;
  10. struct sChangeList;
  11. class Analysis
  12. {
  13. public:
  14. Analysis(
  15. const GUID guid_,
  16. const CSVDSReader& csvReader409_,
  17. const CSVDSReader& csvReaderIntl_,
  18. const String& ldapPrefix_,
  19. const String& rootContainerDn_,
  20. AnalysisResults &res,
  21. const String &reportName_=L"",
  22. void *caleeStruct_=NULL,
  23. progressFunction stepIt_=NULL,
  24. progressFunction totalSteps_=NULL
  25. );
  26. HRESULT run();
  27. private:
  28. const CSVDSReader& csvReader409;
  29. const CSVDSReader& csvReaderIntl;
  30. String ldapPrefix;
  31. String rootContainerDn;
  32. AnalysisResults& results;
  33. String reportName;
  34. void *caleeStruct;
  35. progressFunction stepIt;
  36. progressFunction totalSteps;
  37. GUID guid;
  38. // add entry to result.createContainers if container is not present
  39. // also returns flag isPresent
  40. HRESULT
  41. dealWithContainer
  42. (
  43. const long locale,
  44. bool &isPresent
  45. );
  46. // add entries to results.createW2KObjects and
  47. // and results.objectActions as necessary
  48. HRESULT
  49. dealWithW2KObjects(const long locale);
  50. // sets iDirObj with the Active Directory object
  51. // corresponding to the locale and object
  52. HRESULT
  53. getADObj
  54. (
  55. const long locale,
  56. const String& object,
  57. SmartInterface<IDirectoryObject> &iDirObj
  58. );
  59. // adds ordAndGuid to the property if Guid is not already there.
  60. HRESULT
  61. addGuid
  62. (
  63. IDirectoryObject *iDirObj,
  64. const int locale,
  65. const String &object,
  66. const String &property,
  67. const String &ordAndGuid
  68. );
  69. // replaces ordAndGuidWin2K for ordAndGuidWhistler.
  70. HRESULT
  71. replaceGuid
  72. (
  73. IDirectoryObject *iDirObj,
  74. const int locale,
  75. const String &object,
  76. const String &property,
  77. const String &ordAndGuidWin2K,
  78. const String &ordAndGuidWhistler
  79. );
  80. // adds all csv values still not on the property
  81. HRESULT
  82. addAllCsvValues
  83. (
  84. IDirectoryObject *iDirObj,
  85. const long locale,
  86. const String &object,
  87. const String &property
  88. );
  89. // adds value to the property if it is not already there.
  90. HRESULT
  91. addValue
  92. (
  93. IDirectoryObject *iDirObj,
  94. const long locale,
  95. const String &object,
  96. const String &property,
  97. const String &value
  98. );
  99. HRESULT
  100. replaceW2KSingleValue
  101. (
  102. IDirectoryObject *iDirObj,
  103. const int locale,
  104. const String &object,
  105. const String &property,
  106. const String &WhistlerStart,
  107. const String &W2KStart
  108. );
  109. HRESULT
  110. replaceW2KMultipleValue
  111. (
  112. IDirectoryObject *iDirObj,
  113. const int locale,
  114. const String &object,
  115. const String &property,
  116. const String &W2KCsvValue,
  117. const String &WhistlerCsvValue
  118. );
  119. // removes ordAndGuid from the property if Guid is there.
  120. HRESULT
  121. removeGuid(
  122. IDirectoryObject *iDirObj,
  123. const int locale,
  124. const String &object,
  125. const String &property,
  126. const String &ordAndGuid);
  127. // set previousSuccessfulRun reading from ADSI
  128. HRESULT
  129. setPreviousSuccessfullRun();
  130. // check all changes for the given locale
  131. HRESULT
  132. checkChanges
  133. (
  134. const long locale,
  135. const changeList& changes
  136. );
  137. HRESULT
  138. getADFirstValue
  139. (
  140. IDirectoryObject *iDirObj,
  141. const String &property,
  142. String &value
  143. );
  144. HRESULT
  145. isADStartValuePresent
  146. (
  147. IDirectoryObject *iDirObj,
  148. const String &property,
  149. const String &valueStart,
  150. String &value
  151. );
  152. HRESULT
  153. isADValuePresent
  154. (
  155. IDirectoryObject *iDirObj,
  156. const String &property,
  157. const String &value
  158. );
  159. HRESULT
  160. getADGuid
  161. (
  162. IDirectoryObject *iDirObj,
  163. const String &property,
  164. const String &guidValue,
  165. String &guidFound
  166. );
  167. HRESULT
  168. removeExtraneous
  169. (
  170. IDirectoryObject *iDirObj,
  171. const int locale,
  172. const String &object,
  173. const String &property,
  174. const String &keeper
  175. );
  176. HRESULT
  177. removeExtraneous
  178. (
  179. IDirectoryObject *iDirObj,
  180. const int locale,
  181. const String &object,
  182. const String &property,
  183. const String &keeper,
  184. const String &start1,
  185. const String &start2
  186. );
  187. HRESULT
  188. removeExtraneousGUID
  189. (
  190. IDirectoryObject *iDirObj,
  191. const int locale,
  192. const String &object,
  193. const String &property,
  194. const String &keeper,
  195. const String &ordAndGuid1,
  196. const String &ordAndGuid2
  197. );
  198. HRESULT
  199. reportObjects
  200. (
  201. HANDLE file,
  202. const ObjectIdList &list,
  203. const String &header
  204. );
  205. HRESULT
  206. reportContainers
  207. (
  208. HANDLE file,
  209. const LongList &list,
  210. const String &header
  211. );
  212. HRESULT
  213. reportActions
  214. (
  215. HANDLE file,
  216. const ObjectActions &list,
  217. const String &header
  218. );
  219. HRESULT
  220. reportValues
  221. (
  222. HANDLE file,
  223. const SingleValueList &list,
  224. const String &header
  225. );
  226. HRESULT
  227. createReport(const String& reportName);
  228. };
  229. #endif