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.

315 lines
22 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995
  5. //
  6. // File: cmacro.h
  7. //
  8. // Contents: Macros for adsi methods
  9. //
  10. // History: 21-04-97 sophiac Created.
  11. //
  12. //----------------------------------------------------------------------------
  13. #define DEFINE_CONTAINED_IADs_Implementation(cls) \
  14. STDMETHODIMP \
  15. cls::get_Name(THIS_ BSTR FAR* retval) \
  16. { \
  17. RRETURN(_pADs->get_Name(retval)); \
  18. } \
  19. \
  20. STDMETHODIMP \
  21. cls::get_ADsPath(THIS_ BSTR FAR* retval) \
  22. { \
  23. \
  24. RRETURN(_pADs->get_ADsPath(retval)); \
  25. } \
  26. \
  27. STDMETHODIMP \
  28. cls::get_Class(THIS_ BSTR FAR* retval) \
  29. { \
  30. \
  31. RRETURN(_pADs->get_Class(retval)); \
  32. } \
  33. \
  34. \
  35. STDMETHODIMP \
  36. cls::get_Parent(THIS_ BSTR FAR* retval) \
  37. { \
  38. RRETURN(_pADs->get_Parent(retval)); \
  39. } \
  40. \
  41. STDMETHODIMP \
  42. cls::get_Schema(THIS_ BSTR FAR* retval) \
  43. { \
  44. RRETURN(_pADs->get_Schema(retval)); \
  45. } \
  46. \
  47. STDMETHODIMP \
  48. cls::get_GUID(THIS_ BSTR FAR* retval) \
  49. { \
  50. RRETURN(_pADs->get_GUID(retval)); \
  51. } \
  52. \
  53. STDMETHODIMP \
  54. cls::Get(THIS_ BSTR bstrName, VARIANT FAR* pvProp) \
  55. { \
  56. RRETURN(_pADs->Get(bstrName, pvProp)); \
  57. } \
  58. \
  59. STDMETHODIMP \
  60. cls::Put(THIS_ BSTR bstrName, VARIANT vProp) \
  61. { \
  62. RRETURN(_pADs->Put(bstrName, vProp)); \
  63. } \
  64. \
  65. \
  66. STDMETHODIMP \
  67. cls::GetEx(THIS_ BSTR bstrName, VARIANT FAR* pvProp) \
  68. { \
  69. RRETURN(_pADs->GetEx(bstrName, pvProp)); \
  70. } \
  71. \
  72. STDMETHODIMP \
  73. cls::PutEx(THIS_ long lnControlCode, BSTR bstrName, VARIANT vProp) \
  74. { \
  75. RRETURN(_pADs->PutEx(lnControlCode, bstrName, vProp)); \
  76. } \
  77. \
  78. STDMETHODIMP \
  79. cls::GetInfo(THIS_) \
  80. { \
  81. RRETURN(_pADs->GetInfo()); \
  82. } \
  83. \
  84. STDMETHODIMP \
  85. cls::SetInfo(THIS_ ) \
  86. { \
  87. RRETURN(_pADs->SetInfo()); \
  88. } \
  89. STDMETHODIMP \
  90. cls::GetInfoEx(THIS_ VARIANT vProperties, long lnReserved) \
  91. { \
  92. RRETURN(_pADs->GetInfoEx(vProperties, lnReserved)); \
  93. }
  94. #define DEFINE_CONTAINED_IDSObject_Implementation(cls) \
  95. STDMETHODIMP \
  96. cls::SetObjectAttributes( \
  97. PADS_ATTR_DEF pAttributeEntries, \
  98. DWORD dwNumAttributes, \
  99. DWORD *pdwNumAttributesModified \
  100. ) \
  101. { \
  102. HRESULT hr = S_OK; \
  103. \
  104. hr = _pDSObject->SetObjectAttributes( \
  105. pAttributeEntries, \
  106. dwNumAttributes, \
  107. pdwNumAttributesModified \
  108. ); \
  109. RRETURN(hr); \
  110. } \
  111. \
  112. STDMETHODIMP \
  113. cls::GetObjectAttributes( \
  114. PADS_ATTR_NAME pAttributeNames, \
  115. DWORD dwNumberAttributes, \
  116. PADS_ATTR_DEF *ppAttributeEntries, \
  117. DWORD * pdwNumAttributesReturned \
  118. ) \
  119. { \
  120. HRESULT hr = S_OK; \
  121. \
  122. hr = _pDSObject->GetObjectAttributes( \
  123. pAttributeNames, \
  124. dwNumberAttributes, \
  125. ppAttributeEntries, \
  126. pdwNumAttributesReturned \
  127. ); \
  128. RRETURN(hr); \
  129. } \
  130. \
  131. \
  132. STDMETHODIMP \
  133. cls::CreateDSObject( \
  134. LPWSTR pszRDNName, \
  135. PADS_ATTR_DEF pAttributeEntries, \
  136. DWORD dwNumAttributes \
  137. ) \
  138. { \
  139. HRESULT hr = S_OK; \
  140. \
  141. hr = _pDSObject->CreateDSObject( \
  142. pszRDNName, \
  143. pAttributeEntries, \
  144. dwNumAttributes \
  145. ); \
  146. RRETURN(hr); \
  147. } \
  148. \
  149. STDMETHODIMP \
  150. cls::DeleteDSObject( \
  151. LPWSTR pszRDNName \
  152. ) \
  153. \
  154. { \
  155. HRESULT hr = S_OK; \
  156. \
  157. hr = _pDSObject->DeleteDSObject( \
  158. pszRDNName \
  159. ); \
  160. RRETURN(hr); \
  161. } \
  162. \
  163. STDMETHODIMP \
  164. cls::GetObjectInformation( \
  165. THIS_ PADS_OBJECT_INFO * ppObjInfo \
  166. ) \
  167. { \
  168. HRESULT hr = S_OK; \
  169. \
  170. hr = _pDSObject->GetObjectInformation( \
  171. ppObjInfo \
  172. ); \
  173. RRETURN(hr); \
  174. }
  175. #define DEFINE_CONTAINED_IADsContainer_Implementation(cls) \
  176. STDMETHODIMP \
  177. cls::get_Filter(THIS_ VARIANT FAR* pVar ) \
  178. { \
  179. HRESULT hr = E_NOTIMPL; \
  180. if ( _pADsContainer ) { \
  181. hr = _pADsContainer->get_Filter( pVar ); \
  182. } \
  183. RRETURN(hr); \
  184. } \
  185. \
  186. STDMETHODIMP \
  187. cls::put_Filter(THIS_ VARIANT Var ) \
  188. { \
  189. HRESULT hr = E_NOTIMPL; \
  190. if ( _pADsContainer ) { \
  191. hr = _pADsContainer->put_Filter( Var ); \
  192. } \
  193. RRETURN(hr); \
  194. } \
  195. \
  196. STDMETHODIMP \
  197. cls::get_Hints(THIS_ VARIANT FAR* pVar ) \
  198. { \
  199. HRESULT hr = E_NOTIMPL; \
  200. if ( _pADsContainer ) { \
  201. hr = _pADsContainer->get_Hints( pVar ); \
  202. } \
  203. RRETURN(hr); \
  204. } \
  205. \
  206. STDMETHODIMP \
  207. cls::put_Hints(THIS_ VARIANT Var ) \
  208. { \
  209. HRESULT hr = E_NOTIMPL; \
  210. if ( _pADsContainer ) { \
  211. hr = _pADsContainer->put_Hints( Var ); \
  212. } \
  213. RRETURN(hr); \
  214. } \
  215. \
  216. STDMETHODIMP \
  217. cls::get_Count(THIS_ long FAR* retval) \
  218. { \
  219. HRESULT hr = E_NOTIMPL; \
  220. if ( _pADsContainer ) { \
  221. hr = _pADsContainer->get_Count( retval ); \
  222. } \
  223. RRETURN(hr); \
  224. } \
  225. \
  226. STDMETHODIMP \
  227. cls::get__NewEnum(THIS_ IUnknown * FAR * retval ) \
  228. { \
  229. HRESULT hr = E_NOTIMPL; \
  230. if ( _pADsContainer ) { \
  231. hr = _pADsContainer->get__NewEnum( retval ); \
  232. } \
  233. RRETURN(hr); \
  234. } \
  235. \
  236. STDMETHODIMP \
  237. cls::GetObject(THIS_ BSTR ClassName, BSTR RelativeName, \
  238. IDispatch * FAR * ppObject ) \
  239. { \
  240. HRESULT hr = E_NOTIMPL; \
  241. if ( _pADsContainer ) { \
  242. hr = _pADsContainer->GetObject( ClassName, RelativeName, ppObject ); \
  243. } \
  244. RRETURN(hr); \
  245. } \
  246. \
  247. STDMETHODIMP \
  248. cls::Create(THIS_ BSTR ClassName, BSTR RelativeName, \
  249. IDispatch * FAR * ppObject ) \
  250. { \
  251. HRESULT hr = E_NOTIMPL; \
  252. if ( _pADsContainer ) { \
  253. hr =_pADsContainer->Create( ClassName, RelativeName, ppObject ); \
  254. } \
  255. RRETURN(hr); \
  256. } \
  257. \
  258. STDMETHODIMP \
  259. cls::Delete(THIS_ BSTR ClassName, BSTR SourceName ) \
  260. { \
  261. HRESULT hr = E_NOTIMPL; \
  262. if ( _pADsContainer ) { \
  263. hr = _pADsContainer->Delete( ClassName, SourceName ); \
  264. } \
  265. RRETURN(hr); \
  266. } \
  267. \
  268. STDMETHODIMP \
  269. cls::CopyHere(THIS_ BSTR SourceName, BSTR NewName, \
  270. IDispatch * FAR * ppObject ) \
  271. { \
  272. HRESULT hr = E_NOTIMPL; \
  273. if ( _pADsContainer ) { \
  274. hr = _pADsContainer->CopyHere( SourceName, NewName, ppObject ); \
  275. } \
  276. RRETURN(hr); \
  277. } \
  278. \
  279. STDMETHODIMP \
  280. cls::MoveHere(THIS_ BSTR SourceName, BSTR NewName, \
  281. IDispatch * FAR * ppObject ) \
  282. { \
  283. HRESULT hr = E_NOTIMPL; \
  284. if ( _pADsContainer ) { \
  285. hr = _pADsContainer->MoveHere( SourceName, NewName, ppObject ); \
  286. } \
  287. RRETURN(hr); \
  288. }
  289. #define DEFINE_CONTAINED_IIsBaseObject_Implementation(cls) \
  290. STDMETHODIMP \
  291. cls::GetDataPaths(THIS_ BSTR bstrName, LONG lnAttribute, \
  292. VARIANT FAR* pvProp) \
  293. { \
  294. HRESULT hr = E_NOTIMPL; \
  295. if ( _pIIsBaseObject) { \
  296. hr = _pIIsBaseObject->GetDataPaths( bstrName, lnAttribute, pvProp); \
  297. } \
  298. RRETURN(hr); \
  299. } \
  300. \
  301. STDMETHODIMP \
  302. cls::GetPropertyAttribObj(THIS_ BSTR bstrName, \
  303. IDispatch * FAR *ppObject) \
  304. { \
  305. HRESULT hr = E_NOTIMPL; \
  306. if ( _pIIsBaseObject) { \
  307. hr = _pIIsBaseObject->GetPropertyAttribObj(bstrName, ppObject); \
  308. } \
  309. RRETURN(hr); \
  310. }