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.

385 lines
9.5 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996
  5. //
  6. // File: cschema.hxx
  7. //
  8. // Contents: Schema class
  9. //
  10. // History: 01-09-96 yihsins Created.
  11. //
  12. //----------------------------------------------------------------------------
  13. #define DEFAULT_SCHEMA_CLASS_A "IIsObject"
  14. #define DEFAULT_SCHEMA_CLASS_W L"IIsObject"
  15. #define COMPUTER_CLASS_A "IIsComputer"
  16. #define COMPUTER_CLASS_W L"IIsComputer"
  17. #define WEBDIR_CLASS_A "IIsWebDirectory"
  18. #define WEBDIR_CLASS_W L"IIsWebDirectory"
  19. #define FTPVDIR_CLASS_A "IIsFtpVirtualDir"
  20. #define FTPVDIR_CLASS_W L"IIsFtpVirtualDir"
  21. #define SIZEOF_WEBDIR_CLASS_W (wcslen(WEBDIR_CLASS_W)+1)*sizeof(WCHAR)
  22. #define SIZEOF_FTPVDIR_CLASS_W (wcslen(FTPVDIR_CLASS_W)+1)*sizeof(WCHAR)
  23. #define SIZEOF_DEFAULT_CLASS_W (wcslen(DEFAULT_SCHEMA_CLASS_W)+1)*sizeof(WCHAR)
  24. #define SCHEMA_CLASS_METABASE_PATH L"Schema/Classes"
  25. #define SCHEMA_PROP_METABASE_PATH L"Schema/Properties"
  26. #define CLASS_PRIMARY_INTERFACE 1
  27. #define CLASS_CLSID 2
  28. #define CLASS_OID 3
  29. #define CLASS_ABSTRACT 4
  30. #define CLASS_AUXILIARY 5
  31. #define CLASS_MAND_PROPERTIES 6
  32. #define CLASS_OPT_PROPERTIES 7
  33. #define CLASS_NAMING_PROPERTIES 8
  34. #define CLASS_DERIVEDFROM 9
  35. #define CLASS_AUX_DERIVEDFROM 10
  36. #define CLASS_POSS_SUPERIORS 11
  37. #define CLASS_CONTAINMENT 12
  38. #define CLASS_CONTAINER 13
  39. #define CLASS_HELPFILENAME 14
  40. #define CLASS_HELPFILECONTEXT 15
  41. #define PROP_OID 16
  42. #define PROP_SYNTAX 17
  43. #define PROP_MAXRANGE 18
  44. #define PROP_MINRANGE 19
  45. #define PROP_MULTIVALUED 20
  46. #define PROP_PROPNAME 21
  47. #define PROP_METAID 22
  48. #define PROP_USERTYPE 23
  49. #define PROP_ALLATTRIBUTES 24
  50. #define PROP_INHERIT 25
  51. #define PROP_PARTIALPATH 26
  52. #define PROP_SECURE 27
  53. #define PROP_REFERENCE 28
  54. #define PROP_VOLATILE 29
  55. #define PROP_ISINHERIT 30
  56. #define PROP_INSERTPATH 31
  57. #define PROP_DEFAULT 32
  58. typedef struct _SchemaObjProps {
  59. WCHAR szObjectName[MAX_PATH];
  60. DWORD dwSyntaxId;
  61. DWORD dwID;
  62. } SCHEMAOBJPROPS, *PSCHEMAOBJPROPS;
  63. typedef struct _PropertyInfo
  64. {
  65. LPTSTR szPropertyName;
  66. BSTR bstrOID;
  67. BSTR bstrSyntax;
  68. long lMaxRange;
  69. long lMinRange;
  70. BOOL fMultiValued;
  71. DWORD dwFlags;
  72. DWORD dwInfoLevel;
  73. DWORD dwSyntaxId;
  74. DWORD dwMetaID;
  75. DWORD dwPropID; // usually same as meta id, unless a bitmasked prop
  76. DWORD dwMask; // For flags.
  77. DWORD dwMetaFlags; // Metabase flags (inherit, etc.)
  78. DWORD dwUserGroup;
  79. DWORD dwDefault;
  80. LPTSTR szDefault;
  81. DWORD dwBinDataLen;
  82. } PROPERTYINFO, *PPROPERTYINFO, *LPPROPERTYINFO;
  83. typedef struct _ClassInfo
  84. {
  85. BSTR bstrName;
  86. const GUID *pCLSID;
  87. const GUID *pPrimaryInterfaceGUID;
  88. BSTR bstrOID;
  89. BOOL fAbstract;
  90. BSTR bstrMandatoryProperties;
  91. BSTR bstrOptionalProperties;
  92. BSTR bstrPossSuperiors;
  93. BSTR bstrContainment;
  94. BOOL fContainer;
  95. BSTR bstrHelpFileName;
  96. long lHelpFileContext;
  97. } CLASSINFO, *PCLASSINFO;
  98. typedef struct _SyntaxInfo
  99. {
  100. BSTR bstrName;
  101. DWORD dwIISSyntaxId;
  102. long lOleAutoDataType;
  103. } SYNTAXINFO;
  104. extern DWORD g_cPropertyObjProps;
  105. extern SCHEMAOBJPROPS g_pPropertyObjProps[];
  106. extern DWORD g_cClassObjProps;
  107. extern SCHEMAOBJPROPS g_pClassObjProps[];
  108. extern DWORD g_cIISClasses;
  109. extern CLASSINFO g_aIISClasses[];
  110. extern DWORD g_cIISSyntax;
  111. extern SYNTAXINFO g_aIISSyntax[];
  112. HRESULT MakeVariantFromStringList(
  113. BSTR bstrList,
  114. VARIANT *pvVariant );
  115. HRESULT
  116. ValidateClassObjProps(
  117. LPWSTR pszName,
  118. PDWORD pdwSyntax,
  119. PDWORD pdwID
  120. );
  121. HRESULT
  122. ValidatePropertyObjProps(
  123. LPWSTR pszName,
  124. PDWORD pdwSyntax,
  125. PDWORD pdwID
  126. );
  127. HRESULT
  128. IISMarshallClassProperties(
  129. CLASSINFO *pClassInfo,
  130. PMETADATA_RECORD * ppMetaDataRecords,
  131. PDWORD pdwMDNumDataEntries
  132. );
  133. HRESULT
  134. GenerateNewMetaID(
  135. LPWSTR pszServerName,
  136. IMSAdminBase *pAdminBase, //interface pointer
  137. PDWORD pdwMetaID
  138. );
  139. HRESULT
  140. CheckDuplicateNames(
  141. LPWSTR pszNames
  142. );
  143. class CIISClass : INHERIT_TRACKING,
  144. public CCoreADsObject,
  145. public IADsClass
  146. {
  147. public:
  148. /* IUnknown methods */
  149. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  150. DECLARE_STD_REFCOUNTING
  151. /* Other methods */
  152. DECLARE_IDispatch_METHODS
  153. DECLARE_IADs_METHODS
  154. DECLARE_IADsClass_METHODS
  155. /* Constructors, Destructors, .... */
  156. CIISClass::CIISClass();
  157. CIISClass::~CIISClass();
  158. static HRESULT CIISClass::CreateClass(
  159. BSTR bstrParent,
  160. BSTR bstrRelative,
  161. DWORD dwObjectState,
  162. REFIID riid,
  163. void **ppvObj );
  164. static HRESULT CIISClass::AllocateClassObject(
  165. CIISClass **ppClass );
  166. HRESULT
  167. CIISClass::IISSetObject();
  168. HRESULT
  169. CIISClass::IISCreateObject();
  170. HRESULT
  171. CIISClass::ValidateProperties(
  172. LPWSTR pszList,
  173. BOOL bMandatory
  174. );
  175. HRESULT
  176. CIISClass::ValidateClassNames(
  177. LPWSTR pszList
  178. );
  179. HRESULT
  180. CIISClass::PropertyInMetabase(
  181. LPWSTR szPropName,
  182. BOOL bMandatory
  183. );
  184. protected:
  185. CAggregatorDispMgr FAR * _pDispMgr;
  186. /* Properties */
  187. BSTR _bstrCLSID;
  188. BSTR _bstrOID;
  189. BSTR _bstrPrimaryInterface;
  190. VARIANT_BOOL _fAbstract;
  191. VARIANT _vMandatoryProperties;
  192. VARIANT _vOptionalProperties;
  193. VARIANT _vPossSuperiors;
  194. VARIANT _vContainment;
  195. VARIANT_BOOL _fContainer;
  196. BSTR _bstrHelpFileName;
  197. long _lHelpFileContext;
  198. LPWSTR _pszServerName;
  199. LPWSTR _pszClassName;
  200. BOOL _bExistClass;
  201. IIsSchema *_pSchema;
  202. IMSAdminBase *_pAdminBase; //interface pointer
  203. };
  204. class CIISProperty : INHERIT_TRACKING,
  205. public CCoreADsObject,
  206. public IADsProperty,
  207. public IISPropertyAttribute
  208. {
  209. public:
  210. /* IUnknown methods */
  211. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  212. DECLARE_STD_REFCOUNTING
  213. /* Other methods */
  214. DECLARE_IDispatch_METHODS
  215. DECLARE_IADs_METHODS
  216. DECLARE_IADsProperty_METHODS
  217. DECLARE_IISPropertyAttribute_METHODS
  218. /* Constructors, Destructors, ... */
  219. CIISProperty::CIISProperty();
  220. CIISProperty::~CIISProperty();
  221. static HRESULT CIISProperty::CreateProperty(
  222. BSTR bstrParent,
  223. BSTR bstrRelative,
  224. DWORD dwObjectState,
  225. REFIID riid,
  226. void **ppvObj );
  227. static HRESULT CIISProperty::AllocatePropertyObject(
  228. CIISProperty **ppProperty );
  229. HRESULT
  230. CIISProperty::IISSetObject();
  231. HRESULT
  232. CIISProperty::ValidateSyntaxName(
  233. LPWSTR pszName,
  234. PDWORD pdwSytnax
  235. );
  236. HRESULT
  237. CIISProperty::ConvertDefaultValue(
  238. PVARIANT pVar,
  239. PROPERTYINFO *pPropInfo
  240. );
  241. HRESULT
  242. CIISProperty::SetMetaID(
  243. );
  244. private:
  245. BOOL
  246. IsMetaIdAvailable(
  247. DWORD MetaId
  248. );
  249. protected:
  250. CAggregatorDispMgr FAR * _pDispMgr;
  251. /* Properties */
  252. BSTR _bstrOID;
  253. BSTR _bstrSyntax;
  254. long _lMaxRange;
  255. long _lMinRange;
  256. VARIANT_BOOL _fMultiValued;
  257. long _lMetaId;
  258. long _lUserType;
  259. long _lAllAttributes;
  260. VARIANT _vDefault;
  261. DWORD _dwSyntaxId;
  262. DWORD _dwMask;
  263. DWORD _dwFlags;
  264. DWORD _dwPropID;
  265. IIsSchema *_pSchema;
  266. IMSAdminBase *_pAdminBase; //interface pointer
  267. LPWSTR _pszServerName;
  268. LPWSTR _pszPropName;
  269. BOOL _bExistProp;
  270. };
  271. class CIISSyntax : INHERIT_TRACKING,
  272. public CCoreADsObject,
  273. public IADsSyntax
  274. {
  275. public:
  276. /* IUnknown methods */
  277. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  278. DECLARE_STD_REFCOUNTING
  279. /* Other methods */
  280. DECLARE_IDispatch_METHODS
  281. DECLARE_IADs_METHODS
  282. DECLARE_IADsSyntax_METHODS
  283. /* Constructors, Destructors, ... */
  284. CIISSyntax::CIISSyntax();
  285. CIISSyntax::~CIISSyntax();
  286. static HRESULT CIISSyntax::CreateSyntax(
  287. BSTR bstrParent,
  288. SYNTAXINFO *pSyntaxInfo,
  289. DWORD dwObjectState,
  290. REFIID riid,
  291. void **ppvObj );
  292. static HRESULT CIISSyntax::AllocateSyntaxObject(
  293. CIISSyntax **ppSyntax );
  294. protected:
  295. CAggregatorDispMgr FAR * _pDispMgr;
  296. /* Properties */
  297. long _lOleAutoDataType;
  298. IIsSchema *_pSchema;
  299. };