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.

343 lines
8.2 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(OfficeLocation, BSTR, 14) NI
  25. // PROPERTY_RW(Picture, VARIANT, 51) NI
  26. // PROPERTY_RW(TelephoneHome, VARIANT, 18) NI
  27. // PROPERTY_RW(TelephoneMobile, VARIANT, 19) NI
  28. // PROPERTY_RW(TelephoneNumber, VARIANT, 20) NI
  29. // PROPERTY_RW(FaxNumber, VARIANT, 2) NI
  30. // PROPERTY_RW(Title, BSTR, 19)
  31. //
  32. //----------------------------------------------------------------------------
  33. #include "winnt.hxx"
  34. #pragma hdrstop
  35. STDMETHODIMP
  36. CWinNTUser::get_Description(THIS_ BSTR FAR* retval)
  37. {
  38. GET_PROPERTY_BSTR((IADsUser *)this, Description);
  39. }
  40. STDMETHODIMP
  41. CWinNTUser::put_Description(THIS_ BSTR bstrDescription)
  42. {
  43. PUT_PROPERTY_BSTR((IADsUser *)this, Description);
  44. }
  45. STDMETHODIMP
  46. CWinNTUser::get_Department(THIS_ BSTR FAR* retval)
  47. {
  48. GET_PROPERTY_BSTR((IADsUser *)this, Department);
  49. }
  50. STDMETHODIMP
  51. CWinNTUser::put_Department(THIS_ BSTR bstrDepartment)
  52. {
  53. PUT_PROPERTY_BSTR((IADsUser *)this, Department);
  54. }
  55. STDMETHODIMP
  56. CWinNTUser::get_Division(THIS_ BSTR FAR* retval)
  57. {
  58. GET_PROPERTY_BSTR((IADsUser *)this, Division);
  59. }
  60. STDMETHODIMP
  61. CWinNTUser::put_Division(THIS_ BSTR bstrDivision)
  62. {
  63. PUT_PROPERTY_BSTR((IADsUser *)this, Division);
  64. }
  65. STDMETHODIMP
  66. CWinNTUser::get_EmployeeID(THIS_ BSTR FAR* retval)
  67. {
  68. GET_PROPERTY_BSTR((IADsUser *)this, EmployeeID);
  69. }
  70. STDMETHODIMP
  71. CWinNTUser::put_EmployeeID(THIS_ BSTR bstrEmployeeID)
  72. {
  73. PUT_PROPERTY_BSTR((IADsUser *)this, EmployeeID);
  74. }
  75. STDMETHODIMP
  76. CWinNTUser::get_FirstName(THIS_ BSTR FAR* retval)
  77. {
  78. GET_PROPERTY_BSTR((IADsUser *)this, FirstName);
  79. }
  80. STDMETHODIMP
  81. CWinNTUser::put_FirstName(THIS_ BSTR bstrFirstName)
  82. {
  83. PUT_PROPERTY_BSTR((IADsUser *)this, FirstName);
  84. }
  85. STDMETHODIMP
  86. CWinNTUser::get_FullName(THIS_ BSTR FAR* retval)
  87. {
  88. GET_PROPERTY_BSTR((IADsUser *)this, FullName);
  89. }
  90. STDMETHODIMP
  91. CWinNTUser::put_FullName(THIS_ BSTR bstrFullName)
  92. {
  93. PUT_PROPERTY_BSTR((IADsUser *)this, FullName);
  94. }
  95. STDMETHODIMP
  96. CWinNTUser::get_LastName(THIS_ BSTR FAR* retval)
  97. {
  98. GET_PROPERTY_BSTR((IADsUser *)this, LastName);
  99. }
  100. STDMETHODIMP
  101. CWinNTUser::put_LastName(THIS_ BSTR bstrLastName)
  102. {
  103. PUT_PROPERTY_BSTR((IADsUser *)this, LastName);
  104. }
  105. STDMETHODIMP
  106. CWinNTUser::get_Manager(THIS_ BSTR FAR* retval)
  107. {
  108. GET_PROPERTY_BSTR((IADsUser *)this, Manager);
  109. }
  110. STDMETHODIMP
  111. CWinNTUser::put_Manager(THIS_ BSTR bstrManager)
  112. {
  113. PUT_PROPERTY_BSTR((IADsUser *)this, Manager);
  114. }
  115. STDMETHODIMP
  116. CWinNTUser::get_OfficeLocations(THIS_ VARIANT FAR* retval)
  117. {
  118. GET_PROPERTY_VARIANT((IADsUser *)this, OfficeLocation);
  119. }
  120. STDMETHODIMP
  121. CWinNTUser::put_OfficeLocations(THIS_ VARIANT vOfficeLocation)
  122. {
  123. PUT_PROPERTY_VARIANT((IADsUser *)this, OfficeLocation);
  124. }
  125. STDMETHODIMP
  126. CWinNTUser::get_Picture(THIS_ VARIANT FAR* retval)
  127. {
  128. GET_PROPERTY_VARIANT((IADsUser *)this, Picture);
  129. }
  130. STDMETHODIMP
  131. CWinNTUser::put_Picture(THIS_ VARIANT vPicture)
  132. {
  133. PUT_PROPERTY_VARIANT((IADsUser *)this, Picture);
  134. }
  135. STDMETHODIMP
  136. CWinNTUser::get_PostalAddresses(THIS_ VARIANT FAR* retval)
  137. {
  138. GET_PROPERTY_VARIANT((IADsUser *)this, PostalAddresses);
  139. }
  140. STDMETHODIMP
  141. CWinNTUser::put_PostalAddresses(THIS_ VARIANT vPostalAddresses)
  142. {
  143. PUT_PROPERTY_VARIANT((IADsUser *)this, PostalAddresses);
  144. }
  145. STDMETHODIMP
  146. CWinNTUser::get_PostalCodes(THIS_ VARIANT FAR* retval)
  147. {
  148. GET_PROPERTY_VARIANT((IADsUser *)this, PostalCodes);
  149. }
  150. STDMETHODIMP
  151. CWinNTUser::put_PostalCodes(THIS_ VARIANT vPostalCodes)
  152. {
  153. PUT_PROPERTY_VARIANT((IADsUser *)this, PostalCodes);
  154. }
  155. STDMETHODIMP
  156. CWinNTUser::get_TelephoneNumber(THIS_ VARIANT FAR* retval)
  157. {
  158. GET_PROPERTY_VARIANT((IADsUser *)this, TelephoneNumber);
  159. }
  160. STDMETHODIMP
  161. CWinNTUser::put_TelephoneNumber(THIS_ VARIANT vTelephoneNumber)
  162. {
  163. PUT_PROPERTY_VARIANT((IADsUser *)this, TelephoneNumber);
  164. }
  165. STDMETHODIMP
  166. CWinNTUser::get_TelephoneHome(THIS_ VARIANT FAR* retval)
  167. {
  168. GET_PROPERTY_VARIANT((IADsUser *)this, TelephoneHome);
  169. }
  170. STDMETHODIMP
  171. CWinNTUser::put_TelephoneHome(THIS_ VARIANT vTelephoneHome)
  172. {
  173. PUT_PROPERTY_VARIANT((IADsUser *)this, TelephoneHome);
  174. }
  175. STDMETHODIMP
  176. CWinNTUser::get_TelephoneMobile(THIS_ VARIANT FAR* retval)
  177. {
  178. GET_PROPERTY_VARIANT((IADsUser *)this, TelephoneMobile);
  179. }
  180. STDMETHODIMP
  181. CWinNTUser::put_TelephoneMobile(THIS_ VARIANT vTelephoneMobile)
  182. {
  183. PUT_PROPERTY_VARIANT((IADsUser *)this, TelephoneMobile);
  184. }
  185. STDMETHODIMP
  186. CWinNTUser::get_TelephonePager(THIS_ VARIANT FAR* retval)
  187. {
  188. GET_PROPERTY_VARIANT((IADsUser *)this, TelephonePager);
  189. }
  190. STDMETHODIMP
  191. CWinNTUser::put_TelephonePager(THIS_ VARIANT vTelephonePager)
  192. {
  193. PUT_PROPERTY_VARIANT((IADsUser *)this, TelephonePager);
  194. }
  195. STDMETHODIMP
  196. CWinNTUser::get_FaxNumber(THIS_ VARIANT FAR* retval)
  197. {
  198. GET_PROPERTY_VARIANT((IADsUser *)this, FaxNumber);
  199. }
  200. STDMETHODIMP
  201. CWinNTUser::put_FaxNumber(THIS_ VARIANT vFaxNumber)
  202. {
  203. PUT_PROPERTY_VARIANT((IADsUser *)this, FaxNumber);
  204. }
  205. STDMETHODIMP
  206. CWinNTUser::get_Title(THIS_ BSTR FAR* retval)
  207. {
  208. GET_PROPERTY_BSTR((IADsUser *)this, Title);
  209. }
  210. STDMETHODIMP
  211. CWinNTUser::put_Title(THIS_ BSTR bstrTitle)
  212. {
  213. PUT_PROPERTY_BSTR((IADsUser *)this, Title);
  214. }
  215. STDMETHODIMP CWinNTUser::get_HomePage(THIS_ BSTR FAR* retval)
  216. {
  217. GET_PROPERTY_BSTR((IADsUser *)this,HomePage);
  218. }
  219. STDMETHODIMP CWinNTUser::put_HomePage(THIS_ BSTR bstrHomePage)
  220. {
  221. PUT_PROPERTY_BSTR((IADsUser *)this, HomePage);
  222. }
  223. STDMETHODIMP CWinNTUser::get_SeeAlso(THIS_ VARIANT FAR* retval)
  224. {
  225. GET_PROPERTY_VARIANT((IADsUser *)this, SeeAlso);
  226. }
  227. STDMETHODIMP CWinNTUser::put_SeeAlso(THIS_ VARIANT vSeeAlso)
  228. {
  229. PUT_PROPERTY_VARIANT((IADsUser *)this, SeeAlso);
  230. }
  231. STDMETHODIMP CWinNTUser::get_NamePrefix(THIS_ BSTR FAR* retval)
  232. {
  233. GET_PROPERTY_BSTR((IADsUser *)this, NamePrefix);
  234. }
  235. STDMETHODIMP CWinNTUser::put_NamePrefix(THIS_ BSTR bstrNamePrefix)
  236. {
  237. PUT_PROPERTY_BSTR((IADsUser *)this, NamePrefix);
  238. }
  239. STDMETHODIMP CWinNTUser::get_NameSuffix(THIS_ BSTR FAR* retval)
  240. {
  241. GET_PROPERTY_BSTR((IADsUser *)this, NameSuffix);
  242. }
  243. STDMETHODIMP CWinNTUser::put_NameSuffix(THIS_ BSTR bstrNamePrefix)
  244. {
  245. PUT_PROPERTY_BSTR((IADsUser *)this,NamePrefix);
  246. }
  247. STDMETHODIMP CWinNTUser::get_OtherName(THIS_ BSTR FAR* retval)
  248. {
  249. GET_PROPERTY_BSTR((IADsUser *)this, OtherName);
  250. }
  251. STDMETHODIMP CWinNTUser::put_OtherName(THIS_ BSTR bstrOtherName)
  252. {
  253. PUT_PROPERTY_BSTR((IADsUser *)this, OtherName);
  254. }
  255. STDMETHODIMP
  256. CWinNTUser::Groups(THIS_ IADsMembers FAR* FAR* ppGroups)
  257. {
  258. HRESULT hr;
  259. WCHAR szHostServerName[MAX_PATH];
  260. //
  261. // objects associated with invalid SIDs have neither a
  262. // corresponding server nor domain
  263. //
  264. if ((!_DomainName) && (!_ServerName)) {
  265. BAIL_ON_FAILURE(hr = E_ADS_INVALID_USER_OBJECT);
  266. }
  267. if (_ParentType == WINNT_DOMAIN_ID) {
  268. hr = WinNTGetCachedDCName(
  269. _DomainName,
  270. szHostServerName,
  271. _Credentials.GetFlags()
  272. );
  273. BAIL_ON_FAILURE(hr);
  274. }
  275. hr = CWinNTUserGroupsCollection::CreateUserGroupsCollection(
  276. _ParentType,
  277. _Parent,
  278. _DomainName,
  279. _ParentType == WINNT_DOMAIN_ID ?
  280. (szHostServerName + 2) :
  281. _ServerName,
  282. _Name,
  283. IID_IADsMembers,
  284. _Credentials,
  285. (void **)ppGroups
  286. );
  287. error:
  288. RRETURN_EXP_IF_ERR(hr);
  289. }