public static unsafe extern int LsaCallAuthenticationPackage(
     LsaSafeHandle LsaHandle,
     int AuthenticationPackage,
     void *ProtocolSubmitBuffer,
     int SubmitBufferLength,
     out LsaBufferSafeHandle ProtocolReturnBuffer,
     out int ReturnBufferLength,
     out int ProtocolStatus
     );
        /// <summary>
        /// Call Auth package to cache given Kerberos ticket.
        /// </summary>
        /// <param name="pBuffer">Pointer to Kerberos Ticket to cache.</param>
        /// <param name="bufferSize">Length of Kerberos Ticket data.</param>

        private unsafe void LsaCallAuthenticationPackage(void *pBuffer, int bufferSize)
        {
            LsaBufferSafeHandle returnBuffer = null;

            try
            {
                var result = NativeMethods.LsaCallAuthenticationPackage(
                    _lsaHandle,
                    _selectedAuthPackage,
                    pBuffer,
                    bufferSize,
                    out returnBuffer,
                    out int returnBufferLength,
                    out int protocolStatus
                    );

                NativeMethods.LsaThrowIfError(result);
                NativeMethods.LsaThrowIfError(protocolStatus);
            }
            finally
            {
                returnBuffer?.Dispose();
            }
        }