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.

340 lines
5.8 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1997
  5. //
  6. // File: common.hxx
  7. //
  8. // Contents: Microsoft ADs IIS Common routines
  9. //
  10. // History: 28-Feb-97 SophiaC Created.
  11. //
  12. //----------------------------------------------------------------------------
  13. #define MAX_DWORD 0xFFFFFFFF
  14. #define SCHEMA_NAME L"Schema"
  15. HRESULT
  16. LoadTypeInfoEntry(
  17. CAggregatorDispMgr * pDispMgr,
  18. REFIID libid,
  19. REFIID iid,
  20. void * pIntf,
  21. DISPID SpecialId
  22. );
  23. HRESULT
  24. ValidateOutParameter(
  25. BSTR * retval
  26. );
  27. HRESULT
  28. BuildADsPath(
  29. BSTR Parent,
  30. BSTR Name,
  31. BSTR *pADsPath
  32. );
  33. HRESULT
  34. BuildSchemaPath(
  35. BSTR bstrADsPath,
  36. BSTR bstrClass,
  37. BSTR *pSchemaPath
  38. );
  39. HRESULT
  40. BuildADsGuid(
  41. REFCLSID clsid,
  42. BSTR *pADsClass
  43. );
  44. //
  45. // Accessing Well-known object types
  46. //
  47. typedef struct _filters {
  48. WCHAR szObjectName[MAX_PATH];
  49. DWORD dwFilterId;
  50. } FILTERS, *PFILTERS;
  51. extern PFILTERS gpFilters;
  52. extern DWORD gdwMaxFilters;
  53. HRESULT
  54. BuildIISPathFromIISParentPath(
  55. LPWSTR szIISParentPathName,
  56. LPWSTR szIISObjectCommonName,
  57. LPWSTR szIISPathName
  58. );
  59. typedef struct _KEYDATA {
  60. DWORD cTokens;
  61. LPWSTR pTokens[1];
  62. } KEYDATA, *PKEYDATA;
  63. //
  64. // Get IIS Admin Base Object
  65. //
  66. HRESULT
  67. OpenAdminBaseKey(
  68. IN LPWSTR pszServerName,
  69. IN LPWSTR pszPathName,
  70. IN DWORD dwAccessType,
  71. IN OUT IMSAdminBase **ppAdminBase,
  72. OUT METADATA_HANDLE *phHandle
  73. );
  74. VOID
  75. CloseAdminBaseKey(
  76. IN IMSAdminBase *pAdminBase,
  77. IN METADATA_HANDLE hHandle
  78. );
  79. HRESULT
  80. MetaBaseGetAllData(
  81. IN IMSAdminBase *pAdminBase,
  82. IN METADATA_HANDLE hObjHandle,
  83. IN LPWSTR pszIISPathName,
  84. IN DWORD dwMDAttributes,
  85. IN DWORD dwMDUserType,
  86. IN DWORD dwMDDataType,
  87. OUT PDWORD pdwMDNumDataEntries,
  88. OUT PDWORD pdwMDDataSetNumber,
  89. OUT LPBYTE *ppBuffer
  90. );
  91. HRESULT
  92. MetaBaseGetDataPaths(
  93. IN IMSAdminBase *pAdminBase,
  94. IN METADATA_HANDLE hObjHandle,
  95. IN DWORD dwMDMetaID,
  96. OUT LPBYTE *ppBuffer
  97. );
  98. HRESULT
  99. MetaBaseSetAllData(
  100. IN IMSAdminBase *pAdminBase,
  101. IN METADATA_HANDLE hObjHandle,
  102. IN LPWSTR pszIISPathName,
  103. IN PMETADATA_RECORD pMetaDataArray,
  104. IN DWORD dwNumEntries
  105. );
  106. HRESULT
  107. MetaBaseDeleteObject(
  108. IN IMSAdminBase *pAdminBase,
  109. IN METADATA_HANDLE hObjHandle,
  110. IN LPWSTR pszIISPathName
  111. );
  112. HRESULT
  113. MetaBaseCreateObject(
  114. IN IMSAdminBase *pAdminBase,
  115. IN METADATA_HANDLE hObjHandle,
  116. IN LPWSTR pszIISPathName
  117. );
  118. HRESULT
  119. MetaBaseCopyObject(
  120. IN IMSAdminBase *pAdminBase,
  121. IN METADATA_HANDLE hSrcObjHandle,
  122. IN LPWSTR pszIISSrcPathName,
  123. IN METADATA_HANDLE hDestObjHandle,
  124. IN LPWSTR pszIISDestPathName
  125. );
  126. HRESULT
  127. MetaBaseMoveObject(
  128. IN IMSAdminBase *pAdminBase,
  129. IN METADATA_HANDLE hSrcObjHandle,
  130. IN LPWSTR pszIISSrcPathName,
  131. IN METADATA_HANDLE hDestObjHandle,
  132. IN LPWSTR pszIISDestPathName
  133. );
  134. HRESULT
  135. MetaBaseGetAdminACL(
  136. IN IMSAdminBase *pAdminBase,
  137. IN METADATA_HANDLE hObjHandle,
  138. IN LPWSTR pszIISPathName,
  139. OUT LPBYTE *ppBuffer
  140. );
  141. HRESULT
  142. MetaBaseDetectKey(
  143. IN IMSAdminBase *pAdminBase,
  144. IN LPCWSTR pszIISPathName
  145. );
  146. HRESULT
  147. MetaBaseGetADsClass(
  148. IN IMSAdminBase *pAdminBase,
  149. IN LPWSTR pszIISPathName,
  150. IN IIsSchema *pSchema,
  151. OUT LPWSTR pszDataBuffer,
  152. IN DWORD dwBufferLen
  153. );
  154. HRESULT
  155. FreeMetaDataRecordArray(
  156. PMETADATA_RECORD pMetaDataArray,
  157. DWORD dwNumEntries
  158. );
  159. HRESULT
  160. InitAdminBase(
  161. IN LPWSTR pszServerName,
  162. OUT IMSAdminBase **ppAdminBase
  163. );
  164. VOID
  165. UninitAdminBase(
  166. IN IMSAdminBase *pAdminBase
  167. );
  168. HRESULT
  169. InitServerInfo(
  170. IN LPWSTR pszServerName,
  171. OUT IMSAdminBase **ppObject,
  172. OUT IIsSchema **ppSchema
  173. );
  174. HRESULT
  175. MakeVariantFromStringArray(
  176. LPWSTR pszStr,
  177. LPWSTR pszList,
  178. VARIANT *pvVariant
  179. );
  180. HRESULT
  181. MakeVariantFromPathArray(
  182. LPWSTR pszStr,
  183. LPWSTR pszList,
  184. VARIANT *pvVariant
  185. );
  186. HRESULT
  187. InitWamAdmin(
  188. IN LPWSTR pszServerName,
  189. OUT IWamAdmin2 **ppWamAdmin
  190. );
  191. VOID
  192. UninitWamAdmin(
  193. IN IWamAdmin2 *pWamAdmin
  194. );
  195. HRESULT
  196. ConvertArrayToVariantArray(
  197. VARIANT varSafeArray,
  198. PVARIANT * ppVarArray,
  199. PDWORD pdwNumVariants
  200. );
  201. HRESULT
  202. MakeStringFromVariantArray(
  203. VARIANT *pvVariant,
  204. LPBYTE *ppBuffer
  205. );
  206. HRESULT
  207. MakeMultiStringFromVariantArray(
  208. VARIANT *pvVariant,
  209. LPBYTE *ppBuffer
  210. );
  211. typedef VARIANT_BOOL * PVARIANT_BOOL;
  212. typedef VARIANT * PVARIANT;
  213. HRESULT
  214. put_BSTR_Property(
  215. IADs * pADsObject,
  216. BSTR bstrPropertyName,
  217. BSTR pSrcStringProperty
  218. );
  219. HRESULT
  220. get_BSTR_Property(
  221. IADs * pADsObject,
  222. BSTR bstrPropertyName,
  223. BSTR *ppDestStringProperty
  224. );
  225. HRESULT
  226. put_LONG_Property(
  227. IADs * pADsObject,
  228. BSTR bstrPropertyName,
  229. LONG lSrcProperty
  230. );
  231. HRESULT
  232. get_LONG_Property(
  233. IADs * pADsObject,
  234. BSTR bstrPropertyName,
  235. PLONG plDestProperty
  236. );
  237. HRESULT
  238. put_VARIANT_BOOL_Property(
  239. IADs * pADsObject,
  240. BSTR bstrPropertyName,
  241. VARIANT_BOOL fSrcProperty
  242. );
  243. HRESULT
  244. get_VARIANT_BOOL_Property(
  245. IADs * pADsObject,
  246. BSTR bstrPropertyName,
  247. PVARIANT_BOOL pfDestProperty
  248. );
  249. HRESULT
  250. put_VARIANT_Property(
  251. IADs * pADsObject,
  252. BSTR bstrPropertyName,
  253. VARIANT vSrcProperty
  254. );
  255. HRESULT
  256. get_VARIANT_Property(
  257. IADs * pADsObject,
  258. BSTR bstrPropertyName,
  259. PVARIANT pvDestProperty
  260. );
  261. HRESULT
  262. MetaBaseGetStringData(
  263. IN IMSAdminBase * pAdminBase,
  264. IN METADATA_HANDLE hObjHandle,
  265. IN LPWSTR pszIISPathName,
  266. IN DWORD dwMetaId,
  267. OUT LPBYTE *ppBuffer
  268. );
  269. HRESULT
  270. MetaBaseGetDwordData(
  271. IN IMSAdminBase * pAdminBase,
  272. IN METADATA_HANDLE hObjHandle,
  273. IN LPWSTR pszIISPathName,
  274. IN DWORD dwMetaId,
  275. OUT PDWORD pdwData
  276. );
  277. HRESULT
  278. CheckVariantDataType(
  279. PVARIANT pVar,
  280. VARTYPE vt
  281. );