secur32: Don't allocate context handle in wrapper InitializeSecurityContextA/W if it is the same as the handle passed into the function.

This commit is contained in:
Rob Shearman 2009-12-29 19:06:43 +00:00 committed by Alexandre Julliard
parent 1346834605
commit 697955c922

View file

@ -283,7 +283,8 @@ SECURITY_STATUS WINAPI InitializeSecurityContextA(
cred, ctxt, pszTargetName, fContextReq,
Reserved1, TargetDataRep, pInput, Reserved2, phNewContext ? &myCtxt : NULL,
pOutput, pfContextAttr, ptsExpiry);
if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && phNewContext)
if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) &&
phNewContext && phNewContext != phContext)
{
SECURITY_STATUS ret2;
ret2 = SECUR32_makeSecHandle(phNewContext, package, &myCtxt);
@ -346,7 +347,8 @@ SECURITY_STATUS WINAPI InitializeSecurityContextW(
cred, ctxt, pszTargetName, fContextReq,
Reserved1, TargetDataRep, pInput, Reserved2, phNewContext ? &myCtxt : NULL,
pOutput, pfContextAttr, ptsExpiry);
if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && phNewContext)
if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) &&
phNewContext && phNewContext != phContext)
{
SECURITY_STATUS ret2;
ret2 = SECUR32_makeSecHandle(phNewContext, package, &myCtxt);