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.

154 lines
2.9 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. //
  4. // Microsoft Windows
  5. // Copyright (C) Microsoft Corporation, 1992 - 1995
  6. //
  7. // File: cdssch.cxx
  8. //
  9. // Contents: Microsoft ADs LDAP Provider Generic Object
  10. //
  11. //
  12. // History: 03-02-97 ShankSh Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "ldap.hxx"
  16. #pragma hdrstop
  17. HRESULT
  18. CLDAPGenObject::EnumAttributes(
  19. LPWSTR * ppszAttrNames,
  20. DWORD dwNumAttributes,
  21. PADS_ATTR_DEF * ppAttrDefinition,
  22. DWORD * pdwNumAttributes
  23. )
  24. {
  25. HRESULT hr = S_OK;
  26. hr = ADsEnumAttributes(
  27. _pszLDAPServer,
  28. _pszLDAPDn,
  29. _Credentials,
  30. _dwPort,
  31. ppszAttrNames,
  32. dwNumAttributes,
  33. ppAttrDefinition,
  34. pdwNumAttributes
  35. );
  36. RRETURN(hr);
  37. }
  38. HRESULT
  39. CLDAPGenObject::CreateAttributeDefinition(
  40. LPWSTR pszAttributeName,
  41. PADS_ATTR_DEF pAttributeDefinition
  42. )
  43. {
  44. HRESULT hr = S_OK;
  45. hr = ADsCreateAttributeDefinition(
  46. pszAttributeName,
  47. pAttributeDefinition
  48. );
  49. RRETURN(hr);
  50. }
  51. HRESULT
  52. CLDAPGenObject::WriteAttributeDefinition(
  53. LPWSTR pszAttributeName,
  54. PADS_ATTR_DEF pAttributeDefinition
  55. )
  56. {
  57. HRESULT hr = S_OK;
  58. hr = ADsWriteAttributeDefinition(
  59. pszAttributeName,
  60. pAttributeDefinition
  61. );
  62. RRETURN(hr);
  63. }
  64. HRESULT
  65. CLDAPGenObject::DeleteAttributeDefinition(
  66. LPWSTR pszAttributeName
  67. )
  68. {
  69. HRESULT hr = S_OK;
  70. hr = ADsDeleteAttributeDefinition(
  71. pszAttributeName
  72. );
  73. RRETURN(hr);
  74. }
  75. HRESULT
  76. CLDAPGenObject::EnumClasses(
  77. LPWSTR * ppszClassNames,
  78. DWORD dwNumClasses,
  79. PADS_CLASS_DEF * ppClassDefinition,
  80. DWORD * pdwNumClasses
  81. )
  82. {
  83. HRESULT hr = S_OK;
  84. hr = ADsEnumClasses(
  85. ppszClassNames,
  86. dwNumClasses,
  87. ppClassDefinition,
  88. pdwNumClasses
  89. );
  90. RRETURN(hr);
  91. }
  92. HRESULT
  93. CLDAPGenObject::CreateClassDefinition(
  94. LPWSTR pszClassName,
  95. PADS_CLASS_DEF pClassDefinition
  96. )
  97. {
  98. HRESULT hr = S_OK;
  99. hr = ADsCreateClassDefinition(
  100. pszClassName,
  101. pClassDefinition
  102. );
  103. RRETURN(hr);
  104. }
  105. HRESULT
  106. CLDAPGenObject::WriteClassDefinition(
  107. LPWSTR pszClassName,
  108. PADS_CLASS_DEF pClassDefinition
  109. )
  110. {
  111. HRESULT hr = S_OK;
  112. hr = ADsWriteClassDefinition(
  113. pszClassName,
  114. pClassDefinition
  115. );
  116. RRETURN(hr);
  117. }
  118. HRESULT
  119. CLDAPGenObject::DeleteClassDefinition(
  120. LPWSTR pszClassName
  121. )
  122. {
  123. HRESULT hr = S_OK;
  124. hr = ADsDeleteClassDefinition(
  125. pszClassName
  126. );
  127. RRETURN(hr);
  128. }