[PSDK]
[reactos.git] / reactos / sdk / include / psdk / sspi.h
1 /*
2 * Copyright (C) 2004 Juan Lang
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18 #ifndef __WINE_SSPI_H__
19 #define __WINE_SSPI_H__
20
21 #include <wtypes.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #define SEC_ENTRY WINAPI
28
29 typedef WCHAR SEC_WCHAR;
30 typedef CHAR SEC_CHAR;
31
32 #ifndef __SECSTATUS_DEFINED__
33 #define __SECSTATUS_DEFINED__
34 typedef LONG SECURITY_STATUS;
35 #endif
36
37 #define UNISP_NAME_A "Microsoft Unified Security Protocol Provider"
38 #define UNISP_NAME_W L"Microsoft Unified Security Protocol Provider"
39 #define UNISP_NAME WINELIB_NAME_AW(UNISP_NAME_)
40
41 #ifdef UNICODE
42 typedef SEC_WCHAR * SECURITY_PSTR;
43 typedef CONST SEC_WCHAR * SECURITY_PCSTR;
44 #else
45 typedef SEC_CHAR * SECURITY_PSTR;
46 typedef CONST SEC_CHAR * SECURITY_PCSTR;
47 #endif
48
49 #ifndef __SECHANDLE_DEFINED__
50 #define __SECHANDLE_DEFINED__
51 typedef struct _SecHandle
52 {
53 ULONG_PTR dwLower;
54 ULONG_PTR dwUpper;
55 } SecHandle, *PSecHandle;
56 #endif
57
58 #define SecInvalidateHandle(x) do { \
59 ((PSecHandle)(x))->dwLower = ((ULONG_PTR)((INT_PTR)-1)); \
60 ((PSecHandle)(x))->dwUpper = ((ULONG_PTR)((INT_PTR)-1)); \
61 } while (0)
62
63 #define SecIsValidHandle(x) \
64 ((((PSecHandle)(x))->dwLower != ((ULONG_PTR)(INT_PTR)-1)) && \
65 (((PSecHandle)(x))->dwUpper != ((ULONG_PTR)(INT_PTR)-1)))
66
67 typedef SecHandle CredHandle;
68 typedef PSecHandle PCredHandle;
69
70 typedef SecHandle CtxtHandle;
71 typedef PSecHandle PCtxtHandle;
72
73 typedef struct _SECURITY_INTEGER
74 {
75 ULONG LowPart;
76 LONG HighPart;
77 } SECURITY_INTEGER, *PSECURITY_INTEGER;
78 typedef SECURITY_INTEGER TimeStamp, *PTimeStamp;
79
80 #define SSPIPFC_CREDPROV_DO_NOT_SAVE 0x00000001
81 #define SSPIPFC_NO_CHECKBOX 0x00000002
82
83 typedef void *PSEC_WINNT_AUTH_IDENTITY_OPAQUE;
84
85 ULONG SEC_ENTRY SspiPromptForCredentialsW(_In_ PCWSTR, _In_opt_ void *,
86 _In_ ULONG, _In_ PCWSTR, _In_opt_ PSEC_WINNT_AUTH_IDENTITY_OPAQUE,
87 _Outptr_ PSEC_WINNT_AUTH_IDENTITY_OPAQUE *, _Inout_opt_ int *, _In_ ULONG);
88
89 typedef struct _SecPkgInfoA
90 {
91 ULONG fCapabilities;
92 unsigned short wVersion;
93 unsigned short wRPCID;
94 ULONG cbMaxToken;
95 SEC_CHAR *Name;
96 SEC_CHAR *Comment;
97 } SecPkgInfoA, *PSecPkgInfoA;
98
99 typedef struct _SecPkgInfoW
100 {
101 ULONG fCapabilities;
102 unsigned short wVersion;
103 unsigned short wRPCID;
104 ULONG cbMaxToken;
105 SEC_WCHAR *Name;
106 SEC_WCHAR *Comment;
107 } SecPkgInfoW, *PSecPkgInfoW;
108
109 #define SecPkgInfo WINELIB_NAME_AW(SecPkgInfo)
110 #define PSecPkgInfo WINELIB_NAME_AW(PSecPkgInfo)
111
112 /* fCapabilities field of SecPkgInfo */
113 #define SECPKG_FLAG_INTEGRITY 0x00000001
114 #define SECPKG_FLAG_PRIVACY 0x00000002
115 #define SECPKG_FLAG_TOKEN_ONLY 0x00000004
116 #define SECPKG_FLAG_DATAGRAM 0x00000008
117 #define SECPKG_FLAG_CONNECTION 0x00000010
118 #define SECPKG_FLAG_MULTI_REQUIRED 0x00000020
119 #define SECPKG_FLAG_CLIENT_ONLY 0x00000040
120 #define SECPKG_FLAG_EXTENDED_ERROR 0x00000080
121 #define SECPKG_FLAG_IMPERSONATION 0x00000100
122 #define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200
123 #define SECPKG_FLAG_STREAM 0x00000400
124 #define SECPKG_FLAG_NEGOTIABLE 0x00000800
125 #define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000
126 #define SECPKG_FLAG_LOGON 0x00002000
127 #define SECPKG_FLAG_ASCII_BUFFERS 0x00004000
128 #define SECPKG_FLAG_FRAGMENT 0x00008000
129 #define SECPKG_FLAG_MUTUAL_AUTH 0x00010000
130 #define SECPKG_FLAG_DELEGATION 0x00020000
131 #define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000
132 #define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000
133 #define SECPKG_FLAG_NEGO_EXTENDER 0x00100000
134 #define SECPKG_FLAG_NEGOTIABLE2 0x00200000
135 #define SECPKG_FLAG_APPCONTAINER_PASSTHROUGH 0x00400000
136 #define SECPKG_FLAG_APPCONTAINER_CHECKS 0x00800000
137
138 typedef struct _SecBuffer {
139 ULONG cbBuffer;
140 ULONG BufferType;
141 _Field_size_bytes_(cbBuffer) void *pvBuffer;
142 } SecBuffer, *PSecBuffer;
143
144 /* values for BufferType */
145 #define SECBUFFER_EMPTY 0
146 #define SECBUFFER_DATA 1
147 #define SECBUFFER_TOKEN 2
148 #define SECBUFFER_PKG_PARAMS 3
149 #define SECBUFFER_MISSING 4
150 #define SECBUFFER_EXTRA 5
151 #define SECBUFFER_STREAM_TRAILER 6
152 #define SECBUFFER_STREAM_HEADER 7
153 #define SECBUFFER_NEGOTIATION_INFO 8
154 #define SECBUFFER_PADDING 9
155 #define SECBUFFER_STREAM 10
156 #define SECBUFFER_MECHLIST 11
157 #define SECBUFFER_MECHLIST_SIGNATURE 12
158 #define SECBUFFER_TARGET 13
159 #define SECBUFFER_CHANNEL_BINDINGS 14
160
161 #define SECBUFFER_ATTRMASK 0xf0000000
162 #define SECBUFFER_READONLY 0x80000000
163 #define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000
164 #define SECBUFFER_RESERVED 0x60000000
165
166 typedef struct _SecBufferDesc {
167 ULONG ulVersion;
168 ULONG cBuffers;
169 _Field_size_(cBuffers) PSecBuffer pBuffers;
170 } SecBufferDesc, *PSecBufferDesc;
171
172 /* values for ulVersion */
173 #define SECBUFFER_VERSION 0
174
175 typedef void (SEC_ENTRY *SEC_GET_KEY_FN)(void *Arg, void *Principal,
176 ULONG KeyVer, void **Key, SECURITY_STATUS *Status);
177
178 SECURITY_STATUS
179 SEC_ENTRY
180 EnumerateSecurityPackagesA(
181 _Out_ PULONG pcPackages,
182 _Outptr_ PSecPkgInfoA *ppPackageInfo);
183
184 SECURITY_STATUS
185 SEC_ENTRY
186 EnumerateSecurityPackagesW(
187 _Out_ PULONG pcPackages,
188 _Outptr_ PSecPkgInfoW *ppPackageInfo);
189
190 #define EnumerateSecurityPackages WINELIB_NAME_AW(EnumerateSecurityPackages)
191
192 typedef SECURITY_STATUS (SEC_ENTRY *ENUMERATE_SECURITY_PACKAGES_FN_A)(PULONG,
193 PSecPkgInfoA *);
194 typedef SECURITY_STATUS (SEC_ENTRY *ENUMERATE_SECURITY_PACKAGES_FN_W)(PULONG,
195 PSecPkgInfoW *);
196 #define ENUMERATE_SECURITY_PACKAGES_FN WINELIB_NAME_AW(ENUMERATE_SECURITY_PACKAGES_FN_)
197
198 SECURITY_STATUS
199 SEC_ENTRY
200 QueryCredentialsAttributesA(
201 _In_ PCredHandle phCredential,
202 _In_ ULONG ulAttribute,
203 _Inout_ void *pBuffer);
204
205 SECURITY_STATUS
206 SEC_ENTRY
207 QueryCredentialsAttributesW(
208 _In_ PCredHandle phCredential,
209 _In_ ULONG ulAttribute,
210 _Inout_ void *pBuffer);
211
212 #define QueryCredentialsAttributes WINELIB_NAME_AW(QueryCredentialsAttributes)
213
214 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CREDENTIALS_ATTRIBUTES_FN_A)
215 (PCredHandle, ULONG, PVOID);
216 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CREDENTIALS_ATTRIBUTES_FN_W)
217 (PCredHandle, ULONG, PVOID);
218 #define QUERY_CREDENTIALS_ATTRIBUTES_FN WINELIB_NAME_AW(QUERY_CREDENTIALS_ATTRIBUTES_FN_)
219
220 /* values for QueryCredentialsAttributes ulAttribute */
221 #define SECPKG_CRED_ATTR_NAMES 1
222
223 /* types for QueryCredentialsAttributes */
224 typedef struct _SecPkgCredentials_NamesA
225 {
226 SEC_CHAR *sUserName;
227 } SecPkgCredentials_NamesA, *PSecPkgCredentials_NamesA;
228
229 typedef struct _SecPkgCredentials_NamesW
230 {
231 SEC_WCHAR *sUserName;
232 } SecPkgCredentials_NamesW, *PSecPkgCredentials_NamesW;
233
234 #define SecPkgCredentials_Names WINELIB_NAME_AW(SecPkgCredentials_Names)
235
236 SECURITY_STATUS
237 SEC_ENTRY
238 AcquireCredentialsHandleA(
239 _In_opt_ SEC_CHAR *pszPrincipal,
240 _In_ SEC_CHAR *pszPackage,
241 _In_ ULONG fCredentialsUse,
242 _In_opt_ PLUID pvLogonID,
243 _In_opt_ PVOID pAuthData,
244 _In_opt_ SEC_GET_KEY_FN pGetKeyFn,
245 _In_opt_ PVOID pvGetKeyArgument,
246 _Out_ PCredHandle phCredential,
247 _Out_opt_ PTimeStamp ptsExpiry);
248
249 SECURITY_STATUS
250 SEC_ENTRY
251 AcquireCredentialsHandleW(
252 _In_opt_ SEC_WCHAR *pszPrincipal,
253 _In_ SEC_WCHAR *pszPackage,
254 _In_ ULONG fCredentialsUse,
255 _In_opt_ PLUID pvLogonID,
256 _In_opt_ PVOID pAuthData,
257 _In_opt_ SEC_GET_KEY_FN pGetKeyFn,
258 _In_opt_ PVOID pvGetKeyArgument,
259 _Out_ PCredHandle phCredential,
260 _Out_opt_ PTimeStamp ptsExpiry);
261
262 #define AcquireCredentialsHandle WINELIB_NAME_AW(AcquireCredentialsHandle)
263
264 /* flags for fCredentialsUse */
265 #define SECPKG_CRED_INBOUND 0x00000001
266 #define SECPKG_CRED_OUTBOUND 0x00000002
267 #define SECPKG_CRED_BOTH (SECPKG_CRED_INBOUND | SECPKG_CRED_OUTBOUND)
268 #define SECPKG_CRED_DEFAULT 0x00000004
269 #define SECPKG_CRED_RESERVED 0xf0000000
270
271 typedef SECURITY_STATUS (SEC_ENTRY *ACQUIRE_CREDENTIALS_HANDLE_FN_A)(
272 SEC_CHAR *, SEC_CHAR *, ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID,
273 PCredHandle, PTimeStamp);
274 typedef SECURITY_STATUS (SEC_ENTRY *ACQUIRE_CREDENTIALS_HANDLE_FN_W)(
275 SEC_WCHAR *, SEC_WCHAR *, ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID,
276 PCredHandle, PTimeStamp);
277 #define ACQUIRE_CREDENTIALS_HANDLE_FN WINELIB_NAME_AW(ACQUIRE_CREDENTIALS_HANDLE_FN_)
278
279 SECURITY_STATUS SEC_ENTRY FreeContextBuffer(_Inout_ PVOID pv);
280
281 typedef SECURITY_STATUS (SEC_ENTRY *FREE_CONTEXT_BUFFER_FN)(_Inout_ PVOID);
282
283 SECURITY_STATUS
284 SEC_ENTRY
285 FreeCredentialsHandle(
286 _In_ PCredHandle phCredential);
287
288 #define FreeCredentialHandle FreeCredentialsHandle
289
290 typedef SECURITY_STATUS (SEC_ENTRY *FREE_CREDENTIALS_HANDLE_FN)(PCredHandle);
291
292 SECURITY_STATUS
293 SEC_ENTRY
294 InitializeSecurityContextA(
295 _In_opt_ PCredHandle phCredential,
296 _In_opt_ PCtxtHandle phContext,
297 _In_opt_ SEC_CHAR *pszTargetName,
298 _In_ ULONG fContextReq,
299 _In_ ULONG Reserved1,
300 _In_ ULONG TargetDataRep,
301 _In_opt_ PSecBufferDesc pInput,
302 _In_ ULONG Reserved2,
303 _Inout_opt_ PCtxtHandle phNewContext,
304 _Inout_opt_ PSecBufferDesc pOutput,
305 _Out_ ULONG *pfContextAttr,
306 _Out_opt_ PTimeStamp ptsExpiry);
307
308 SECURITY_STATUS
309 SEC_ENTRY
310 InitializeSecurityContextW(
311 _In_opt_ PCredHandle phCredential,
312 _In_opt_ PCtxtHandle phContext,
313 _In_opt_ SEC_WCHAR *pszTargetName,
314 _In_ ULONG fContextReq,
315 _In_ ULONG Reserved1,
316 _In_ ULONG TargetDataRep,
317 _In_opt_ PSecBufferDesc pInput,
318 _In_ ULONG Reserved2,
319 _Inout_opt_ PCtxtHandle phNewContext,
320 _Inout_opt_ PSecBufferDesc pOutput,
321 _Out_ ULONG *pfContextAttr,
322 _Out_opt_ PTimeStamp ptsExpiry);
323
324 #define InitializeSecurityContext WINELIB_NAME_AW(InitializeSecurityContext)
325
326 typedef SECURITY_STATUS (SEC_ENTRY *INITIALIZE_SECURITY_CONTEXT_FN_A)
327 (PCredHandle, PCtxtHandle, SEC_CHAR *, ULONG, ULONG,
328 ULONG, PSecBufferDesc, ULONG, PCtxtHandle, PSecBufferDesc,
329 ULONG *, PTimeStamp);
330 typedef SECURITY_STATUS (SEC_ENTRY *INITIALIZE_SECURITY_CONTEXT_FN_W)
331 (PCredHandle, PCtxtHandle, SEC_WCHAR *, ULONG, ULONG,
332 ULONG, PSecBufferDesc, ULONG, PCtxtHandle, PSecBufferDesc,
333 ULONG *, PTimeStamp);
334 #define INITIALIZE_SECURITY_CONTEXT_FN WINELIB_NAME_AW(INITIALIZE_SECURITY_CONTEXT_FN_)
335
336 /* flags for InitializeSecurityContext fContextReq and pfContextAttr */
337 #define ISC_REQ_DELEGATE 0x00000001
338 #define ISC_REQ_MUTUAL_AUTH 0x00000002
339 #define ISC_REQ_REPLAY_DETECT 0x00000004
340 #define ISC_REQ_SEQUENCE_DETECT 0x00000008
341 #define ISC_REQ_CONFIDENTIALITY 0x00000010
342 #define ISC_REQ_USE_SESSION_KEY 0x00000020
343 #define ISC_REQ_PROMPT_FOR_CREDS 0x00000040
344 #define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080
345 #define ISC_REQ_ALLOCATE_MEMORY 0x00000100
346 #define ISC_REQ_USE_DCE_STYLE 0x00000200
347 #define ISC_REQ_DATAGRAM 0x00000400
348 #define ISC_REQ_CONNECTION 0x00000800
349 #define ISC_REQ_CALL_LEVEL 0x00001000
350 #define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000
351 #define ISC_REQ_EXTENDED_ERROR 0x00004000
352 #define ISC_REQ_STREAM 0x00008000
353 #define ISC_REQ_INTEGRITY 0x00010000
354 #define ISC_REQ_IDENTIFY 0x00020000
355 #define ISC_REQ_NULL_SESSION 0x00040000
356 #define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000
357 #define ISC_REQ_RESERVED1 0x00100000
358 #define ISC_REQ_FRAGMENT_TO_FIT 0x00200000
359
360 #define ISC_RET_DELEGATE 0x00000001
361 #define ISC_RET_MUTUAL_AUTH 0x00000002
362 #define ISC_RET_REPLAY_DETECT 0x00000004
363 #define ISC_RET_SEQUENCE_DETECT 0x00000008
364 #define ISC_RET_CONFIDENTIALITY 0x00000010
365 #define ISC_RET_USE_SESSION_KEY 0x00000020
366 #define ISC_RET_USED_COLLECTED_CREDS 0x00000040
367 #define ISC_RET_USED_SUPPLIED_CREDS 0x00000080
368 #define ISC_RET_ALLOCATED_MEMORY 0x00000100
369 #define ISC_RET_USED_DCE_STYLE 0x00000200
370 #define ISC_RET_DATAGRAM 0x00000400
371 #define ISC_RET_CONNECTION 0x00000800
372 #define ISC_RET_INTERMEDIATE_RETURN 0x00001000
373 #define ISC_RET_CALL_LEVEL 0x00002000
374 #define ISC_RET_EXTENDED_ERROR 0x00004000
375 #define ISC_RET_STREAM 0x00008000
376 #define ISC_RET_INTEGRITY 0x00010000
377 #define ISC_RET_IDENTIFY 0x00020000
378 #define ISC_RET_NULL_SESSION 0x00040000
379 #define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000
380 #define ISC_RET_RESERVED1 0x00100000
381 #define ISC_RET_FRAGMENT_ONLY 0x00200000
382
383 SECURITY_STATUS
384 SEC_ENTRY
385 AcceptSecurityContext(
386 _In_opt_ PCredHandle phCredential,
387 _In_opt_ PCtxtHandle phContext,
388 _In_opt_ PSecBufferDesc pInput,
389 _In_ ULONG fContextReq,
390 _In_ ULONG TargetDataRep,
391 _Inout_opt_ PCtxtHandle phNewContext,
392 _Inout_opt_ PSecBufferDesc pOutput,
393 _Out_ ULONG *pfContextAttr,
394 _Out_opt_ PTimeStamp ptsExpiry);
395
396 typedef SECURITY_STATUS (SEC_ENTRY *ACCEPT_SECURITY_CONTEXT_FN)(PCredHandle,
397 PCtxtHandle, PSecBufferDesc, ULONG, ULONG, PCtxtHandle,
398 PSecBufferDesc, ULONG *, PTimeStamp);
399
400 /* flags for AcceptSecurityContext fContextReq and pfContextAttr */
401 #define ASC_REQ_DELEGATE 0x00000001
402 #define ASC_REQ_MUTUAL_AUTH 0x00000002
403 #define ASC_REQ_REPLAY_DETECT 0x00000004
404 #define ASC_REQ_SEQUENCE_DETECT 0x00000008
405 #define ASC_REQ_CONFIDENTIALITY 0x00000010
406 #define ASC_REQ_USE_SESSION_KEY 0x00000020
407 #define ASC_REQ_ALLOCATE_MEMORY 0x00000100
408 #define ASC_REQ_USE_DCE_STYLE 0x00000200
409 #define ASC_REQ_DATAGRAM 0x00000400
410 #define ASC_REQ_CONNECTION 0x00000800
411 #define ASC_REQ_CALL_LEVEL 0x00001000
412 #define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000
413 #define ASC_REQ_EXTENDED_ERROR 0x00008000
414 #define ASC_REQ_STREAM 0x00010000
415 #define ASC_REQ_INTEGRITY 0x00020000
416 #define ASC_REQ_LICENSING 0x00040000
417 #define ASC_REQ_IDENTIFY 0x00080000
418 #define ASC_REQ_ALLOW_NULL_SESSION 0x00100000
419 #define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000
420 #define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000
421 #define ASC_REQ_FRAGMENT_TO_FIT 0x00800000
422 #define ASC_REQ_FRAGMENT_NO_TOKEN 0x01000000
423
424 #define ASC_RET_DELEGATE 0x00000001
425 #define ASC_RET_MUTUAL_AUTH 0x00000002
426 #define ASC_RET_REPLAY_DETECT 0x00000004
427 #define ASC_RET_SEQUENCE_DETECT 0x00000008
428 #define ASC_RET_CONFIDENTIALITY 0x00000010
429 #define ASC_RET_USE_SESSION_KEY 0x00000020
430 #define ASC_RET_ALLOCATED_MEMORY 0x00000100
431 #define ASC_RET_USED_DCE_STYLE 0x00000200
432 #define ASC_RET_DATAGRAM 0x00000400
433 #define ASC_RET_CONNECTION 0x00000800
434 #define ASC_RET_CALL_LEVEL 0x00002000
435 #define ASC_RET_THIRD_LEG_FAILED 0x00004000
436 #define ASC_RET_EXTENDED_ERROR 0x00008000
437 #define ASC_RET_STREAM 0x00010000
438 #define ASC_RET_INTEGRITY 0x00020000
439 #define ASC_RET_LICENSING 0x00040000
440 #define ASC_RET_IDENTIFY 0x00080000
441 #define ASC_RET_NULL_SESSION 0x00100000
442 #define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000
443 #define ASC_RET_ALLOW_CONTEXT_REPLAY 0x00400000
444 #define ASC_RET_FRAGMENT_ONLY 0x00800000
445 #define ASC_RET_NO_TOKEN 0x01000000
446
447 /*Vvalues for TargetDataRep */
448 #define SECURITY_NATIVE_DREP 0x00000010
449 #define SECURITY_NETWORK_DREP 0x00000000
450
451 SECURITY_STATUS
452 SEC_ENTRY
453 CompleteAuthToken(
454 _In_ PCtxtHandle phContext,
455 _In_ PSecBufferDesc pToken);
456
457 typedef SECURITY_STATUS (SEC_ENTRY *COMPLETE_AUTH_TOKEN_FN)(PCtxtHandle,
458 PSecBufferDesc);
459
460 SECURITY_STATUS SEC_ENTRY DeleteSecurityContext(_In_ PCtxtHandle phContext);
461
462 typedef SECURITY_STATUS (SEC_ENTRY *DELETE_SECURITY_CONTEXT_FN)(PCtxtHandle);
463
464 SECURITY_STATUS
465 SEC_ENTRY
466 ApplyControlToken(
467 _In_ PCtxtHandle phContext,
468 _In_ PSecBufferDesc pInput);
469
470 typedef SECURITY_STATUS (SEC_ENTRY *APPLY_CONTROL_TOKEN_FN)(PCtxtHandle,
471 PSecBufferDesc);
472
473 SECURITY_STATUS
474 SEC_ENTRY
475 QueryContextAttributesA(
476 _In_ PCtxtHandle phContext,
477 _In_ ULONG ulAttribute,
478 _Out_ void *pBuffer);
479
480 SECURITY_STATUS
481 SEC_ENTRY
482 QueryContextAttributesW(
483 _In_ PCtxtHandle phContext,
484 _In_ ULONG ulAttribute,
485 _Out_ void *pBuffer);
486
487 #define QueryContextAttributes WINELIB_NAME_AW(QueryContextAttributes)
488
489 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle,
490 ULONG, void *);
491 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,
492 ULONG, void *);
493 #define QUERY_CONTEXT_ATTRIBUTES_FN WINELIB_NAME_AW(QUERY_CONTEXT_ATTRIBUTES_FN_)
494
495 /* values for QueryContextAttributes/SetContextAttributes ulAttribute */
496 #define SECPKG_ATTR_SIZES 0
497 #define SECPKG_ATTR_NAMES 1
498 #define SECPKG_ATTR_LIFESPAN 2
499 #define SECPKG_ATTR_DCE_INFO 3
500 #define SECPKG_ATTR_STREAM_SIZES 4
501 #define SECPKG_ATTR_KEY_INFO 5
502 #define SECPKG_ATTR_AUTHORITY 6
503 #define SECPKG_ATTR_PROTO_INFO 7
504 #define SECPKG_ATTR_PASSWORD_EXPIRY 8
505 #define SECPKG_ATTR_SESSION_KEY 9
506 #define SECPKG_ATTR_PACKAGE_INFO 10
507 #define SECPKG_ATTR_USER_FLAGS 11
508 #define SECPKG_ATTR_NEGOTIATION_INFO 12
509 #define SECPKG_ATTR_NATIVE_NAMES 13
510 #define SECPKG_ATTR_FLAGS 14
511 #define SECPKG_ATTR_USE_VALIDATED 15
512 #define SECPKG_ATTR_CREDENTIAL_NAME 16
513 #define SECPKG_ATTR_TARGET_INFORMATION 17
514 #define SECPKG_ATTR_ACCESS_TOKEN 18
515 #define SECPKG_ATTR_TARGET 19
516 #define SECPKG_ATTR_AUTHENTICATION_ID 20
517
518 /* types for QueryContextAttributes/SetContextAttributes */
519
520 typedef struct _SecPkgContext_Sizes
521 {
522 ULONG cbMaxToken;
523 ULONG cbMaxSignature;
524 ULONG cbBlockSize;
525 ULONG cbSecurityTrailer;
526 } SecPkgContext_Sizes, *PSecPkgContext_Sizes;
527
528 typedef struct _SecPkgContext_StreamSizes
529 {
530 ULONG cbHeader;
531 ULONG cbTrailer;
532 ULONG cbMaximumMessage;
533 ULONG cbBuffers;
534 ULONG cbBlockSize;
535 } SecPkgContext_StreamSizes, *PSecPkgContext_StreamSizes;
536
537 typedef struct _SecPkgContext_NamesA
538 {
539 SEC_CHAR *sUserName;
540 } SecPkgContext_NamesA, *PSecPkgContext_NamesA;
541
542 typedef struct _SecPkgContext_NamesW
543 {
544 SEC_WCHAR *sUserName;
545 } SecPkgContext_NamesW, *PSecPkgContext_NamesW;
546
547 #define SecPkgContext_Names WINELIB_NAME_AW(SecPkgContext_Names)
548 #define PSecPkgContext_Names WINELIB_NAME_AW(PSecPkgContext_Names)
549
550 typedef struct _SecPkgContext_Lifespan
551 {
552 TimeStamp tsStart;
553 TimeStamp tsExpiry;
554 } SecPkgContext_Lifespan, *PSecPkgContext_Lifespan;
555
556 typedef struct _SecPkgContext_DceInfo
557 {
558 ULONG AuthzSvc;
559 void *pPac;
560 } SecPkgContext_DceInfo, *PSecPkgContext_DceInfo;
561
562 typedef struct _SecPkgContext_KeyInfoA
563 {
564 SEC_CHAR *sSignatureAlgorithmName;
565 SEC_CHAR *sEncryptAlgorithmName;
566 ULONG KeySize;
567 ULONG SignatureAlgorithm;
568 ULONG EncryptAlgorithm;
569 } SecPkgContext_KeyInfoA, *PSecPkgContext_KeyInfoA;
570
571 typedef struct _SecPkgContext_KeyInfoW
572 {
573 SEC_WCHAR *sSignatureAlgorithmName;
574 SEC_WCHAR *sEncryptAlgorithmName;
575 ULONG KeySize;
576 ULONG SignatureAlgorithm;
577 ULONG EncryptAlgorithm;
578 } SecPkgContext_KeyInfoW, *PSecPkgContext_KeyInfoW;
579
580 #define SecPkgContext_KeyInfo WINELIB_NAME_AW(SecPkgContext_KeyInfo)
581 #define PSecPkgContext_KeyInfo WINELIB_NAME_AW(PSecPkgContext_KeyInfo)
582
583 typedef struct _SecPkgContext_AuthorityA
584 {
585 SEC_CHAR *sAuthorityName;
586 } SecPkgContext_AuthorityA, *PSecPkgContext_AuthorityA;
587
588 typedef struct _SecPkgContext_AuthorityW
589 {
590 SEC_WCHAR *sAuthorityName;
591 } SecPkgContext_AuthorityW, *PSecPkgContext_AuthorityW;
592
593 #define SecPkgContext_Authority WINELIB_NAME_AW(SecPkgContext_Authority)
594 #define PSecPkgContext_Authority WINELIB_NAME_AW(PSecPkgContext_Authority)
595
596 typedef struct _SecPkgContext_ProtoInfoA
597 {
598 SEC_CHAR *sProtocolName;
599 ULONG majorVersion;
600 ULONG minorVersion;
601 } SecPkgContext_ProtoInfoA, *PSecPkgContext_ProtoInfoA;
602
603 typedef struct _SecPkgContext_ProtoInfoW
604 {
605 SEC_WCHAR *sProtocolName;
606 ULONG majorVersion;
607 ULONG minorVersion;
608 } SecPkgContext_ProtoInfoW, *PSecPkgContext_ProtoInfoW;
609
610 #define SecPkgContext_ProtoInfo WINELIB_NAME_AW(SecPkgContext_ProtoInfo)
611 #define PSecPkgContext_ProtoInfo WINELIB_NAME_AW(PSecPkgContext_ProtoInfo)
612
613 typedef struct _SecPkgContext_PasswordExpiry
614 {
615 TimeStamp tsPasswordExpires;
616 } SecPkgContext_PasswordExpiry, *PSecPkgContext_PasswordExpiry;
617
618 typedef struct _SecPkgContext_SessionKey {
619 ULONG SessionKeyLength;
620 _Field_size_bytes_(SessionKeyLength) unsigned char *SessionKey;
621 } SecPkgContext_SessionKey, *PSecPkgContext_SessionKey;
622
623 typedef struct _SecPkgContext_PackageInfoA
624 {
625 PSecPkgInfoA PackageInfo;
626 } SecPkgContext_PackageInfoA, *PSecPkgContext_PackageInfoA;
627
628 typedef struct _SecPkgContext_PackageInfoW
629 {
630 PSecPkgInfoW PackageInfo;
631 } SecPkgContext_PackageInfoW, *PSecPkgContext_PackageInfoW;
632
633 #define SecPkgContext_PackageInfo WINELIB_NAME_AW(SecPkgContext_PackageInfo)
634 #define PSecPkgContext_PackageInfo WINELIB_NAME_AW(PSecPkgContext_PackageInfo)
635
636 typedef struct _SecPkgContext_Flags
637 {
638 ULONG Flags;
639 } SecPkgContext_Flags, *PSecPkgContext_Flags;
640
641 typedef struct _SecPkgContext_UserFlags
642 {
643 ULONG UserFlags;
644 } SecPkgContext_UserFlags, *PSecPkgContext_UserFlags;
645
646 typedef struct _SecPkgContext_NegotiationInfoA
647 {
648 PSecPkgInfoA PackageInfo;
649 ULONG NegotiationState;
650 } SecPkgContext_NegotiationInfoA, *PSecPkgContext_NegotiationInfoA;
651
652 typedef struct _SecPkgContext_NegotiationInfoW
653 {
654 PSecPkgInfoW PackageInfo;
655 ULONG NegotiationState;
656 } SecPkgContext_NegotiationInfoW, *PSecPkgContext_NegotiationInfoW;
657
658 #define SecPkgContext_NegotiationInfo WINELIB_NAME_AW(SecPkgContext_NegotiationInfo)
659 #define PSecPkgContext_NegotiationInfo WINELIB_NAME_AW(PSecPkgContext_NegotiationInfo)
660
661 /* values for NegotiationState */
662 #define SECPKG_NEGOTIATION_COMPLETE 0
663 #define SECPKG_NEGOTIATION_OPTIMISTIC 1
664 #define SECPKG_NEGOTIATION_IN_PROGRESS 2
665 #define SECPKG_NEGOTIATION_DIRECT 3
666 #define SECPKG_NEGOTIATION_TRY_MULTICRED 4
667
668 typedef struct _SecPkgContext_NativeNamesA
669 {
670 SEC_CHAR *sClientName;
671 SEC_CHAR *sServerName;
672 } SecPkgContext_NativeNamesA, *PSecPkgContext_NativeNamesA;
673
674 typedef struct _SecPkgContext_NativeNamesW
675 {
676 SEC_WCHAR *sClientName;
677 SEC_WCHAR *sServerName;
678 } SecPkgContext_NativeNamesW, *PSecPkgContext_NativeNamesW;
679
680 #define SecPkgContext_NativeNames WINELIB_NAME_AW(SecPkgContext_NativeNames)
681 #define PSecPkgContext_NativeNames WINELIB_NAME_AW(PSecPkgContext_NativeNames)
682
683 typedef struct _SecPkgContext_CredentialNameA
684 {
685 ULONG CredentialType;
686 SEC_CHAR *sCredentialName;
687 } SecPkgContext_CredentialNameA, *PSecPkgContext_CredentialNameA;
688
689 typedef struct _SecPkgContext_CredentialNameW
690 {
691 ULONG CredentialType;
692 SEC_WCHAR *sCredentialName;
693 } SecPkgContext_CredentialNameW, *PSecPkgContext_CredentialNameW;
694
695 #define SecPkgContext_CredentialName WINELIB_NAME_AW(SecPkgContext_CredentialName)
696 #define PSecPkgContext_CredentialName WINELIB_NAME_AW(PSecPkgContext_CredentialName)
697
698 typedef struct _SecPkgContext_AccessToken
699 {
700 void *AccessToken;
701 } SecPkgContext_AccessToken, *PSecPkgContext_AccessToken;
702
703 typedef struct _SecPkgContext_TargetInformation
704 {
705 ULONG MarshalledTargetInfoLength;
706 unsigned char *MarshalledTargetInfo;
707 } SecPkgContext_TargetInformation, *PSecPkgContext_TargetInformation;
708
709 typedef struct _SecPkgContext_AuthzID
710 {
711 ULONG AuthzIDLength;
712 char *AuthzID;
713 } SecPkgContext_AuthzID, *PSecPkgContext_AuthzID;
714
715 typedef struct _SecPkgContext_Target
716 {
717 ULONG TargetLength;
718 char *Target;
719 } SecPkgContext_Target, *PSecPkgContext_Target;
720
721 _Check_return_
722 SECURITY_STATUS
723 SEC_ENTRY
724 ImpersonateSecurityContext(
725 _In_ PCtxtHandle phContext);
726
727 typedef SECURITY_STATUS (SEC_ENTRY *IMPERSONATE_SECURITY_CONTEXT_FN)
728 (PCtxtHandle);
729
730 SECURITY_STATUS SEC_ENTRY RevertSecurityContext(_In_ PCtxtHandle phContext);
731
732 typedef SECURITY_STATUS (SEC_ENTRY *REVERT_SECURITY_CONTEXT_FN)(PCtxtHandle);
733
734 SECURITY_STATUS
735 SEC_ENTRY
736 MakeSignature(
737 _In_ PCtxtHandle phContext,
738 _In_ ULONG fQOP,
739 _In_ PSecBufferDesc pMessage,
740 _In_ ULONG MessageSeqNo);
741
742 typedef SECURITY_STATUS (SEC_ENTRY *MAKE_SIGNATURE_FN)(PCtxtHandle,
743 ULONG, PSecBufferDesc, ULONG);
744
745 SECURITY_STATUS
746 SEC_ENTRY
747 VerifySignature(
748 _In_ PCtxtHandle phContext,
749 _In_ PSecBufferDesc pMessage,
750 _In_ ULONG MessageSeqNo,
751 _Out_ PULONG pfQOP);
752
753 typedef SECURITY_STATUS (SEC_ENTRY *VERIFY_SIGNATURE_FN)(PCtxtHandle,
754 PSecBufferDesc, ULONG, PULONG);
755
756 SECURITY_STATUS
757 SEC_ENTRY
758 QuerySecurityPackageInfoA(
759 _In_ SEC_CHAR *pszPackageName,
760 _Outptr_ PSecPkgInfoA *ppPackageInfo);
761
762 SECURITY_STATUS
763 SEC_ENTRY
764 QuerySecurityPackageInfoW(
765 _In_ SEC_WCHAR *pszPackageName,
766 _Outptr_ PSecPkgInfoW *ppPackageInfo);
767
768 #define QuerySecurityPackageInfo WINELIB_NAME_AW(QuerySecurityPackageInfo)
769
770 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_PACKAGE_INFO_FN_A)
771 (SEC_CHAR *, PSecPkgInfoA *);
772 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_PACKAGE_INFO_FN_W)
773 (SEC_WCHAR *, PSecPkgInfoW *);
774 #define QUERY_SECURITY_PACKAGE_INFO_FN WINELIB_NAME_AW(QUERY_SECURITY_PACKAGE_INFO_FN_)
775
776 SECURITY_STATUS
777 SEC_ENTRY
778 ExportSecurityContext(
779 _In_ PCtxtHandle phContext,
780 _In_ ULONG fFlags,
781 _Out_ PSecBuffer pPackedContext,
782 _Out_ void **pToken);
783
784 typedef SECURITY_STATUS (SEC_ENTRY *EXPORT_SECURITY_CONTEXT_FN)(PCtxtHandle,
785 ULONG, PSecBuffer, void **);
786
787 /* values for ExportSecurityContext fFlags */
788 #define SECPKG_CONTEXT_EXPORT_RESET_NEW 0x00000001
789 #define SECPKG_CONTEXT_EXPORT_DELETE_OLD 0x00000002
790
791 SECURITY_STATUS
792 SEC_ENTRY
793 ImportSecurityContextA(
794 _In_ SEC_CHAR *pszPackage,
795 _In_ PSecBuffer pPackedContext,
796 _In_ void *Token,
797 _Out_ PCtxtHandle phContext);
798
799 SECURITY_STATUS
800 SEC_ENTRY
801 ImportSecurityContextW(
802 _In_ SEC_WCHAR *pszPackage,
803 _In_ PSecBuffer pPackedContext,
804 _In_ void *Token,
805 _Out_ PCtxtHandle phContext);
806
807 #define ImportSecurityContext WINELIB_NAME_AW(ImportSecurityContext)
808
809 typedef SECURITY_STATUS (SEC_ENTRY *IMPORT_SECURITY_CONTEXT_FN_A)(SEC_CHAR *,
810 PSecBuffer, void *, PCtxtHandle);
811 typedef SECURITY_STATUS (SEC_ENTRY *IMPORT_SECURITY_CONTEXT_FN_W)(SEC_WCHAR *,
812 PSecBuffer, void *, PCtxtHandle);
813 #define IMPORT_SECURITY_CONTEXT_FN WINELIB_NAME_AW(IMPORT_SECURITY_CONTEXT_FN_)
814
815 SECURITY_STATUS
816 SEC_ENTRY
817 AddCredentialsA(
818 _In_ PCredHandle hCredentials,
819 _In_opt_ SEC_CHAR *pszPrincipal,
820 _In_ SEC_CHAR *pszPackage,
821 _In_ ULONG fCredentialUse,
822 _In_opt_ void *pAuthData,
823 _In_opt_ SEC_GET_KEY_FN pGetKeyFn,
824 _In_opt_ void *pvGetKeyArgument,
825 _Out_opt_ PTimeStamp ptsExpiry);
826
827 SECURITY_STATUS
828 SEC_ENTRY
829 AddCredentialsW(
830 _In_ PCredHandle hCredentials,
831 _In_opt_ SEC_WCHAR *pszPrincipal,
832 _In_ SEC_WCHAR *pszPackage,
833 _In_ ULONG fCredentialUse,
834 _In_opt_ void *pAuthData,
835 _In_opt_ SEC_GET_KEY_FN pGetKeyFn,
836 _In_opt_ void *pvGetKeyArgument,
837 _Out_opt_ PTimeStamp ptsExpiry);
838
839 #define AddCredentials WINELIB_NAME_AW(AddCredentials)
840
841 typedef SECURITY_STATUS (SEC_ENTRY *ADD_CREDENTIALS_FN_A)(PCredHandle,
842 SEC_CHAR *, SEC_CHAR *, ULONG, void *, SEC_GET_KEY_FN, void *,
843 PTimeStamp);
844 typedef SECURITY_STATUS (SEC_ENTRY *ADD_CREDENTIALS_FN_W)(PCredHandle,
845 SEC_WCHAR *, SEC_WCHAR *, ULONG, void *, SEC_GET_KEY_FN, void *,
846 PTimeStamp);
847
848 SECURITY_STATUS
849 SEC_ENTRY
850 QuerySecurityContextToken(
851 _In_ PCtxtHandle phContext,
852 _Out_ HANDLE *phToken);
853
854 typedef SECURITY_STATUS (SEC_ENTRY *QUERY_SECURITY_CONTEXT_TOKEN_FN)
855 (PCtxtHandle, HANDLE *);
856
857 SECURITY_STATUS
858 SEC_ENTRY
859 EncryptMessage(
860 _In_ PCtxtHandle phContext,
861 _In_ ULONG fQOP,
862 _In_ PSecBufferDesc pMessage,
863 _In_ ULONG MessageSeqNo);
864
865 SECURITY_STATUS
866 SEC_ENTRY
867 DecryptMessage(
868 _In_ PCtxtHandle phContext,
869 _In_ PSecBufferDesc pMessage,
870 _In_ ULONG MessageSeqNo,
871 _Out_opt_ PULONG pfQOP);
872
873 /* values for EncryptMessage fQOP */
874 #define SECQOP_WRAP_NO_ENCRYPT 0x80000001
875
876 typedef SECURITY_STATUS (SEC_ENTRY *ENCRYPT_MESSAGE_FN)(PCtxtHandle, ULONG,
877 PSecBufferDesc, ULONG);
878 typedef SECURITY_STATUS (SEC_ENTRY *DECRYPT_MESSAGE_FN)(PCtxtHandle,
879 PSecBufferDesc, ULONG, PULONG);
880
881 SECURITY_STATUS
882 SEC_ENTRY
883 SetContextAttributesA(
884 _In_ PCtxtHandle phContext,
885 _In_ ULONG ulAttribute,
886 _In_reads_bytes_(cbBuffer) void *pBuffer,
887 _In_ ULONG cbBuffer);
888
889 SECURITY_STATUS
890 SEC_ENTRY
891 SetContextAttributesW(
892 _In_ PCtxtHandle phContext,
893 _In_ ULONG ulAttribute,
894 _In_reads_bytes_(cbBuffer) void *pBuffer,
895 _In_ ULONG cbBuffer);
896
897 #define SetContextAttributes WINELIB_NAME_AW(SetContextAttributes)
898
899 typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_A)(PCtxtHandle,
900 ULONG, void *, ULONG);
901 typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,
902 ULONG, void *, ULONG);
903
904 #define SECURITY_ENTRYPOINT_ANSIA "InitSecurityInterfaceA"
905 #define SECURITY_ENTRYPOINT_ANSIW "InitSecurityInterfaceW"
906 #define SECURITY_ENTRYPOINT_ANSI WINELIB_NAME_AW(SECURITY_ENTRYPOINT_ANSI)
907
908 typedef struct _SECURITY_FUNCTION_TABLE_A
909 {
910 ULONG dwVersion;
911 ENUMERATE_SECURITY_PACKAGES_FN_A EnumerateSecurityPackagesA;
912 QUERY_CREDENTIALS_ATTRIBUTES_FN_A QueryCredentialsAttributesA;
913 ACQUIRE_CREDENTIALS_HANDLE_FN_A AcquireCredentialsHandleA;
914 FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
915 void *Reserved2;
916 INITIALIZE_SECURITY_CONTEXT_FN_A InitializeSecurityContextA;
917 ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
918 COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
919 DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
920 APPLY_CONTROL_TOKEN_FN ApplyControlToken;
921 QUERY_CONTEXT_ATTRIBUTES_FN_A QueryContextAttributesA;
922 IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
923 REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
924 MAKE_SIGNATURE_FN MakeSignature;
925 VERIFY_SIGNATURE_FN VerifySignature;
926 FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
927 QUERY_SECURITY_PACKAGE_INFO_FN_A QuerySecurityPackageInfoA;
928 void *Reserved3;
929 void *Reserved4;
930 EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
931 IMPORT_SECURITY_CONTEXT_FN_A ImportSecurityContextA;
932 ADD_CREDENTIALS_FN_A AddCredentialsA;
933 void *Reserved8;
934 QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
935 ENCRYPT_MESSAGE_FN EncryptMessage;
936 DECRYPT_MESSAGE_FN DecryptMessage;
937 SET_CONTEXT_ATTRIBUTES_FN_A SetContextAttributesA;
938 } SecurityFunctionTableA, *PSecurityFunctionTableA;
939
940 /* No, it really is FreeCredentialsHandle, see the thread beginning
941 * http://sourceforge.net/mailarchive/message.php?msg_id=4321080 for a
942 * discovery discussion. */
943 typedef struct _SECURITY_FUNCTION_TABLE_W
944 {
945 ULONG dwVersion;
946 ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW;
947 QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW;
948 ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW;
949 FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle;
950 void *Reserved2;
951 INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW;
952 ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext;
953 COMPLETE_AUTH_TOKEN_FN CompleteAuthToken;
954 DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext;
955 APPLY_CONTROL_TOKEN_FN ApplyControlToken;
956 QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW;
957 IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext;
958 REVERT_SECURITY_CONTEXT_FN RevertSecurityContext;
959 MAKE_SIGNATURE_FN MakeSignature;
960 VERIFY_SIGNATURE_FN VerifySignature;
961 FREE_CONTEXT_BUFFER_FN FreeContextBuffer;
962 QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW;
963 void *Reserved3;
964 void *Reserved4;
965 EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext;
966 IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW;
967 ADD_CREDENTIALS_FN_W AddCredentialsW;
968 void *Reserved8;
969 QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken;
970 ENCRYPT_MESSAGE_FN EncryptMessage;
971 DECRYPT_MESSAGE_FN DecryptMessage;
972 SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW;
973 } SecurityFunctionTableW, *PSecurityFunctionTableW;
974
975 #define SecurityFunctionTable WINELIB_NAME_AW(SecurityFunctionTable)
976 #define PSecurityFunctionTable WINELIB_NAME_AW(PSecurityFunctionTable)
977
978 #define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1
979 #define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2
980
981 PSecurityFunctionTableA SEC_ENTRY InitSecurityInterfaceA(void);
982 PSecurityFunctionTableW SEC_ENTRY InitSecurityInterfaceW(void);
983 #define InitSecurityInterface WINELIB_NAME_AW(InitSecurityInterface)
984
985 typedef PSecurityFunctionTableA (SEC_ENTRY *INIT_SECURITY_INTERFACE_A)(void);
986 typedef PSecurityFunctionTableW (SEC_ENTRY *INIT_SECURITY_INTERFACE_W)(void);
987 #define INIT_SECURITY_INTERFACE WINELIB_NAME_AW(INIT_SECURITY_INTERFACE_)
988
989 #ifdef __cplusplus
990 }
991 #endif
992
993 #endif /* ndef __WINE_SSPI_H__ */