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.

350 lines
6.4 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 CCredentials& Credentials,
  69. IN LPWSTR pszServerName,
  70. IN LPWSTR pszPathName,
  71. IN DWORD dwAccessType,
  72. IN OUT IMSAdminBase **ppAdminBase,
  73. OUT METADATA_HANDLE *phHandle
  74. );
  75. VOID
  76. CloseAdminBaseKey(
  77. IN IMSAdminBase *pAdminBase,
  78. IN METADATA_HANDLE hHandle
  79. );
  80. HRESULT
  81. MetaBaseGetAllData(
  82. IN IMSAdminBase *pAdminBase,
  83. IN METADATA_HANDLE hObjHandle,
  84. IN LPWSTR pszIISPathName,
  85. IN DWORD dwMDAttributes,
  86. IN DWORD dwMDUserType,
  87. IN DWORD dwMDDataType,
  88. OUT PDWORD pdwMDNumDataEntries,
  89. OUT PDWORD pdwMDDataSetNumber,
  90. OUT LPBYTE *ppBuffer
  91. );
  92. HRESULT
  93. MetaBaseGetDataPaths(
  94. IN IMSAdminBase *pAdminBase,
  95. IN METADATA_HANDLE hObjHandle,
  96. IN DWORD dwMDMetaID,
  97. OUT LPBYTE *ppBuffer
  98. );
  99. HRESULT
  100. MetaBaseSetAllData(
  101. IN IMSAdminBase *pAdminBase,
  102. IN METADATA_HANDLE hObjHandle,
  103. IN LPWSTR pszIISPathName,
  104. IN PMETADATA_RECORD pMetaDataArray,
  105. IN DWORD dwNumEntries
  106. );
  107. HRESULT
  108. MetaBaseDeleteObject(
  109. IN IMSAdminBase *pAdminBase,
  110. IN METADATA_HANDLE hObjHandle,
  111. IN LPWSTR pszIISPathName
  112. );
  113. HRESULT
  114. MetaBaseCreateObject(
  115. IN IMSAdminBase *pAdminBase,
  116. IN METADATA_HANDLE hObjHandle,
  117. IN LPWSTR pszIISPathName
  118. );
  119. HRESULT
  120. MetaBaseCopyObject(
  121. IN IMSAdminBase *pAdminBase,
  122. IN METADATA_HANDLE hSrcObjHandle,
  123. IN LPWSTR pszIISSrcPathName,
  124. IN METADATA_HANDLE hDestObjHandle,
  125. IN LPWSTR pszIISDestPathName
  126. );
  127. HRESULT
  128. MetaBaseMoveObject(
  129. IN IMSAdminBase *pAdminBase,
  130. IN METADATA_HANDLE hSrcObjHandle,
  131. IN LPWSTR pszIISSrcPathName,
  132. IN METADATA_HANDLE hDestObjHandle,
  133. IN LPWSTR pszIISDestPathName
  134. );
  135. HRESULT
  136. MetaBaseGetAdminACL(
  137. IN IMSAdminBase *pAdminBase,
  138. IN METADATA_HANDLE hObjHandle,
  139. IN LPWSTR pszIISPathName,
  140. OUT LPBYTE *ppBuffer
  141. );
  142. HRESULT
  143. MetaBaseDetectKey(
  144. IN IMSAdminBase *pAdminBase,
  145. IN LPCWSTR pszIISPathName
  146. );
  147. HRESULT
  148. MetaBaseGetADsClass(
  149. IN IMSAdminBase *pAdminBase,
  150. IN LPWSTR pszIISPathName,
  151. IN IIsSchema *pSchema,
  152. OUT LPWSTR pszDataBuffer,
  153. IN DWORD dwBufferLen
  154. );
  155. HRESULT
  156. FreeMetaDataRecordArray(
  157. PMETADATA_RECORD pMetaDataArray,
  158. DWORD dwNumEntries
  159. );
  160. HRESULT
  161. InitAdminBase(
  162. IN CCredentials& Credentials,
  163. IN LPWSTR pszServerName,
  164. OUT IMSAdminBase **ppAdminBase
  165. );
  166. VOID
  167. UninitAdminBase(
  168. IN IMSAdminBase *pAdminBase
  169. );
  170. HRESULT
  171. InitServerInfo(
  172. IN CCredentials& Credentials,
  173. IN LPWSTR pszServerName,
  174. OUT IMSAdminBase **ppObject,
  175. OUT IIsSchema **ppSchema
  176. );
  177. HRESULT
  178. MakeVariantFromStringArray(
  179. LPWSTR pszStr,
  180. LPWSTR pszList,
  181. VARIANT *pvVariant
  182. );
  183. HRESULT
  184. MakeVariantFromPathArray(
  185. LPWSTR pszStr,
  186. LPWSTR pszList,
  187. VARIANT *pvVariant
  188. );
  189. HRESULT
  190. InitWamAdmin(
  191. IN LPWSTR pszServerName,
  192. OUT IWamAdmin2 **ppWamAdmin
  193. );
  194. VOID
  195. UninitWamAdmin(
  196. IN IWamAdmin2 *pWamAdmin
  197. );
  198. HRESULT
  199. ConvertArrayToVariantArray(
  200. VARIANT varSafeArray,
  201. PVARIANT * ppVarArray,
  202. PDWORD pdwNumVariants
  203. );
  204. HRESULT
  205. ConvertDispatchToVariantArray(
  206. VARIANT varDispatch,
  207. PVARIANT * ppVarArray,
  208. PDWORD pdwNumVariants
  209. );
  210. HRESULT
  211. MakeStringFromVariantArray(
  212. VARIANT *pvVariant,
  213. LPBYTE *ppBuffer
  214. );
  215. HRESULT
  216. MakeMultiStringFromVariantArray(
  217. VARIANT *pvVariant,
  218. LPBYTE *ppBuffer
  219. );
  220. typedef VARIANT_BOOL * PVARIANT_BOOL;
  221. typedef VARIANT * PVARIANT;
  222. HRESULT
  223. put_BSTR_Property(
  224. IADs * pADsObject,
  225. BSTR bstrPropertyName,
  226. BSTR pSrcStringProperty
  227. );
  228. HRESULT
  229. get_BSTR_Property(
  230. IADs * pADsObject,
  231. BSTR bstrPropertyName,
  232. BSTR *ppDestStringProperty
  233. );
  234. HRESULT
  235. put_LONG_Property(
  236. IADs * pADsObject,
  237. BSTR bstrPropertyName,
  238. LONG lSrcProperty
  239. );
  240. HRESULT
  241. get_LONG_Property(
  242. IADs * pADsObject,
  243. BSTR bstrPropertyName,
  244. PLONG plDestProperty
  245. );
  246. HRESULT
  247. put_VARIANT_BOOL_Property(
  248. IADs * pADsObject,
  249. BSTR bstrPropertyName,
  250. VARIANT_BOOL fSrcProperty
  251. );
  252. HRESULT
  253. get_VARIANT_BOOL_Property(
  254. IADs * pADsObject,
  255. BSTR bstrPropertyName,
  256. PVARIANT_BOOL pfDestProperty
  257. );
  258. HRESULT
  259. put_VARIANT_Property(
  260. IADs * pADsObject,
  261. BSTR bstrPropertyName,
  262. VARIANT vSrcProperty
  263. );
  264. HRESULT
  265. get_VARIANT_Property(
  266. IADs * pADsObject,
  267. BSTR bstrPropertyName,
  268. PVARIANT pvDestProperty
  269. );
  270. HRESULT
  271. MetaBaseGetStringData(
  272. IN IMSAdminBase * pAdminBase,
  273. IN METADATA_HANDLE hObjHandle,
  274. IN LPWSTR pszIISPathName,
  275. IN DWORD dwMetaId,
  276. OUT LPBYTE *ppBuffer
  277. );
  278. HRESULT
  279. MetaBaseGetDwordData(
  280. IN IMSAdminBase * pAdminBase,
  281. IN METADATA_HANDLE hObjHandle,
  282. IN LPWSTR pszIISPathName,
  283. IN DWORD dwMetaId,
  284. OUT PDWORD pdwData
  285. );
  286. HRESULT
  287. CheckVariantDataType(
  288. PVARIANT pVar,
  289. VARTYPE vt
  290. );