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.

359 lines
7.8 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995
  5. //
  6. // File: cubi.cxx
  7. //
  8. // Contents:
  9. //
  10. // History: 11-1-95 krishnag Created.
  11. // 8-5-96 ramv Modified to be consistent with spec
  12. //
  13. // PROPERTY_RW(Address, VARIANT, 1) NI
  14. // PROPERTY_RW(Department, BSTR, 3) NI
  15. // PROPERTY_RW(Division, BSTR, 5) NI
  16. // PROPERTY_RW(EmployeeID, BSTR, 6) NI
  17. // PROPERTY_RW(FaxNumber, BSTR, 7) NI
  18. // PROPERTY_RW(FirstName, BSTR, 8) Implemented
  19. // PROPERTY_RW(FullName, BSTR, 9) NI
  20. // PROPERTY_RW(Initials, BSTR, 10) NI
  21. // PROPERTY_RW(LastName, BSTR, 11) NI
  22. // PROPERTY_RW(Manager, BSTR, 12) NI
  23. // PROPERTY_RW(NickName, BSTR, 13) NI
  24. // PROPERTY_RW(OfficeLocations, BSTR, 14) NI
  25. // PROPERTY_RW(Picture, VARIANT, 15) NI
  26. // PROPERTY_RW(Title, BSTR, 19)
  27. //
  28. //----------------------------------------------------------------------------
  29. #include "nds.hxx"
  30. #pragma hdrstop
  31. STDMETHODIMP
  32. CNDSUser::get_Description(THIS_ BSTR FAR* retval)
  33. {
  34. GET_PROPERTY_BSTR((IADsUser *)this, Description);
  35. }
  36. STDMETHODIMP
  37. CNDSUser::put_Description(THIS_ BSTR bstrDescription)
  38. {
  39. PUT_PROPERTY_BSTR((IADsUser *)this, Description);
  40. }
  41. STDMETHODIMP
  42. CNDSUser::get_Department(THIS_ BSTR FAR* retval)
  43. {
  44. GET_PROPERTY_BSTR((IADsUser *)this, Department);
  45. }
  46. STDMETHODIMP
  47. CNDSUser::put_Department(THIS_ BSTR bstrDepartment)
  48. {
  49. PUT_PROPERTY_BSTR((IADsUser *)this, Department);
  50. }
  51. STDMETHODIMP
  52. CNDSUser::get_Division(THIS_ BSTR FAR* retval)
  53. {
  54. GET_PROPERTY_BSTR((IADsUser *)this, Division);
  55. }
  56. STDMETHODIMP
  57. CNDSUser::put_Division(THIS_ BSTR bstrDivision)
  58. {
  59. PUT_PROPERTY_BSTR((IADsUser *)this, Division);
  60. }
  61. STDMETHODIMP
  62. CNDSUser::get_EmployeeID(THIS_ BSTR FAR* retval)
  63. {
  64. GET_PROPERTY_BSTR((IADsUser *)this, EmployeeID);
  65. }
  66. STDMETHODIMP
  67. CNDSUser::put_EmployeeID(THIS_ BSTR bstrEmployeeID)
  68. {
  69. PUT_PROPERTY_BSTR((IADsUser *)this, EmployeeID);
  70. }
  71. STDMETHODIMP
  72. CNDSUser::get_FirstName(THIS_ BSTR FAR* retval)
  73. {
  74. GET_PROPERTY_BSTR((IADsUser *)this, FirstName);
  75. }
  76. STDMETHODIMP
  77. CNDSUser::put_FirstName(THIS_ BSTR bstrFirstName)
  78. {
  79. PUT_PROPERTY_BSTR((IADsUser *)this, FirstName);
  80. }
  81. STDMETHODIMP
  82. CNDSUser::get_FullName(THIS_ BSTR FAR* retval)
  83. {
  84. GET_PROPERTY_BSTR((IADsUser *)this, FullName);
  85. }
  86. STDMETHODIMP
  87. CNDSUser::put_FullName(THIS_ BSTR bstrFullName)
  88. {
  89. PUT_PROPERTY_BSTR((IADsUser *)this, FullName);
  90. }
  91. STDMETHODIMP
  92. CNDSUser::get_LastName(THIS_ BSTR FAR* retval)
  93. {
  94. GET_PROPERTY_BSTR((IADsUser *)this, LastName);
  95. }
  96. STDMETHODIMP
  97. CNDSUser::put_LastName(THIS_ BSTR bstrLastName)
  98. {
  99. PUT_PROPERTY_BSTR((IADsUser *)this, LastName);
  100. }
  101. STDMETHODIMP
  102. CNDSUser::get_Manager(THIS_ BSTR FAR* retval)
  103. {
  104. GET_PROPERTY_BSTR((IADsUser *)this, Manager);
  105. }
  106. STDMETHODIMP
  107. CNDSUser::put_Manager(THIS_ BSTR bstrManager)
  108. {
  109. PUT_PROPERTY_BSTR((IADsUser *)this, Manager);
  110. }
  111. STDMETHODIMP
  112. CNDSUser::get_OfficeLocations(THIS_ VARIANT FAR* retval)
  113. {
  114. GET_PROPERTY_VARIANT((IADsUser *)this, OfficeLocation);
  115. }
  116. STDMETHODIMP
  117. CNDSUser::put_OfficeLocations(THIS_ VARIANT vOfficeLocation)
  118. {
  119. PUT_PROPERTY_VARIANT((IADsUser *)this, OfficeLocation);
  120. }
  121. STDMETHODIMP
  122. CNDSUser::get_Picture(THIS_ VARIANT FAR* retval)
  123. {
  124. GET_PROPERTY_VARIANT((IADsUser *)this, PictureIcon);
  125. }
  126. STDMETHODIMP
  127. CNDSUser::put_Picture(THIS_ VARIANT vPictureIcon)
  128. {
  129. PUT_PROPERTY_VARIANT((IADsUser *)this, PictureIcon);
  130. }
  131. STDMETHODIMP
  132. CNDSUser::get_PostalAddresses(THIS_ VARIANT FAR* retval)
  133. {
  134. GET_PROPERTY_VARIANT((IADsUser *)this, PostalAddresses);
  135. }
  136. STDMETHODIMP
  137. CNDSUser::put_PostalAddresses(THIS_ VARIANT vPostalAddresses)
  138. {
  139. PUT_PROPERTY_VARIANT((IADsUser *)this, PostalAddresses);
  140. }
  141. STDMETHODIMP
  142. CNDSUser::get_PostalCodes(THIS_ VARIANT FAR* retval)
  143. {
  144. GET_PROPERTY_VARIANT((IADsUser *)this, PostalCodes);
  145. }
  146. STDMETHODIMP
  147. CNDSUser::put_PostalCodes(THIS_ VARIANT vPostalCodes)
  148. {
  149. PUT_PROPERTY_VARIANT((IADsUser *)this, PostalCodes);
  150. }
  151. STDMETHODIMP
  152. CNDSUser::get_TelephoneNumber(THIS_ VARIANT FAR* retval)
  153. {
  154. GET_PROPERTY_VARIANT((IADsUser *)this, TelephoneNumber);
  155. }
  156. STDMETHODIMP
  157. CNDSUser::put_TelephoneNumber(THIS_ VARIANT vTelephoneNumber)
  158. {
  159. PUT_PROPERTY_VARIANT((IADsUser *)this, TelephoneNumber);
  160. }
  161. STDMETHODIMP
  162. CNDSUser::get_TelephoneHome(THIS_ VARIANT FAR* retval)
  163. {
  164. GET_PROPERTY_VARIANT((IADsUser *)this, TelephoneHome);
  165. }
  166. STDMETHODIMP
  167. CNDSUser::put_TelephoneHome(THIS_ VARIANT vTelephoneHome)
  168. {
  169. PUT_PROPERTY_VARIANT((IADsUser *)this, TelephoneHome);
  170. }
  171. STDMETHODIMP
  172. CNDSUser::get_TelephoneMobile(THIS_ VARIANT FAR* retval)
  173. {
  174. GET_PROPERTY_VARIANT((IADsUser *)this, TelephoneMobile);
  175. }
  176. STDMETHODIMP
  177. CNDSUser::put_TelephoneMobile(THIS_ VARIANT vTelephoneMobile)
  178. {
  179. PUT_PROPERTY_VARIANT((IADsUser *)this, TelephoneMobile);
  180. }
  181. STDMETHODIMP
  182. CNDSUser::get_TelephonePager(THIS_ VARIANT FAR* retval)
  183. {
  184. GET_PROPERTY_VARIANT((IADsUser *)this, TelephonePager);
  185. }
  186. STDMETHODIMP
  187. CNDSUser::put_TelephonePager(THIS_ VARIANT vTelephonePager)
  188. {
  189. PUT_PROPERTY_VARIANT((IADsUser *)this, TelephonePager);
  190. }
  191. STDMETHODIMP
  192. CNDSUser::get_FaxNumber(THIS_ VARIANT FAR* retval)
  193. {
  194. GET_PROPERTY_VARIANT((IADsUser *)this, FaxNumber);
  195. }
  196. STDMETHODIMP
  197. CNDSUser::put_FaxNumber(THIS_ VARIANT vFaxNumber)
  198. {
  199. PUT_PROPERTY_VARIANT((IADsUser *)this, FaxNumber);
  200. }
  201. STDMETHODIMP
  202. CNDSUser::get_Title(THIS_ BSTR FAR* retval)
  203. {
  204. GET_PROPERTY_BSTR((IADsUser *)this, Title);
  205. }
  206. STDMETHODIMP
  207. CNDSUser::put_Title(THIS_ BSTR bstrTitle)
  208. {
  209. PUT_PROPERTY_BSTR((IADsUser *)this, Title);
  210. }
  211. STDMETHODIMP CNDSUser::Groups(THIS_ IADsMembers FAR* FAR * ppGroups)
  212. {
  213. VARIANT varProp;
  214. HRESULT hr = S_OK;
  215. BSTR bstrADsPath = NULL;
  216. VariantInit(&varProp);
  217. hr = _pADs->GetEx(L"Group Membership", &varProp);
  218. if (hr == E_ADS_PROPERTY_NOT_FOUND) {
  219. SAFEARRAY *aList = NULL;
  220. VariantInit(&varProp);
  221. SAFEARRAYBOUND aBound;
  222. aBound.lLbound = 0;
  223. aBound.cElements = 0;
  224. aList = SafeArrayCreate( VT_VARIANT, 1, &aBound );
  225. if ( aList == NULL ) {
  226. hr = E_OUTOFMEMORY;
  227. BAIL_ON_FAILURE(hr);
  228. }
  229. V_VT(&varProp) = VT_ARRAY | VT_VARIANT;
  230. V_ARRAY(&varProp) = aList;
  231. }
  232. else {
  233. BAIL_ON_FAILURE(hr);
  234. }
  235. hr = _pADs->get_ADsPath(&bstrADsPath);
  236. hr = CNDSUserCollection::CreateUserCollection(
  237. bstrADsPath,
  238. varProp,
  239. IID_IADsMembers,
  240. (void **)ppGroups
  241. );
  242. BAIL_ON_FAILURE(hr);
  243. error:
  244. if (bstrADsPath) {
  245. ADsFreeString(bstrADsPath);
  246. }
  247. VariantClear(&varProp);
  248. RRETURN_EXP_IF_ERR(hr);
  249. }
  250. STDMETHODIMP CNDSUser::get_HomePage(THIS_ BSTR FAR* retval)
  251. {
  252. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  253. }
  254. STDMETHODIMP CNDSUser::put_HomePage(THIS_ BSTR bstrHomePage)
  255. {
  256. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  257. }
  258. STDMETHODIMP CNDSUser::get_SeeAlso(THIS_ VARIANT FAR* retval)
  259. {
  260. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  261. }
  262. STDMETHODIMP CNDSUser::put_SeeAlso(THIS_ VARIANT vSeeAlso)
  263. {
  264. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  265. }
  266. STDMETHODIMP CNDSUser::get_NamePrefix(THIS_ BSTR FAR* retval)
  267. {
  268. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  269. }
  270. STDMETHODIMP CNDSUser::put_NamePrefix(THIS_ BSTR bstrNamePrefix)
  271. {
  272. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  273. }
  274. STDMETHODIMP CNDSUser::get_NameSuffix(THIS_ BSTR FAR* retval)
  275. {
  276. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  277. }
  278. STDMETHODIMP CNDSUser::put_NameSuffix(THIS_ BSTR bstrNamePrefix)
  279. {
  280. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  281. }
  282. STDMETHODIMP CNDSUser::get_OtherName(THIS_ BSTR FAR* retval)
  283. {
  284. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  285. }
  286. STDMETHODIMP CNDSUser::put_OtherName(THIS_ BSTR bstrOtherName)
  287. {
  288. RRETURN_EXP_IF_ERR(E_NOTIMPL);
  289. }