winpr/sspi: fixed test TestInitializeSecurityContext

This commit is contained in:
Bernhard Miklautz 2013-03-15 21:47:24 +01:00
parent e4aef1b07f
commit 1519152709
2 changed files with 8 additions and 0 deletions

View File

@ -98,6 +98,9 @@ size_t _wcslen(const WCHAR* str)
{
WCHAR* p = (WCHAR*) str;
if (!p)
return 0;
while (*p)
p++;

View File

@ -63,6 +63,11 @@ void ntlm_SetContextWorkstation(NTLM_CONTEXT* context, char* Workstation)
void ntlm_SetContextServicePrincipalNameW(NTLM_CONTEXT* context, LPWSTR ServicePrincipalName)
{
context->ServicePrincipalName.Length = _wcslen(ServicePrincipalName) * 2;
if (!ServicePrincipalName)
{
context->ServicePrincipalName.Buffer = NULL;
return;
}
context->ServicePrincipalName.Buffer = (PWSTR) malloc(context->ServicePrincipalName.Length + 2);
CopyMemory(context->ServicePrincipalName.Buffer, ServicePrincipalName, context->ServicePrincipalName.Length + 2);
}