windows-nt/Source/XPSP1/NT/termsrv/tsutil/lsa.c

48 lines
867 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
/*
* Lsa.c
*
* Author: BreenH
*
* LSA utilities.
*/
/*
* Includes
*/
#include "precomp.h"
/*
* Function Implementations
*/
VOID NTAPI
InitLsaString(
PLSA_UNICODE_STRING pLsaString,
PCWSTR pString
)
{
ULONG cchString;
//
// Unicode strings do not require NULL terminators. Length should relay
// the number of bytes in the string, with MaximumLength set to the
// number of bytes in the entire buffer.
//
if (pString != NULL)
{
cchString = lstrlenW(pString);
pLsaString->Buffer = (PWSTR)pString;
pLsaString->Length = (USHORT)(cchString * sizeof(WCHAR));
pLsaString->MaximumLength = (USHORT)((cchString + 1) * sizeof(WCHAR));
}
else
{
pLsaString->Buffer = (PWSTR)NULL;
pLsaString->Length = 0;
pLsaString->MaximumLength = 0;
}
}