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.

67 lines
1.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright(C) 1997-1998 Microsoft Corporation all rights reserved.
  4. //
  5. // Module: sdouser.cpp
  6. //
  7. // Project: Everest
  8. //
  9. // Description: IAS Server Data Object - User Object Implementation
  10. //
  11. // Author: TLP 1/23/98
  12. //
  13. /////////////////////////////////////////////////////////////////////////////
  14. #include "stdafx.h"
  15. #include "sdouser.h"
  16. //////////////////////////////////////////////////////////////////////////////
  17. HRESULT CSdoUser::FinalInitialize(
  18. /*[in]*/ bool fInitNew,
  19. /*[in]*/ ISdoMachine* pAttachedMachine
  20. )
  21. {
  22. // Should always have a data store object associated with a user
  23. //
  24. _ASSERT( ! fInitNew );
  25. // Load the persistent User object properties (including the name)
  26. //
  27. HRESULT hr = LoadProperties();
  28. // Don't allow the client application to modify or persist the user name
  29. //
  30. PropertyMapIterator p = m_PropertyMap.find(PROPERTY_SDO_NAME);
  31. _ASSERT( p != m_PropertyMap.end() );
  32. DWORD dwFlags = ((*p).second)->GetFlags();
  33. dwFlags |= (SDO_PROPERTY_NO_PERSIST | SDO_PROPERTY_READ_ONLY);
  34. ((*p).second)->SetFlags(dwFlags);
  35. return hr;
  36. }
  37. //////////////////////////////////////////////////////////////////////////////
  38. STDMETHODIMP CSdoUser::Apply()
  39. {
  40. if (m_pDSObject)
  41. {
  42. m_pDSObject->Restore();
  43. }
  44. return CSdo::Apply();
  45. }
  46. /////////////////////////////////////////////////////////////////////////////
  47. HRESULT CSdoUser::ValidateProperty(
  48. /*[in]*/ PSDOPROPERTY pProperty,
  49. /*[in]*/ VARIANT* pValue
  50. )
  51. {
  52. if ( VT_EMPTY == V_VT(pValue) )
  53. return S_OK;
  54. else
  55. return pProperty->Validate(pValue);
  56. }