internal unsafe uint SniSecGenClientContext(byte[]?inBuff, uint receivedLength, byte[] outBuff, ref uint sendLength) { fixed(byte *pinServerUserName = &_sniSpnBuffer[0]) { return(SniNativeMethodWrapper.SNISecGenClientContextWrapper(_sniNativeHandle, inBuff, receivedLength, outBuff, ref sendLength, out _, pinServerUserName, (uint)_sniSpnBuffer.Length, null, null)); } }
static SspiNative() { // use local for ref param to defer setting s_maxSSPILength until we know the call succeeded. uint maxLength = 0; if (0 != SniNativeMethodWrapper.SNISecInitPackage(ref maxLength)) { throw new Exception("Cannot load sspi"); } _sMaxSspiLength = maxLength; if (_sMaxSspiLength > int.MaxValue) { throw SQL.InvalidSspiPacketSize(); // SqlBu 332503 } }