Blame winpr/include/winpr/sspi.h

Packit Service fa4841
/**
Packit Service fa4841
 * WinPR: Windows Portable Runtime
Packit Service fa4841
 * Security Support Provider Interface (SSPI)
Packit Service fa4841
 *
Packit Service fa4841
 * Copyright 2012-2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit Service fa4841
 *
Packit Service fa4841
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit Service fa4841
 * you may not use this file except in compliance with the License.
Packit Service fa4841
 * You may obtain a copy of the License at
Packit Service fa4841
 *
Packit Service fa4841
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit Service fa4841
 *
Packit Service fa4841
 * Unless required by applicable law or agreed to in writing, software
Packit Service fa4841
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit Service fa4841
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit Service fa4841
 * See the License for the specific language governing permissions and
Packit Service fa4841
 * limitations under the License.
Packit Service fa4841
 */
Packit Service fa4841
Packit Service fa4841
#ifndef WINPR_SSPI_H
Packit Service fa4841
#define WINPR_SSPI_H
Packit Service fa4841
Packit Service fa4841
#include <winpr/winpr.h>
Packit Service fa4841
#include <winpr/wtypes.h>
Packit Service fa4841
#include <winpr/windows.h>
Packit Service fa4841
#include <winpr/security.h>
Packit Service fa4841
Packit Service fa4841
#ifdef _WIN32
Packit Service fa4841
Packit Service fa4841
#include <tchar.h>
Packit Service fa4841
#include <winerror.h>
Packit Service fa4841
Packit Service fa4841
#define SECURITY_WIN32
Packit Service fa4841
#include <sspi.h>
Packit Service fa4841
#include <security.h>
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if !defined(_WIN32) || defined(_UWP)
Packit Service fa4841
Packit Service fa4841
#ifndef SEC_ENTRY
Packit Service fa4841
#define SEC_ENTRY
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef CHAR SEC_CHAR;
Packit Service fa4841
typedef WCHAR SEC_WCHAR;
Packit Service fa4841
Packit Service fa4841
struct _SECURITY_INTEGER
Packit Service fa4841
{
Packit Service fa4841
	UINT32 LowPart;
Packit Service fa4841
	INT32 HighPart;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SECURITY_INTEGER SECURITY_INTEGER;
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_INTEGER TimeStamp;
Packit Service fa4841
typedef SECURITY_INTEGER* PTimeStamp;
Packit Service fa4841
Packit Service fa4841
#ifndef __SECSTATUS_DEFINED__
Packit Service fa4841
typedef LONG SECURITY_STATUS;
Packit Service fa4841
#define __SECSTATUS_DEFINED__
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
struct _SecPkgInfoA
Packit Service fa4841
{
Packit Service fa4841
	UINT32 fCapabilities;
Packit Service fa4841
	UINT16 wVersion;
Packit Service fa4841
	UINT16 wRPCID;
Packit Service fa4841
	UINT32 cbMaxToken;
Packit Service fa4841
	SEC_CHAR* Name;
Packit Service fa4841
	SEC_CHAR* Comment;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgInfoA SecPkgInfoA;
Packit Service fa4841
typedef SecPkgInfoA* PSecPkgInfoA;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgInfoW
Packit Service fa4841
{
Packit Service fa4841
	UINT32 fCapabilities;
Packit Service fa4841
	UINT16 wVersion;
Packit Service fa4841
	UINT16 wRPCID;
Packit Service fa4841
	UINT32 cbMaxToken;
Packit Service fa4841
	SEC_WCHAR* Name;
Packit Service fa4841
	SEC_WCHAR* Comment;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgInfoW SecPkgInfoW;
Packit Service fa4841
typedef SecPkgInfoW* PSecPkgInfoW;
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define SecPkgInfo SecPkgInfoW
Packit Service fa4841
#define PSecPkgInfo PSecPkgInfoW
Packit Service fa4841
#else
Packit Service fa4841
#define SecPkgInfo SecPkgInfoA
Packit Service fa4841
#define PSecPkgInfo PSecPkgInfoA
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#define NTLM_SSP_NAME _T("NTLM")
Packit Service fa4841
#define KERBEROS_SSP_NAME _T("Kerberos")
Packit Service fa4841
#define NEGO_SSP_NAME _T("Negotiate")
Packit Service fa4841
Packit Service fa4841
#define SECPKG_ID_NONE 0xFFFF
Packit Service fa4841
Packit Service fa4841
#define SECPKG_FLAG_INTEGRITY 0x00000001
Packit Service fa4841
#define SECPKG_FLAG_PRIVACY 0x00000002
Packit Service fa4841
#define SECPKG_FLAG_TOKEN_ONLY 0x00000004
Packit Service fa4841
#define SECPKG_FLAG_DATAGRAM 0x00000008
Packit Service fa4841
#define SECPKG_FLAG_CONNECTION 0x00000010
Packit Service fa4841
#define SECPKG_FLAG_MULTI_REQUIRED 0x00000020
Packit Service fa4841
#define SECPKG_FLAG_CLIENT_ONLY 0x00000040
Packit Service fa4841
#define SECPKG_FLAG_EXTENDED_ERROR 0x00000080
Packit Service fa4841
#define SECPKG_FLAG_IMPERSONATION 0x00000100
Packit Service fa4841
#define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200
Packit Service fa4841
#define SECPKG_FLAG_STREAM 0x00000400
Packit Service fa4841
#define SECPKG_FLAG_NEGOTIABLE 0x00000800
Packit Service fa4841
#define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000
Packit Service fa4841
#define SECPKG_FLAG_LOGON 0x00002000
Packit Service fa4841
#define SECPKG_FLAG_ASCII_BUFFERS 0x00004000
Packit Service fa4841
#define SECPKG_FLAG_FRAGMENT 0x00008000
Packit Service fa4841
#define SECPKG_FLAG_MUTUAL_AUTH 0x00010000
Packit Service fa4841
#define SECPKG_FLAG_DELEGATION 0x00020000
Packit Service fa4841
#define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000
Packit Service fa4841
#define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000
Packit Service fa4841
#define SECPKG_FLAG_NEGO_EXTENDER 0x00100000
Packit Service fa4841
#define SECPKG_FLAG_NEGOTIABLE2 0x00200000
Packit Service fa4841
Packit Service fa4841
#ifndef _WINERROR_
Packit Service fa4841
Packit Service fa4841
#define SEC_E_OK (SECURITY_STATUS)0x00000000L
Packit Service fa4841
#define SEC_E_INSUFFICIENT_MEMORY (SECURITY_STATUS)0x80090300L
Packit Service fa4841
#define SEC_E_INVALID_HANDLE (SECURITY_STATUS)0x80090301L
Packit Service fa4841
#define SEC_E_UNSUPPORTED_FUNCTION (SECURITY_STATUS)0x80090302L
Packit Service fa4841
#define SEC_E_TARGET_UNKNOWN (SECURITY_STATUS)0x80090303L
Packit Service fa4841
#define SEC_E_INTERNAL_ERROR (SECURITY_STATUS)0x80090304L
Packit Service fa4841
#define SEC_E_SECPKG_NOT_FOUND (SECURITY_STATUS)0x80090305L
Packit Service fa4841
#define SEC_E_NOT_OWNER (SECURITY_STATUS)0x80090306L
Packit Service fa4841
#define SEC_E_CANNOT_INSTALL (SECURITY_STATUS)0x80090307L
Packit Service fa4841
#define SEC_E_INVALID_TOKEN (SECURITY_STATUS)0x80090308L
Packit Service fa4841
#define SEC_E_CANNOT_PACK (SECURITY_STATUS)0x80090309L
Packit Service fa4841
#define SEC_E_QOP_NOT_SUPPORTED (SECURITY_STATUS)0x8009030AL
Packit Service fa4841
#define SEC_E_NO_IMPERSONATION (SECURITY_STATUS)0x8009030BL
Packit Service fa4841
#define SEC_E_LOGON_DENIED (SECURITY_STATUS)0x8009030CL
Packit Service fa4841
#define SEC_E_UNKNOWN_CREDENTIALS (SECURITY_STATUS)0x8009030DL
Packit Service fa4841
#define SEC_E_NO_CREDENTIALS (SECURITY_STATUS)0x8009030EL
Packit Service fa4841
#define SEC_E_MESSAGE_ALTERED (SECURITY_STATUS)0x8009030FL
Packit Service fa4841
#define SEC_E_OUT_OF_SEQUENCE (SECURITY_STATUS)0x80090310L
Packit Service fa4841
#define SEC_E_NO_AUTHENTICATING_AUTHORITY (SECURITY_STATUS)0x80090311L
Packit Service fa4841
#define SEC_E_BAD_PKGID (SECURITY_STATUS)0x80090316L
Packit Service fa4841
#define SEC_E_CONTEXT_EXPIRED (SECURITY_STATUS)0x80090317L
Packit Service fa4841
#define SEC_E_INCOMPLETE_MESSAGE (SECURITY_STATUS)0x80090318L
Packit Service fa4841
#define SEC_E_INCOMPLETE_CREDENTIALS (SECURITY_STATUS)0x80090320L
Packit Service fa4841
#define SEC_E_BUFFER_TOO_SMALL (SECURITY_STATUS)0x80090321L
Packit Service fa4841
#define SEC_E_WRONG_PRINCIPAL (SECURITY_STATUS)0x80090322L
Packit Service fa4841
#define SEC_E_TIME_SKEW (SECURITY_STATUS)0x80090324L
Packit Service fa4841
#define SEC_E_UNTRUSTED_ROOT (SECURITY_STATUS)0x80090325L
Packit Service fa4841
#define SEC_E_ILLEGAL_MESSAGE (SECURITY_STATUS)0x80090326L
Packit Service fa4841
#define SEC_E_CERT_UNKNOWN (SECURITY_STATUS)0x80090327L
Packit Service fa4841
#define SEC_E_CERT_EXPIRED (SECURITY_STATUS)0x80090328L
Packit Service fa4841
#define SEC_E_ENCRYPT_FAILURE (SECURITY_STATUS)0x80090329L
Packit Service fa4841
#define SEC_E_DECRYPT_FAILURE (SECURITY_STATUS)0x80090330L
Packit Service fa4841
#define SEC_E_ALGORITHM_MISMATCH (SECURITY_STATUS)0x80090331L
Packit Service fa4841
#define SEC_E_SECURITY_QOS_FAILED (SECURITY_STATUS)0x80090332L
Packit Service fa4841
#define SEC_E_UNFINISHED_CONTEXT_DELETED (SECURITY_STATUS)0x80090333L
Packit Service fa4841
#define SEC_E_NO_TGT_REPLY (SECURITY_STATUS)0x80090334L
Packit Service fa4841
#define SEC_E_NO_IP_ADDRESSES (SECURITY_STATUS)0x80090335L
Packit Service fa4841
#define SEC_E_WRONG_CREDENTIAL_HANDLE (SECURITY_STATUS)0x80090336L
Packit Service fa4841
#define SEC_E_CRYPTO_SYSTEM_INVALID (SECURITY_STATUS)0x80090337L
Packit Service fa4841
#define SEC_E_MAX_REFERRALS_EXCEEDED (SECURITY_STATUS)0x80090338L
Packit Service fa4841
#define SEC_E_MUST_BE_KDC (SECURITY_STATUS)0x80090339L
Packit Service fa4841
#define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED (SECURITY_STATUS)0x8009033AL
Packit Service fa4841
#define SEC_E_TOO_MANY_PRINCIPALS (SECURITY_STATUS)0x8009033BL
Packit Service fa4841
#define SEC_E_NO_PA_DATA (SECURITY_STATUS)0x8009033CL
Packit Service fa4841
#define SEC_E_PKINIT_NAME_MISMATCH (SECURITY_STATUS)0x8009033DL
Packit Service fa4841
#define SEC_E_SMARTCARD_LOGON_REQUIRED (SECURITY_STATUS)0x8009033EL
Packit Service fa4841
#define SEC_E_SHUTDOWN_IN_PROGRESS (SECURITY_STATUS)0x8009033FL
Packit Service fa4841
#define SEC_E_KDC_INVALID_REQUEST (SECURITY_STATUS)0x80090340L
Packit Service fa4841
#define SEC_E_KDC_UNABLE_TO_REFER (SECURITY_STATUS)0x80090341L
Packit Service fa4841
#define SEC_E_KDC_UNKNOWN_ETYPE (SECURITY_STATUS)0x80090342L
Packit Service fa4841
#define SEC_E_UNSUPPORTED_PREAUTH (SECURITY_STATUS)0x80090343L
Packit Service fa4841
#define SEC_E_DELEGATION_REQUIRED (SECURITY_STATUS)0x80090345L
Packit Service fa4841
#define SEC_E_BAD_BINDINGS (SECURITY_STATUS)0x80090346L
Packit Service fa4841
#define SEC_E_MULTIPLE_ACCOUNTS (SECURITY_STATUS)0x80090347L
Packit Service fa4841
#define SEC_E_NO_KERB_KEY (SECURITY_STATUS)0x80090348L
Packit Service fa4841
#define SEC_E_CERT_WRONG_USAGE (SECURITY_STATUS)0x80090349L
Packit Service fa4841
#define SEC_E_DOWNGRADE_DETECTED (SECURITY_STATUS)0x80090350L
Packit Service fa4841
#define SEC_E_SMARTCARD_CERT_REVOKED (SECURITY_STATUS)0x80090351L
Packit Service fa4841
#define SEC_E_ISSUING_CA_UNTRUSTED (SECURITY_STATUS)0x80090352L
Packit Service fa4841
#define SEC_E_REVOCATION_OFFLINE_C (SECURITY_STATUS)0x80090353L
Packit Service fa4841
#define SEC_E_PKINIT_CLIENT_FAILURE (SECURITY_STATUS)0x80090354L
Packit Service fa4841
#define SEC_E_SMARTCARD_CERT_EXPIRED (SECURITY_STATUS)0x80090355L
Packit Service fa4841
#define SEC_E_NO_S4U_PROT_SUPPORT (SECURITY_STATUS)0x80090356L
Packit Service fa4841
#define SEC_E_CROSSREALM_DELEGATION_FAILURE (SECURITY_STATUS)0x80090357L
Packit Service fa4841
#define SEC_E_REVOCATION_OFFLINE_KDC (SECURITY_STATUS)0x80090358L
Packit Service fa4841
#define SEC_E_ISSUING_CA_UNTRUSTED_KDC (SECURITY_STATUS)0x80090359L
Packit Service fa4841
#define SEC_E_KDC_CERT_EXPIRED (SECURITY_STATUS)0x8009035AL
Packit Service fa4841
#define SEC_E_KDC_CERT_REVOKED (SECURITY_STATUS)0x8009035BL
Packit Service fa4841
#define SEC_E_INVALID_PARAMETER (SECURITY_STATUS)0x8009035DL
Packit Service fa4841
#define SEC_E_DELEGATION_POLICY (SECURITY_STATUS)0x8009035EL
Packit Service fa4841
#define SEC_E_POLICY_NLTM_ONLY (SECURITY_STATUS)0x8009035FL
Packit Service fa4841
#define SEC_E_NO_CONTEXT (SECURITY_STATUS)0x80090361L
Packit Service fa4841
#define SEC_E_PKU2U_CERT_FAILURE (SECURITY_STATUS)0x80090362L
Packit Service fa4841
#define SEC_E_MUTUAL_AUTH_FAILED (SECURITY_STATUS)0x80090363L
Packit Service fa4841
Packit Service fa4841
#define SEC_I_CONTINUE_NEEDED (SECURITY_STATUS)0x00090312L
Packit Service fa4841
#define SEC_I_COMPLETE_NEEDED (SECURITY_STATUS)0x00090313L
Packit Service fa4841
#define SEC_I_COMPLETE_AND_CONTINUE (SECURITY_STATUS)0x00090314L
Packit Service fa4841
#define SEC_I_LOCAL_LOGON (SECURITY_STATUS)0x00090315L
Packit Service fa4841
#define SEC_I_CONTEXT_EXPIRED (SECURITY_STATUS)0x00090317L
Packit Service fa4841
#define SEC_I_INCOMPLETE_CREDENTIALS (SECURITY_STATUS)0x00090320L
Packit Service fa4841
#define SEC_I_RENEGOTIATE (SECURITY_STATUS)0x00090321L
Packit Service fa4841
#define SEC_I_NO_LSA_CONTEXT (SECURITY_STATUS)0x00090323L
Packit Service fa4841
#define SEC_I_SIGNATURE_NEEDED (SECURITY_STATUS)0x0009035CL
Packit Service fa4841
#define SEC_I_NO_RENEGOTIATION (SECURITY_STATUS)0x00090360L
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#define SECURITY_NATIVE_DREP 0x00000010
Packit Service fa4841
#define SECURITY_NETWORK_DREP 0x00000000
Packit Service fa4841
Packit Service fa4841
#define SECPKG_CRED_INBOUND 0x00000001
Packit Service fa4841
#define SECPKG_CRED_OUTBOUND 0x00000002
Packit Service fa4841
#define SECPKG_CRED_BOTH 0x00000003
Packit Service fa4841
#define SECPKG_CRED_AUTOLOGON_RESTRICTED 0x00000010
Packit Service fa4841
#define SECPKG_CRED_PROCESS_POLICY_ONLY 0x00000020
Packit Service fa4841
Packit Service fa4841
/* Security Context Attributes */
Packit Service fa4841
Packit Service fa4841
#define SECPKG_ATTR_SIZES 0
Packit Service fa4841
#define SECPKG_ATTR_NAMES 1
Packit Service fa4841
#define SECPKG_ATTR_LIFESPAN 2
Packit Service fa4841
#define SECPKG_ATTR_DCE_INFO 3
Packit Service fa4841
#define SECPKG_ATTR_STREAM_SIZES 4
Packit Service fa4841
#define SECPKG_ATTR_KEY_INFO 5
Packit Service fa4841
#define SECPKG_ATTR_AUTHORITY 6
Packit Service fa4841
#define SECPKG_ATTR_PROTO_INFO 7
Packit Service fa4841
#define SECPKG_ATTR_PASSWORD_EXPIRY 8
Packit Service fa4841
#define SECPKG_ATTR_SESSION_KEY 9
Packit Service fa4841
#define SECPKG_ATTR_PACKAGE_INFO 10
Packit Service fa4841
#define SECPKG_ATTR_USER_FLAGS 11
Packit Service fa4841
#define SECPKG_ATTR_NEGOTIATION_INFO 12
Packit Service fa4841
#define SECPKG_ATTR_NATIVE_NAMES 13
Packit Service fa4841
#define SECPKG_ATTR_FLAGS 14
Packit Service fa4841
#define SECPKG_ATTR_USE_VALIDATED 15
Packit Service fa4841
#define SECPKG_ATTR_CREDENTIAL_NAME 16
Packit Service fa4841
#define SECPKG_ATTR_TARGET_INFORMATION 17
Packit Service fa4841
#define SECPKG_ATTR_ACCESS_TOKEN 18
Packit Service fa4841
#define SECPKG_ATTR_TARGET 19
Packit Service fa4841
#define SECPKG_ATTR_AUTHENTICATION_ID 20
Packit Service fa4841
#define SECPKG_ATTR_LOGOFF_TIME 21
Packit Service fa4841
#define SECPKG_ATTR_NEGO_KEYS 22
Packit Service fa4841
#define SECPKG_ATTR_PROMPTING_NEEDED 24
Packit Service fa4841
#define SECPKG_ATTR_UNIQUE_BINDINGS 25
Packit Service fa4841
#define SECPKG_ATTR_ENDPOINT_BINDINGS 26
Packit Service fa4841
#define SECPKG_ATTR_CLIENT_SPECIFIED_TARGET 27
Packit Service fa4841
#define SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS 30
Packit Service fa4841
#define SECPKG_ATTR_NEGO_PKG_INFO 31
Packit Service fa4841
#define SECPKG_ATTR_NEGO_STATUS 32
Packit Service fa4841
#define SECPKG_ATTR_CONTEXT_DELETED 33
Packit Service fa4841
Packit Service fa4841
#if !defined(_WIN32) || defined(_UWP)
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_AccessToken
Packit Service fa4841
{
Packit Service fa4841
	void* AccessToken;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_AccessToken SecPkgContext_AccessToken;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_SessionAppData
Packit Service fa4841
{
Packit Service fa4841
	UINT32 dwFlags;
Packit Service fa4841
	UINT32 cbAppData;
Packit Service fa4841
	BYTE* pbAppData;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_SessionAppData SecPkgContext_SessionAppData;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_Authority
Packit Service fa4841
{
Packit Service fa4841
	char* sAuthorityName;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_Authority SecPkgContext_Authority;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_ClientSpecifiedTarget
Packit Service fa4841
{
Packit Service fa4841
	char* sTargetName;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_ClientSpecifiedTarget SecPkgContext_ClientSpecifiedTarget;
Packit Service fa4841
Packit Service fa4841
typedef UINT32 ALG_ID;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_ConnectionInfo
Packit Service fa4841
{
Packit Service fa4841
	UINT32 dwProtocol;
Packit Service fa4841
	ALG_ID aiCipher;
Packit Service fa4841
	UINT32 dwCipherStrength;
Packit Service fa4841
	ALG_ID aiHash;
Packit Service fa4841
	UINT32 dwHashStrength;
Packit Service fa4841
	ALG_ID aiExch;
Packit Service fa4841
	UINT32 dwExchStrength;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_ConnectionInfo SecPkgContext_ConnectionInfo;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_ClientCreds
Packit Service fa4841
{
Packit Service fa4841
	UINT32 AuthBufferLen;
Packit Service fa4841
	BYTE* AuthBuffer;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_ClientCreds SecPkgContext_ClientCreds;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContex_DceInfo
Packit Service fa4841
{
Packit Service fa4841
	UINT32 AuthzSvc;
Packit Service fa4841
	void* pPac;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContex_DceInfo SecPkgContex_DceInfo;
Packit Service fa4841
Packit Service fa4841
struct _SEC_CHANNEL_BINDINGS
Packit Service fa4841
{
Packit Service fa4841
	UINT32 dwInitiatorAddrType;
Packit Service fa4841
	UINT32 cbInitiatorLength;
Packit Service fa4841
	UINT32 dwInitiatorOffset;
Packit Service fa4841
	UINT32 dwAcceptorAddrType;
Packit Service fa4841
	UINT32 cbAcceptorLength;
Packit Service fa4841
	UINT32 dwAcceptorOffset;
Packit Service fa4841
	UINT32 cbApplicationDataLength;
Packit Service fa4841
	UINT32 dwApplicationDataOffset;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SEC_CHANNEL_BINDINGS SEC_CHANNEL_BINDINGS;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_Bindings
Packit Service fa4841
{
Packit Service fa4841
	UINT32 BindingsLength;
Packit Service fa4841
	SEC_CHANNEL_BINDINGS* Bindings;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_Bindings SecPkgContext_Bindings;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_EapKeyBlock
Packit Service fa4841
{
Packit Service fa4841
	BYTE rgbKeys[128];
Packit Service fa4841
	BYTE rgbIVs[64];
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_EapKeyBlock SecPkgContext_EapKeyBlock;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_Flags
Packit Service fa4841
{
Packit Service fa4841
	UINT32 Flags;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_Flags SecPkgContext_Flags;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_KeyInfo
Packit Service fa4841
{
Packit Service fa4841
	char* sSignatureAlgorithmName;
Packit Service fa4841
	char* sEncryptAlgorithmName;
Packit Service fa4841
	UINT32 KeySize;
Packit Service fa4841
	UINT32 SignatureAlgorithm;
Packit Service fa4841
	UINT32 EncryptAlgorithm;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_KeyInfo SecPkgContext_KeyInfo;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_Lifespan
Packit Service fa4841
{
Packit Service fa4841
	TimeStamp tsStart;
Packit Service fa4841
	TimeStamp tsExpiry;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_Lifespan SecPkgContext_Lifespan;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_Names
Packit Service fa4841
{
Packit Service fa4841
	char* sUserName;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_Names SecPkgContext_Names;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_NativeNames
Packit Service fa4841
{
Packit Service fa4841
	char* sClientName;
Packit Service fa4841
	char* sServerName;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_NativeNames SecPkgContext_NativeNames;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_NegotiationInfo
Packit Service fa4841
{
Packit Service fa4841
	SecPkgInfo* PackageInfo;
Packit Service fa4841
	UINT32 NegotiationState;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_NegotiationInfo SecPkgContext_NegotiationInfo;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_PackageInfo
Packit Service fa4841
{
Packit Service fa4841
	SecPkgInfo* PackageInfo;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_PackageInfo SecPkgContext_PackageInfo;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_PasswordExpiry
Packit Service fa4841
{
Packit Service fa4841
	TimeStamp tsPasswordExpires;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_PasswordExpiry SecPkgContext_PasswordExpiry;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_SessionKey
Packit Service fa4841
{
Packit Service fa4841
	UINT32 SessionKeyLength;
Packit Service fa4841
	BYTE* SessionKey;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_SessionKey SecPkgContext_SessionKey;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_SessionInfo
Packit Service fa4841
{
Packit Service fa4841
	UINT32 dwFlags;
Packit Service fa4841
	UINT32 cbSessionId;
Packit Service fa4841
	BYTE rgbSessionId[32];
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_SessionInfo SecPkgContext_SessionInfo;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_Sizes
Packit Service fa4841
{
Packit Service fa4841
	UINT32 cbMaxToken;
Packit Service fa4841
	UINT32 cbMaxSignature;
Packit Service fa4841
	UINT32 cbBlockSize;
Packit Service fa4841
	UINT32 cbSecurityTrailer;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_Sizes SecPkgContext_Sizes;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_StreamSizes
Packit Service fa4841
{
Packit Service fa4841
	UINT32 cbHeader;
Packit Service fa4841
	UINT32 cbTrailer;
Packit Service fa4841
	UINT32 cbMaximumMessage;
Packit Service fa4841
	UINT32 cBuffers;
Packit Service fa4841
	UINT32 cbBlockSize;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_StreamSizes SecPkgContext_StreamSizes;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_SubjectAttributes
Packit Service fa4841
{
Packit Service fa4841
	void* AttributeInfo;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_SubjectAttributes SecPkgContext_SubjectAttributes;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_SupportedSignatures
Packit Service fa4841
{
Packit Service fa4841
	UINT16 cSignatureAndHashAlgorithms;
Packit Service fa4841
	UINT16* pSignatureAndHashAlgorithms;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_SupportedSignatures SecPkgContext_SupportedSignatures;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgContext_TargetInformation
Packit Service fa4841
{
Packit Service fa4841
	UINT32 MarshalledTargetInfoLength;
Packit Service fa4841
	BYTE* MarshalledTargetInfo;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgContext_TargetInformation SecPkgContext_TargetInformation;
Packit Service fa4841
Packit Service fa4841
/* Security Credentials Attributes */
Packit Service fa4841
Packit Service fa4841
#define SECPKG_CRED_ATTR_NAMES 1
Packit Service fa4841
Packit Service fa4841
struct _SecPkgCredentials_NamesA
Packit Service fa4841
{
Packit Service fa4841
	SEC_CHAR* sUserName;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgCredentials_NamesA SecPkgCredentials_NamesA;
Packit Service fa4841
typedef SecPkgCredentials_NamesA* PSecPkgCredentials_NamesA;
Packit Service fa4841
Packit Service fa4841
struct _SecPkgCredentials_NamesW
Packit Service fa4841
{
Packit Service fa4841
	SEC_WCHAR* sUserName;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecPkgCredentials_NamesW SecPkgCredentials_NamesW;
Packit Service fa4841
typedef SecPkgCredentials_NamesW* PSecPkgCredentials_NamesW;
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define SecPkgCredentials_Names SecPkgCredentials_NamesW
Packit Service fa4841
#define PSecPkgCredentials_Names PSecPkgCredentials_NamesW
Packit Service fa4841
#else
Packit Service fa4841
#define SecPkgCredentials_Names SecPkgCredentials_NamesA
Packit Service fa4841
#define PSecPkgCredentials_Names PSecPkgCredentials_NamesA
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
/* InitializeSecurityContext Flags */
Packit Service fa4841
Packit Service fa4841
#define ISC_REQ_DELEGATE 0x00000001
Packit Service fa4841
#define ISC_REQ_MUTUAL_AUTH 0x00000002
Packit Service fa4841
#define ISC_REQ_REPLAY_DETECT 0x00000004
Packit Service fa4841
#define ISC_REQ_SEQUENCE_DETECT 0x00000008
Packit Service fa4841
#define ISC_REQ_CONFIDENTIALITY 0x00000010
Packit Service fa4841
#define ISC_REQ_USE_SESSION_KEY 0x00000020
Packit Service fa4841
#define ISC_REQ_PROMPT_FOR_CREDS 0x00000040
Packit Service fa4841
#define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080
Packit Service fa4841
#define ISC_REQ_ALLOCATE_MEMORY 0x00000100
Packit Service fa4841
#define ISC_REQ_USE_DCE_STYLE 0x00000200
Packit Service fa4841
#define ISC_REQ_DATAGRAM 0x00000400
Packit Service fa4841
#define ISC_REQ_CONNECTION 0x00000800
Packit Service fa4841
#define ISC_REQ_CALL_LEVEL 0x00001000
Packit Service fa4841
#define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000
Packit Service fa4841
#define ISC_REQ_EXTENDED_ERROR 0x00004000
Packit Service fa4841
#define ISC_REQ_STREAM 0x00008000
Packit Service fa4841
#define ISC_REQ_INTEGRITY 0x00010000
Packit Service fa4841
#define ISC_REQ_IDENTIFY 0x00020000
Packit Service fa4841
#define ISC_REQ_NULL_SESSION 0x00040000
Packit Service fa4841
#define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000
Packit Service fa4841
#define ISC_REQ_RESERVED1 0x00100000
Packit Service fa4841
#define ISC_REQ_FRAGMENT_TO_FIT 0x00200000
Packit Service fa4841
#define ISC_REQ_FORWARD_CREDENTIALS 0x00400000
Packit Service fa4841
#define ISC_REQ_NO_INTEGRITY 0x00800000
Packit Service fa4841
#define ISC_REQ_USE_HTTP_STYLE 0x01000000
Packit Service fa4841
Packit Service fa4841
#define ISC_RET_DELEGATE 0x00000001
Packit Service fa4841
#define ISC_RET_MUTUAL_AUTH 0x00000002
Packit Service fa4841
#define ISC_RET_REPLAY_DETECT 0x00000004
Packit Service fa4841
#define ISC_RET_SEQUENCE_DETECT 0x00000008
Packit Service fa4841
#define ISC_RET_CONFIDENTIALITY 0x00000010
Packit Service fa4841
#define ISC_RET_USE_SESSION_KEY 0x00000020
Packit Service fa4841
#define ISC_RET_USED_COLLECTED_CREDS 0x00000040
Packit Service fa4841
#define ISC_RET_USED_SUPPLIED_CREDS 0x00000080
Packit Service fa4841
#define ISC_RET_ALLOCATED_MEMORY 0x00000100
Packit Service fa4841
#define ISC_RET_USED_DCE_STYLE 0x00000200
Packit Service fa4841
#define ISC_RET_DATAGRAM 0x00000400
Packit Service fa4841
#define ISC_RET_CONNECTION 0x00000800
Packit Service fa4841
#define ISC_RET_INTERMEDIATE_RETURN 0x00001000
Packit Service fa4841
#define ISC_RET_CALL_LEVEL 0x00002000
Packit Service fa4841
#define ISC_RET_EXTENDED_ERROR 0x00004000
Packit Service fa4841
#define ISC_RET_STREAM 0x00008000
Packit Service fa4841
#define ISC_RET_INTEGRITY 0x00010000
Packit Service fa4841
#define ISC_RET_IDENTIFY 0x00020000
Packit Service fa4841
#define ISC_RET_NULL_SESSION 0x00040000
Packit Service fa4841
#define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000
Packit Service fa4841
#define ISC_RET_RESERVED1 0x00100000
Packit Service fa4841
#define ISC_RET_FRAGMENT_ONLY 0x00200000
Packit Service fa4841
#define ISC_RET_FORWARD_CREDENTIALS 0x00400000
Packit Service fa4841
#define ISC_RET_USED_HTTP_STYLE 0x01000000
Packit Service fa4841
Packit Service fa4841
/* AcceptSecurityContext Flags */
Packit Service fa4841
Packit Service fa4841
#define ASC_REQ_DELEGATE 0x00000001
Packit Service fa4841
#define ASC_REQ_MUTUAL_AUTH 0x00000002
Packit Service fa4841
#define ASC_REQ_REPLAY_DETECT 0x00000004
Packit Service fa4841
#define ASC_REQ_SEQUENCE_DETECT 0x00000008
Packit Service fa4841
#define ASC_REQ_CONFIDENTIALITY 0x00000010
Packit Service fa4841
#define ASC_REQ_USE_SESSION_KEY 0x00000020
Packit Service fa4841
#define ASC_REQ_ALLOCATE_MEMORY 0x00000100
Packit Service fa4841
#define ASC_REQ_USE_DCE_STYLE 0x00000200
Packit Service fa4841
#define ASC_REQ_DATAGRAM 0x00000400
Packit Service fa4841
#define ASC_REQ_CONNECTION 0x00000800
Packit Service fa4841
#define ASC_REQ_CALL_LEVEL 0x00001000
Packit Service fa4841
#define ASC_REQ_EXTENDED_ERROR 0x00008000
Packit Service fa4841
#define ASC_REQ_STREAM 0x00010000
Packit Service fa4841
#define ASC_REQ_INTEGRITY 0x00020000
Packit Service fa4841
#define ASC_REQ_LICENSING 0x00040000
Packit Service fa4841
#define ASC_REQ_IDENTIFY 0x00080000
Packit Service fa4841
#define ASC_REQ_ALLOW_NULL_SESSION 0x00100000
Packit Service fa4841
#define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000
Packit Service fa4841
#define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000
Packit Service fa4841
#define ASC_REQ_FRAGMENT_TO_FIT 0x00800000
Packit Service fa4841
#define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000
Packit Service fa4841
#define ASC_REQ_NO_TOKEN 0x01000000
Packit Service fa4841
#define ASC_REQ_PROXY_BINDINGS 0x04000000
Packit Service fa4841
#define ASC_REQ_ALLOW_MISSING_BINDINGS 0x10000000
Packit Service fa4841
Packit Service fa4841
#define ASC_RET_DELEGATE 0x00000001
Packit Service fa4841
#define ASC_RET_MUTUAL_AUTH 0x00000002
Packit Service fa4841
#define ASC_RET_REPLAY_DETECT 0x00000004
Packit Service fa4841
#define ASC_RET_SEQUENCE_DETECT 0x00000008
Packit Service fa4841
#define ASC_RET_CONFIDENTIALITY 0x00000010
Packit Service fa4841
#define ASC_RET_USE_SESSION_KEY 0x00000020
Packit Service fa4841
#define ASC_RET_ALLOCATED_MEMORY 0x00000100
Packit Service fa4841
#define ASC_RET_USED_DCE_STYLE 0x00000200
Packit Service fa4841
#define ASC_RET_DATAGRAM 0x00000400
Packit Service fa4841
#define ASC_RET_CONNECTION 0x00000800
Packit Service fa4841
#define ASC_RET_CALL_LEVEL 0x00002000
Packit Service fa4841
#define ASC_RET_THIRD_LEG_FAILED 0x00004000
Packit Service fa4841
#define ASC_RET_EXTENDED_ERROR 0x00008000
Packit Service fa4841
#define ASC_RET_STREAM 0x00010000
Packit Service fa4841
#define ASC_RET_INTEGRITY 0x00020000
Packit Service fa4841
#define ASC_RET_LICENSING 0x00040000
Packit Service fa4841
#define ASC_RET_IDENTIFY 0x00080000
Packit Service fa4841
#define ASC_RET_NULL_SESSION 0x00100000
Packit Service fa4841
#define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000
Packit Service fa4841
#define ASC_RET_FRAGMENT_ONLY 0x00800000
Packit Service fa4841
#define ASC_RET_NO_TOKEN 0x01000000
Packit Service fa4841
#define ASC_RET_NO_PROXY_BINDINGS 0x04000000
Packit Service fa4841
#define ASC_RET_MISSING_BINDINGS 0x10000000
Packit Service fa4841
Packit Service fa4841
#define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1
Packit Service fa4841
#define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2
Packit Service fa4841
Packit Service fa4841
#if !defined(_WIN32) || defined(_UWP)
Packit Service fa4841
Packit Service fa4841
#ifndef _AUTH_IDENTITY_DEFINED
Packit Service fa4841
#define _AUTH_IDENTITY_DEFINED
Packit Service fa4841
Packit Service fa4841
typedef struct _SEC_WINNT_AUTH_IDENTITY_W
Packit Service fa4841
{
Packit Service fa4841
	/* TSPasswordCreds */
Packit Service fa4841
	UINT16* User;
Packit Service fa4841
	UINT32 UserLength;
Packit Service fa4841
	UINT16* Domain;
Packit Service fa4841
	UINT32 DomainLength;
Packit Service fa4841
	UINT16* Password;
Packit Service fa4841
	UINT32 PasswordLength;
Packit Service fa4841
	UINT32 Flags;
Packit Service fa4841
} SEC_WINNT_AUTH_IDENTITY_W, *PSEC_WINNT_AUTH_IDENTITY_W;
Packit Service fa4841
Packit Service fa4841
typedef struct _SEC_WINNT_AUTH_IDENTITY_A
Packit Service fa4841
{
Packit Service fa4841
	/* TSPasswordCreds */
Packit Service fa4841
	BYTE* User;
Packit Service fa4841
	UINT32 UserLength;
Packit Service fa4841
	BYTE* Domain;
Packit Service fa4841
	UINT32 DomainLength;
Packit Service fa4841
	BYTE* Password;
Packit Service fa4841
	UINT32 PasswordLength;
Packit Service fa4841
	UINT32 Flags;
Packit Service fa4841
} SEC_WINNT_AUTH_IDENTITY_A, *PSEC_WINNT_AUTH_IDENTITY_A;
Packit Service fa4841
Packit Service fa4841
struct _SEC_WINNT_AUTH_IDENTITY
Packit Service fa4841
{
Packit Service fa4841
	/* TSPasswordCreds */
Packit Service fa4841
	UINT16* User;
Packit Service fa4841
	UINT32 UserLength;
Packit Service fa4841
	UINT16* Domain;
Packit Service fa4841
	UINT32 DomainLength;
Packit Service fa4841
	UINT16* Password;
Packit Service fa4841
	UINT32 PasswordLength;
Packit Service fa4841
	UINT32 Flags;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY;
Packit Service fa4841
Packit Service fa4841
#endif /* _AUTH_IDENTITY_DEFINED */
Packit Service fa4841
Packit Service fa4841
struct _SecHandle
Packit Service fa4841
{
Packit Service fa4841
	ULONG_PTR dwLower;
Packit Service fa4841
	ULONG_PTR dwUpper;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecHandle SecHandle;
Packit Service fa4841
typedef SecHandle* PSecHandle;
Packit Service fa4841
Packit Service fa4841
typedef SecHandle CredHandle;
Packit Service fa4841
typedef CredHandle* PCredHandle;
Packit Service fa4841
typedef SecHandle CtxtHandle;
Packit Service fa4841
typedef CtxtHandle* PCtxtHandle;
Packit Service fa4841
Packit Service fa4841
#define SecInvalidateHandle(x) \
Packit Service fa4841
	((PSecHandle)(x))->dwLower = ((PSecHandle)(x))->dwUpper = ((ULONG_PTR)((INT_PTR)-1));
Packit Service fa4841
Packit Service fa4841
#define SecIsValidHandle(x)                                        \
Packit Service fa4841
	((((PSecHandle)(x))->dwLower != ((ULONG_PTR)((INT_PTR)-1))) && \
Packit Service fa4841
	 (((PSecHandle)(x))->dwUpper != ((ULONG_PTR)((INT_PTR)-1))))
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#define SECBUFFER_VERSION 0
Packit Service fa4841
Packit Service fa4841
/* Buffer Types */
Packit Service fa4841
#define SECBUFFER_EMPTY 0
Packit Service fa4841
#define SECBUFFER_DATA 1
Packit Service fa4841
#define SECBUFFER_TOKEN 2
Packit Service fa4841
#define SECBUFFER_PKG_PARAMS 3
Packit Service fa4841
#define SECBUFFER_MISSING 4
Packit Service fa4841
#define SECBUFFER_EXTRA 5
Packit Service fa4841
#define SECBUFFER_STREAM_TRAILER 6
Packit Service fa4841
#define SECBUFFER_STREAM_HEADER 7
Packit Service fa4841
#define SECBUFFER_NEGOTIATION_INFO 8
Packit Service fa4841
#define SECBUFFER_PADDING 9
Packit Service fa4841
#define SECBUFFER_STREAM 10
Packit Service fa4841
#define SECBUFFER_MECHLIST 11
Packit Service fa4841
#define SECBUFFER_MECHLIST_SIGNATURE 12
Packit Service fa4841
#define SECBUFFER_TARGET 13
Packit Service fa4841
#define SECBUFFER_CHANNEL_BINDINGS 14
Packit Service fa4841
#define SECBUFFER_CHANGE_PASS_RESPONSE 15
Packit Service fa4841
#define SECBUFFER_TARGET_HOST 16
Packit Service fa4841
#define SECBUFFER_ALERT 17
Packit Service fa4841
Packit Service fa4841
/* Security Buffer Flags */
Packit Service fa4841
#define SECBUFFER_ATTRMASK 0xF0000000
Packit Service fa4841
#define SECBUFFER_READONLY 0x80000000
Packit Service fa4841
#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000
Packit Service fa4841
#define SECBUFFER_RESERVED 0x60000000
Packit Service fa4841
Packit Service fa4841
#if !defined(_WIN32) || defined(_UWP)
Packit Service fa4841
Packit Service fa4841
struct _SecBuffer
Packit Service fa4841
{
Packit Service fa4841
	ULONG cbBuffer;
Packit Service fa4841
	ULONG BufferType;
Packit Service fa4841
	void* pvBuffer;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecBuffer SecBuffer;
Packit Service fa4841
typedef SecBuffer* PSecBuffer;
Packit Service fa4841
Packit Service fa4841
struct _SecBufferDesc
Packit Service fa4841
{
Packit Service fa4841
	ULONG ulVersion;
Packit Service fa4841
	ULONG cBuffers;
Packit Service fa4841
	PSecBuffer pBuffers;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecBufferDesc SecBufferDesc;
Packit Service fa4841
typedef SecBufferDesc* PSecBufferDesc;
Packit Service fa4841
Packit Service fa4841
typedef void(SEC_ENTRY* SEC_GET_KEY_FN)(void* Arg, void* Principal, UINT32 KeyVer, void** Key,
Packit Service fa4841
                                        SECURITY_STATUS* pStatus);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* ENUMERATE_SECURITY_PACKAGES_FN_A)(ULONG* pcPackages,
Packit Service fa4841
                                                                     PSecPkgInfoA* ppPackageInfo);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* ENUMERATE_SECURITY_PACKAGES_FN_W)(ULONG* pcPackages,
Packit Service fa4841
                                                                     PSecPkgInfoW* ppPackageInfo);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define EnumerateSecurityPackages EnumerateSecurityPackagesW
Packit Service fa4841
#define ENUMERATE_SECURITY_PACKAGES_FN ENUMERATE_SECURITY_PACKAGES_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define EnumerateSecurityPackages EnumerateSecurityPackagesA
Packit Service fa4841
#define ENUMERATE_SECURITY_PACKAGES_FN ENUMERATE_SECURITY_PACKAGES_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CREDENTIALS_ATTRIBUTES_FN_A)(PCredHandle phCredential,
Packit Service fa4841
                                                                      ULONG ulAttribute,
Packit Service fa4841
                                                                      void* pBuffer);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CREDENTIALS_ATTRIBUTES_FN_W)(PCredHandle phCredential,
Packit Service fa4841
                                                                      ULONG ulAttribute,
Packit Service fa4841
                                                                      void* pBuffer);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define QueryCredentialsAttributes QueryCredentialsAttributesW
Packit Service fa4841
#define QUERY_CREDENTIALS_ATTRIBUTES_FN QUERY_CREDENTIALS_ATTRIBUTES_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define QueryCredentialsAttributes QueryCredentialsAttributesA
Packit Service fa4841
#define QUERY_CREDENTIALS_ATTRIBUTES_FN QUERY_CREDENTIALS_ATTRIBUTES_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* ACQUIRE_CREDENTIALS_HANDLE_FN_A)(
Packit Service fa4841
    LPSTR pszPrincipal, LPSTR pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData,
Packit Service fa4841
    SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential,
Packit Service fa4841
    PTimeStamp ptsExpiry);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* ACQUIRE_CREDENTIALS_HANDLE_FN_W)(
Packit Service fa4841
    LPWSTR pszPrincipal, LPWSTR pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData,
Packit Service fa4841
    SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential,
Packit Service fa4841
    PTimeStamp ptsExpiry);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define AcquireCredentialsHandle AcquireCredentialsHandleW
Packit Service fa4841
#define ACQUIRE_CREDENTIALS_HANDLE_FN ACQUIRE_CREDENTIALS_HANDLE_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define AcquireCredentialsHandle AcquireCredentialsHandleA
Packit Service fa4841
#define ACQUIRE_CREDENTIALS_HANDLE_FN ACQUIRE_CREDENTIALS_HANDLE_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* FREE_CREDENTIALS_HANDLE_FN)(PCredHandle phCredential);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* INITIALIZE_SECURITY_CONTEXT_FN_A)(
Packit Service fa4841
    PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq,
Packit Service fa4841
    ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2,
Packit Service fa4841
    PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* INITIALIZE_SECURITY_CONTEXT_FN_W)(
Packit Service fa4841
    PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq,
Packit Service fa4841
    ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2,
Packit Service fa4841
    PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define InitializeSecurityContext InitializeSecurityContextW
Packit Service fa4841
#define INITIALIZE_SECURITY_CONTEXT_FN INITIALIZE_SECURITY_CONTEXT_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define InitializeSecurityContext InitializeSecurityContextA
Packit Service fa4841
#define INITIALIZE_SECURITY_CONTEXT_FN INITIALIZE_SECURITY_CONTEXT_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* ACCEPT_SECURITY_CONTEXT_FN)(
Packit Service fa4841
    PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq,
Packit Service fa4841
    ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr,
Packit Service fa4841
    PTimeStamp ptsTimeStamp);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* COMPLETE_AUTH_TOKEN_FN)(PCtxtHandle phContext,
Packit Service fa4841
                                                           PSecBufferDesc pToken);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* DELETE_SECURITY_CONTEXT_FN)(PCtxtHandle phContext);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* APPLY_CONTROL_TOKEN_FN)(PCtxtHandle phContext,
Packit Service fa4841
                                                           PSecBufferDesc pInput);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle phContext,
Packit Service fa4841
                                                                  ULONG ulAttribute, void* pBuffer);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* QUERY_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle phContext,
Packit Service fa4841
                                                                  ULONG ulAttribute, void* pBuffer);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define QueryContextAttributes QueryContextAttributesW
Packit Service fa4841
#define QUERY_CONTEXT_ATTRIBUTES_FN QUERY_CONTEXT_ATTRIBUTES_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define QueryContextAttributes QueryContextAttributesA
Packit Service fa4841
#define QUERY_CONTEXT_ATTRIBUTES_FN QUERY_CONTEXT_ATTRIBUTES_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* IMPERSONATE_SECURITY_CONTEXT_FN)(PCtxtHandle phContext);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* REVERT_SECURITY_CONTEXT_FN)(PCtxtHandle phContext);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* MAKE_SIGNATURE_FN)(PCtxtHandle phContext, ULONG fQOP,
Packit Service fa4841
                                                      PSecBufferDesc pMessage, ULONG MessageSeqNo);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* VERIFY_SIGNATURE_FN)(PCtxtHandle phContext,
Packit Service fa4841
                                                        PSecBufferDesc pMessage, ULONG MessageSeqNo,
Packit Service fa4841
                                                        PULONG pfQOP);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* FREE_CONTEXT_BUFFER_FN)(void* pvContextBuffer);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* QUERY_SECURITY_PACKAGE_INFO_FN_A)(SEC_CHAR* pszPackageName,
Packit Service fa4841
                                                                     PSecPkgInfoA* ppPackageInfo);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* QUERY_SECURITY_PACKAGE_INFO_FN_W)(SEC_WCHAR* pszPackageName,
Packit Service fa4841
                                                                     PSecPkgInfoW* ppPackageInfo);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define QuerySecurityPackageInfo QuerySecurityPackageInfoW
Packit Service fa4841
#define QUERY_SECURITY_PACKAGE_INFO_FN QUERY_SECURITY_PACKAGE_INFO_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define QuerySecurityPackageInfo QuerySecurityPackageInfoA
Packit Service fa4841
#define QUERY_SECURITY_PACKAGE_INFO_FN QUERY_SECURITY_PACKAGE_INFO_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* EXPORT_SECURITY_CONTEXT_FN)(PCtxtHandle phContext, ULONG fFlags,
Packit Service fa4841
                                                               PSecBuffer pPackedContext,
Packit Service fa4841
                                                               HANDLE* pToken);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* IMPORT_SECURITY_CONTEXT_FN_A)(SEC_CHAR* pszPackage,
Packit Service fa4841
                                                                 PSecBuffer pPackedContext,
Packit Service fa4841
                                                                 HANDLE pToken,
Packit Service fa4841
                                                                 PCtxtHandle phContext);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* IMPORT_SECURITY_CONTEXT_FN_W)(SEC_WCHAR* pszPackage,
Packit Service fa4841
                                                                 PSecBuffer pPackedContext,
Packit Service fa4841
                                                                 HANDLE pToken,
Packit Service fa4841
                                                                 PCtxtHandle phContext);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define ImportSecurityContext ImportSecurityContextW
Packit Service fa4841
#define IMPORT_SECURITY_CONTEXT_FN IMPORT_SECURITY_CONTEXT_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define ImportSecurityContext ImportSecurityContextA
Packit Service fa4841
#define IMPORT_SECURITY_CONTEXT_FN IMPORT_SECURITY_CONTEXT_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* ADD_CREDENTIALS_FN_A)(
Packit Service fa4841
    PCredHandle hCredentials, SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, UINT32 fCredentialUse,
Packit Service fa4841
    void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PTimeStamp ptsExpiry);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* ADD_CREDENTIALS_FN_W)(
Packit Service fa4841
    PCredHandle hCredentials, SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, UINT32 fCredentialUse,
Packit Service fa4841
    void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PTimeStamp ptsExpiry);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define AddCredentials AddCredentialsW
Packit Service fa4841
#define ADD_CREDENTIALS_FN ADD_CREDENTIALS_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define AddCredentials AddCredentialsA
Packit Service fa4841
#define ADD_CREDENTIALS_FN ADD_CREDENTIALS_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* QUERY_SECURITY_CONTEXT_TOKEN_FN)(PCtxtHandle phContext,
Packit Service fa4841
                                                                    HANDLE* phToken);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* ENCRYPT_MESSAGE_FN)(PCtxtHandle phContext, ULONG fQOP,
Packit Service fa4841
                                                       PSecBufferDesc pMessage, ULONG MessageSeqNo);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* DECRYPT_MESSAGE_FN)(PCtxtHandle phContext,
Packit Service fa4841
                                                       PSecBufferDesc pMessage, ULONG MessageSeqNo,
Packit Service fa4841
                                                       PULONG pfQOP);
Packit Service fa4841
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* SET_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle phContext,
Packit Service fa4841
                                                                ULONG ulAttribute, void* pBuffer,
Packit Service fa4841
                                                                ULONG cbBuffer);
Packit Service fa4841
typedef SECURITY_STATUS(SEC_ENTRY* SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle phContext,
Packit Service fa4841
                                                                ULONG ulAttribute, void* pBuffer,
Packit Service fa4841
                                                                ULONG cbBuffer);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define SetContextAttributes SetContextAttributesW
Packit Service fa4841
#define SET_CONTEXT_ATTRIBUTES_FN SET_CONTEXT_ATTRIBUTES_FN_W
Packit Service fa4841
#else
Packit Service fa4841
#define SetContextAttributes SetContextAttributesA
Packit Service fa4841
#define SET_CONTEXT_ATTRIBUTES_FN SET_CONTEXT_ATTRIBUTES_FN_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION \
Packit Service fa4841
	1 /* Interface has all routines through DecryptMessage */
Packit Service fa4841
#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 \
Packit Service fa4841
	2 /* Interface has all routines through SetContextAttributes */
Packit Service fa4841
#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 \
Packit Service fa4841
	3 /* Interface has all routines through SetCredentialsAttributes */
Packit Service fa4841
#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_4 \
Packit Service fa4841
	4 /* Interface has all routines through ChangeAccountPassword */
Packit Service fa4841
Packit Service fa4841
struct _SecurityFunctionTableA
Packit Service fa4841
{
Packit Service fa4841
	UINT32 dwVersion;
Packit Service fa4841
	ENUMERATE_SECURITY_PACKAGES_FN_A EnumerateSecurityPackagesA;
Packit Service fa4841
	QUERY_CREDENTIALS_ATTRIBUTES_FN_A QueryCredentialsAttributesA;
Packit Service fa4841
	ACQUIRE_CREDENTIALS_HANDLE_FN_A AcquireCredentialsHandleA;
Packit Service fa4841
	FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
Packit Service fa4841
	void* Reserved2;
Packit Service fa4841
	INITIALIZE_SECURITY_CONTEXT_FN_A InitializeSecurityContextA;
Packit Service fa4841
	ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
Packit Service fa4841
	COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
Packit Service fa4841
	DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
Packit Service fa4841
	APPLY_CONTROL_TOKEN_FN ApplyControlToken;
Packit Service fa4841
	QUERY_CONTEXT_ATTRIBUTES_FN_A QueryContextAttributesA;
Packit Service fa4841
	IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
Packit Service fa4841
	REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
Packit Service fa4841
	MAKE_SIGNATURE_FN MakeSignature;
Packit Service fa4841
	VERIFY_SIGNATURE_FN VerifySignature;
Packit Service fa4841
	FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
Packit Service fa4841
	QUERY_SECURITY_PACKAGE_INFO_FN_A QuerySecurityPackageInfoA;
Packit Service fa4841
	void* Reserved3;
Packit Service fa4841
	void* Reserved4;
Packit Service fa4841
	EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
Packit Service fa4841
	IMPORT_SECURITY_CONTEXT_FN_A ImportSecurityContextA;
Packit Service fa4841
	ADD_CREDENTIALS_FN_A AddCredentialsA;
Packit Service fa4841
	void* Reserved8;
Packit Service fa4841
	QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
Packit Service fa4841
	ENCRYPT_MESSAGE_FN EncryptMessage;
Packit Service fa4841
	DECRYPT_MESSAGE_FN DecryptMessage;
Packit Service fa4841
	SET_CONTEXT_ATTRIBUTES_FN_A SetContextAttributesA;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecurityFunctionTableA SecurityFunctionTableA;
Packit Service fa4841
typedef SecurityFunctionTableA* PSecurityFunctionTableA;
Packit Service fa4841
Packit Service fa4841
struct _SecurityFunctionTableW
Packit Service fa4841
{
Packit Service fa4841
	UINT32 dwVersion;
Packit Service fa4841
	ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW;
Packit Service fa4841
	QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW;
Packit Service fa4841
	ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW;
Packit Service fa4841
	FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
Packit Service fa4841
	void* Reserved2;
Packit Service fa4841
	INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW;
Packit Service fa4841
	ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
Packit Service fa4841
	COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
Packit Service fa4841
	DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
Packit Service fa4841
	APPLY_CONTROL_TOKEN_FN ApplyControlToken;
Packit Service fa4841
	QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW;
Packit Service fa4841
	IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
Packit Service fa4841
	REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
Packit Service fa4841
	MAKE_SIGNATURE_FN MakeSignature;
Packit Service fa4841
	VERIFY_SIGNATURE_FN VerifySignature;
Packit Service fa4841
	FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
Packit Service fa4841
	QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW;
Packit Service fa4841
	void* Reserved3;
Packit Service fa4841
	void* Reserved4;
Packit Service fa4841
	EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
Packit Service fa4841
	IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW;
Packit Service fa4841
	ADD_CREDENTIALS_FN_W AddCredentialsW;
Packit Service fa4841
	void* Reserved8;
Packit Service fa4841
	QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
Packit Service fa4841
	ENCRYPT_MESSAGE_FN EncryptMessage;
Packit Service fa4841
	DECRYPT_MESSAGE_FN DecryptMessage;
Packit Service fa4841
	SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW;
Packit Service fa4841
};
Packit Service fa4841
typedef struct _SecurityFunctionTableW SecurityFunctionTableW;
Packit Service fa4841
typedef SecurityFunctionTableW* PSecurityFunctionTableW;
Packit Service fa4841
Packit Service fa4841
typedef PSecurityFunctionTableA(SEC_ENTRY* INIT_SECURITY_INTERFACE_A)(void);
Packit Service fa4841
typedef PSecurityFunctionTableW(SEC_ENTRY* INIT_SECURITY_INTERFACE_W)(void);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define InitSecurityInterface InitSecurityInterfaceW
Packit Service fa4841
#define SecurityFunctionTable SecurityFunctionTableW
Packit Service fa4841
#define PSecurityFunctionTable PSecurityFunctionTableW
Packit Service fa4841
#define INIT_SECURITY_INTERFACE INIT_SECURITY_INTERFACE_W
Packit Service fa4841
#else
Packit Service fa4841
#define InitSecurityInterface InitSecurityInterfaceA
Packit Service fa4841
#define SecurityFunctionTable SecurityFunctionTableA
Packit Service fa4841
#define PSecurityFunctionTable PSecurityFunctionTableA
Packit Service fa4841
#define INIT_SECURITY_INTERFACE INIT_SECURITY_INTERFACE_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service fa4841
extern "C"
Packit Service fa4841
{
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
	/* Package Management */
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(ULONG* pcPackages,
Packit Service fa4841
	                                                               PSecPkgInfoA* ppPackageInfo);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(ULONG* pcPackages,
Packit Service fa4841
	                                                               PSecPkgInfoW* ppPackageInfo);
Packit Service fa4841
Packit Service fa4841
	WINPR_API PSecurityFunctionTableA SEC_ENTRY InitSecurityInterfaceA(void);
Packit Service fa4841
	WINPR_API PSecurityFunctionTableW SEC_ENTRY InitSecurityInterfaceW(void);
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA(SEC_CHAR* pszPackageName,
Packit Service fa4841
	                                                              PSecPkgInfoA* ppPackageInfo);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName,
Packit Service fa4841
	                                                              PSecPkgInfoW* ppPackageInfo);
Packit Service fa4841
Packit Service fa4841
	/* Credential Management */
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA(
Packit Service fa4841
	    SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID,
Packit Service fa4841
	    void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential,
Packit Service fa4841
	    PTimeStamp ptsExpiry);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW(
Packit Service fa4841
	    SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID,
Packit Service fa4841
	    void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential,
Packit Service fa4841
	    PTimeStamp ptsExpiry);
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY ExportSecurityContext(PCtxtHandle phContext, ULONG fFlags,
Packit Service fa4841
	                                                          PSecBuffer pPackedContext,
Packit Service fa4841
	                                                          HANDLE* pToken);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(PCredHandle phCredential);
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(SEC_CHAR* pszPackage,
Packit Service fa4841
	                                                           PSecBuffer pPackedContext,
Packit Service fa4841
	                                                           HANDLE pToken,
Packit Service fa4841
	                                                           PCtxtHandle phContext);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(SEC_WCHAR* pszPackage,
Packit Service fa4841
	                                                           PSecBuffer pPackedContext,
Packit Service fa4841
	                                                           HANDLE pToken,
Packit Service fa4841
	                                                           PCtxtHandle phContext);
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(PCredHandle phCredential,
Packit Service fa4841
	                                                                ULONG ulAttribute,
Packit Service fa4841
	                                                                void* pBuffer);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW(PCredHandle phCredential,
Packit Service fa4841
	                                                                ULONG ulAttribute,
Packit Service fa4841
	                                                                void* pBuffer);
Packit Service fa4841
Packit Service fa4841
	/* Context Management */
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY
Packit Service fa4841
	AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput,
Packit Service fa4841
	                      ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext,
Packit Service fa4841
	                      PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp);
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY ApplyControlToken(PCtxtHandle phContext,
Packit Service fa4841
	                                                      PSecBufferDesc pInput);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY CompleteAuthToken(PCtxtHandle phContext,
Packit Service fa4841
	                                                      PSecBufferDesc pToken);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY DeleteSecurityContext(PCtxtHandle phContext);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY FreeContextBuffer(void* pvContextBuffer);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(PCtxtHandle phContext);
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA(
Packit Service fa4841
	    PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq,
Packit Service fa4841
	    ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2,
Packit Service fa4841
	    PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr,
Packit Service fa4841
	    PTimeStamp ptsExpiry);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW(
Packit Service fa4841
	    PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName,
Packit Service fa4841
	    ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput,
Packit Service fa4841
	    ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr,
Packit Service fa4841
	    PTimeStamp ptsExpiry);
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY QueryContextAttributes(PCtxtHandle phContext,
Packit Service fa4841
	                                                           ULONG ulAttribute, void* pBuffer);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY QuerySecurityContextToken(PCtxtHandle phContext,
Packit Service fa4841
	                                                              HANDLE* phToken);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY SetContextAttributes(PCtxtHandle phContext,
Packit Service fa4841
	                                                         ULONG ulAttribute, void* pBuffer,
Packit Service fa4841
	                                                         ULONG cbBuffer);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY RevertSecurityContext(PCtxtHandle phContext);
Packit Service fa4841
Packit Service fa4841
	/* Message Support */
Packit Service fa4841
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY DecryptMessage(PCtxtHandle phContext,
Packit Service fa4841
	                                                   PSecBufferDesc pMessage, ULONG MessageSeqNo,
Packit Service fa4841
	                                                   PULONG pfQOP);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY EncryptMessage(PCtxtHandle phContext, ULONG fQOP,
Packit Service fa4841
	                                                   PSecBufferDesc pMessage, ULONG MessageSeqNo);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY MakeSignature(PCtxtHandle phContext, ULONG fQOP,
Packit Service fa4841
	                                                  PSecBufferDesc pMessage, ULONG MessageSeqNo);
Packit Service fa4841
	WINPR_API SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext,
Packit Service fa4841
	                                                    PSecBufferDesc pMessage, ULONG MessageSeqNo,
Packit Service fa4841
	                                                    PULONG pfQOP);
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service fa4841
}
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service fa4841
extern "C"
Packit Service fa4841
{
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
	/* Custom API */
Packit Service fa4841
Packit Service fa4841
#define SECPKG_ATTR_AUTH_IDENTITY 1001
Packit Service fa4841
#define SECPKG_ATTR_AUTH_PASSWORD 1002
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_HASH 1003
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_SAM_FILE 1004
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_MESSAGE 1100
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_TIMESTAMP 1101
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_CLIENT_CHALLENGE 1102
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_SERVER_CHALLENGE 1103
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_NTPROOF_VALUE 1104
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_RANDKEY 1105
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_MIC 1106
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_MIC_VALUE 1107
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_HASH_CB 1108
Packit Service fa4841
#define SECPKG_ATTR_AUTH_NTLM_HASH_CB_DATA 1109
Packit Service fa4841
Packit Service fa4841
	struct _SecPkgContext_AuthIdentity
Packit Service fa4841
	{
Packit Service fa4841
		char User[256 + 1];
Packit Service fa4841
		char Domain[256 + 1];
Packit Service fa4841
	};
Packit Service fa4841
	typedef struct _SecPkgContext_AuthIdentity SecPkgContext_AuthIdentity;
Packit Service fa4841
Packit Service fa4841
	struct _SecPkgContext_AuthPassword
Packit Service fa4841
	{
Packit Service fa4841
		char Password[256 + 1];
Packit Service fa4841
	};
Packit Service fa4841
	typedef struct _SecPkgContext_AuthPassword SecPkgContext_AuthPassword;
Packit Service fa4841
Packit Service fa4841
	struct _SecPkgContext_AuthNtlmHash
Packit Service fa4841
	{
Packit Service fa4841
		int Version;
Packit Service fa4841
		BYTE NtlmHash[16];
Packit Service fa4841
	};
Packit Service fa4841
	typedef struct _SecPkgContext_AuthNtlmHash SecPkgContext_AuthNtlmHash;
Packit Service fa4841
Packit Service fa4841
	struct _SecPkgContext_AuthNtlmTimestamp
Packit Service fa4841
	{
Packit Service fa4841
		BYTE Timestamp[8];
Packit Service fa4841
		BOOL ChallengeOrResponse;
Packit Service fa4841
	};
Packit Service fa4841
	typedef struct _SecPkgContext_AuthNtlmTimestamp SecPkgContext_AuthNtlmTimestamp;
Packit Service fa4841
Packit Service fa4841
	struct _SecPkgContext_AuthNtlmClientChallenge
Packit Service fa4841
	{
Packit Service fa4841
		BYTE ClientChallenge[8];
Packit Service fa4841
	};
Packit Service fa4841
	typedef struct _SecPkgContext_AuthNtlmClientChallenge SecPkgContext_AuthNtlmClientChallenge;
Packit Service fa4841
Packit Service fa4841
	struct _SecPkgContext_AuthNtlmServerChallenge
Packit Service fa4841
	{
Packit Service fa4841
		BYTE ServerChallenge[8];
Packit Service fa4841
	};
Packit Service fa4841
	typedef struct _SecPkgContext_AuthNtlmServerChallenge SecPkgContext_AuthNtlmServerChallenge;
Packit Service fa4841
Packit Service fa4841
	struct _SecPkgContext_AuthNtlmMessage
Packit Service fa4841
	{
Packit Service fa4841
		UINT32 type;
Packit Service fa4841
		UINT32 length;
Packit Service fa4841
		BYTE* buffer;
Packit Service fa4841
	};
Packit Service fa4841
	typedef struct _SecPkgContext_AuthNtlmMessage SecPkgContext_AuthNtlmMessage;
Packit Service fa4841
Packit Service fa4841
#define SSPI_INTERFACE_WINPR 0x00000001
Packit Service fa4841
#define SSPI_INTERFACE_NATIVE 0x00000002
Packit Service fa4841
Packit Service fa4841
	typedef PSecurityFunctionTableA(SEC_ENTRY* INIT_SECURITY_INTERFACE_EX_A)(DWORD flags);
Packit Service fa4841
	typedef PSecurityFunctionTableW(SEC_ENTRY* INIT_SECURITY_INTERFACE_EX_W)(DWORD flags);
Packit Service fa4841
Packit Service fa4841
	WINPR_API void sspi_GlobalInit(void);
Packit Service fa4841
	WINPR_API void sspi_GlobalFinish(void);
Packit Service fa4841
Packit Service fa4841
	WINPR_API void* sspi_SecBufferAlloc(PSecBuffer SecBuffer, ULONG size);
Packit Service fa4841
	WINPR_API void sspi_SecBufferFree(PSecBuffer SecBuffer);
Packit Service fa4841
Packit Service fa4841
	WINPR_API int sspi_SetAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, const char* user,
Packit Service fa4841
	                                   const char* domain, const char* password);
Packit Service fa4841
	WINPR_API int sspi_SetAuthIdentityWithUnicodePassword(SEC_WINNT_AUTH_IDENTITY* identity,
Packit Service fa4841
	                                                      const char* user, const char* domain,
Packit Service fa4841
	                                                      LPWSTR password, ULONG passwordLength);
Packit Service fa4841
	WINPR_API int sspi_CopyAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity,
Packit Service fa4841
	                                    SEC_WINNT_AUTH_IDENTITY* srcIdentity);
Packit Service fa4841
Packit Service fa4841
	WINPR_API const char* GetSecurityStatusString(SECURITY_STATUS status);
Packit Service fa4841
Packit Service fa4841
	WINPR_API SecurityFunctionTableW* SEC_ENTRY InitSecurityInterfaceExW(DWORD flags);
Packit Service fa4841
	WINPR_API SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA(DWORD flags);
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service fa4841
#define InitSecurityInterfaceEx InitSecurityInterfaceExW
Packit Service fa4841
#define INIT_SECURITY_INTERFACE_EX INIT_SECURITY_INTERFACE_EX_W
Packit Service fa4841
#else
Packit Service fa4841
#define InitSecurityInterfaceEx InitSecurityInterfaceExA
Packit Service fa4841
#define INIT_SECURITY_INTERFACE_EX INIT_SECURITY_INTERFACE_EX_A
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service fa4841
}
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#endif /* WINPR_SSPI_H */