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.

54 lines
1.3 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // UserSchema.cpp
  8. //
  9. // SYNOPSIS
  10. //
  11. // Defines the various attribute injection functions.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 04/20/1998 Original version.
  16. // 05/01/1998 InjectorProc takes an ATTRIBUTEPOSITION array.
  17. // 08/20/1998 Remove InjectAllowDialin.
  18. //
  19. ///////////////////////////////////////////////////////////////////////////////
  20. #include <ias.h>
  21. #include <iastlutl.h>
  22. #include <userschema.h>
  23. using _com_util::CheckError;
  24. VOID
  25. WINAPI
  26. OverwriteAttribute(
  27. IAttributesRaw* dst,
  28. PATTRIBUTEPOSITION first,
  29. PATTRIBUTEPOSITION last
  30. )
  31. {
  32. // Note: we assume that all the attributes are of the same type.
  33. // Remove any existing attributes with the same ID.
  34. CheckError(dst->RemoveAttributesByType(1, &(first->pAttribute->dwId)));
  35. // Add the new attributes.
  36. CheckError(dst->AddAttributes((DWORD)(last - first), first));
  37. }
  38. VOID
  39. WINAPI
  40. AppendAttribute(
  41. IAttributesRaw* dst,
  42. PATTRIBUTEPOSITION first,
  43. PATTRIBUTEPOSITION last
  44. )
  45. {
  46. // Add the new attribute.
  47. CheckError(dst->AddAttributes((DWORD)(last - first), first));
  48. }