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.

125 lines
3.2 KiB

  1. // Basic constants and structures
  2. // Copyright (c) 2001 Microsoft Corporation
  3. // Jun 2001 lucios
  4. #ifndef CONSTANTS_HPP
  5. #define CONSTANTS_HPP
  6. #include <stdlib.h>
  7. #include <set>
  8. struct AnalysisResults;
  9. class CSVDSReader;
  10. using namespace std;
  11. // Variables kept from analysis to repair
  12. extern bool goodAnalysis;
  13. extern AnalysisResults results;
  14. extern String targetDomainControllerName;
  15. extern String completeDcName;
  16. extern String csvFileName;
  17. extern String csv409Name;
  18. extern CSVDSReader csvReaderIntl;
  19. extern CSVDSReader csvReader409;
  20. extern String rootContainerDn;
  21. extern String ldapPrefix;
  22. extern String domainName;
  23. // Used to hold the latest error
  24. extern String error;
  25. // Used in WinGetVLFilePointer. Declared in constants.cpp as ={0};
  26. extern LARGE_INTEGER zero;
  27. enum TYPE_OF_CHANGE
  28. {
  29. // NOP stands for no operation.
  30. // It gives an alternative way to limit the
  31. // enumeration of CHANGE_LIST
  32. NOP,
  33. ADD_ALL_CSV_VALUES,
  34. ADD_VALUE,
  35. ADD_GUID,
  36. REPLACE_W2K_SINGLE_VALUE,
  37. REPLACE_W2K_MULTIPLE_VALUE,
  38. REMOVE_GUID,
  39. REPLACE_GUID,
  40. ADD_OBJECT
  41. };
  42. struct sChange
  43. {
  44. String object;
  45. String property;
  46. String firstArg;
  47. String secondArg;
  48. TYPE_OF_CHANGE type;
  49. };
  50. typedef list <
  51. sChange,
  52. Burnslib::Heap::Allocator< sChange >
  53. > changeList;
  54. typedef map <
  55. long, // locale
  56. changeList,
  57. less< long > ,
  58. Burnslib::Heap::Allocator< changeList >
  59. > objectChanges;
  60. // designed to be used as a less<GUID> operator in a map like
  61. // std::map< GUID,abc,GUIDLess<GUID> > mpGUID;
  62. template<class T>
  63. struct GUIDLess
  64. {
  65. bool operator()(const T& x, const T& y) const
  66. {
  67. if(x.Data1 != y.Data1) return (x.Data1 < y.Data1);
  68. if(x.Data2 != y.Data2) return (x.Data2 < y.Data2);
  69. if(x.Data3 != y.Data3) return (x.Data3 < y.Data3);
  70. if(x.Data4[0] != y.Data4[0]) return (x.Data4[0] < y.Data4[0]);
  71. if(x.Data4[1] != y.Data4[1]) return (x.Data4[1] < y.Data4[1]);
  72. if(x.Data4[2] != y.Data4[2]) return (x.Data4[2] < y.Data4[2]);
  73. if(x.Data4[3] != y.Data4[3]) return (x.Data4[3] < y.Data4[3]);
  74. if(x.Data4[4] != y.Data4[4]) return (x.Data4[4] < y.Data4[4]);
  75. if(x.Data4[5] != y.Data4[5]) return (x.Data4[5] < y.Data4[5]);
  76. if(x.Data4[6] != y.Data4[6]) return (x.Data4[6] < y.Data4[6]);
  77. return (x.Data4[7] < y.Data4[7]);
  78. }
  79. };
  80. typedef map <
  81. GUID,
  82. objectChanges,
  83. GUIDLess<GUID>,
  84. Burnslib::Heap::Allocator<objectChanges>
  85. > allChanges;
  86. extern allChanges changes;
  87. extern const long LOCALEIDS[];
  88. extern const long LOCALE409[];
  89. void addChange
  90. (
  91. const GUID guid,
  92. const long locale,
  93. const wchar_t *object,
  94. const wchar_t *property,
  95. const wchar_t *firstArg,
  96. const wchar_t *secondArg,
  97. const enum TYPE_OF_CHANGE type
  98. );
  99. // implemented in guids.cpp
  100. void setChanges();
  101. extern GUID guids[];
  102. #endif;