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.

306 lines
6.1 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. crmapper.hxx
  5. Abstract:
  6. ADSIIS cert mapper object
  7. Author:
  8. Philippe Choquier (phillich) 10-Apr-1997
  9. --*/
  10. #if !defined( _CRMAPPER_INCLUDED )
  11. #define _CRMAPPER_INCLUDED
  12. class CIISDsCrMap : INHERIT_TRACKING,
  13. public IISDsCrMap,
  14. public IPrivateUnknown,
  15. public IPrivateDispatch,
  16. public IADsExtension,
  17. public INonDelegatingUnknown
  18. {
  19. public:
  20. CIISDsCrMap();
  21. ~CIISDsCrMap();
  22. HRESULT
  23. Init(
  24. LPWSTR pszServerName,
  25. LPWSTR pszMetabasePath
  26. );
  27. HRESULT
  28. SetString(
  29. LONG lMethod,
  30. VARIANT vKey,
  31. BSTR bstrName,
  32. DWORD dwProp
  33. );
  34. HRESULT
  35. OpenMd(
  36. LPWSTR pszOpenPath,
  37. DWORD dwPermission = METADATA_PERMISSION_READ
  38. );
  39. HRESULT
  40. CloseMd(
  41. BOOL fSave = FALSE
  42. );
  43. HRESULT
  44. DeleteMdObject(
  45. LPWSTR pszKey
  46. );
  47. HRESULT
  48. CreateMdObject(
  49. LPWSTR pszKey
  50. );
  51. HRESULT
  52. SetMdData(
  53. LPWSTR achIndex,
  54. DWORD dwProp,
  55. DWORD dwDataType,
  56. DWORD dwDataLen,
  57. LPBYTE pbData
  58. );
  59. HRESULT
  60. GetMdData(
  61. LPWSTR achIndex,
  62. DWORD dwProp,
  63. DWORD dwDataType,
  64. LPDWORD pdwDataLen,
  65. LPBYTE* ppbData
  66. );
  67. HRESULT
  68. Locate(
  69. LONG lMethod,
  70. VARIANT vKey,
  71. LPWSTR pszResKey
  72. );
  73. static
  74. HRESULT
  75. AllocateObject(
  76. IUnknown *pUnkOuter,
  77. CCredentials& Credentials,
  78. CIISDsCrMap ** ppMap
  79. );
  80. static
  81. HRESULT
  82. Create(
  83. IUnknown *pUnkOuter,
  84. REFIID riid,
  85. void **ppvObj
  86. );
  87. public:
  88. /* IUnknown methods */
  89. STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR* ppvObj) ;
  90. DECLARE_DELEGATING_REFCOUNTING
  91. //
  92. // INonDelegatingUnkown methods declaration for NG_QI, definition for
  93. // NG_AddRef adn NG_Release.
  94. //
  95. STDMETHOD(NonDelegatingQueryInterface)(THIS_
  96. const IID&,
  97. void **
  98. );
  99. DECLARE_NON_DELEGATING_REFCOUNTING
  100. DECLARE_IDispatch_METHODS
  101. DECLARE_IPrivateUnknown_METHODS
  102. DECLARE_IPrivateDispatch_METHODS
  103. STDMETHOD(Operate)(
  104. THIS_
  105. DWORD dwCode,
  106. VARIANT varUserName,
  107. VARIANT varPassword,
  108. VARIANT varReserved
  109. );
  110. STDMETHOD(PrivateGetIDsOfNames)(
  111. THIS_
  112. REFIID riid,
  113. OLECHAR FAR* FAR* rgszNames,
  114. unsigned int cNames,
  115. LCID lcid,
  116. DISPID FAR* rgdispid) ;
  117. STDMETHOD(PrivateInvoke)(
  118. THIS_
  119. DISPID dispidMember,
  120. REFIID riid,
  121. LCID lcid,
  122. WORD wFlags,
  123. DISPPARAMS FAR* pdispparams,
  124. VARIANT FAR* pvarResult,
  125. EXCEPINFO FAR* pexcepinfo,
  126. unsigned int FAR* puArgErr
  127. ) ;
  128. DECLARE_IADs_METHODS
  129. STDMETHOD(CreateMapping) (
  130. VARIANT vCert,
  131. BSTR bstrNtAcct,
  132. BSTR bstrNtPwd,
  133. BSTR bstrName,
  134. LONG lEnabled
  135. );
  136. STDMETHOD(GetMapping) (
  137. LONG lMethod,
  138. VARIANT vKey,
  139. VARIANT* pvCert,
  140. VARIANT* pbstrNtAcct,
  141. VARIANT* pbstrNtPwd,
  142. VARIANT* pbstrName,
  143. VARIANT* plEnabled
  144. );
  145. STDMETHOD(DeleteMapping) (
  146. LONG lMethod,
  147. VARIANT vKey
  148. );
  149. STDMETHOD(SetEnabled) (
  150. LONG lMethod,
  151. VARIANT vKey,
  152. LONG lEnabled
  153. );
  154. STDMETHOD(SetName) (
  155. LONG lMethod,
  156. VARIANT vKey,
  157. BSTR bstrName
  158. );
  159. STDMETHOD(SetPwd) (
  160. LONG lMethod,
  161. VARIANT vKey,
  162. BSTR bstrPwd
  163. );
  164. STDMETHOD(SetAcct) (
  165. LONG lMethod,
  166. VARIANT vKey,
  167. BSTR bstrAcct
  168. );
  169. private:
  170. HRESULT
  171. CreateMappingIIS6(
  172. VARIANT vCert,
  173. BSTR bstrNtAcct,
  174. BSTR bstrNtPwd,
  175. BSTR bstrName,
  176. LONG lEnabled
  177. );
  178. HRESULT
  179. GetMappingIIS6(
  180. LONG lMethod,
  181. VARIANT vKey,
  182. VARIANT* pvCert,
  183. VARIANT* pbstrNtAcct,
  184. VARIANT* pbstrNtPwd,
  185. VARIANT* pbstrName,
  186. VARIANT* plEnabled
  187. );
  188. HRESULT
  189. DeleteMappingIIS6(
  190. LONG lMethod,
  191. VARIANT vKey
  192. );
  193. HRESULT
  194. SetEnabledIIS6(
  195. LONG lMethod,
  196. VARIANT vKey,
  197. LONG lEnabled
  198. );
  199. HRESULT
  200. SetNameIIS6(
  201. LONG lMethod,
  202. VARIANT vKey,
  203. BSTR bstrName
  204. );
  205. HRESULT
  206. SetPwdIIS6(
  207. LONG lMethod,
  208. VARIANT vKey,
  209. BSTR bstrPwd
  210. );
  211. HRESULT
  212. SetAcctIIS6(
  213. LONG lMethod,
  214. VARIANT vKey,
  215. BSTR bstrAcct
  216. );
  217. HRESULT
  218. LocateIIS6(
  219. LONG lMethod,
  220. VARIANT vKey,
  221. LPWSTR pszResKey
  222. );
  223. HRESULT
  224. SetStringIIS6(
  225. LONG lMethod,
  226. VARIANT vKey,
  227. BSTR bstrName,
  228. DWORD dwProp
  229. );
  230. IMSAdminBase * m_pcAdmCom; //interface pointer
  231. METADATA_HANDLE m_hmd;
  232. BSTR m_ADsPath;
  233. CCredentials m_Credentials;
  234. IADs FAR * _pADs;
  235. CAggregateeDispMgr FAR * _pDispMgr;
  236. LPWSTR m_pszMetabasePath;
  237. LPWSTR m_pszServerName;
  238. BOOL _fDispInitialized;
  239. BOOL m_fIsIIS6;
  240. } ;
  241. #define IISMAPPER_LOCATE_BY_CERT 1
  242. #define IISMAPPER_LOCATE_BY_NAME 2
  243. #define IISMAPPER_LOCATE_BY_ACCT 3
  244. #define IISMAPPER_LOCATE_BY_INDEX 4
  245. #endif