https://bugs.winehq.org/show_bug.cgi?id=51049
--- Comment #3 from Hans Leidekker hans@meelstraat.net --- (In reply to Alistair Leslie-Hughes from comment #2)
Created attachment 69916 [details] +secur32 log without staging fix
AS you can see in the log 0x00007f8f765227b0 schan_InitializeSecurityContextW+0x560 [Z:\home\alesliehughes\source\wine-alesliehughes\dlls\secur32\schannel.c: 926] in secur32: cmpq $d,0x0000000000000070(%rax) 926 else if (!is_dtls_context(ctx)) return SEC_E_INCOMPLETE_MESSAGE;
This is the point of failure since in this case ctx is NULL. (The handle has been freed).
Limiting the log to thread 05e4, shows that the InitializeSecurityContextW is called multiple times with the same handle, including after a DeleteSecurityContext.
It deletes the context after the second call to InitializeSecurityContext, which correctly fails because a NULL input buffer is passed. It then calls InitializeSecurityContext a third time with the freed context, which might be the result of poor error handling.
So the question is why a NULL input buffer is passed in the second call. It should hold the response from the server to the token produced with the first call.