#ifndef _CUPS_SSPI_PRIVATE_H_
# define _CUPS_SSPI_PRIVATE_H_
# include <config.h>
# include <winsock2.h>
# include <ws2tcpip.h>
# include <wincrypt.h>
# include <wintrust.h>
# include <schannel.h>
# define SECURITY_WIN32
# include <security.h>
# include <sspi.h>
# ifdef __cplusplus
extern "C" {
# endif
typedef struct
{
SOCKET sock;
CredHandle creds;
CtxtHandle context;
BOOL contextInitialized;
SecPkgContext_StreamSizes streamSizes;
BYTE *decryptBuffer;
size_t decryptBufferLength;
size_t decryptBufferUsed;
BYTE *readBuffer;
size_t readBufferLength;
size_t readBufferUsed;
DWORD certFlags;
} _sspi_struct_t;
_sspi_struct_t *_sspiAlloc(void);
BOOL _sspiAccept(_sspi_struct_t *conn);
BOOL _sspiConnect(_sspi_struct_t *conn,
const CHAR *hostname);
void _sspiFree(_sspi_struct_t *conn);
BOOL _sspiGetCredentials(_sspi_struct_t *conn,
const LPWSTR containerName,
const TCHAR *commonName,
BOOL server);
int _sspiPending(_sspi_struct_t *conn);
int _sspiRead(_sspi_struct_t *conn,
void *buf, size_t len);
void _sspiSetAllowsAnyRoot(_sspi_struct_t *conn,
BOOL allow);
void _sspiSetAllowsExpiredCerts(_sspi_struct_t *conn,
BOOL allow);
int _sspiWrite(_sspi_struct_t *conn,
void *buf, size_t len);
# ifdef __cplusplus
}
# endif
#endif