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.

107 lines
3.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright(C) 2000 Microsoft Corporation all rights reserved.
  4. //
  5. // Module: ProfileAttributeList.cpp
  6. //
  7. // Project: Windows 2000 IAS
  8. //
  9. // Description:
  10. // Implementation of the CProfileAttributeList class
  11. //
  12. // Author: tperraut
  13. //
  14. // Revision 03/15/2000 created
  15. //
  16. /////////////////////////////////////////////////////////////////////////////
  17. #include "stdafx.h"
  18. #include "ProfileAttributeList.h"
  19. #include "RADIUSAttributes.h"
  20. CProfileAttributeList::CProfileAttributeList(CSession& Session)
  21. :m_Session(Session)
  22. {
  23. Init(Session);
  24. }
  25. //////////////////////////////////////////////////////////////////////////
  26. // GetAttribute
  27. //////////////////////////////////////////////////////////////////////////
  28. HRESULT CProfileAttributeList::GetAttribute(
  29. const _bstr_t& ProfileName,
  30. _bstr_t& Attribute,
  31. LONG& AttributeNumber,
  32. _bstr_t& AttributeValueName,
  33. _bstr_t& StringValue,
  34. LONG& Order
  35. )
  36. {
  37. lstrcpynW(m_ProfileParam, ProfileName, COLUMN_SIZE);
  38. HRESULT hr = BaseExecute();
  39. if ( SUCCEEDED(hr) )
  40. {
  41. // set the out params
  42. Order = m_Order;
  43. AttributeValueName = m_AttributeValueName;
  44. Attribute = m_Attribute;
  45. CRADIUSAttributes RadiusAttributes(m_Session);
  46. AttributeNumber = RadiusAttributes.GetAttributeNumber(Attribute);
  47. // special case because the integers in NT4 are stored (sometimes)
  48. // with a blanc space before the value.
  49. if ( !wcsncmp(m_StringValue , L" ", 1) )
  50. {
  51. WCHAR* TempString = m_StringValue + 1;
  52. StringValue = TempString;
  53. }
  54. else
  55. {
  56. StringValue = m_StringValue;
  57. }
  58. }
  59. return hr;
  60. }
  61. //////////////////////////////////////////////////////////////////////////
  62. // GetAttribute overloaded
  63. //////////////////////////////////////////////////////////////////////////
  64. HRESULT CProfileAttributeList::GetAttribute(
  65. const _bstr_t ProfileName,
  66. _bstr_t& Attribute,
  67. LONG& AttributeNumber,
  68. _bstr_t& AttributeValueName,
  69. _bstr_t& StringValue,
  70. LONG& Order,
  71. LONG Index
  72. ) throw()
  73. {
  74. lstrcpynW(m_ProfileParam, ProfileName, COLUMN_SIZE);
  75. HRESULT hr = BaseExecute(Index);
  76. if ( SUCCEEDED(hr) )
  77. {
  78. // set the out params
  79. Order = m_Order;
  80. AttributeValueName = m_AttributeValueName;
  81. Attribute = m_Attribute;
  82. CRADIUSAttributes RadiusAttributes(m_Session);
  83. AttributeNumber = RadiusAttributes.GetAttributeNumber(Attribute);
  84. // special case because the integers in NT4 are stored (sometimes)
  85. // with a blanc space before the value.
  86. if ( !wcsncmp(m_StringValue , L" ", 1) )
  87. {
  88. WCHAR* TempString = m_StringValue + 1;
  89. StringValue = TempString;
  90. }
  91. else
  92. {
  93. StringValue = m_StringValue;
  94. }
  95. }
  96. return hr;
  97. }