On Thu, 2018-02-01 at 11:52 +0800, Dmitry Timoshkov wrote:
Partially based on Hans Leidekker's work.
v2: switch order of context vs. credentials initialization initialize context also in case of SEC_I_CONTINUE_NEEDED v3: actually switch order of context vs. credentials initialization
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
dlls/secur32/lsa.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-)
diff --git a/dlls/secur32/lsa.c b/dlls/secur32/lsa.c index 1916aa4b3a..ce4fb62a9d 100644 --- a/dlls/secur32/lsa.c +++ b/dlls/secur32/lsa.c @@ -396,6 +396,76 @@ static SECURITY_STATUS WINAPI lsa_FreeCredentialsHandle(CredHandle *credential) return lsa_package->lsa_api->FreeCredentialsHandle(lsa_credential); } +static SECURITY_STATUS WINAPI lsa_InitializeSecurityContextW( + CredHandle *credential, CtxtHandle *context, SEC_WCHAR *target_name, ULONG context_req, + ULONG reserved1, ULONG target_data_rep, SecBufferDesc *input, ULONG reserved2, + CtxtHandle *new_context, SecBufferDesc *output, ULONG *context_attr, TimeStamp *ts_expiry) +{ + SECURITY_STATUS status; + struct lsa_package *lsa_package = NULL; + LSA_SEC_HANDLE lsa_credential = 0, lsa_context = 0, new_lsa_context; + UNICODE_STRING target_name_us; + BOOLEAN mapped_context; + + TRACE("%p %p %s %#x %d %d %p %d %p %p %p %p\n", credential, context, + debugstr_w(target_name), context_req, reserved1, target_data_rep, input, + reserved2, new_context, output, context_attr, ts_expiry); + + if (context) + { + lsa_package = (struct lsa_package *)credential->dwUpper; + lsa_context = (LSA_SEC_HANDLE)context->dwLower; + } + else if (credential) + { + lsa_package = (struct lsa_package *)context->dwUpper; + lsa_credential = (LSA_SEC_HANDLE)credential->dwLower; + }
It's still mixed up.