source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/sspi.h@ 1180

Last change on this file since 1180 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 70.7 KB
RevLine 
[1166]1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#ifndef __SSPI_H__
7#define __SSPI_H__
8
9#include <_mingw_unicode.h>
10#include <ntsecapi.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#ifdef SECURITY_WIN32
17#define ISSP_LEVEL 32
18#define ISSP_MODE 1
19#endif
20
21#ifdef SECURITY_KERNEL
22#define ISSP_LEVEL 32
23
24#ifdef ISSP_MODE
25#undef ISSP_MODE
26#endif
27#define ISSP_MODE 0
28#endif
29
30#ifdef SECURITY_MAC
31#define ISSP_LEVEL 32
32#define ISSP_MODE 1
33#endif
34
35#ifndef ISSP_LEVEL
36#error You must define one of SECURITY_WIN32,SECURITY_KERNEL,or
37#error SECURITY_MAC
38#endif
39
40#if defined(_NO_KSECDD_IMPORT_)
41
42#define KSECDDDECLSPEC
43#else
44
45#define KSECDDDECLSPEC __declspec(dllimport)
46#endif
47
48 typedef WCHAR SEC_WCHAR;
49 typedef CHAR SEC_CHAR;
50
51#ifndef __SECSTATUS_DEFINED__
52 typedef LONG SECURITY_STATUS;
53#define __SECSTATUS_DEFINED__
54#endif
55
56#ifndef WINAPI
57#if defined(_ARM_)
58#define WINAPI
59#else
60#define WINAPI __stdcall
61#endif
62#endif
63
64#define SEC_TEXT TEXT
65#define SEC_FAR
66#define __SEC_FAR
67#define SEC_ENTRY WINAPI
68
69#if defined(UNICODE)
70 typedef SEC_WCHAR *SECURITY_PSTR;
71 typedef CONST SEC_WCHAR *SECURITY_PCSTR;
72#else
73 typedef SEC_CHAR *SECURITY_PSTR;
74 typedef CONST SEC_CHAR *SECURITY_PCSTR;
75#endif
76
77
78#ifndef __SECHANDLE_DEFINED__
79 typedef struct _SecHandle {
80 ULONG_PTR dwLower;
81 ULONG_PTR dwUpper;
82 } SecHandle,*PSecHandle;
83
84#define __SECHANDLE_DEFINED__
85#endif
86
87#define SecInvalidateHandle(x) ((PSecHandle) x)->dwLower = ((ULONG_PTR) ((INT_PTR)-1)); ((PSecHandle) x)->dwUpper = ((ULONG_PTR) ((INT_PTR)-1));
88#define SecIsValidHandle(x) ((((PSecHandle) x)->dwLower!=((ULONG_PTR) ((INT_PTR) -1))) && (((PSecHandle) x)->dwUpper!=((ULONG_PTR) ((INT_PTR) -1))))
89
90#define SEC_DELETED_HANDLE ((ULONG_PTR)(-2))
91
92 typedef SecHandle CredHandle;
93 typedef PSecHandle PCredHandle;
94
95 typedef SecHandle CtxtHandle;
96 typedef PSecHandle PCtxtHandle;
97
98#ifdef WIN32_CHICAGO
99 __MINGW_EXTENSION typedef unsigned __int64 QWORD;
100 typedef QWORD SECURITY_INTEGER,*PSECURITY_INTEGER;
101#define SEC_SUCCESS(Status) ((Status) >= 0)
102#elif defined(_NTDEF_) || defined(_WINNT_)
103 typedef LARGE_INTEGER _SECURITY_INTEGER,SECURITY_INTEGER,*PSECURITY_INTEGER;
104#else
105 typedef struct _SECURITY_INTEGER {
106 unsigned __LONG32 LowPart;
107 __LONG32 HighPart;
108 } SECURITY_INTEGER,*PSECURITY_INTEGER;
109#endif
110
111#ifndef SECURITY_MAC
112 typedef SECURITY_INTEGER TimeStamp;
113 typedef SECURITY_INTEGER *PTimeStamp;
114#else
115 typedef unsigned __LONG32 TimeStamp;
116 typedef unsigned __LONG32 *PTimeStamp;
117#endif
118
119#ifndef _NTDEF_
120 typedef struct _SECURITY_STRING {
121 unsigned short Length;
122 unsigned short MaximumLength;
123 unsigned short *Buffer;
124 } SECURITY_STRING,*PSECURITY_STRING;
125#else
126 typedef UNICODE_STRING SECURITY_STRING,*PSECURITY_STRING;
127#endif
128
129 typedef struct _SecPkgInfoW {
130 unsigned __LONG32 fCapabilities;
131 unsigned short wVersion;
132 unsigned short wRPCID;
133 unsigned __LONG32 cbMaxToken;
134 SEC_WCHAR *Name;
135 SEC_WCHAR *Comment;
136 } SecPkgInfoW,*PSecPkgInfoW;
137
138 typedef struct _SecPkgInfoA {
139 unsigned __LONG32 fCapabilities;
140 unsigned short wVersion;
141 unsigned short wRPCID;
142 unsigned __LONG32 cbMaxToken;
143 SEC_CHAR *Name;
144 SEC_CHAR *Comment;
145 } SecPkgInfoA,*PSecPkgInfoA;
146
147#define SecPkgInfo __MINGW_NAME_AW(SecPkgInfo)
148#define PSecPkgInfo __MINGW_NAME_AW(PSecPkgInfo)
149
150#define SECPKG_FLAG_INTEGRITY 0x00000001
151#define SECPKG_FLAG_PRIVACY 0x00000002
152#define SECPKG_FLAG_TOKEN_ONLY 0x00000004
153#define SECPKG_FLAG_DATAGRAM 0x00000008
154#define SECPKG_FLAG_CONNECTION 0x00000010
155#define SECPKG_FLAG_MULTI_REQUIRED 0x00000020
156#define SECPKG_FLAG_CLIENT_ONLY 0x00000040
157#define SECPKG_FLAG_EXTENDED_ERROR 0x00000080
158#define SECPKG_FLAG_IMPERSONATION 0x00000100
159#define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200
160#define SECPKG_FLAG_STREAM 0x00000400
161#define SECPKG_FLAG_NEGOTIABLE 0x00000800
162#define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000
163#define SECPKG_FLAG_LOGON 0x00002000
164#define SECPKG_FLAG_ASCII_BUFFERS 0x00004000
165#define SECPKG_FLAG_FRAGMENT 0x00008000
166#define SECPKG_FLAG_MUTUAL_AUTH 0x00010000
167#define SECPKG_FLAG_DELEGATION 0x00020000
168#define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000
169#define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000
170#define SECPKG_FLAG_NEGO_EXTENDER 0x00100000
171#define SECPKG_FLAG_NEGOTIABLE2 0x00200000
172#define SECPKG_FLAG_APPCONTAINER_PASSTHROUGH 0x00400000
173#define SECPKG_FLAG_APPCONTAINER_CHECKS 0x00800000
174#define SECPKG_FLAG_CREDENTIAL_ISOLATION_ENABLED 0x01000000
175#define SECPKG_FLAG_APPLY_LOOPBACK 0x02000000
176
177#define SECPKG_ID_NONE 0xFFFF
178
179#define SECPKG_CALLFLAGS_APPCONTAINER 0x00000001
180#define SECPKG_CALLFLAGS_APPCONTAINER_AUTHCAPABLE 0x00000002
181#define SECPKG_CALLFLAGS_FORCE_SUPPLIED 0x00000004
182#define SECPKG_CALLFLAGS_APPCONTAINER_UPNCAPABLE 0x00000008
183
184 typedef struct _SecBuffer {
185 unsigned __LONG32 cbBuffer;
186 unsigned __LONG32 BufferType;
187 void *pvBuffer;
188 } SecBuffer,*PSecBuffer;
189
190 typedef struct _SecBufferDesc {
191 unsigned __LONG32 ulVersion;
192 unsigned __LONG32 cBuffers;
193 PSecBuffer pBuffers;
194 } SecBufferDesc,*PSecBufferDesc;
195
196#define SECBUFFER_VERSION 0
197
198#define SECBUFFER_EMPTY 0
199#define SECBUFFER_DATA 1
200#define SECBUFFER_TOKEN 2
201#define SECBUFFER_PKG_PARAMS 3
202#define SECBUFFER_MISSING 4
203#define SECBUFFER_EXTRA 5
204#define SECBUFFER_STREAM_TRAILER 6
205#define SECBUFFER_STREAM_HEADER 7
206#define SECBUFFER_NEGOTIATION_INFO 8
207#define SECBUFFER_PADDING 9
208#define SECBUFFER_STREAM 10
209#define SECBUFFER_MECHLIST 11
210#define SECBUFFER_MECHLIST_SIGNATURE 12
211#define SECBUFFER_TARGET 13
212#define SECBUFFER_CHANNEL_BINDINGS 14
213#define SECBUFFER_CHANGE_PASS_RESPONSE 15
214#define SECBUFFER_TARGET_HOST 16
215#define SECBUFFER_ALERT 17
216#define SECBUFFER_APPLICATION_PROTOCOLS 18
217#define SECBUFFER_SRTP_PROTECTION_PROFILES 19
218#define SECBUFFER_SRTP_MASTER_KEY_IDENTIFIER 20
219#define SECBUFFER_TOKEN_BINDING 21
220#define SECBUFFER_PRESHARED_KEY 22
221#define SECBUFFER_PRESHARED_KEY_IDENTITY 23
222#define SECBUFFER_DTLS_MTU 24
223#define SECBUFFER_SEND_GENERIC_TLS_EXTENSION 25
224#define SECBUFFER_SUBSCRIBE_GENERIC_TLS_EXTENSION 26
225#define SECBUFFER_FLAGS 27
226#define SECBUFFER_TRAFFIC_SECRETS 28
227
228#define SECBUFFER_ATTRMASK 0xF0000000
229#define SECBUFFER_READONLY 0x80000000
230#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000
231#define SECBUFFER_RESERVED 0x60000000
232
233 typedef struct _SEC_NEGOTIATION_INFO {
234 unsigned __LONG32 Size;
235 unsigned __LONG32 NameLength;
236 SEC_WCHAR *Name;
237 void *Reserved;
238 } SEC_NEGOTIATION_INFO,*PSEC_NEGOTIATION_INFO;
239
240 typedef struct _SEC_CHANNEL_BINDINGS {
241 unsigned __LONG32 dwInitiatorAddrType;
242 unsigned __LONG32 cbInitiatorLength;
243 unsigned __LONG32 dwInitiatorOffset;
244 unsigned __LONG32 dwAcceptorAddrType;
245 unsigned __LONG32 cbAcceptorLength;
246 unsigned __LONG32 dwAcceptorOffset;
247 unsigned __LONG32 cbApplicationDataLength;
248 unsigned __LONG32 dwApplicationDataOffset;
249 } SEC_CHANNEL_BINDINGS,*PSEC_CHANNEL_BINDINGS;
250
251 typedef enum _SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT {
252 SecApplicationProtocolNegotiationExt_None,
253 SecApplicationProtocolNegotiationExt_NPN,
254 SecApplicationProtocolNegotiationExt_ALPN
255 } SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT,*PSEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT;
256
257 typedef struct _SEC_APPLICATION_PROTOCOL_LIST {
258 SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT ProtoNegoExt;
259 unsigned short ProtocolListSize;
260 unsigned char ProtocolList[ANYSIZE_ARRAY];
261 } SEC_APPLICATION_PROTOCOL_LIST,*PSEC_APPLICATION_PROTOCOL_LIST;
262
263 typedef struct _SEC_APPLICATION_PROTOCOLS {
264 unsigned __LONG32 ProtocolListsSize;
265 SEC_APPLICATION_PROTOCOL_LIST ProtocolLists[ANYSIZE_ARRAY];
266 } SEC_APPLICATION_PROTOCOLS,*PSEC_APPLICATION_PROTOCOLS;
267
268 typedef struct _SEC_SRTP_PROTECTION_PROFILES {
269 unsigned short ProfilesSize;
270 unsigned short ProfilesList[ANYSIZE_ARRAY];
271 } SEC_SRTP_PROTECTION_PROFILES,*PSEC_SRTP_PROTECTION_PROFILES;
272
273 typedef struct _SEC_SRTP_MASTER_KEY_IDENTIFIER {
274 unsigned char MasterKeyIdentifierSize;
275 unsigned char MasterKeyIdentifier[ANYSIZE_ARRAY];
276 } SEC_SRTP_MASTER_KEY_IDENTIFIER,*PSEC_SRTP_MASTER_KEY_IDENTIFIER;
277
278 typedef struct _SEC_TOKEN_BINDING {
279 unsigned char MajorVersion;
280 unsigned char MinorVersion;
281 unsigned short KeyParametersSize;
282 unsigned char KeyParameters[ANYSIZE_ARRAY];
283 } SEC_TOKEN_BINDING,*PSEC_TOKEN_BINDING;
284
285 typedef struct _SEC_PRESHAREDKEY {
286 unsigned short KeySize;
287 unsigned char Key[ANYSIZE_ARRAY];
288 } SEC_PRESHAREDKEY,*PSEC_PRESHAREDKEY;
289
290 typedef struct _SEC_PRESHAREDKEY_IDENTITY {
291 unsigned short KeyIdentitySize;
292 unsigned char KeyIdentity[ANYSIZE_ARRAY];
293 } SEC_PRESHAREDKEY_IDENTITY,*PSEC_PRESHAREDKEY_IDENTITY;
294
295 typedef struct _SEC_DTLS_MTU {
296 unsigned short PathMTU;
297 } SEC_DTLS_MTU,*PSEC_DTLS_MTU;
298
299 typedef struct _SEC_FLAGS {
300 unsigned long long Flags;
301 } SEC_FLAGS,*PSEC_FLAGS;
302
303 typedef enum _SEC_TRAFFIC_SECRET_TYPE {
304 SecTrafficSecret_None,
305 SecTrafficSecret_Client,
306 SecTrafficSecret_Server
307 } SEC_TRAFFIC_SECRET_TYPE,*PSEC_TRAFFIC_SECRET_TYPE;
308
309#define SZ_ALG_MAX_SIZE 64
310
311 typedef struct _SEC_TRAFFIC_SECRETS {
312 wchar_t SymmetricAlgId[SZ_ALG_MAX_SIZE];
313 wchar_t ChainingMode[SZ_ALG_MAX_SIZE];
314 wchar_t HashAlgId[SZ_ALG_MAX_SIZE];
315 unsigned short KeySize;
316 unsigned short IvSize;
317 unsigned short MsgSequenceStart;
318 unsigned short MsgSequenceEnd;
319 SEC_TRAFFIC_SECRET_TYPE TrafficSecretType;
320 unsigned short TrafficSecretSize;
321 unsigned char TrafficSecret[ANYSIZE_ARRAY];
322} SEC_TRAFFIC_SECRETS,*PSEC_TRAFFIC_SECRETS;
323
324#define SECURITY_NATIVE_DREP 0x00000010
325#define SECURITY_NETWORK_DREP 0x00000000
326
327#define SECPKG_CRED_INBOUND 0x00000001
328#define SECPKG_CRED_OUTBOUND 0x00000002
329#define SECPKG_CRED_BOTH 0x00000003
330#define SECPKG_CRED_DEFAULT 0x00000004
331#define SECPKG_CRED_RESERVED 0xF0000000
332
333#define SECPKG_CRED_AUTOLOGON_RESTRICTED 0x00000010
334#define SECPKG_CRED_PROCESS_POLICY_ONLY 0x00000020
335
336#define ISC_REQ_DELEGATE 0x00000001
337#define ISC_REQ_MUTUAL_AUTH 0x00000002
338#define ISC_REQ_REPLAY_DETECT 0x00000004
339#define ISC_REQ_SEQUENCE_DETECT 0x00000008
340#define ISC_REQ_CONFIDENTIALITY 0x00000010
341#define ISC_REQ_USE_SESSION_KEY 0x00000020
342#define ISC_REQ_PROMPT_FOR_CREDS 0x00000040
343#define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080
344#define ISC_REQ_ALLOCATE_MEMORY 0x00000100
345#define ISC_REQ_USE_DCE_STYLE 0x00000200
346#define ISC_REQ_DATAGRAM 0x00000400
347#define ISC_REQ_CONNECTION 0x00000800
348#define ISC_REQ_CALL_LEVEL 0x00001000
349#define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000
350#define ISC_REQ_EXTENDED_ERROR 0x00004000
351#define ISC_REQ_STREAM 0x00008000
352#define ISC_REQ_INTEGRITY 0x00010000
353#define ISC_REQ_IDENTIFY 0x00020000
354#define ISC_REQ_NULL_SESSION 0x00040000
355#define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000
356#define ISC_REQ_RESERVED1 0x00100000
357#define ISC_REQ_FRAGMENT_TO_FIT 0x00200000
358#define ISC_REQ_FORWARD_CREDENTIALS 0x00400000
359#define ISC_REQ_NO_INTEGRITY 0x00800000
360#define ISC_REQ_USE_HTTP_STYLE 0x01000000
361#define ISC_REQ_UNVERIFIED_TARGET_NAME 0x20000000
362#define ISC_REQ_CONFIDENTIALITY_ONLY 0x40000000
363#define ISC_REQ_MESSAGES 0x0000000100000000
364
365#define ISC_RET_DELEGATE 0x00000001
366#define ISC_RET_MUTUAL_AUTH 0x00000002
367#define ISC_RET_REPLAY_DETECT 0x00000004
368#define ISC_RET_SEQUENCE_DETECT 0x00000008
369#define ISC_RET_CONFIDENTIALITY 0x00000010
370#define ISC_RET_USE_SESSION_KEY 0x00000020
371#define ISC_RET_USED_COLLECTED_CREDS 0x00000040
372#define ISC_RET_USED_SUPPLIED_CREDS 0x00000080
373#define ISC_RET_ALLOCATED_MEMORY 0x00000100
374#define ISC_RET_USED_DCE_STYLE 0x00000200
375#define ISC_RET_DATAGRAM 0x00000400
376#define ISC_RET_CONNECTION 0x00000800
377#define ISC_RET_INTERMEDIATE_RETURN 0x00001000
378#define ISC_RET_CALL_LEVEL 0x00002000
379#define ISC_RET_EXTENDED_ERROR 0x00004000
380#define ISC_RET_STREAM 0x00008000
381#define ISC_RET_INTEGRITY 0x00010000
382#define ISC_RET_IDENTIFY 0x00020000
383#define ISC_RET_NULL_SESSION 0x00040000
384#define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000
385#define ISC_RET_RESERVED1 0x00100000
386#define ISC_RET_FRAGMENT_ONLY 0x00200000
387#define ISC_RET_FORWARD_CREDENTIALS 0x00400000
388#define ISC_RET_USED_HTTP_STYLE 0x01000000
389#define ISC_RET_NO_ADDITIONAL_TOKEN 0x02000000
390#define ISC_RET_REAUTHENTICATION 0x08000000
391#define ISC_RET_CONFIDENTIALITY_ONLY 0x40000000
392#define ISC_RET_MESSAGES 0x0000000100000000
393
394#define ASC_REQ_DELEGATE 0x00000001
395#define ASC_REQ_MUTUAL_AUTH 0x00000002
396#define ASC_REQ_REPLAY_DETECT 0x00000004
397#define ASC_REQ_SEQUENCE_DETECT 0x00000008
398#define ASC_REQ_CONFIDENTIALITY 0x00000010
399#define ASC_REQ_USE_SESSION_KEY 0x00000020
400#define ASC_REQ_SESSION_TICKET 0x00000040
401#define ASC_REQ_ALLOCATE_MEMORY 0x00000100
402#define ASC_REQ_USE_DCE_STYLE 0x00000200
403#define ASC_REQ_DATAGRAM 0x00000400
404#define ASC_REQ_CONNECTION 0x00000800
405#define ASC_REQ_CALL_LEVEL 0x00001000
406#define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000
407#define ASC_REQ_EXTENDED_ERROR 0x00008000
408#define ASC_REQ_STREAM 0x00010000
409#define ASC_REQ_INTEGRITY 0x00020000
410#define ASC_REQ_LICENSING 0x00040000
411#define ASC_REQ_IDENTIFY 0x00080000
412#define ASC_REQ_ALLOW_NULL_SESSION 0x00100000
413#define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000
414#define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000
415#define ASC_REQ_FRAGMENT_TO_FIT 0x00800000
416#define ASC_REQ_NO_TOKEN 0x01000000
417#define ASC_REQ_PROXY_BINDINGS 0x04000000
418#define ASC_REQ_ALLOW_MISSING_BINDINGS 0x10000000
419#define ASC_REQ_MESSAGES 0x0000000100000000
420
421#define ASC_RET_DELEGATE 0x00000001
422#define ASC_RET_MUTUAL_AUTH 0x00000002
423#define ASC_RET_REPLAY_DETECT 0x00000004
424#define ASC_RET_SEQUENCE_DETECT 0x00000008
425#define ASC_RET_CONFIDENTIALITY 0x00000010
426#define ASC_RET_USE_SESSION_KEY 0x00000020
427#define ASC_RET_SESSION_TICKET 0x00000040
428#define ASC_RET_ALLOCATED_MEMORY 0x00000100
429#define ASC_RET_USED_DCE_STYLE 0x00000200
430#define ASC_RET_DATAGRAM 0x00000400
431#define ASC_RET_CONNECTION 0x00000800
432#define ASC_RET_CALL_LEVEL 0x00002000
433#define ASC_RET_THIRD_LEG_FAILED 0x00004000
434#define ASC_RET_EXTENDED_ERROR 0x00008000
435#define ASC_RET_STREAM 0x00010000
436#define ASC_RET_INTEGRITY 0x00020000
437#define ASC_RET_LICENSING 0x00040000
438#define ASC_RET_IDENTIFY 0x00080000
439#define ASC_RET_NULL_SESSION 0x00100000
440#define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000
441#define ASC_RET_ALLOW_CONTEXT_REPLAY 0x00400000
442#define ASC_RET_FRAGMENT_ONLY 0x00800000
443#define ASC_RET_NO_TOKEN 0x01000000
444#define ASC_RET_NO_ADDITIONAL_TOKEN 0x02000000
445#define ASC_RET_MESSAGES 0x0000000100000000
446
447#define SECPKG_CRED_ATTR_NAMES 1
448#define SECPKG_CRED_ATTR_SSI_PROVIDER 2
449#define SECPKG_CRED_ATTR_KDC_PROXY_SETTINGS 3
450#define SECPKG_CRED_ATTR_CERT 4
451#define SECPKG_CRED_ATTR_PAC_BYPASS 5
452
453 typedef struct _SecPkgCredentials_NamesW
454 {
455 SEC_WCHAR *sUserName;
456 } SecPkgCredentials_NamesW,*PSecPkgCredentials_NamesW;
457
458 typedef struct _SecPkgCredentials_NamesA
459 {
460 SEC_CHAR *sUserName;
461 } SecPkgCredentials_NamesA,*PSecPkgCredentials_NamesA;
462
463#define SecPkgCredentials_Names __MINGW_NAME_AW(SecPkgCredentials_Names)
464#define PSecPkgCredentials_Names __MINGW_NAME_AW(PSecPkgCredentials_Names)
465
466 typedef struct _SecPkgCredentials_SSIProviderW {
467 SEC_WCHAR *sProviderName;
468 unsigned __LONG32 ProviderInfoLength;
469 char *ProviderInfo;
470 } SecPkgCredentials_SSIProviderW,*PSecPkgCredentials_SSIProviderW;
471
472 typedef struct _SecPkgCredentials_SSIProviderA {
473 SEC_CHAR *sProviderName;
474 unsigned __LONG32 ProviderInfoLength;
475 char *ProviderInfo;
476 } SecPkgCredentials_SSIProviderA,*PSecPkgCredentials_SSIProviderA;
477
478#define SecPkgCredentials_SSIProvider __MINGW_NAME_AW(SecPkgCredentials_SSIProvider)
479#define PSecPkgCredentials_SSIProvider __MINGW_NAME_AW(PSecPkgCredentials_SSIProvider)
480
481#define KDC_PROXY_SETTINGS_V1 1
482#define KDC_PROXY_SETTINGS_FLAGS_FORCEPROXY 0x1
483
484 typedef struct _SecPkgCredentials_KdcProxySettingsW {
485 ULONG Version;
486 ULONG Flags;
487 USHORT ProxyServerOffset;
488 USHORT ProxyServerLength;
489 USHORT ClientTlsCredOffset;
490 USHORT ClientTlsCredLength;
491 } SecPkgCredentials_KdcProxySettingsW,*PSecPkgCredentials_KdcProxySettingsW;
492
493 typedef struct _SecPkgCredentials_Cert {
494 unsigned __LONG32 EncodedCertSize;
495 unsigned char *EncodedCert;
496 } SecPkgCredentials_Cert,*PSecPkgCredentials_Cert;
497
498#define SECPKG_ATTR_SIZES 0
499#define SECPKG_ATTR_NAMES 1
500#define SECPKG_ATTR_LIFESPAN 2
501#define SECPKG_ATTR_DCE_INFO 3
502#define SECPKG_ATTR_STREAM_SIZES 4
503#define SECPKG_ATTR_KEY_INFO 5
504#define SECPKG_ATTR_AUTHORITY 6
505#define SECPKG_ATTR_PROTO_INFO 7
506#define SECPKG_ATTR_PASSWORD_EXPIRY 8
507#define SECPKG_ATTR_SESSION_KEY 9
508#define SECPKG_ATTR_PACKAGE_INFO 10
509#define SECPKG_ATTR_USER_FLAGS 11
510#define SECPKG_ATTR_NEGOTIATION_INFO 12
511#define SECPKG_ATTR_NATIVE_NAMES 13
512#define SECPKG_ATTR_FLAGS 14
513#define SECPKG_ATTR_USE_VALIDATED 15
514#define SECPKG_ATTR_CREDENTIAL_NAME 16
515#define SECPKG_ATTR_TARGET_INFORMATION 17
516#define SECPKG_ATTR_ACCESS_TOKEN 18
517#define SECPKG_ATTR_TARGET 19
518#define SECPKG_ATTR_AUTHENTICATION_ID 20
519#define SECPKG_ATTR_LOGOFF_TIME 21
520#define SECPKG_ATTR_NEGO_KEYS 22
521#define SECPKG_ATTR_PROMPTING_NEEDED 24
522#define SECPKG_ATTR_UNIQUE_BINDINGS 25
523#define SECPKG_ATTR_ENDPOINT_BINDINGS 26
524#define SECPKG_ATTR_CLIENT_SPECIFIED_TARGET 27
525#define SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS 30
526#define SECPKG_ATTR_NEGO_PKG_INFO 31
527#define SECPKG_ATTR_NEGO_STATUS 32
528#define SECPKG_ATTR_CONTEXT_DELETED 33
529#define SECPKG_ATTR_DTLS_MTU 34
530#define SECPKG_ATTR_DATAGRAM_SIZES SECPKG_ATTR_STREAM_SIZES
531#define SECPKG_ATTR_SUBJECT_SECURITY_ATTRIBUTES 128
532#define SECPKG_ATTR_APPLICATION_PROTOCOL 35
533#define SECPKG_ATTR_NEGOTIATED_TLS_EXTENSIONS 36
534#define SECPKG_ATTR_IS_LOOPBACK 37
535
536 typedef struct _SecPkgContext_SubjectAttributes {
537 void *AttributeInfo;
538 } SecPkgContext_SubjectAttributes,*PSecPkgContext_SubjectAttributes;
539
540#define SECPKG_ATTR_NEGO_INFO_FLAG_NO_KERBEROS 0x1
541#define SECPKG_ATTR_NEGO_INFO_FLAG_NO_NTLM 0x2
542
543 typedef enum _SECPKG_CRED_CLASS {
544 SecPkgCredClass_None = 0,
545 SecPkgCredClass_Ephemeral = 10,
546 SecPkgCredClass_PersistedGeneric = 20,
547 SecPkgCredClass_PersistedSpecific = 30,
548 SecPkgCredClass_Explicit = 40
549 } SECPKG_CRED_CLASS,*PSECPKG_CRED_CLASS;
550
551 typedef struct _SecPkgContext_CredInfo {
552 SECPKG_CRED_CLASS CredClass;
553 unsigned __LONG32 IsPromptingNeeded;
554 } SecPkgContext_CredInfo,*PSecPkgContext_CredInfo;
555
556 typedef struct _SecPkgContext_NegoPackageInfo {
557 unsigned __LONG32 PackageMask;
558 } SecPkgContext_NegoPackageInfo,*PSecPkgContext_NegoPackageInfo;
559
560 typedef struct _SecPkgContext_NegoStatus {
561 unsigned __LONG32 LastStatus;
562 } SecPkgContext_NegoStatus,*PSecPkgContext_NegoStatus;
563
564 typedef struct _SecPkgContext_Sizes {
565 unsigned __LONG32 cbMaxToken;
566 unsigned __LONG32 cbMaxSignature;
567 unsigned __LONG32 cbBlockSize;
568 unsigned __LONG32 cbSecurityTrailer;
569 } SecPkgContext_Sizes,*PSecPkgContext_Sizes;
570
571 typedef struct _SecPkgContext_StreamSizes {
572 unsigned __LONG32 cbHeader;
573 unsigned __LONG32 cbTrailer;
574 unsigned __LONG32 cbMaximumMessage;
575 unsigned __LONG32 cBuffers;
576 unsigned __LONG32 cbBlockSize;
577 } SecPkgContext_StreamSizes,*PSecPkgContext_StreamSizes;
578
579typedef SecPkgContext_StreamSizes SecPkgContext_DatagramSizes;
580typedef PSecPkgContext_StreamSizes PSecPkgContext_DatagramSizes;
581
582 typedef struct _SecPkgContext_NamesW {
583 SEC_WCHAR *sUserName;
584 } SecPkgContext_NamesW,*PSecPkgContext_NamesW;
585
586 typedef enum _SECPKG_ATTR_LCT_STATUS {
587 SecPkgAttrLastClientTokenYes,
588 SecPkgAttrLastClientTokenNo,
589 SecPkgAttrLastClientTokenMaybe
590 } SECPKG_ATTR_LCT_STATUS,*PSECPKG_ATTR_LCT_STATUS;
591
592 typedef struct _SecPkgContext_LastClientTokenStatus {
593 SECPKG_ATTR_LCT_STATUS LastClientTokenStatus;
594 } SecPkgContext_LastClientTokenStatus,*PSecPkgContext_LastClientTokenStatus;
595
596 typedef struct _SecPkgContext_NamesA {
597 SEC_CHAR *sUserName;
598 } SecPkgContext_NamesA,*PSecPkgContext_NamesA;
599
600#define SecPkgContext_Names __MINGW_NAME_AW(SecPkgContext_Names)
601#define PSecPkgContext_Names __MINGW_NAME_AW(PSecPkgContext_Names)
602
603 typedef struct _SecPkgContext_Lifespan {
604 TimeStamp tsStart;
605 TimeStamp tsExpiry;
606 } SecPkgContext_Lifespan,*PSecPkgContext_Lifespan;
607
608 typedef struct _SecPkgContext_DceInfo {
609 unsigned __LONG32 AuthzSvc;
610 void *pPac;
611 } SecPkgContext_DceInfo,*PSecPkgContext_DceInfo;
612
613 typedef struct _SecPkgContext_KeyInfoA {
614 SEC_CHAR *sSignatureAlgorithmName;
615 SEC_CHAR *sEncryptAlgorithmName;
616 unsigned __LONG32 KeySize;
617 unsigned __LONG32 SignatureAlgorithm;
618 unsigned __LONG32 EncryptAlgorithm;
619 } SecPkgContext_KeyInfoA,*PSecPkgContext_KeyInfoA;
620
621 typedef struct _SecPkgContext_KeyInfoW {
622 SEC_WCHAR *sSignatureAlgorithmName;
623 SEC_WCHAR *sEncryptAlgorithmName;
624 unsigned __LONG32 KeySize;
625 unsigned __LONG32 SignatureAlgorithm;
626 unsigned __LONG32 EncryptAlgorithm;
627 } SecPkgContext_KeyInfoW,*PSecPkgContext_KeyInfoW;
628
629#define SecPkgContext_KeyInfo __MINGW_NAME_AW(SecPkgContext_KeyInfo)
630#define PSecPkgContext_KeyInfo __MINGW_NAME_AW(PSecPkgContext_KeyInfo)
631
632 typedef struct _SecPkgContext_AuthorityA {
633 SEC_CHAR *sAuthorityName;
634 } SecPkgContext_AuthorityA,*PSecPkgContext_AuthorityA;
635
636 typedef struct _SecPkgContext_AuthorityW {
637 SEC_WCHAR *sAuthorityName;
638 } SecPkgContext_AuthorityW,*PSecPkgContext_AuthorityW;
639
640#define SecPkgContext_Authority __MINGW_NAME_AW(SecPkgContext_Authority)
641#define PSecPkgContext_Authority __MINGW_NAME_AW(PSecPkgContext_Authority)
642
643 typedef struct _SecPkgContext_ProtoInfoA {
644 SEC_CHAR *sProtocolName;
645 unsigned __LONG32 majorVersion;
646 unsigned __LONG32 minorVersion;
647 } SecPkgContext_ProtoInfoA,*PSecPkgContext_ProtoInfoA;
648
649 typedef struct _SecPkgContext_ProtoInfoW {
650 SEC_WCHAR *sProtocolName;
651 unsigned __LONG32 majorVersion;
652 unsigned __LONG32 minorVersion;
653 } SecPkgContext_ProtoInfoW,*PSecPkgContext_ProtoInfoW;
654
655#define SecPkgContext_ProtoInfo __MINGW_NAME_AW(SecPkgContext_ProtoInfo)
656#define PSecPkgContext_ProtoInfo __MINGW_NAME_AW(PSecPkgContext_ProtoInfo)
657
658 typedef struct _SecPkgContext_PasswordExpiry {
659 TimeStamp tsPasswordExpires;
660 } SecPkgContext_PasswordExpiry,*PSecPkgContext_PasswordExpiry;
661
662 typedef struct _SecPkgContext_LogoffTime {
663 TimeStamp tsLogoffTime;
664 } SecPkgContext_LogoffTime,*PSecPkgContext_LogoffTime;
665
666 typedef struct _SecPkgContext_SessionKey {
667 unsigned __LONG32 SessionKeyLength;
668 unsigned char *SessionKey;
669 } SecPkgContext_SessionKey,*PSecPkgContext_SessionKey;
670
671 typedef struct _SecPkgContext_NegoKeys {
672 unsigned __LONG32 KeyType;
673 unsigned short KeyLength;
674 unsigned char *KeyValue;
675 unsigned __LONG32 VerifyKeyType;
676 unsigned short VerifyKeyLength;
677 unsigned char *VerifyKeyValue;
678 } SecPkgContext_NegoKeys,*PSecPkgContext_NegoKeys;
679
680 typedef struct _SecPkgContext_PackageInfoW {
681 PSecPkgInfoW PackageInfo;
682 } SecPkgContext_PackageInfoW,*PSecPkgContext_PackageInfoW;
683
684 typedef struct _SecPkgContext_PackageInfoA {
685 PSecPkgInfoA PackageInfo;
686 } SecPkgContext_PackageInfoA,*PSecPkgContext_PackageInfoA;
687
688 typedef struct _SecPkgContext_UserFlags {
689 unsigned __LONG32 UserFlags;
690 } SecPkgContext_UserFlags,*PSecPkgContext_UserFlags;
691
692 typedef struct _SecPkgContext_Flags {
693 unsigned __LONG32 Flags;
694 } SecPkgContext_Flags,*PSecPkgContext_Flags;
695
696#define SecPkgContext_PackageInfo __MINGW_NAME_AW(SecPkgContext_PackageInfo)
697#define PSecPkgContext_PackageInfo __MINGW_NAME_AW(PSecPkgContext_PackageInfo)
698
699 typedef struct _SecPkgContext_NegotiationInfoA {
700 PSecPkgInfoA PackageInfo;
701 unsigned __LONG32 NegotiationState;
702 } SecPkgContext_NegotiationInfoA,*PSecPkgContext_NegotiationInfoA;
703
704 typedef struct _SecPkgContext_NegotiationInfoW {
705 PSecPkgInfoW PackageInfo;
706 unsigned __LONG32 NegotiationState;
707 } SecPkgContext_NegotiationInfoW,*PSecPkgContext_NegotiationInfoW;
708
709#define SecPkgContext_NegotiationInfo __MINGW_NAME_AW(SecPkgContext_NegotiationInfo)
710#define PSecPkgContext_NegotiationInfo __MINGW_NAME_AW(PSecPkgContext_NegotiationInfo)
711
712#define SECPKG_NEGOTIATION_COMPLETE 0
713#define SECPKG_NEGOTIATION_OPTIMISTIC 1
714#define SECPKG_NEGOTIATION_IN_PROGRESS 2
715#define SECPKG_NEGOTIATION_DIRECT 3
716#define SECPKG_NEGOTIATION_TRY_MULTICRED 4
717
718 typedef struct _SecPkgContext_NativeNamesW {
719 SEC_WCHAR *sClientName;
720 SEC_WCHAR *sServerName;
721 } SecPkgContext_NativeNamesW,*PSecPkgContext_NativeNamesW;
722
723 typedef struct _SecPkgContext_NativeNamesA {
724 SEC_CHAR *sClientName;
725 SEC_CHAR *sServerName;
726 } SecPkgContext_NativeNamesA,*PSecPkgContext_NativeNamesA;
727
728#define SecPkgContext_NativeNames __MINGW_NAME_AW(SecPkgContext_NativeNames)
729#define PSecPkgContext_NativeNames __MINGW_NAME_AW(PSecPkgContext_NativeNames)
730
731 typedef struct _SecPkgContext_CredentialNameW {
732 unsigned __LONG32 CredentialType;
733 SEC_WCHAR *sCredentialName;
734 } SecPkgContext_CredentialNameW,*PSecPkgContext_CredentialNameW;
735
736 typedef struct _SecPkgContext_CredentialNameA {
737 unsigned __LONG32 CredentialType;
738 SEC_CHAR *sCredentialName;
739 } SecPkgContext_CredentialNameA,*PSecPkgContext_CredentialNameA;
740
741#define SecPkgContext_CredentialName __MINGW_NAME_AW(SecPkgContext_CredentialName)
742#define PSecPkgContext_CredentialName __MINGW_NAME_AW(PSecPkgContext_CredentialName)
743
744 typedef struct _SecPkgContext_AccessToken {
745 void *AccessToken;
746 } SecPkgContext_AccessToken,*PSecPkgContext_AccessToken;
747
748 typedef struct _SecPkgContext_TargetInformation {
749 unsigned __LONG32 MarshalledTargetInfoLength;
750 unsigned char *MarshalledTargetInfo;
751 } SecPkgContext_TargetInformation,*PSecPkgContext_TargetInformation;
752
753 typedef struct _SecPkgContext_AuthzID {
754 unsigned __LONG32 AuthzIDLength;
755 char *AuthzID;
756 } SecPkgContext_AuthzID,*PSecPkgContext_AuthzID;
757
758 typedef struct _SecPkgContext_Target {
759 unsigned __LONG32 TargetLength;
760 char *Target;
761 } SecPkgContext_Target,*PSecPkgContext_Target;
762
763 typedef struct _SecPkgContext_ClientSpecifiedTarget {
764 SEC_WCHAR *sTargetName;
765 } SecPkgContext_ClientSpecifiedTarget,*PSecPkgContext_ClientSpecifiedTarget;
766
767 typedef struct _SecPkgContext_Bindings {
768 unsigned __LONG32 BindingsLength;
769 SEC_CHANNEL_BINDINGS *Bindings;
770 } SecPkgContext_Bindings,*PSecPkgContext_Bindings;
771
772 typedef enum _SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS {
773 SecApplicationProtocolNegotiationStatus_None,
774 SecApplicationProtocolNegotiationStatus_Success,
775 SecApplicationProtocolNegotiationStatus_SelectedClientOnly
776 } SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS,*PSEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS;
777
778#define MAX_PROTOCOL_ID_SIZE 0xff
779
780 typedef struct _SecPkgContext_ApplicationProtocol {
781 SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS ProtoNegoStatus;
782 SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT ProtoNegoExt;
783 unsigned char ProtocolIdSize;
784 unsigned char ProtocolId[MAX_PROTOCOL_ID_SIZE];
785 } SecPkgContext_ApplicationProtocol,*PSecPkgContext_ApplicationProtocol;
786
787 typedef struct _SecPkgContext_NegotiatedTlsExtensions {
788 unsigned __LONG32 ExtensionsCount;
789 unsigned short *Extensions;
790 } SecPkgContext_NegotiatedTlsExtensions,*PSecPkgContext_NegotiatedTlsExtensions;
791
792 typedef struct _SECPKG_APP_MODE_INFO {
793 ULONG UserFunction;
794 ULONG_PTR Argument1;
795 ULONG_PTR Argument2;
796 SecBuffer UserData;
797 BOOLEAN ReturnToLsa;
798 } SECPKG_APP_MODE_INFO,*PSECPKG_APP_MODE_INFO;
799
800 typedef void (WINAPI *SEC_GET_KEY_FN) (void *Arg,void *Principal,unsigned __LONG32 KeyVer,void **Key,SECURITY_STATUS *Status);
801
802#define SECPKG_CONTEXT_EXPORT_RESET_NEW 0x00000001
803#define SECPKG_CONTEXT_EXPORT_DELETE_OLD 0x00000002
804#define SECPKG_CONTEXT_EXPORT_TO_KERNEL 0x00000004
805
806 KSECDDDECLSPEC SECURITY_STATUS WINAPI AcquireCredentialsHandleW(
807#if ISSP_MODE==0
808 PSECURITY_STRING pPrincipal,PSECURITY_STRING pPackage,
809#else
810 SEC_WCHAR *pszPrincipal,SEC_WCHAR *pszPackage,
811#endif
812 unsigned __LONG32 fCredentialUse,void *pvLogonId,void *pAuthData,SEC_GET_KEY_FN pGetKeyFn,void *pvGetKeyArgument,PCredHandle phCredential,PTimeStamp ptsExpiry);
813
814 typedef SECURITY_STATUS (WINAPI *ACQUIRE_CREDENTIALS_HANDLE_FN_W)(
815#if ISSP_MODE==0
816 PSECURITY_STRING,PSECURITY_STRING,
817#else
818 SEC_WCHAR *,SEC_WCHAR *,
819#endif
820 unsigned __LONG32,void *,void *,SEC_GET_KEY_FN,void *,PCredHandle,PTimeStamp);
821
822 SECURITY_STATUS WINAPI AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal,SEC_CHAR *pszPackage,unsigned __LONG32 fCredentialUse,void *pvLogonId,void *pAuthData,SEC_GET_KEY_FN pGetKeyFn,void *pvGetKeyArgument,PCredHandle phCredential,PTimeStamp ptsExpiry);
823
824 typedef SECURITY_STATUS (WINAPI *ACQUIRE_CREDENTIALS_HANDLE_FN_A)(SEC_CHAR *,SEC_CHAR *,unsigned __LONG32,void *,void *,SEC_GET_KEY_FN,void *,PCredHandle,PTimeStamp);
825
826#define AcquireCredentialsHandle __MINGW_NAME_AW(AcquireCredentialsHandle)
827#define ACQUIRE_CREDENTIALS_HANDLE_FN __MINGW_NAME_UAW(ACQUIRE_CREDENTIALS_HANDLE_FN)
828
829 KSECDDDECLSPEC SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential);
830
831 typedef SECURITY_STATUS (WINAPI *FREE_CREDENTIALS_HANDLE_FN)(PCredHandle);
832
833 KSECDDDECLSPEC SECURITY_STATUS WINAPI AddCredentialsW(PCredHandle hCredentials,
834#if ISSP_MODE==0
835 PSECURITY_STRING pPrincipal,PSECURITY_STRING pPackage,
836#else
837 SEC_WCHAR *pszPrincipal,SEC_WCHAR *pszPackage,
838#endif
839 unsigned __LONG32 fCredentialUse,void *pAuthData,SEC_GET_KEY_FN pGetKeyFn,void *pvGetKeyArgument,PTimeStamp ptsExpiry);
840
841 typedef SECURITY_STATUS (WINAPI *ADD_CREDENTIALS_FN_W)(PCredHandle,
842#if ISSP_MODE==0
843 PSECURITY_STRING,PSECURITY_STRING,
844#else
845 SEC_WCHAR *,SEC_WCHAR *,
846#endif
847 unsigned __LONG32,void *,SEC_GET_KEY_FN,void *,PTimeStamp);
848
849 SECURITY_STATUS WINAPI AddCredentialsA(PCredHandle hCredentials,SEC_CHAR *pszPrincipal,SEC_CHAR *pszPackage,unsigned __LONG32 fCredentialUse,void *pAuthData,SEC_GET_KEY_FN pGetKeyFn,void *pvGetKeyArgument,PTimeStamp ptsExpiry);
850
851 typedef SECURITY_STATUS (WINAPI *ADD_CREDENTIALS_FN_A)(PCredHandle,SEC_CHAR *,SEC_CHAR *,unsigned __LONG32,void *,SEC_GET_KEY_FN,void *,PTimeStamp);
852
853#define AddCredentials __MINGW_NAME_AW(AddCredentials)
854#define ADD_CREDENTIALS_FN __MINGW_NAME_UAW(ADD_CREDENTIALS_FN)
855
856 KSECDDDECLSPEC SECURITY_STATUS WINAPI InitializeSecurityContextW(PCredHandle phCredential,PCtxtHandle phContext,
857#if ISSP_MODE==0
858 PSECURITY_STRING pTargetName,
859#else
860 SEC_WCHAR *pszTargetName,
861#endif
862 unsigned __LONG32 fContextReq,unsigned __LONG32 Reserved1,unsigned __LONG32 TargetDataRep,PSecBufferDesc pInput,unsigned __LONG32 Reserved2,PCtxtHandle phNewContext,PSecBufferDesc pOutput,unsigned __LONG32 *pfContextAttr,PTimeStamp ptsExpiry);
863
864 typedef SECURITY_STATUS (WINAPI *INITIALIZE_SECURITY_CONTEXT_FN_W)(PCredHandle,PCtxtHandle,
865#if ISSP_MODE==0
866 PSECURITY_STRING,
867#else
868 SEC_WCHAR *,
869#endif
870 unsigned __LONG32,unsigned __LONG32,unsigned __LONG32,PSecBufferDesc,unsigned __LONG32,PCtxtHandle,PSecBufferDesc,unsigned __LONG32 *,PTimeStamp);
871
872 SECURITY_STATUS WINAPI InitializeSecurityContextA(PCredHandle phCredential,PCtxtHandle phContext,SEC_CHAR *pszTargetName,unsigned __LONG32 fContextReq,unsigned __LONG32 Reserved1,unsigned __LONG32 TargetDataRep,PSecBufferDesc pInput,unsigned __LONG32 Reserved2,PCtxtHandle phNewContext,PSecBufferDesc pOutput,unsigned __LONG32 *pfContextAttr,PTimeStamp ptsExpiry);
873
874 typedef SECURITY_STATUS (WINAPI *INITIALIZE_SECURITY_CONTEXT_FN_A)(PCredHandle,PCtxtHandle,SEC_CHAR *,unsigned __LONG32,unsigned __LONG32,unsigned __LONG32,PSecBufferDesc,unsigned __LONG32,PCtxtHandle,PSecBufferDesc,unsigned __LONG32 *,PTimeStamp);
875
876#define InitializeSecurityContext __MINGW_NAME_AW(InitializeSecurityContext)
877#define INITIALIZE_SECURITY_CONTEXT_FN __MINGW_NAME_UAW(INITIALIZE_SECURITY_CONTEXT_FN)
878
879 KSECDDDECLSPEC SECURITY_STATUS WINAPI AcceptSecurityContext(PCredHandle phCredential,PCtxtHandle phContext,PSecBufferDesc pInput,unsigned __LONG32 fContextReq,unsigned __LONG32 TargetDataRep,PCtxtHandle phNewContext,PSecBufferDesc pOutput,unsigned __LONG32 *pfContextAttr,PTimeStamp ptsExpiry);
880
881 typedef SECURITY_STATUS (WINAPI *ACCEPT_SECURITY_CONTEXT_FN)(PCredHandle,PCtxtHandle,PSecBufferDesc,unsigned __LONG32,unsigned __LONG32,PCtxtHandle,PSecBufferDesc,unsigned __LONG32 *,PTimeStamp);
882
883 SECURITY_STATUS WINAPI CompleteAuthToken(PCtxtHandle phContext,PSecBufferDesc pToken);
884
885 typedef SECURITY_STATUS (WINAPI *COMPLETE_AUTH_TOKEN_FN)(PCtxtHandle,PSecBufferDesc);
886
887 KSECDDDECLSPEC SECURITY_STATUS WINAPI ImpersonateSecurityContext(PCtxtHandle phContext);
888
889 typedef SECURITY_STATUS (WINAPI *IMPERSONATE_SECURITY_CONTEXT_FN)(PCtxtHandle);
890
891 KSECDDDECLSPEC SECURITY_STATUS WINAPI RevertSecurityContext(PCtxtHandle phContext);
892
893 typedef SECURITY_STATUS (WINAPI *REVERT_SECURITY_CONTEXT_FN)(PCtxtHandle);
894
895 KSECDDDECLSPEC SECURITY_STATUS WINAPI QuerySecurityContextToken(PCtxtHandle phContext,HANDLE *Token);
896
897 typedef SECURITY_STATUS (WINAPI *QUERY_SECURITY_CONTEXT_TOKEN_FN)(PCtxtHandle,HANDLE *);
898
899 KSECDDDECLSPEC SECURITY_STATUS WINAPI DeleteSecurityContext(PCtxtHandle phContext);
900
901 typedef SECURITY_STATUS (WINAPI *DELETE_SECURITY_CONTEXT_FN)(PCtxtHandle);
902
903 KSECDDDECLSPEC SECURITY_STATUS WINAPI ApplyControlToken(PCtxtHandle phContext,PSecBufferDesc pInput);
904
905 typedef SECURITY_STATUS (WINAPI *APPLY_CONTROL_TOKEN_FN)(PCtxtHandle,PSecBufferDesc);
906
907 KSECDDDECLSPEC SECURITY_STATUS WINAPI QueryContextAttributesW(PCtxtHandle phContext,unsigned __LONG32 ulAttribute,void *pBuffer);
908
909 typedef SECURITY_STATUS (WINAPI *QUERY_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,unsigned __LONG32,void *);
910
911 SECURITY_STATUS WINAPI QueryContextAttributesA(PCtxtHandle phContext,unsigned __LONG32 ulAttribute,void *pBuffer);
912
913 typedef SECURITY_STATUS (WINAPI *QUERY_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle,unsigned __LONG32,void *);
914
915#define QueryContextAttributes __MINGW_NAME_AW(QueryContextAttributes)
916#define QUERY_CONTEXT_ATTRIBUTES_FN __MINGW_NAME_UAW(QUERY_CONTEXT_ATTRIBUTES_FN)
917
918 SECURITY_STATUS WINAPI QueryContextAttributesExW(PCtxtHandle phContext,unsigned __LONG32 ulAttribute,void *pBuffer,unsigned __LONG32 cbBuffer);
919
920 typedef SECURITY_STATUS (WINAPI *QUERY_CONTEXT_ATTRIBUTES_EX_FN_W)(PCtxtHandle,unsigned __LONG32,void*,unsigned __LONG32);
921
922 SECURITY_STATUS WINAPI QueryContextAttributesExA(PCtxtHandle phContext,unsigned __LONG32 ulAttribute,void *pBuffer,unsigned __LONG32 cbBuffer);
923
924 typedef SECURITY_STATUS (WINAPI *QUERY_CONTEXT_ATTRIBUTES_EX_FN_A)(PCtxtHandle,unsigned __LONG32,void*,unsigned __LONG32);
925
926#define QueryContextAttributesEx __MINGW_NAME_AW(QueryContextAttributesEx)
927#define QUERY_CONTEXT_ATTRIBUTES_EX_FN __MINGW_NAME_UAW(QUERY_CONTEXT_ATTRIBUTES_EX_FN)
928
929 SECURITY_STATUS WINAPI SetContextAttributesW(PCtxtHandle phContext,unsigned __LONG32 ulAttribute,void *pBuffer,unsigned __LONG32 cbBuffer);
930
931 typedef SECURITY_STATUS (WINAPI *SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,unsigned __LONG32,void *,unsigned __LONG32);
932
933 SECURITY_STATUS WINAPI SetContextAttributesA(PCtxtHandle phContext,unsigned __LONG32 ulAttribute,void *pBuffer,unsigned __LONG32 cbBuffer);
934
935 typedef SECURITY_STATUS (WINAPI *SET_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle,unsigned __LONG32,void *,unsigned __LONG32);
936
937#define SetContextAttributes __MINGW_NAME_AW(SetContextAttributes)
938#define SET_CONTEXT_ATTRIBUTES_FN __MINGW_NAME_UAW(SET_CONTEXT_ATTRIBUTES_FN)
939
940 KSECDDDECLSPEC SECURITY_STATUS WINAPI QueryCredentialsAttributesW(PCredHandle phCredential,unsigned __LONG32 ulAttribute,void *pBuffer);
941
942 typedef SECURITY_STATUS (WINAPI *QUERY_CREDENTIALS_ATTRIBUTES_FN_W)(PCredHandle,unsigned __LONG32,void *);
943
944 SECURITY_STATUS WINAPI QueryCredentialsAttributesA(PCredHandle phCredential,unsigned __LONG32 ulAttribute,void *pBuffer);
945
946 typedef SECURITY_STATUS (WINAPI *QUERY_CREDENTIALS_ATTRIBUTES_FN_A)(PCredHandle,unsigned __LONG32,void *);
947
948#define QueryCredentialsAttributes __MINGW_NAME_AW(QueryCredentialsAttributes)
949#define QUERY_CREDENTIALS_ATTRIBUTES_FN __MINGW_NAME_UAW(QUERY_CREDENTIALS_ATTRIBUTES_FN)
950
951 SECURITY_STATUS WINAPI QueryCredentialsAttributesExW(PCredHandle phCredential,unsigned __LONG32 ulAttribute,void *pBuffer,unsigned __LONG32 cbBuffer);
952
953 typedef SECURITY_STATUS (WINAPI *QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_W)(PCredHandle,unsigned __LONG32,void*,unsigned __LONG32);
954
955 SECURITY_STATUS WINAPI QueryCredentialsAttributesExA(PCredHandle phCredential,unsigned __LONG32 ulAttribute,void *pBuffer,unsigned __LONG32 cbBuffer);
956
957 typedef SECURITY_STATUS (WINAPI *QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_A)(PCredHandle,unsigned __LONG32,void*,unsigned __LONG32);
958
959#define QueryCredentialsAttributesEx __MINGW_NAME_AW(QueryCredentialsAttributesEx)
960#define QUERY_CREDENTIALS_ATTRIBUTES_EX_FN __MINGW_NAME_UAW(QUERY_CREDENTIALS_ATTRIBUTES_EX_FN)
961
962 KSECDDDECLSPEC SECURITY_STATUS WINAPI SetCredentialsAttributesW(PCredHandle phCredential,unsigned __LONG32 ulAttribute,void *pBuffer,unsigned __LONG32 cbBuffer);
963
964 typedef SECURITY_STATUS (WINAPI *SET_CREDENTIALS_ATTRIBUTES_FN_W)(PCredHandle,unsigned __LONG32,void *,unsigned __LONG32);
965
966 SECURITY_STATUS WINAPI SetCredentialsAttributesA(PCredHandle phCredential,unsigned __LONG32 ulAttribute,void *pBuffer,unsigned __LONG32 cbBuffer);
967
968 typedef SECURITY_STATUS (WINAPI *SET_CREDENTIALS_ATTRIBUTES_FN_A)(PCredHandle,unsigned __LONG32,void *,unsigned __LONG32);
969
970#define SetCredentialsAttributes __MINGW_NAME_AW(SetCredentialsAttributes)
971#define SET_CREDENTIALS_ATTRIBUTES_FN __MINGW_NAME_UAW(SET_CREDENTIALS_ATTRIBUTES_FN)
972
973 SECURITY_STATUS WINAPI FreeContextBuffer(void *pvContextBuffer);
974
975 typedef SECURITY_STATUS (WINAPI *FREE_CONTEXT_BUFFER_FN)(void *);
976
977 KSECDDDECLSPEC SECURITY_STATUS WINAPI MakeSignature(PCtxtHandle phContext,unsigned __LONG32 fQOP,PSecBufferDesc pMessage,unsigned __LONG32 MessageSeqNo);
978
979 typedef SECURITY_STATUS (WINAPI *MAKE_SIGNATURE_FN)(PCtxtHandle,unsigned __LONG32,PSecBufferDesc,unsigned __LONG32);
980
981 KSECDDDECLSPEC SECURITY_STATUS WINAPI VerifySignature(PCtxtHandle phContext,PSecBufferDesc pMessage,unsigned __LONG32 MessageSeqNo,unsigned __LONG32 *pfQOP);
982
983 typedef SECURITY_STATUS (WINAPI *VERIFY_SIGNATURE_FN)(PCtxtHandle,PSecBufferDesc,unsigned __LONG32,unsigned __LONG32 *);
984
985#define SECQOP_WRAP_NO_ENCRYPT 0x80000001
986#define SECQOP_WRAP_OOB_DATA 0x40000000
987
988 SECURITY_STATUS WINAPI EncryptMessage(PCtxtHandle phContext,unsigned __LONG32 fQOP,PSecBufferDesc pMessage,unsigned __LONG32 MessageSeqNo);
989
990 typedef SECURITY_STATUS (WINAPI *ENCRYPT_MESSAGE_FN)(PCtxtHandle,unsigned __LONG32,PSecBufferDesc,unsigned __LONG32);
991
992 SECURITY_STATUS WINAPI DecryptMessage(PCtxtHandle phContext,PSecBufferDesc pMessage,unsigned __LONG32 MessageSeqNo,unsigned __LONG32 *pfQOP);
993
994 typedef SECURITY_STATUS (WINAPI *DECRYPT_MESSAGE_FN)(PCtxtHandle,PSecBufferDesc,unsigned __LONG32,unsigned __LONG32 *);
995
996 KSECDDDECLSPEC SECURITY_STATUS WINAPI EnumerateSecurityPackagesW(unsigned __LONG32 *pcPackages,PSecPkgInfoW *ppPackageInfo);
997
998 typedef SECURITY_STATUS (WINAPI *ENUMERATE_SECURITY_PACKAGES_FN_W)(unsigned __LONG32 *,PSecPkgInfoW *);
999
1000 SECURITY_STATUS WINAPI EnumerateSecurityPackagesA(unsigned __LONG32 *pcPackages,PSecPkgInfoA *ppPackageInfo);
1001
1002 typedef SECURITY_STATUS (WINAPI *ENUMERATE_SECURITY_PACKAGES_FN_A)(unsigned __LONG32 *,PSecPkgInfoA *);
1003
1004#define EnumerateSecurityPackages __MINGW_NAME_AW(EnumerateSecurityPackages)
1005#define ENUMERATE_SECURITY_PACKAGES_FN __MINGW_NAME_UAW(ENUMERATE_SECURITY_PACKAGES_FN)
1006
1007 KSECDDDECLSPEC SECURITY_STATUS WINAPI QuerySecurityPackageInfoW(
1008#if ISSP_MODE==0
1009 PSECURITY_STRING pPackageName,
1010#else
1011 SEC_WCHAR *pszPackageName,
1012#endif
1013 PSecPkgInfoW *ppPackageInfo);
1014
1015 typedef SECURITY_STATUS (WINAPI *QUERY_SECURITY_PACKAGE_INFO_FN_W)(
1016#if ISSP_MODE==0
1017 PSECURITY_STRING,
1018#else
1019 SEC_WCHAR *,
1020#endif
1021 PSecPkgInfoW *);
1022
1023 SECURITY_STATUS WINAPI QuerySecurityPackageInfoA(SEC_CHAR *pszPackageName,PSecPkgInfoA *ppPackageInfo);
1024
1025 typedef SECURITY_STATUS (WINAPI *QUERY_SECURITY_PACKAGE_INFO_FN_A)(SEC_CHAR *,PSecPkgInfoA *);
1026
1027#define QuerySecurityPackageInfo __MINGW_NAME_AW(QuerySecurityPackageInfo)
1028#define QUERY_SECURITY_PACKAGE_INFO_FN __MINGW_NAME_UAW(QUERY_SECURITY_PACKAGE_INFO_FN)
1029
1030 typedef enum _SecDelegationType {
1031 SecFull,SecService,SecTree,SecDirectory,SecObject
1032 } SecDelegationType,*PSecDelegationType;
1033
1034 SECURITY_STATUS WINAPI DelegateSecurityContext(PCtxtHandle phContext,
1035#if ISSP_MODE==0
1036 PSECURITY_STRING pTarget,
1037#else
1038 SEC_CHAR *pszTarget,
1039#endif
1040 SecDelegationType DelegationType,PTimeStamp pExpiry,PSecBuffer pPackageParameters,PSecBufferDesc pOutput);
1041
1042 KSECDDDECLSPEC SECURITY_STATUS WINAPI ExportSecurityContext(PCtxtHandle phContext,ULONG fFlags,PSecBuffer pPackedContext,void **pToken);
1043
1044 typedef SECURITY_STATUS (WINAPI *EXPORT_SECURITY_CONTEXT_FN)(PCtxtHandle,ULONG,PSecBuffer,void **);
1045
1046 KSECDDDECLSPEC SECURITY_STATUS WINAPI ImportSecurityContextW(
1047#if ISSP_MODE==0
1048 PSECURITY_STRING pszPackage,
1049#else
1050 SEC_WCHAR *pszPackage,
1051#endif
1052 PSecBuffer pPackedContext,void *Token,PCtxtHandle phContext);
1053
1054 typedef SECURITY_STATUS (WINAPI *IMPORT_SECURITY_CONTEXT_FN_W)(
1055#if ISSP_MODE==0
1056 PSECURITY_STRING,
1057#else
1058 SEC_WCHAR *,
1059#endif
1060 PSecBuffer,VOID *,PCtxtHandle);
1061
1062 SECURITY_STATUS WINAPI ImportSecurityContextA(SEC_CHAR *pszPackage,PSecBuffer pPackedContext,VOID *Token,PCtxtHandle phContext);
1063
1064 typedef SECURITY_STATUS (WINAPI *IMPORT_SECURITY_CONTEXT_FN_A)(SEC_CHAR *,PSecBuffer,void *,PCtxtHandle);
1065
1066#define ImportSecurityContext __MINGW_NAME_AW(ImportSecurityContext)
1067#define IMPORT_SECURITY_CONTEXT_FN __MINGW_NAME_UAW(IMPORT_SECURITY_CONTEXT_FN)
1068
1069#if ISSP_MODE==0
1070 KSECDDDECLSPEC NTSTATUS NTAPI SecMakeSPN(PUNICODE_STRING ServiceClass,PUNICODE_STRING ServiceName,PUNICODE_STRING InstanceName,USHORT InstancePort,PUNICODE_STRING Referrer,PUNICODE_STRING Spn,PULONG Length,BOOLEAN Allocate);
1071 KSECDDDECLSPEC NTSTATUS NTAPI SecMakeSPNEx(PUNICODE_STRING ServiceClass,PUNICODE_STRING ServiceName,PUNICODE_STRING InstanceName,USHORT InstancePort,PUNICODE_STRING Referrer,PUNICODE_STRING TargetInfo,PUNICODE_STRING Spn,PULONG Length,BOOLEAN Allocate);
1072 KSECDDDECLSPEC NTSTATUS NTAPI SecMakeSPNEx2(PUNICODE_STRING ServiceClass,PUNICODE_STRING ServiceName,PUNICODE_STRING InstanceName,USHORT InstancePort,PUNICODE_STRING Referrer,PUNICODE_STRING InTargetInfo,PUNICODE_STRING Spn,PULONG TotalSize,BOOLEAN Allocate,BOOLEAN IsTargetInfoMarshaled);
1073 KSECDDDECLSPEC NTSTATUS WINAPI SecLookupAccountSid(PSID Sid,PULONG NameSize,PUNICODE_STRING NameBuffer,PULONG DomainSize,PUNICODE_STRING DomainBuffer,PSID_NAME_USE NameUse);
1074 KSECDDDECLSPEC NTSTATUS WINAPI SecLookupAccountName(PUNICODE_STRING Name,PULONG SidSize,PSID Sid,PSID_NAME_USE NameUse,PULONG DomainSize,PUNICODE_STRING ReferencedDomain);
1075 KSECDDDECLSPEC NTSTATUS WINAPI SecLookupWellKnownSid(WELL_KNOWN_SID_TYPE SidType,PSID Sid,ULONG SidBufferSize,PULONG SidSize);
1076#endif
1077
1078#define SECURITY_ENTRYPOINT_ANSIW "InitSecurityInterfaceW"
1079#define SECURITY_ENTRYPOINT_ANSIA "InitSecurityInterfaceA"
1080#define SECURITY_ENTRYPOINTW SEC_TEXT("InitSecurityInterfaceW")
1081#define SECURITY_ENTRYPOINTA SEC_TEXT("InitSecurityInterfaceA")
1082#define SECURITY_ENTRYPOINT16 "INITSECURITYINTERFACEA"
1083
1084#ifdef SECURITY_WIN32
1085#define SECURITY_ENTRYPOINT __MINGW_NAME_AW(SECURITY_ENTRYPOINT)
1086#define SECURITY_ENTRYPOINT_ANSI __MINGW_NAME_AW(SECURITY_ENTRYPOINT_ANSI)
1087#else
1088#define SECURITY_ENTRYPOINT SECURITY_ENTRYPOINT16
1089#define SECURITY_ENTRYPOINT_ANSI SECURITY_ENTRYPOINT16
1090#endif
1091
1092#define FreeCredentialHandle FreeCredentialsHandle
1093
1094#if ISSP_MODE != 0
1095
1096SECURITY_STATUS SEC_ENTRY ChangeAccountPasswordW(SEC_WCHAR* pszPackageName,
1097 SEC_WCHAR* pszDomainName,
1098 SEC_WCHAR* pszAccountName,
1099 SEC_WCHAR* pszOldPassword,
1100 SEC_WCHAR* pszNewPassword,
1101 BOOLEAN bImpersonating,
1102 unsigned __LONG32 dwReserved,
1103 PSecBufferDesc pOutput);
1104
1105typedef SECURITY_STATUS (SEC_ENTRY *CHANGE_PASSWORD_FN_W)(SEC_WCHAR*,
1106 SEC_WCHAR*,
1107 SEC_WCHAR*,
1108 SEC_WCHAR*,
1109 SEC_WCHAR*,
1110 BOOLEAN,
1111 unsigned __LONG32,
1112 PSecBufferDesc);
1113
1114SECURITY_STATUS SEC_ENTRY ChangeAccountPasswordA(SEC_CHAR* pszPackageName,
1115 SEC_CHAR* pszDomainName,
1116 SEC_CHAR* pszAccountName,
1117 SEC_CHAR* pszOldPassword,
1118 SEC_CHAR* pszNewPassword,
1119 BOOLEAN bImpersonating,
1120 unsigned __LONG32 dwReserved,
1121 PSecBufferDesc pOutput);
1122
1123typedef SECURITY_STATUS (SEC_ENTRY *CHANGE_PASSWORD_FN_A)(SEC_CHAR*,
1124 SEC_CHAR*,
1125 SEC_CHAR*,
1126 SEC_CHAR*,
1127 SEC_CHAR*,
1128 BOOLEAN,
1129 unsigned __LONG32,
1130 PSecBufferDesc);
1131
1132#define ChangeAccountPassword __MINGW_NAME_AW(ChangeAccountPassword)
1133#define CHANGE_PASSWORD_FN __MINGW_NAME_UAW(CHANGE_PASSWORD_FN)
1134
1135#endif
1136
1137 typedef struct _SECURITY_FUNCTION_TABLE_W {
1138 unsigned __LONG32 dwVersion;
1139 ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW;
1140 QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW;
1141 ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW;
1142 FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
1143 void *Reserved2;
1144 INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW;
1145 ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
1146 COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
1147 DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
1148 APPLY_CONTROL_TOKEN_FN ApplyControlToken;
1149 QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW;
1150 IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
1151 REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
1152 MAKE_SIGNATURE_FN MakeSignature;
1153 VERIFY_SIGNATURE_FN VerifySignature;
1154 FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
1155 QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW;
1156 void *Reserved3;
1157 void *Reserved4;
1158 EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
1159 IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW;
1160 ADD_CREDENTIALS_FN_W AddCredentialsW;
1161 void *Reserved8;
1162 QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
1163 ENCRYPT_MESSAGE_FN EncryptMessage;
1164 DECRYPT_MESSAGE_FN DecryptMessage;
1165 SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW;
1166 SET_CREDENTIALS_ATTRIBUTES_FN_W SetCredentialsAttributesW;
1167#if ISSP_MODE != 0
1168 CHANGE_PASSWORD_FN_W ChangeAccountPasswordW;
1169#else
1170 void* Reserved9;
1171#endif
1172#if NTDDI_VERSION > NTDDI_WINBLUE
1173 QUERY_CONTEXT_ATTRIBUTES_EX_FN_W QueryContextAttributesExW;
1174 QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_W QueryCredentialsAttributesExW;
1175#endif
1176 } SecurityFunctionTableW,*PSecurityFunctionTableW;
1177
1178 typedef struct _SECURITY_FUNCTION_TABLE_A {
1179 unsigned __LONG32 dwVersion;
1180 ENUMERATE_SECURITY_PACKAGES_FN_A EnumerateSecurityPackagesA;
1181 QUERY_CREDENTIALS_ATTRIBUTES_FN_A QueryCredentialsAttributesA;
1182 ACQUIRE_CREDENTIALS_HANDLE_FN_A AcquireCredentialsHandleA;
1183 FREE_CREDENTIALS_HANDLE_FN FreeCredentialHandle;
1184 void *Reserved2;
1185 INITIALIZE_SECURITY_CONTEXT_FN_A InitializeSecurityContextA;
1186 ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
1187 COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
1188 DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
1189 APPLY_CONTROL_TOKEN_FN ApplyControlToken;
1190 QUERY_CONTEXT_ATTRIBUTES_FN_A QueryContextAttributesA;
1191 IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
1192 REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
1193 MAKE_SIGNATURE_FN MakeSignature;
1194 VERIFY_SIGNATURE_FN VerifySignature;
1195 FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
1196 QUERY_SECURITY_PACKAGE_INFO_FN_A QuerySecurityPackageInfoA;
1197 void *Reserved3;
1198 void *Reserved4;
1199 EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
1200 IMPORT_SECURITY_CONTEXT_FN_A ImportSecurityContextA;
1201 ADD_CREDENTIALS_FN_A AddCredentialsA;
1202 void *Reserved8;
1203 QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
1204 ENCRYPT_MESSAGE_FN EncryptMessage;
1205 DECRYPT_MESSAGE_FN DecryptMessage;
1206 SET_CONTEXT_ATTRIBUTES_FN_A SetContextAttributesA;
1207 SET_CREDENTIALS_ATTRIBUTES_FN_A SetCredentialsAttributesA;
1208#if ISSP_MODE != 0
1209 CHANGE_PASSWORD_FN_A ChangeAccountPasswordA;
1210#else
1211 void* Reserved9;
1212#endif
1213#if NTDDI_VERSION > NTDDI_WINBLUE
1214 QUERY_CONTEXT_ATTRIBUTES_EX_FN_A QueryContextAttributesExA;
1215 QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_A QueryCredentialsAttributesExA;
1216#endif
1217 } SecurityFunctionTableA,*PSecurityFunctionTableA;
1218
1219#define SecurityFunctionTable __MINGW_NAME_AW(SecurityFunctionTable)
1220#define PSecurityFunctionTable __MINGW_NAME_AW(PSecurityFunctionTable)
1221
1222#define SECURITY_
1223
1224#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1
1225#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2
1226#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 3
1227#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_4 4
1228#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_5 5
1229
1230 PSecurityFunctionTableA WINAPI InitSecurityInterfaceA(void);
1231
1232 typedef PSecurityFunctionTableA (WINAPI *INIT_SECURITY_INTERFACE_A)(void);
1233
1234 KSECDDDECLSPEC PSecurityFunctionTableW WINAPI InitSecurityInterfaceW(void);
1235
1236 typedef PSecurityFunctionTableW (WINAPI *INIT_SECURITY_INTERFACE_W)(void);
1237
1238#define InitSecurityInterface __MINGW_NAME_AW(InitSecurityInterface)
1239#define INIT_SECURITY_INTERFACE __MINGW_NAME_UAW(INIT_SECURITY_INTERFACE)
1240
1241#ifdef SECURITY_WIN32
1242
1243 SECURITY_STATUS WINAPI SaslEnumerateProfilesA(LPSTR *ProfileList,ULONG *ProfileCount);
1244 SECURITY_STATUS WINAPI SaslEnumerateProfilesW(LPWSTR *ProfileList,ULONG *ProfileCount);
1245
1246#define SaslEnumerateProfiles __MINGW_NAME_AW(SaslEnumerateProfiles)
1247
1248 SECURITY_STATUS WINAPI SaslGetProfilePackageA(LPSTR ProfileName,PSecPkgInfoA *PackageInfo);
1249 SECURITY_STATUS WINAPI SaslGetProfilePackageW(LPWSTR ProfileName,PSecPkgInfoW *PackageInfo);
1250
1251#define SaslGetProfilePackage __MINGW_NAME_AW(SaslGetProfilePackage)
1252
1253 SECURITY_STATUS WINAPI SaslIdentifyPackageA(PSecBufferDesc pInput,PSecPkgInfoA *PackageInfo);
1254 SECURITY_STATUS WINAPI SaslIdentifyPackageW(PSecBufferDesc pInput,PSecPkgInfoW *PackageInfo);
1255
1256#define SaslIdentifyPackage __MINGW_NAME_AW(SaslIdentifyPackage)
1257
1258 SECURITY_STATUS WINAPI SaslInitializeSecurityContextW(PCredHandle phCredential,PCtxtHandle phContext,LPWSTR pszTargetName,unsigned __LONG32 fContextReq,unsigned __LONG32 Reserved1,unsigned __LONG32 TargetDataRep,PSecBufferDesc pInput,unsigned __LONG32 Reserved2,PCtxtHandle phNewContext,PSecBufferDesc pOutput,unsigned __LONG32 *pfContextAttr,PTimeStamp ptsExpiry);
1259 SECURITY_STATUS WINAPI SaslInitializeSecurityContextA(PCredHandle phCredential,PCtxtHandle phContext,LPSTR pszTargetName,unsigned __LONG32 fContextReq,unsigned __LONG32 Reserved1,unsigned __LONG32 TargetDataRep,PSecBufferDesc pInput,unsigned __LONG32 Reserved2,PCtxtHandle phNewContext,PSecBufferDesc pOutput,unsigned __LONG32 *pfContextAttr,PTimeStamp ptsExpiry);
1260
1261#define SaslInitializeSecurityContext __MINGW_NAME_AW(SaslInitializeSecurityContext)
1262
1263 SECURITY_STATUS WINAPI SaslAcceptSecurityContext(PCredHandle phCredential,PCtxtHandle phContext,PSecBufferDesc pInput,unsigned __LONG32 fContextReq,unsigned __LONG32 TargetDataRep,PCtxtHandle phNewContext,PSecBufferDesc pOutput,unsigned __LONG32 *pfContextAttr,PTimeStamp ptsExpiry);
1264
1265#define SASL_OPTION_SEND_SIZE 1
1266#define SASL_OPTION_RECV_SIZE 2
1267#define SASL_OPTION_AUTHZ_STRING 3
1268#define SASL_OPTION_AUTHZ_PROCESSING 4
1269
1270 typedef enum _SASL_AUTHZID_STATE {
1271 Sasl_AuthZIDForbidden,Sasl_AuthZIDProcessed
1272 } SASL_AUTHZID_STATE;
1273
1274 SECURITY_STATUS WINAPI SaslSetContextOption(PCtxtHandle ContextHandle,ULONG Option,PVOID Value,ULONG Size);
1275 SECURITY_STATUS WINAPI SaslGetContextOption(PCtxtHandle ContextHandle,ULONG Option,PVOID Value,ULONG Size,PULONG Needed);
1276#endif
1277
1278#ifndef _AUTH_IDENTITY_EX2_DEFINED
1279#define _AUTH_IDENTITY_EX2_DEFINED
1280
1281#define SEC_WINNT_AUTH_IDENTITY_VERSION_2 0x201
1282
1283 typedef struct _SEC_WINNT_AUTH_IDENTITY_EX2 {
1284 unsigned __LONG32 Version;
1285 unsigned short cbHeaderLength;
1286 unsigned __LONG32 cbStructureLength;
1287 unsigned __LONG32 UserOffset;
1288 unsigned short UserLength;
1289 unsigned __LONG32 DomainOffset;
1290 unsigned short DomainLength;
1291 unsigned __LONG32 PackedCredentialsOffset;
1292 unsigned short PackedCredentialsLength;
1293 unsigned __LONG32 Flags;
1294 unsigned __LONG32 PackageListOffset;
1295 unsigned short PackageListLength;
1296 } SEC_WINNT_AUTH_IDENTITY_EX2, *PSEC_WINNT_AUTH_IDENTITY_EX2;
1297
1298#endif
1299
1300#ifndef _AUTH_IDENTITY_DEFINED
1301#define _AUTH_IDENTITY_DEFINED
1302
1303#define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1
1304#define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2
1305
1306 typedef struct _SEC_WINNT_AUTH_IDENTITY_W {
1307 unsigned short *User;
1308 unsigned __LONG32 UserLength;
1309 unsigned short *Domain;
1310 unsigned __LONG32 DomainLength;
1311 unsigned short *Password;
1312 unsigned __LONG32 PasswordLength;
1313 unsigned __LONG32 Flags;
1314 } SEC_WINNT_AUTH_IDENTITY_W,*PSEC_WINNT_AUTH_IDENTITY_W;
1315
1316 typedef struct _SEC_WINNT_AUTH_IDENTITY_A {
1317 unsigned char *User;
1318 unsigned __LONG32 UserLength;
1319 unsigned char *Domain;
1320 unsigned __LONG32 DomainLength;
1321 unsigned char *Password;
1322 unsigned __LONG32 PasswordLength;
1323 unsigned __LONG32 Flags;
1324 } SEC_WINNT_AUTH_IDENTITY_A,*PSEC_WINNT_AUTH_IDENTITY_A;
1325
1326#define SEC_WINNT_AUTH_IDENTITY __MINGW_NAME_UAW(SEC_WINNT_AUTH_IDENTITY)
1327#define PSEC_WINNT_AUTH_IDENTITY __MINGW_NAME_UAW(PSEC_WINNT_AUTH_IDENTITY)
1328#define _SEC_WINNT_AUTH_IDENTITY __MINGW_NAME_UAW(_SEC_WINNT_AUTH_IDENTITY)
1329#endif
1330
1331#ifndef SEC_WINNT_AUTH_IDENTITY_VERSION
1332#define SEC_WINNT_AUTH_IDENTITY_VERSION 0x200
1333
1334 typedef struct _SEC_WINNT_AUTH_IDENTITY_EXW {
1335 unsigned __LONG32 Version;
1336 unsigned __LONG32 Length;
1337 unsigned short *User;
1338 unsigned __LONG32 UserLength;
1339 unsigned short *Domain;
1340 unsigned __LONG32 DomainLength;
1341 unsigned short *Password;
1342 unsigned __LONG32 PasswordLength;
1343 unsigned __LONG32 Flags;
1344 unsigned short *PackageList;
1345 unsigned __LONG32 PackageListLength;
1346 } SEC_WINNT_AUTH_IDENTITY_EXW,*PSEC_WINNT_AUTH_IDENTITY_EXW;
1347
1348 typedef struct _SEC_WINNT_AUTH_IDENTITY_EXA {
1349 unsigned __LONG32 Version;
1350 unsigned __LONG32 Length;
1351 unsigned char *User;
1352 unsigned __LONG32 UserLength;
1353 unsigned char *Domain;
1354 unsigned __LONG32 DomainLength;
1355 unsigned char *Password;
1356 unsigned __LONG32 PasswordLength;
1357 unsigned __LONG32 Flags;
1358 unsigned char *PackageList;
1359 unsigned __LONG32 PackageListLength;
1360 } SEC_WINNT_AUTH_IDENTITY_EXA,*PSEC_WINNT_AUTH_IDENTITY_EXA;
1361
1362#define SEC_WINNT_AUTH_IDENTITY_EX __MINGW_NAME_AW(SEC_WINNT_AUTH_IDENTITY_EX)
1363#define PSEC_WINNT_AUTH_IDENTITY_EX __MINGW_NAME_AW(PSEC_WINNT_AUTH_IDENTITY_EX)
1364#endif
1365
1366#ifndef _AUTH_IDENTITY_INFO_DEFINED
1367#define _AUTH_IDENTITY_INFO_DEFINED
1368
1369 typedef union _SEC_WINNT_AUTH_IDENTITY_INFO {
1370 SEC_WINNT_AUTH_IDENTITY_EXW AuthIdExw;
1371 SEC_WINNT_AUTH_IDENTITY_EXA AuthIdExa;
1372 SEC_WINNT_AUTH_IDENTITY_A AuthId_a;
1373 SEC_WINNT_AUTH_IDENTITY_W AuthId_w;
1374 SEC_WINNT_AUTH_IDENTITY_EX2 AuthIdEx2;
1375 } SEC_WINNT_AUTH_IDENTITY_INFO, *PSEC_WINNT_AUTH_IDENTITY_INFO;
1376
1377#define SEC_WINNT_AUTH_IDENTITY_FLAGS_PROCESS_ENCRYPTED 0x10
1378#define SEC_WINNT_AUTH_IDENTITY_FLAGS_SYSTEM_PROTECTED 0x20
1379#define SEC_WINNT_AUTH_IDENTITY_FLAGS_USER_PROTECTED 0x40
1380#define SEC_WINNT_AUTH_IDENTITY_FLAGS_SYSTEM_ENCRYPTED 0x80
1381
1382#define SEC_WINNT_AUTH_IDENTITY_FLAGS_RESERVED 0x10000
1383#define SEC_WINNT_AUTH_IDENTITY_FLAGS_NULL_USER 0x20000
1384#define SEC_WINNT_AUTH_IDENTITY_FLAGS_NULL_DOMAIN 0x40000
1385#define SEC_WINNT_AUTH_IDENTITY_FLAGS_ID_PROVIDER 0x80000
1386
1387#define SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_USE_MASK 0xff000000
1388#define SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_CREDPROV_DO_NOT_SAVE 0x80000000
1389#define SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_SAVE_CRED_BY_CALLER SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_CREDPROV_DO_NOT_SAVE
1390#define SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_SAVE_CRED_CHECKED 0x40000000
1391#define SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_NO_CHECKBOX 0x20000000
1392#define SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_CREDPROV_DO_NOT_LOAD 0x10000000
1393
1394#define SEC_WINNT_AUTH_IDENTITY_FLAGS_VALID_SSPIPFC_FLAGS \
1395 (SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_CREDPROV_DO_NOT_SAVE | \
1396 SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_SAVE_CRED_CHECKED | \
1397 SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_NO_CHECKBOX | \
1398 SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_CREDPROV_DO_NOT_LOAD)
1399
1400#endif
1401
1402#define SSPIPFC_CREDPROV_DO_NOT_SAVE 0x00000001
1403#define SSPIPFC_SAVE_CRED_BY_CALLER SSPIPFC_CREDPROV_DO_NOT_SAVE
1404#define SSPIPFC_NO_CHECKBOX 0x00000002
1405#define SSPIPFC_CREDPROV_DO_NOT_LOAD 0x00000004
1406#define SSPIPFC_USE_CREDUIBROKER 0x00000008
1407#define SSPIPFC_VALID_FLAGS \
1408 (SSPIPFC_CREDPROV_DO_NOT_SAVE | SSPIPFC_NO_CHECKBOX | SSPIPFC_CREDPROV_DO_NOT_LOAD | SSPIPFC_USE_CREDUIBROKER)
1409
1410#ifndef _SSPIPFC_NONE_
1411
1412typedef PVOID PSEC_WINNT_AUTH_IDENTITY_OPAQUE;
1413
1414unsigned __LONG32 SEC_ENTRY SspiPromptForCredentialsW(
1415 PCWSTR pszTargetName,
1416#ifdef _CREDUI_INFO_DEFINED
1417 PCREDUI_INFOW pUiInfo,
1418#else
1419 PVOID pUiInfo,
1420#endif
1421 unsigned __LONG32 dwAuthError,
1422 PCWSTR pszPackage,
1423 PSEC_WINNT_AUTH_IDENTITY_OPAQUE pInputAuthIdentity,
1424 PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity,
1425 int* pfSave,
1426 unsigned __LONG32 dwFlags
1427);
1428
1429unsigned __LONG32 SEC_ENTRY SspiPromptForCredentialsA(
1430 PCSTR pszTargetName,
1431#ifdef _CREDUI_INFO_DEFINED
1432 PCREDUI_INFOA pUiInfo,
1433#else
1434 PVOID pUiInfo,
1435#endif
1436 unsigned __LONG32 dwAuthError,
1437 PCSTR pszPackage,
1438 PSEC_WINNT_AUTH_IDENTITY_OPAQUE pInputAuthIdentity,
1439 PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity,
1440 int* pfSave,
1441 unsigned __LONG32 dwFlags
1442);
1443
1444#else
1445
1446typedef PSEC_WINNT_AUTH_IDENTITY_INFO PSEC_WINNT_AUTH_IDENTITY_OPAQUE;
1447
1448#endif
1449
1450#ifdef _SEC_WINNT_AUTH_TYPES
1451
1452EXTERN_C __declspec(selectany) const GUID SEC_WINNT_AUTH_DATA_TYPE_PASSWORD =
1453 { 0x28bfc32f, 0x10f6, 0x4738, { 0x98, 0xd1, 0x1a, 0xc0, 0x61, 0xdf, 0x71, 0x6a } };
1454
1455EXTERN_C __declspec(selectany) const GUID SEC_WINNT_AUTH_DATA_TYPE_CERT =
1456 { 0x235f69ad, 0x73fb, 0x4dbc, { 0x82, 0x3, 0x6, 0x29, 0xe7, 0x39, 0x33, 0x9b } };
1457
1458EXTERN_C __declspec(selectany) const GUID SEC_WINNT_AUTH_DATA_TYPE_CREDMAN_CERT =
1459 { 0x7cb72412, 0x1016, 0x491a, { 0x8c, 0x87, 0x4d, 0x2a, 0xa1, 0xb7, 0xdd, 0x3a } };
1460
1461EXTERN_C __declspec(selectany) const GUID SEC_WINNT_AUTH_DATA_TYPE_NGC =
1462 { 0x10a47879, 0x5ebf, 0x4b85, { 0xbd, 0x8d, 0xc2, 0x1b, 0xb4, 0xf4, 0x9c, 0x8a } };
1463
1464EXTERN_C __declspec(selectany) const GUID SEC_WINNT_AUTH_DATA_TYPE_FIDO =
1465 { 0x32e8f8d7, 0x7871, 0x4bcc, { 0x83, 0xc5, 0x46, 0xf, 0x66, 0xc6, 0x13, 0x5c } };
1466
1467EXTERN_C __declspec(selectany) const GUID SEC_WINNT_AUTH_DATA_TYPE_KEYTAB =
1468 { 0xd587aae8, 0xf78f, 0x4455, { 0xa1, 0x12, 0xc9, 0x34, 0xbe, 0xee, 0x7c, 0xe1 } };
1469
1470EXTERN_C __declspec(selectany) const GUID SEC_WINNT_AUTH_DATA_TYPE_CSP_DATA =
1471 { 0x68fd9879, 0x79c, 0x4dfe, { 0x82, 0x81, 0x57, 0x8a, 0xad, 0xc1, 0xc1, 0x0 } };
1472
1473EXTERN_C __declspec(selectany) const GUID SEC_WINNT_AUTH_DATA_TYPE_SMARTCARD_CONTEXTS =
1474 { 0xb86c4ff3, 0x49d7, 0x4dc4, { 0xb5, 0x60, 0xb1, 0x16, 0x36, 0x85, 0xb2, 0x36 } };
1475
1476EXTERN_C __declspec(selectany) const GUID CREDUIWIN_STRUCTURE_TYPE_SSPIPFC =
1477 { 0x3c3e93d9, 0xd96b, 0x49b5, { 0x94, 0xa7, 0x45, 0x85, 0x92, 0x8, 0x83, 0x37 } };
1478
1479EXTERN_C __declspec(selectany) const GUID SSPIPFC_STRUCTURE_TYPE_CREDUI_CONTEXT =
1480 { 0xc2fffe6f, 0x503d, 0x4c3d, { 0xa9, 0x5e, 0xbc, 0xe8, 0x21, 0x21, 0x3d, 0x44 } };
1481
1482typedef struct _SEC_WINNT_AUTH_BYTE_VECTOR {
1483 unsigned __LONG32 ByteArrayOffset;
1484 unsigned short ByteArrayLength;
1485} SEC_WINNT_AUTH_BYTE_VECTOR, *PSEC_WINNT_AUTH_BYTE_VECTOR;
1486
1487typedef struct _SEC_WINNT_AUTH_DATA {
1488 GUID CredType;
1489 SEC_WINNT_AUTH_BYTE_VECTOR CredData;
1490} SEC_WINNT_AUTH_DATA, *PSEC_WINNT_AUTH_DATA;
1491
1492typedef struct _SEC_WINNT_AUTH_PACKED_CREDENTIALS {
1493 unsigned short cbHeaderLength;
1494 unsigned short cbStructureLength;
1495 SEC_WINNT_AUTH_DATA AuthData;
1496} SEC_WINNT_AUTH_PACKED_CREDENTIALS, *PSEC_WINNT_AUTH_PACKED_CREDENTIALS;
1497
1498typedef struct _SEC_WINNT_AUTH_DATA_PASSWORD {
1499 SEC_WINNT_AUTH_BYTE_VECTOR UnicodePassword;
1500} SEC_WINNT_AUTH_DATA_PASSWORD, PSEC_WINNT_AUTH_DATA_PASSWORD;
1501
1502typedef struct _SEC_WINNT_AUTH_CERTIFICATE_DATA {
1503 unsigned short cbHeaderLength;
1504 unsigned short cbStructureLength;
1505 SEC_WINNT_AUTH_BYTE_VECTOR Certificate;
1506} SEC_WINNT_AUTH_CERTIFICATE_DATA, *PSEC_WINNT_AUTH_CERTIFICATE_DATA;
1507
1508typedef struct _SEC_WINNT_AUTH_NGC_DATA {
1509 LUID LogonId;
1510 unsigned __LONG32 Flags;
1511 SEC_WINNT_AUTH_BYTE_VECTOR CspInfo;
1512 SEC_WINNT_AUTH_BYTE_VECTOR UserIdKeyAuthTicket;
1513 SEC_WINNT_AUTH_BYTE_VECTOR DecryptionKeyName;
1514 SEC_WINNT_AUTH_BYTE_VECTOR DecryptionKeyAuthTicket;
1515} SEC_WINNT_AUTH_NGC_DATA, *PSEC_WINNT_AUTH_NGC_DATA;
1516
1517#define NGC_DATA_FLAG_KERB_CERTIFICATE_LOGON_FLAG_CHECK_DUPLICATES 1
1518#define NGC_DATA_FLAG_KERB_CERTIFICATE_LOGON_FLAG_USE_CERTIFICATE_INFO 2
1519#define NGC_DATA_FLAG_IS_SMARTCARD_DATA 4
1520
1521typedef struct _SEC_WINNT_AUTH_DATA_TYPE_SMARTCARD_CONTEXTS_DATA {
1522 PVOID pcc;
1523 PVOID hProv;
1524 LPWSTR pwszECDHKeyName;
1525} SEC_WINNT_AUTH_DATA_TYPE_SMARTCARD_CONTEXTS_DATA, *PSEC_WINNT_AUTH_DATA_TYPE_SMARTCARD_CONTEXTS_DATA;
1526
1527typedef struct _SEC_WINNT_AUTH_FIDO_DATA {
1528 unsigned short cbHeaderLength;
1529 unsigned short cbStructureLength;
1530 SEC_WINNT_AUTH_BYTE_VECTOR Secret;
1531 SEC_WINNT_AUTH_BYTE_VECTOR NewSecret;
1532 SEC_WINNT_AUTH_BYTE_VECTOR EncryptedNewSecret;
1533 SEC_WINNT_AUTH_BYTE_VECTOR NetworkLogonBuffer;
1534 ULONG64 ulSignatureCount;
1535} SEC_WINNT_AUTH_FIDO_DATA, *PSEC_WINNT_AUTH_FIDO_DATA;
1536
1537typedef struct _SEC_WINNT_CREDUI_CONTEXT_VECTOR {
1538 ULONG CredUIContextArrayOffset;
1539 USHORT CredUIContextCount;
1540} SEC_WINNT_CREDUI_CONTEXT_VECTOR, *PSEC_WINNT_CREDUI_CONTEXT_VECTOR;
1541
1542typedef struct _SEC_WINNT_AUTH_SHORT_VECTOR {
1543 ULONG ShortArrayOffset;
1544 USHORT ShortArrayCount;
1545} SEC_WINNT_AUTH_SHORT_VECTOR, *PSEC_WINNT_AUTH_SHORT_VECTOR;
1546
1547typedef struct _CREDUIWIN_MARSHALED_CONTEXT {
1548 GUID StructureType;
1549 USHORT cbHeaderLength;
1550 LUID LogonId;
1551 GUID MarshaledDataType;
1552 ULONG MarshaledDataOffset;
1553 USHORT MarshaledDataLength;
1554} CREDUIWIN_MARSHALED_CONTEXT, *PCREDUIWIN_MARSHALED_CONTEXT;
1555
1556typedef struct _SEC_WINNT_CREDUI_CONTEXT {
1557 USHORT cbHeaderLength;
1558 HANDLE CredUIContextHandle;
1559#ifdef _CREDUI_INFO_DEFINED
1560 PCREDUI_INFOW UIInfo;
1561#else
1562 PVOID UIInfo;
1563#endif
1564 ULONG dwAuthError;
1565 PSEC_WINNT_AUTH_IDENTITY_OPAQUE pInputAuthIdentity;
1566 PUNICODE_STRING TargetName;
1567} SEC_WINNT_CREDUI_CONTEXT, *PSEC_WINNT_CREDUI_CONTEXT;
1568
1569typedef struct _SEC_WINNT_AUTH_PACKED_CREDENTIALS_EX {
1570 unsigned short cbHeaderLength;
1571 unsigned __LONG32 Flags;
1572 SEC_WINNT_AUTH_BYTE_VECTOR PackedCredentials;
1573 SEC_WINNT_AUTH_SHORT_VECTOR PackageList;
1574} SEC_WINNT_AUTH_PACKED_CREDENTIALS_EX, *PSEC_WINNT_AUTH_PACKED_CREDENTIALS_EX;
1575
1576SECURITY_STATUS SEC_ENTRY SspiGetCredUIContext(HANDLE ContextHandle, GUID* CredType,
1577 LUID* LogonId,
1578 PSEC_WINNT_CREDUI_CONTEXT_VECTOR* CredUIContexts,
1579 HANDLE* TokenHandle);
1580SECURITY_STATUS SEC_ENTRY SspiUpdateCredentials(HANDLE ContextHandle, GUID* CredType,
1581 ULONG FlatCredUIContextLength,
1582 PUCHAR FlatCredUIContext);
1583SECURITY_STATUS SEC_ENTRY SspiUnmarshalCredUIContext(PUCHAR MarshaledCredUIContext,
1584 ULONG MarshaledCredUIContextLength,
1585 PSEC_WINNT_CREDUI_CONTEXT* CredUIContext);
1586
1587#endif
1588
1589#define SEC_WINNT_AUTH_IDENTITY_MARSHALLED 0x4
1590#define SEC_WINNT_AUTH_IDENTITY_ONLY 0x8
1591
1592typedef struct _SECURITY_PACKAGE_OPTIONS {
1593 unsigned __LONG32 Size;
1594 unsigned __LONG32 Type;
1595 unsigned __LONG32 Flags;
1596 unsigned __LONG32 SignatureSize;
1597 void *Signature;
1598} SECURITY_PACKAGE_OPTIONS,*PSECURITY_PACKAGE_OPTIONS;
1599
1600#define SECPKG_OPTIONS_TYPE_UNKNOWN 0
1601#define SECPKG_OPTIONS_TYPE_LSA 1
1602#define SECPKG_OPTIONS_TYPE_SSPI 2
1603
1604#define SECPKG_OPTIONS_PERMANENT 0x00000001
1605
1606#define AddSecurityPackage __MINGW_NAME_AW(AddSecurityPackage)
1607#define DeleteSecurityPackage __MINGW_NAME_AW(DeleteSecurityPackage)
1608
1609SECURITY_STATUS WINAPI AddSecurityPackageA(LPSTR pszPackageName,PSECURITY_PACKAGE_OPTIONS pOptions);
1610SECURITY_STATUS WINAPI AddSecurityPackageW(LPWSTR pszPackageName,PSECURITY_PACKAGE_OPTIONS pOptions);
1611
1612 SECURITY_STATUS WINAPI DeleteSecurityPackageA(SEC_CHAR *pszPackageName);
1613 SECURITY_STATUS WINAPI DeleteSecurityPackageW(SEC_WCHAR *pszPackageName);
1614
1615#if ISSP_MODE == 0
1616
1617typedef struct _SspiAsyncContext SspiAsyncContext;
1618
1619typedef void (*SspiAsyncNotifyCallback)(SspiAsyncContext* Handle, PVOID CallbackData);
1620
1621SspiAsyncContext* SspiCreateAsyncContext();
1622void SspiFreeAsyncContext(SspiAsyncContext* Handle);
1623NTSTATUS SspiReinitAsyncContext(SspiAsyncContext* Handle);
1624SECURITY_STATUS SspiSetAsyncNotifyCallback(SspiAsyncContext* Context,
1625 SspiAsyncNotifyCallback Callback,
1626 void* CallbackData);
1627BOOLEAN SspiAsyncContextRequiresNotify(SspiAsyncContext* AsyncContext);
1628SECURITY_STATUS SspiGetAsyncCallStatus(SspiAsyncContext* Handle);
1629
1630SECURITY_STATUS SspiAcquireCredentialsHandleAsyncW(
1631 SspiAsyncContext* AsyncContext,
1632#if ISSP_MODE == 0
1633 PSECURITY_STRING pszPrincipal,
1634 PSECURITY_STRING pszPackage,
1635#else
1636 LPWSTR pszPrincipal,
1637 LPWSTR pszPackage,
1638#endif
1639 unsigned __LONG32 fCredentialUse,
1640 void* pvLogonId,
1641 void* pAuthData,
1642 SEC_GET_KEY_FN pGetKeyFn,
1643 void* pvGetKeyArgument,
1644 PCredHandle phCredential,
1645 PTimeStamp ptsExpiry
1646);
1647
1648SECURITY_STATUS SspiAcquireCredentialsHandleAsyncA(
1649 SspiAsyncContext* AsyncContext,
1650 LPSTR pszPrincipal,
1651 LPSTR pszPackage,
1652 unsigned __LONG32 fCredentialUse,
1653 void * pvLogonId,
1654 void * pAuthData,
1655 SEC_GET_KEY_FN pGetKeyFn,
1656 void * pvGetKeyArgument,
1657 PCredHandle phCredential,
1658 PTimeStamp ptsExpiry
1659);
1660
1661SECURITY_STATUS SspiInitializeSecurityContextAsyncW(
1662 SspiAsyncContext* AsyncContext,
1663 PCredHandle phCredential,
1664 PCtxtHandle phContext,
1665#if ISSP_MODE == 0
1666 PSECURITY_STRING pszTargetName,
1667#else
1668 LPWSTR pszTargetName,
1669#endif
1670 unsigned __LONG32 fContextReq,
1671 unsigned __LONG32 Reserved1,
1672 unsigned __LONG32 TargetDataRep,
1673 PSecBufferDesc pInput,
1674 unsigned __LONG32 Reserved2,
1675 PCtxtHandle phNewContext,
1676 PSecBufferDesc pOutput,
1677 unsigned __LONG32* pfContextAttr,
1678 PTimeStamp ptsExpiry
1679);
1680
1681SECURITY_STATUS SspiInitializeSecurityContextAsyncA(
1682 SspiAsyncContext* AsyncContext,
1683 PCredHandle phCredential,
1684 PCtxtHandle phContext,
1685 LPSTR pszTargetName,
1686 unsigned __LONG32 fContextReq,
1687 unsigned __LONG32 Reserved1,
1688 unsigned __LONG32 TargetDataRep,
1689 PSecBufferDesc pInput,
1690 unsigned __LONG32 Reserved2,
1691 PCtxtHandle phNewContext,
1692 PSecBufferDesc pOutput,
1693 unsigned __LONG32* pfContextAttr,
1694 PTimeStamp ptsExpiry
1695);
1696
1697SECURITY_STATUS SspiAcceptSecurityContextAsync(
1698 SspiAsyncContext* AsyncContext,
1699 PCredHandle phCredential,
1700 PCtxtHandle phContext,
1701 PSecBufferDesc pInput,
1702 unsigned __LONG32 fContextReq,
1703 unsigned __LONG32 TargetDataRep,
1704 PCtxtHandle phNewContext,
1705 PSecBufferDesc pOutput,
1706 unsigned __LONG32* pfContextAttr,
1707 PTimeStamp ptsExpiry
1708);
1709
1710SECURITY_STATUS SspiFreeCredentialsHandleAsync(
1711 SspiAsyncContext* AsyncContext,
1712 PCredHandle phCredential
1713);
1714
1715SECURITY_STATUS SspiDeleteSecurityContextAsync(
1716 SspiAsyncContext* AsyncContext,
1717 PCtxtHandle phContext
1718);
1719
1720#define SspiAcquireCredentialsHandleAsync __MINGW_NAME_AW(SspiAcquireCredentialsHandleAsync)
1721#define SspiInitializeSecurityContextAsync __MINGW_NAME_AW(SspiInitializeSecurityContextAsync)
1722
1723#endif
1724
1725SECURITY_STATUS SEC_ENTRY SspiPrepareForCredRead(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity,
1726 PCWSTR pszTargetName, PULONG pCredmanCredentialType,
1727 PCWSTR* ppszCredmanTargetName);
1728
1729SECURITY_STATUS SEC_ENTRY SspiPrepareForCredWrite(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity,
1730 PCWSTR pszTargetName, PULONG pCredmanCredentialType,
1731 PCWSTR* ppszCredmanTargetName, PCWSTR* ppszCredmanUserName,
1732 PUCHAR *ppCredentialBlob, PULONG pCredentialBlobSize);
1733
1734#define SEC_WINNT_AUTH_IDENTITY_ENCRYPT_SAME_LOGON 1
1735#define SEC_WINNT_AUTH_IDENTITY_ENCRYPT_SAME_PROCESS 2
1736#define SEC_WINNT_AUTH_IDENTITY_ENCRYPT_FOR_SYSTEM 4
1737
1738SECURITY_STATUS SEC_ENTRY SspiEncryptAuthIdentity(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData);
1739
1740SECURITY_STATUS SEC_ENTRY SspiEncryptAuthIdentityEx(ULONG Options, PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData);
1741
1742SECURITY_STATUS SEC_ENTRY SspiDecryptAuthIdentity(PSEC_WINNT_AUTH_IDENTITY_OPAQUE EncryptedAuthData);
1743
1744SECURITY_STATUS SEC_ENTRY SspiDecryptAuthIdentityEx(ULONG Options, PSEC_WINNT_AUTH_IDENTITY_OPAQUE EncryptedAuthData);
1745
1746BOOLEAN SEC_ENTRY SspiIsAuthIdentityEncrypted(PSEC_WINNT_AUTH_IDENTITY_OPAQUE EncryptedAuthData);
1747
1748#if NTDDI_VERSION >= NTDDI_WIN7
1749
1750SECURITY_STATUS SEC_ENTRY SspiEncodeAuthIdentityAsStrings(PSEC_WINNT_AUTH_IDENTITY_OPAQUE pAuthIdentity,
1751 PCWSTR* ppszUserName, PCWSTR* ppszDomainName,
1752 PCWSTR* ppszPackedCredentialsString);
1753
1754SECURITY_STATUS SEC_ENTRY SspiValidateAuthIdentity(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData);
1755
1756SECURITY_STATUS SEC_ENTRY SspiCopyAuthIdentity(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData,
1757 PSEC_WINNT_AUTH_IDENTITY_OPAQUE* AuthDataCopy);
1758
1759VOID SEC_ENTRY SspiFreeAuthIdentity(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData);
1760
1761VOID SEC_ENTRY SspiZeroAuthIdentity(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData);
1762
1763VOID SEC_ENTRY SspiLocalFree(PVOID DataBuffer);
1764
1765SECURITY_STATUS SEC_ENTRY SspiEncodeStringsAsAuthIdentity(PCWSTR pszUserName, PCWSTR pszDomainName,
1766 PCWSTR pszPackedCredentialsString,
1767 PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity);
1768
1769SECURITY_STATUS SEC_ENTRY SspiCompareAuthIdentities(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity1,
1770 PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity2,
1771 PBOOLEAN SameSuppliedUser, PBOOLEAN SameSuppliedIdentity);
1772
1773SECURITY_STATUS SEC_ENTRY SspiMarshalAuthIdentity(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity,
1774 unsigned __LONG32* AuthIdentityLength,
1775 char** AuthIdentityByteArray);
1776
1777SECURITY_STATUS SEC_ENTRY SspiUnmarshalAuthIdentity(unsigned __LONG32 AuthIdentityLength,
1778 char* AuthIdentityByteArray,
1779 PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity);
1780
1781BOOLEAN SEC_ENTRY SspiIsPromptingNeeded(unsigned __LONG32 ErrorOrNtStatus);
1782
1783SECURITY_STATUS SEC_ENTRY SspiGetTargetHostName(PCWSTR pszTargetName, PWSTR* pszHostName);
1784
1785SECURITY_STATUS SEC_ENTRY SspiExcludePackage(PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity,
1786 PCWSTR pszPackageName,
1787 PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppNewAuthIdentity);
1788
1789#endif
1790
1791#ifdef __cplusplus
1792}
1793#endif
1794#endif
Note: See TracBrowser for help on using the repository browser.