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.

47 lines
914 B

  1. /*
  2. * Lsa.c
  3. *
  4. * Author: BreenH
  5. *
  6. * LSA utilities.
  7. */
  8. /*
  9. * Includes
  10. */
  11. #include "precomp.h"
  12. /*
  13. * Function Implementations
  14. */
  15. VOID NTAPI
  16. InitLsaString(
  17. PLSA_UNICODE_STRING pLsaString,
  18. PCWSTR pString
  19. )
  20. {
  21. ULONG cchString;
  22. //
  23. // Unicode strings do not require NULL terminators. Length should relay
  24. // the number of bytes in the string, with MaximumLength set to the
  25. // number of bytes in the entire buffer.
  26. //
  27. if (pString != NULL)
  28. {
  29. cchString = lstrlenW(pString);
  30. pLsaString->Buffer = (PWSTR)pString;
  31. pLsaString->Length = (USHORT)(cchString * sizeof(WCHAR));
  32. pLsaString->MaximumLength = (USHORT)((cchString + 1) * sizeof(WCHAR));
  33. }
  34. else
  35. {
  36. pLsaString->Buffer = (PWSTR)NULL;
  37. pLsaString->Length = 0;
  38. pLsaString->MaximumLength = 0;
  39. }
  40. }