Source code of Windows XP (NT5)
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.

384 lines
9.1 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. } PROPERTYINFO, *PPROPERTYINFO, *LPPROPERTYINFO;
  82. typedef struct _ClassInfo
  83. {
  84. BSTR bstrName;
  85. const GUID *pCLSID;
  86. const GUID *pPrimaryInterfaceGUID;
  87. BSTR bstrOID;
  88. BOOL fAbstract;
  89. BSTR bstrMandatoryProperties;
  90. BSTR bstrOptionalProperties;
  91. BSTR bstrPossSuperiors;
  92. BSTR bstrContainment;
  93. BOOL fContainer;
  94. BSTR bstrHelpFileName;
  95. long lHelpFileContext;
  96. } CLASSINFO, *PCLASSINFO;
  97. typedef struct _SyntaxInfo
  98. {
  99. BSTR bstrName;
  100. DWORD dwIISSyntaxId;
  101. long lOleAutoDataType;
  102. } SYNTAXINFO;
  103. extern DWORD g_cPropertyObjProps;
  104. extern SCHEMAOBJPROPS g_pPropertyObjProps[];
  105. extern DWORD g_cClassObjProps;
  106. extern SCHEMAOBJPROPS g_pClassObjProps[];
  107. extern DWORD g_cIISClasses;
  108. extern CLASSINFO g_aIISClasses[];
  109. extern DWORD g_cIISSyntax;
  110. extern SYNTAXINFO g_aIISSyntax[];
  111. HRESULT MakeVariantFromStringList(
  112. BSTR bstrList,
  113. VARIANT *pvVariant );
  114. HRESULT
  115. ValidateClassObjProps(
  116. LPWSTR pszName,
  117. PDWORD pdwSyntax,
  118. PDWORD pdwID
  119. );
  120. HRESULT
  121. ValidatePropertyObjProps(
  122. LPWSTR pszName,
  123. PDWORD pdwSyntax,
  124. PDWORD pdwID
  125. );
  126. HRESULT
  127. IISMarshallClassProperties(
  128. CLASSINFO *pClassInfo,
  129. PMETADATA_RECORD * ppMetaDataRecords,
  130. PDWORD pdwMDNumDataEntries
  131. );
  132. HRESULT
  133. GenerateNewMetaID(
  134. LPWSTR pszServerName,
  135. IMSAdminBase *pAdminBase, //interface pointer
  136. PDWORD pdwMetaID
  137. );
  138. HRESULT
  139. CheckDuplicateNames(
  140. LPWSTR pszNames
  141. );
  142. class CIISClass : INHERIT_TRACKING,
  143. public CCoreADsObject,
  144. public IADsClass
  145. {
  146. public:
  147. /* IUnknown methods */
  148. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  149. DECLARE_STD_REFCOUNTING
  150. /* Other methods */
  151. DECLARE_IDispatch_METHODS
  152. DECLARE_IADs_METHODS
  153. DECLARE_IADsClass_METHODS
  154. /* Constructors, Destructors, .... */
  155. CIISClass::CIISClass();
  156. CIISClass::~CIISClass();
  157. static HRESULT CIISClass::CreateClass(
  158. BSTR bstrParent,
  159. BSTR bstrRelative,
  160. DWORD dwObjectState,
  161. REFIID riid,
  162. void **ppvObj );
  163. static HRESULT CIISClass::AllocateClassObject(
  164. CIISClass **ppClass );
  165. HRESULT
  166. CIISClass::IISSetObject();
  167. HRESULT
  168. CIISClass::IISCreateObject();
  169. HRESULT
  170. CIISClass::ValidateProperties(
  171. LPWSTR pszList,
  172. BOOL bMandatory
  173. );
  174. HRESULT
  175. CIISClass::ValidateClassNames(
  176. LPWSTR pszList
  177. );
  178. HRESULT
  179. CIISClass::PropertyInMetabase(
  180. LPWSTR szPropName,
  181. BOOL bMandatory
  182. );
  183. protected:
  184. CAggregatorDispMgr FAR * _pDispMgr;
  185. /* Properties */
  186. BSTR _bstrCLSID;
  187. BSTR _bstrOID;
  188. BSTR _bstrPrimaryInterface;
  189. VARIANT_BOOL _fAbstract;
  190. VARIANT _vMandatoryProperties;
  191. VARIANT _vOptionalProperties;
  192. VARIANT _vPossSuperiors;
  193. VARIANT _vContainment;
  194. VARIANT_BOOL _fContainer;
  195. BSTR _bstrHelpFileName;
  196. long _lHelpFileContext;
  197. LPWSTR _pszServerName;
  198. LPWSTR _pszClassName;
  199. BOOL _bExistClass;
  200. IIsSchema *_pSchema;
  201. IMSAdminBase *_pAdminBase; //interface pointer
  202. };
  203. class CIISProperty : INHERIT_TRACKING,
  204. public CCoreADsObject,
  205. public IADsProperty,
  206. public IISPropertyAttribute
  207. {
  208. public:
  209. /* IUnknown methods */
  210. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  211. DECLARE_STD_REFCOUNTING
  212. /* Other methods */
  213. DECLARE_IDispatch_METHODS
  214. DECLARE_IADs_METHODS
  215. DECLARE_IADsProperty_METHODS
  216. DECLARE_IISPropertyAttribute_METHODS
  217. /* Constructors, Destructors, ... */
  218. CIISProperty::CIISProperty();
  219. CIISProperty::~CIISProperty();
  220. static HRESULT CIISProperty::CreateProperty(
  221. BSTR bstrParent,
  222. BSTR bstrRelative,
  223. DWORD dwObjectState,
  224. REFIID riid,
  225. void **ppvObj );
  226. static HRESULT CIISProperty::AllocatePropertyObject(
  227. CIISProperty **ppProperty );
  228. HRESULT
  229. CIISProperty::IISSetObject();
  230. HRESULT
  231. CIISProperty::ValidateSyntaxName(
  232. LPWSTR pszName,
  233. PDWORD pdwSytnax
  234. );
  235. HRESULT
  236. CIISProperty::ConvertDefaultValue(
  237. PVARIANT pVar,
  238. PROPERTYINFO *pPropInfo
  239. );
  240. HRESULT
  241. CIISProperty::SetMetaID(
  242. );
  243. private:
  244. BOOL
  245. IsMetaIdAvailable(
  246. DWORD MetaId
  247. );
  248. protected:
  249. CAggregatorDispMgr FAR * _pDispMgr;
  250. /* Properties */
  251. BSTR _bstrOID;
  252. BSTR _bstrSyntax;
  253. long _lMaxRange;
  254. long _lMinRange;
  255. VARIANT_BOOL _fMultiValued;
  256. long _lMetaId;
  257. long _lUserType;
  258. long _lAllAttributes;
  259. VARIANT _vDefault;
  260. DWORD _dwSyntaxId;
  261. DWORD _dwMask;
  262. DWORD _dwFlags;
  263. DWORD _dwPropID;
  264. IIsSchema *_pSchema;
  265. IMSAdminBase *_pAdminBase; //interface pointer
  266. LPWSTR _pszServerName;
  267. LPWSTR _pszPropName;
  268. BOOL _bExistProp;
  269. };
  270. class CIISSyntax : INHERIT_TRACKING,
  271. public CCoreADsObject,
  272. public IADsSyntax
  273. {
  274. public:
  275. /* IUnknown methods */
  276. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  277. DECLARE_STD_REFCOUNTING
  278. /* Other methods */
  279. DECLARE_IDispatch_METHODS
  280. DECLARE_IADs_METHODS
  281. DECLARE_IADsSyntax_METHODS
  282. /* Constructors, Destructors, ... */
  283. CIISSyntax::CIISSyntax();
  284. CIISSyntax::~CIISSyntax();
  285. static HRESULT CIISSyntax::CreateSyntax(
  286. BSTR bstrParent,
  287. SYNTAXINFO *pSyntaxInfo,
  288. DWORD dwObjectState,
  289. REFIID riid,
  290. void **ppvObj );
  291. static HRESULT CIISSyntax::AllocateSyntaxObject(
  292. CIISSyntax **ppSyntax );
  293. protected:
  294. CAggregatorDispMgr FAR * _pDispMgr;
  295. /* Properties */
  296. long _lOleAutoDataType;
  297. IIsSchema *_pSchema;
  298. };