The ApplyControlToken function provides a way to apply a control token to a security context. A token can be received when the security context is being established (InitializeSecurityContext), or with a per-message security service (verify, unseal).
This function allows additional or replacement tokens to be applied to a context.
SECURITY_STATUS ApplyControlToken(
PCtxtHandle phContext, // handle of the context to modify
PSecBufferDesc pInput // input token to apply
);
If the function succeeds, the return value is SEC_E_OK.
If the function fails, the return value is a nonzero error code.
The ApplyControlToken function may modify the context based on this token.
ImpersonateSecurityContext, SecBufferDesc