dblock/waffle — pull request #128 by kentcb (2014-08-04 04:51:52+00:00)
Title: Further amendment to #114

Alas, I was correct in saying I had seen `SEC_E_BUFFER_TOO_SMALL` being returned by `InitializeSecurityContext`. Here is a stack trace from my user:
```
System.ComponentModel.Win32Exception: The buffers supplied to a function was too small
at Waffle.Windows.AuthProvider.WindowsSecurityContext.Initialize(SecHandle credentials, String targetName, Int32 fContextReq, Int32 targetDataRep, SecHandle context, SecBufferDesc continueTokenBuffer)
at Waffle.Windows.AuthProvider.WindowsSecurityContext.Initialize(SecHandle credentials, String targetName, Int32 fContextReq, Int32 targetDataRep)
at Waffle.Windows.AuthProvider.WindowsSecurityContext..ctor(String targetName, WindowsCredentialsHandle credentials, String securityPackage, Int32 fContextReq, Int32 targetDataRep)
at Waffle.Windows.AuthProvider.WindowsSecurityContext.GetCurrent(String package, String targetName, Int32 fContextReq, Int32 targetDataRep)
```
Thus, I have re-added the code that treats `SEC_E_BUFFER_TOO_SMALL` the same as `SEC_E_INSUFFICIENT_MEMORY`. I realize MSDN does not indicate this error is possible from that function, but it certainly is. I have already tested the above change for my user, and all is good.

It would probably be good for someone to update the Java code too...?